prefect 3.6.12__py3-none-any.whl → 3.6.13.dev2__py3-none-any.whl
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.
- prefect/_build_info.py +3 -3
- prefect/_internal/urls.py +29 -0
- prefect/_states.py +4 -1
- prefect/client/orchestration/_concurrency_limits/client.py +16 -16
- prefect/client/subscriptions.py +1 -1
- prefect/events/clients.py +52 -13
- prefect/runner/storage.py +3 -23
- prefect/server/ui-v2/assets/{artifact-card-Ds2tntMW.js → artifact-card-C8JEQRHl.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-Ds2tntMW.js.map → artifact-card-C8JEQRHl.js.map} +1 -1
- prefect/server/ui-v2/assets/{artifact._id-erPNL0a8.js → artifact._id-67V8kTg9.js} +2 -2
- prefect/server/ui-v2/assets/{artifact._id-erPNL0a8.js.map → artifact._id-67V8kTg9.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-wizard-Bx9AQxRV.js → automation-wizard-DuxZ47Nn.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-Bx9AQxRV.js.map → automation-wizard-DuxZ47Nn.js.map} +1 -1
- prefect/server/ui-v2/assets/automation._id-D8S8r4Ji.js +2 -0
- prefect/server/ui-v2/assets/{automation._id-IHh5QJwE.js.map → automation._id-D8S8r4Ji.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-Ds8vO0c5.js → automation_._id.edit-C1fOM0Hx.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-Ds8vO0c5.js.map → automation_._id.edit-C1fOM0Hx.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-C6aUe5Tw.js → automations-header-DrijTNGi.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-C6aUe5Tw.js.map → automations-header-DrijTNGi.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-a-9TFMcW.js → base-job-template-form-section-BDkqOkpe.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-a-9TFMcW.js.map → base-job-template-form-section-BDkqOkpe.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-eq3Wg2ht.js → block-type-details-CrFHWH5D.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-eq3Wg2ht.js.map → block-type-details-CrFHWH5D.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-WQNm0PzP.js +2 -0
- prefect/server/ui-v2/assets/{block-type-logo-B31LJm5H.js.map → block-type-logo-WQNm0PzP.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-OVdz3htC.js → block._id-C3gN1Ae8.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-OVdz3htC.js.map → block._id-C3gN1Ae8.js.map} +1 -1
- prefect/server/ui-v2/assets/block_._id.edit-DzPuSvat.js +2 -0
- prefect/server/ui-v2/assets/{block_._id.edit-CIhIBJrm.js.map → block_._id.edit-DzPuSvat.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog-T-7MqsyE.js +2 -0
- prefect/server/ui-v2/assets/{catalog-CfniU0UV.js.map → catalog-T-7MqsyE.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog_._slug-DMOI61fc.js +2 -0
- prefect/server/ui-v2/assets/{catalog_._slug-C9p86T4s.js.map → catalog_._slug-DMOI61fc.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog_._slug_.create-l9bGUPi-.js +2 -0
- prefect/server/ui-v2/assets/{catalog_._slug_.create-BhSunL__.js.map → catalog_._slug_.create-l9bGUPi-.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-DBD7wjpi.js → collapsible-DM-Ze5-Y.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-DBD7wjpi.js.map → collapsible-DM-Ze5-Y.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-C-XWq7Tf.js → concurrency-limit._id-BHEt9viF.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-C-XWq7Tf.js.map → concurrency-limit._id-BHEt9viF.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-Bj2t5YQq.js → create-BMxUOyN5.js} +2 -2
- prefect/server/ui-v2/assets/{create-Bj2t5YQq.js.map → create-BMxUOyN5.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-noFojqGL.js → create-Cq-EAHVk.js} +2 -2
- prefect/server/ui-v2/assets/{create-noFojqGL.js.map → create-Cq-EAHVk.js.map} +1 -1
- prefect/server/ui-v2/assets/{data-table-BjFlVIyC.js → data-table-Bw8TZx9D.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-BjFlVIyC.js.map → data-table-Bw8TZx9D.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-COdZmNfa.js → delete-confirmation-dialog-CTdWZlGM.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-COdZmNfa.js.map → delete-confirmation-dialog-CTdWZlGM.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-C6v2kZ6V.js → deployment-action-header-BObYqmI_.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-C6v2kZ6V.js.map → deployment-action-header-BObYqmI_.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-D9d5sZM2.js → deployment-form-CntyhRrK.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-D9d5sZM2.js.map → deployment-form-CntyhRrK.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-Dy-M1Que.js → deployment-links-DBUSCaxB.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-Dy-M1Que.js.map → deployment-links-DBUSCaxB.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-CZlY9261.js → deployment._id-BXanVFA8.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-CZlY9261.js.map → deployment._id-BXanVFA8.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment._id-Q5cvHMX9.js +2 -0
- prefect/server/ui-v2/assets/{deployment._id-DVmqclRz.js.map → deployment._id-Q5cvHMX9.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-DB-4hHHc.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-DVMjpk5m.js.map → deployment_._id.duplicate-DB-4hHHc.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-CWf1RIGy.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-Ck_P6KDn.js.map → deployment_._id.edit-CWf1RIGy.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-Cht7AHDG.js → deployment_._id.run-CoHGXFoM.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-Cht7AHDG.js.map → deployment_._id.run-CoHGXFoM.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-xZ_3w9OP.js → dropdown-menu-CT-s-V7d.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-xZ_3w9OP.js.map → dropdown-menu-CT-s-V7d.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CpexuXd6.js → event._eventDate._eventId-BITo_GYL.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CpexuXd6.js.map → event._eventDate._eventId-BITo_GYL.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run-graph-DxIl6fzW.js +2 -0
- prefect/server/ui-v2/assets/flow-run-graph-DxIl6fzW.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-ZBlKBwPO.js → flow-run._id-Bbm9OpDi.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-ZBlKBwPO.js.map → flow-run._id-Bbm9OpDi.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-BtSgRDtA.js +2 -0
- prefect/server/ui-v2/assets/{flow-run._id-OL0YhyLW.js.map → flow-run._id-BtSgRDtA.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-DJuMECRh.js +4 -0
- prefect/server/ui-v2/assets/flow-run._id-DJuMECRh.js.map +1 -0
- prefect/server/ui-v2/assets/flow-runs-pagination-LrU9Aio8.js +2 -0
- prefect/server/ui-v2/assets/flow-runs-pagination-LrU9Aio8.js.map +1 -0
- prefect/server/ui-v2/assets/flow._id-BJBRokk4.js +2 -0
- prefect/server/ui-v2/assets/{flow._id-DhrCicwR.js.map → flow._id-BJBRokk4.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-BTub_PhK.js → form-CVSlEnl8.js} +2 -2
- prefect/server/ui-v2/assets/{form-BTub_PhK.js.map → form-CVSlEnl8.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-Dp9qi8fq.js → header-4plZZheZ.js} +2 -2
- prefect/server/ui-v2/assets/{header-Dp9qi8fq.js.map → header-4plZZheZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-B75eb688.js → header-9rXZ4r39.js} +2 -2
- prefect/server/ui-v2/assets/{header-B75eb688.js.map → header-9rXZ4r39.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-6wmrKLU3.js → header-D3uM8_xM.js} +2 -2
- prefect/server/ui-v2/assets/{header-6wmrKLU3.js.map → header-D3uM8_xM.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BA7ACCoL.js → index-6OsEYhIi.js} +2 -2
- prefect/server/ui-v2/assets/{index-BA7ACCoL.js.map → index-6OsEYhIi.js.map} +1 -1
- prefect/server/ui-v2/assets/index-B7xsJ-QH.js +2 -0
- prefect/server/ui-v2/assets/{index-CT_nG86y.js.map → index-B7xsJ-QH.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CGWoVV2s.js → index-BeoNC2tJ.js} +2 -2
- prefect/server/ui-v2/assets/{index-CGWoVV2s.js.map → index-BeoNC2tJ.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BfJLUM7N.js +2 -0
- prefect/server/ui-v2/assets/index-BfJLUM7N.js.map +1 -0
- prefect/server/ui-v2/assets/{index-DzMGV8GV.js → index-Bj0OOguP.js} +2 -2
- prefect/server/ui-v2/assets/{index-DzMGV8GV.js.map → index-Bj0OOguP.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-zpb5iSCL.js → index-BlpD74iH.js} +2 -2
- prefect/server/ui-v2/assets/{index-zpb5iSCL.js.map → index-BlpD74iH.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BvSl3DKP.js +17 -0
- prefect/server/ui-v2/assets/index-BvSl3DKP.js.map +1 -0
- prefect/server/ui-v2/assets/index-CDwJvjUM.js +2 -0
- prefect/server/ui-v2/assets/{index-Cs8eFQKw.js.map → index-CDwJvjUM.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-UN2Tx4jH.js → index-CDyLkbVG.js} +2 -2
- prefect/server/ui-v2/assets/{index-UN2Tx4jH.js.map → index-CDyLkbVG.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D08xgmV0.js → index-ChIrfjIW.js} +2 -2
- prefect/server/ui-v2/assets/{index-D08xgmV0.js.map → index-ChIrfjIW.js.map} +1 -1
- prefect/server/ui-v2/assets/index-CzCSgCK-.js +2 -0
- prefect/server/ui-v2/assets/{index-qPlIYf3i.js.map → index-CzCSgCK-.js.map} +1 -1
- prefect/server/ui-v2/assets/index-D5v9S-lB.js +2 -0
- prefect/server/ui-v2/assets/{index-B_3f8Hcb.js.map → index-D5v9S-lB.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DfiNsXba.js → index-D6GJ4go1.js} +2 -2
- prefect/server/ui-v2/assets/{index-DfiNsXba.js.map → index-D6GJ4go1.js.map} +1 -1
- prefect/server/ui-v2/assets/index-DJyKqsFO.js +2 -0
- prefect/server/ui-v2/assets/{index-H6bwm6L6.js.map → index-DJyKqsFO.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DSaSov8V.js → index-DODEq1Pi.js} +2 -2
- prefect/server/ui-v2/assets/{index-DSaSov8V.js.map → index-DODEq1Pi.js.map} +1 -1
- prefect/server/ui-v2/assets/index-DicK6p3K.js +2 -0
- prefect/server/ui-v2/assets/{index-7-r4ia_S.js.map → index-DicK6p3K.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DYOACRXY.js → index-DqCPbST9.js} +2 -2
- prefect/server/ui-v2/assets/{index-DYOACRXY.js.map → index-DqCPbST9.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DOkFJdYY.js → index-DxPoKag8.js} +2 -2
- prefect/server/ui-v2/assets/{index-DOkFJdYY.js.map → index-DxPoKag8.js.map} +1 -1
- prefect/server/ui-v2/assets/index-NY089eTx.css +1 -0
- prefect/server/ui-v2/assets/{index-HGoNWFfP.js → index-h9-QgNjZ.js} +2 -2
- prefect/server/ui-v2/assets/{index-HGoNWFfP.js.map → index-h9-QgNjZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D3ILnEzm.js → index-tBdv6kBF.js} +2 -2
- prefect/server/ui-v2/assets/{index-D3ILnEzm.js.map → index-tBdv6kBF.js.map} +1 -1
- prefect/server/ui-v2/assets/index-udb79rgq.js +2 -0
- prefect/server/ui-v2/assets/{index-7ThYp9SY.js.map → index-udb79rgq.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-9UPGqxTw.js → json-input-Dt1icmrn.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-9UPGqxTw.js.map → json-input-Dt1icmrn.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-CTFfXO_k.js → key._key-Cyh5MBX_.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-CTFfXO_k.js.map → key._key-Cyh5MBX_.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-BHwIrC8E.js → lazy-markdown-BwIwKFRF.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-BHwIrC8E.js.map → lazy-markdown-BwIwKFRF.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-kqmT29n7.js → login-DKXFVSwk.js} +2 -2
- prefect/server/ui-v2/assets/{login-kqmT29n7.js.map → login-DKXFVSwk.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-BesmAbLS.js → markdown-input-Dp0mBlkV.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-BesmAbLS.js.map → markdown-input-Dp0mBlkV.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-COTWYn1Y.js → python-example-snippet-BYwPjHI5.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-COTWYn1Y.js.map → python-example-snippet-BYwPjHI5.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-Bjccebi0.js → python-input-y26XMqXw.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-Bjccebi0.js.map → python-input-y26XMqXw.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-DkAK0M2h.js → radio-group-D0van45v.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-DkAK0M2h.js.map → radio-group-D0van45v.js.map} +1 -1
- prefect/server/ui-v2/assets/route-error-state-CGGpuCGN.js +2 -0
- prefect/server/ui-v2/assets/{route-error-state-ALftyvGl.js.map → route-error-state-CGGpuCGN.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-BR4E-WXE.js → schema-form-2tg5SXM4.js} +2 -2
- prefect/server/ui-v2/assets/{schema-form-BR4E-WXE.js.map → schema-form-2tg5SXM4.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BhL8C5NS.js → schema-form-input-string-format-datetime-CZt6AJ4z.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BhL8C5NS.js.map → schema-form-input-string-format-datetime-CZt6AJ4z.js.map} +1 -1
- prefect/server/ui-v2/assets/settings-DDUadk_N.js +2 -0
- prefect/server/ui-v2/assets/settings-DDUadk_N.js.map +1 -0
- prefect/server/ui-v2/assets/{sort-filter-BD4vwJXt.js → sort-filter-D9p3cPx9.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-BD4vwJXt.js.map → sort-filter-D9p3cPx9.js.map} +1 -1
- prefect/server/ui-v2/assets/state-colors-CAAf0Eg3.js +2 -0
- prefect/server/ui-v2/assets/state-colors-CAAf0Eg3.js.map +1 -0
- prefect/server/ui-v2/assets/table-vo9Do8sA.js +2 -0
- prefect/server/ui-v2/assets/table-vo9Do8sA.js.map +1 -0
- prefect/server/ui-v2/assets/tags-input-Ci2JQ-k3.js +2 -0
- prefect/server/ui-v2/assets/tags-input-Ci2JQ-k3.js.map +1 -0
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-CJzPc2gw.js +2 -0
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CG3den1B.js.map → task-run-concurrency-limits-reset-dialog-CJzPc2gw.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-DOcIzVi0.js → task-run._id-CjevSs79.js} +3 -3
- prefect/server/ui-v2/assets/{task-run._id-DOcIzVi0.js.map → task-run._id-CjevSs79.js.map} +1 -1
- prefect/server/ui-v2/assets/task-run._id-D8QKG5UZ.js +2 -0
- prefect/server/ui-v2/assets/{task-run._id-CnIVqU6v.js.map → task-run._id-D8QKG5UZ.js.map} +1 -1
- prefect/server/ui-v2/assets/task-runs-pagination-CifoSGct.js +2 -0
- prefect/server/ui-v2/assets/{task-runs-pagination-DLSAz-Ur.js.map → task-runs-pagination-CifoSGct.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-D8LjlIx7.js → textarea-BAtfAxtV.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-D8LjlIx7.js.map → textarea-BAtfAxtV.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-BG3cL3-U.js → timezone-select-QlQTZSsF.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-BG3cL3-U.js.map → timezone-select-QlQTZSsF.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-D3zeurIL.js → toggle-group-BJN1vjEh.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-D3zeurIL.js.map → toggle-group-BJN1vjEh.js.map} +1 -1
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-eOWJYPkD.js +2 -0
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-Bzy2ML2T.js.map → use-delete-automation-confirmation-dialog-eOWJYPkD.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DRAP-Tnu.js → use-delete-block-document-confirmation-dialog-BTwSeHRM.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DRAP-Tnu.js.map → use-delete-block-document-confirmation-dialog-BTwSeHRM.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D4yWonR8.js → use-flow-runs-selected-rows-BL_Gv9CC.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D4yWonR8.js.map → use-flow-runs-selected-rows-BL_Gv9CC.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DZeBiVd9.js → use-get-artifacts-flow-task-runs-TSCoomjQ.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DZeBiVd9.js.map → use-get-artifacts-flow-task-runs-TSCoomjQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-BxAMqZDM.js → use-quick-run-BMnCkwSv.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-BxAMqZDM.js.map → use-quick-run-BMnCkwSv.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-T3wAKNvM.js → use-stepper-C1wm66U2.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-T3wAKNvM.js.map → use-stepper-C1wm66U2.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-B2JMf8iI.js → utilities-DxRXxFOF.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-B2JMf8iI.js.map → utilities-DxRXxFOF.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-CZz0AJlt.js → work-pool-filter-PudrkZYj.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-CZz0AJlt.js.map → work-pool-filter-PudrkZYj.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-BAOrV_0R.js +2 -0
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-D4eeo-hi.js.map → work-pool-queue-toggle-BAOrV_0R.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-DrWddu9K.js → work-pool._workPoolName-BOM3849e.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-DrWddu9K.js.map → work-pool._workPoolName-BOM3849e.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-CIhcG6yr.js +2 -0
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CA0ePjCk.js.map → work-pool_._workPoolName.edit-CIhcG6yr.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DpUnE86v.js → work-pool_._workPoolName.queue._workQueueName-CjoM77tu.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DpUnE86v.js.map → work-pool_._workPoolName.queue._workQueueName-CjoM77tu.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-BjiA7vAW.js → work-queue-icon-text-CP4yX3uM.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-BjiA7vAW.js.map → work-queue-icon-text-CP4yX3uM.js.map} +1 -1
- prefect/server/ui-v2/index.html +2 -2
- prefect/task_engine.py +16 -0
- prefect/task_worker.py +98 -16
- prefect/testing/fixtures.py +18 -1
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/METADATA +1 -1
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/RECORD +211 -210
- prefect/server/ui-v2/assets/automation._id-IHh5QJwE.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-B31LJm5H.js +0 -2
- prefect/server/ui-v2/assets/block_._id.edit-CIhIBJrm.js +0 -2
- prefect/server/ui-v2/assets/catalog-CfniU0UV.js +0 -2
- prefect/server/ui-v2/assets/catalog_._slug-C9p86T4s.js +0 -2
- prefect/server/ui-v2/assets/catalog_._slug_.create-BhSunL__.js +0 -2
- prefect/server/ui-v2/assets/deployment._id-DVmqclRz.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-DVMjpk5m.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-Ck_P6KDn.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-CfoPEAgQ.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-CfoPEAgQ.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-C-qxwEBp.js +0 -4
- prefect/server/ui-v2/assets/flow-run._id-C-qxwEBp.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-OL0YhyLW.js +0 -2
- prefect/server/ui-v2/assets/flow-runs-pagination-DnwkJapB.js +0 -2
- prefect/server/ui-v2/assets/flow-runs-pagination-DnwkJapB.js.map +0 -1
- prefect/server/ui-v2/assets/flow._id-DhrCicwR.js +0 -2
- prefect/server/ui-v2/assets/index-7-r4ia_S.js +0 -2
- prefect/server/ui-v2/assets/index-7ThYp9SY.js +0 -2
- prefect/server/ui-v2/assets/index-B7zHzWQW.css +0 -1
- prefect/server/ui-v2/assets/index-B_3f8Hcb.js +0 -2
- prefect/server/ui-v2/assets/index-BiCd-Iuz.js +0 -2
- prefect/server/ui-v2/assets/index-BiCd-Iuz.js.map +0 -1
- prefect/server/ui-v2/assets/index-CT_nG86y.js +0 -2
- prefect/server/ui-v2/assets/index-Cs8eFQKw.js +0 -2
- prefect/server/ui-v2/assets/index-H6bwm6L6.js +0 -2
- prefect/server/ui-v2/assets/index-WYPZo52S.js +0 -17
- prefect/server/ui-v2/assets/index-WYPZo52S.js.map +0 -1
- prefect/server/ui-v2/assets/index-qPlIYf3i.js +0 -2
- prefect/server/ui-v2/assets/route-error-state-ALftyvGl.js +0 -2
- prefect/server/ui-v2/assets/settings-BL0X8cDU.js +0 -2
- prefect/server/ui-v2/assets/settings-BL0X8cDU.js.map +0 -1
- prefect/server/ui-v2/assets/table-CEAx-qHs.js +0 -2
- prefect/server/ui-v2/assets/table-CEAx-qHs.js.map +0 -1
- prefect/server/ui-v2/assets/tags-input-D1RJZEUA.js +0 -2
- prefect/server/ui-v2/assets/tags-input-D1RJZEUA.js.map +0 -1
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-CG3den1B.js +0 -2
- prefect/server/ui-v2/assets/task-run._id-CnIVqU6v.js +0 -2
- prefect/server/ui-v2/assets/task-runs-pagination-DLSAz-Ur.js +0 -2
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-Bzy2ML2T.js +0 -2
- prefect/server/ui-v2/assets/use-local-storage-CpxMp5wR.js +0 -2
- prefect/server/ui-v2/assets/use-local-storage-CpxMp5wR.js.map +0 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-D4eeo-hi.js +0 -2
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-CA0ePjCk.js +0 -2
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/WHEEL +0 -0
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-
|
|
1
|
+
{"version":3,"file":"login-DKXFVSwk.js","sources":["../../src/components/ui/prefect-logo.tsx","../../src/components/auth/login-page.tsx","../../src/routes/login.tsx?tsr-split=component"],"sourcesContent":["interface PrefectLogoProps {\n\tclassName?: string;\n}\n\nexport function PrefectLogo({ className = \"size-11\" }: PrefectLogoProps) {\n\treturn (\n\t\t<svg\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\tfill=\"none\"\n\t\t\tviewBox=\"0 0 76 76\"\n\t\t\tclassName={className}\n\t\t\taria-label=\"Prefect Logo\"\n\t\t>\n\t\t\t<title>Prefect Logo</title>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\td=\"M15.89 15.07 38 26.543v22.935l22.104-11.47.007.004V15.068l-.003.001L38 3.598z\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\td=\"M15.89 15.07 38 26.543v22.935l22.104-11.47.007.004V15.068l-.003.001L38 3.598z\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\td=\"M37.987 49.464 15.89 38v22.944l.013-.006L38 72.402V49.457z\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { type FormEvent, useState } from \"react\";\nimport { useAuth } from \"@/auth\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { PrefectLogo } from \"@/components/ui/prefect-logo\";\n\ninterface LoginPageProps {\n\tredirectTo?: string;\n}\n\nexport function LoginPage({ redirectTo = \"/dashboard\" }: LoginPageProps) {\n\tconst [password, setPassword] = useState(\"\");\n\tconst [error, setError] = useState(\"\");\n\tconst [isSubmitting, setIsSubmitting] = useState(false);\n\tconst { login } = useAuth();\n\tconst navigate = useNavigate();\n\n\tconst handleSubmit = (e: FormEvent) => {\n\t\te.preventDefault();\n\t\tif (isSubmitting || !password.trim()) return;\n\n\t\tsetIsSubmitting(true);\n\t\tsetError(\"\");\n\n\t\tvoid login(password).then((result) => {\n\t\t\tif (result.success) {\n\t\t\t\tvoid navigate({ to: redirectTo });\n\t\t\t} else {\n\t\t\t\tsetError(result.error ?? \"Authentication failed\");\n\t\t\t\tsetIsSubmitting(false);\n\t\t\t}\n\t\t});\n\t};\n\n\treturn (\n\t\t<div className=\"flex items-center justify-center min-h-screen\">\n\t\t\t<Card className=\"w-full max-w-[400px]\">\n\t\t\t\t<CardHeader className=\"flex flex-col items-center gap-4\">\n\t\t\t\t\t<PrefectLogo className=\"size-16\" />\n\t\t\t\t\t<CardTitle>Login</CardTitle>\n\t\t\t\t</CardHeader>\n\t\t\t\t<CardContent>\n\t\t\t\t\t<form onSubmit={handleSubmit} className=\"flex flex-col gap-4\">\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\tplaceholder=\"admin:pass\"\n\t\t\t\t\t\t\tvalue={password}\n\t\t\t\t\t\t\tonChange={(e) => setPassword(e.target.value)}\n\t\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\t\tdisabled={isSubmitting}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{error && <p className=\"text-sm text-destructive\">{error}</p>}\n\t\t\t\t\t\t<Button type=\"submit\" disabled={isSubmitting} className=\"w-full\">\n\t\t\t\t\t\t\t{isSubmitting ? \"Logging in...\" : \"Login\"}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</CardContent>\n\t\t\t</Card>\n\t\t</div>\n\t);\n}\n","import { createFileRoute, Navigate, redirect } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { useAuthSafe } from \"@/auth\";\nimport { LoginPage } from \"@/components/auth/login-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nconst loginSearchSchema = z.object({\n\tredirectTo: z.string().optional(),\n});\n\nexport const Route = createFileRoute(\"/login\")({\n\tvalidateSearch: zodValidator(loginSearchSchema),\n\tbeforeLoad: ({ context, search }) => {\n\t\t// If already authenticated, redirect away from login page\n\t\tif (!context.auth.isLoading && context.auth.isAuthenticated) {\n\t\t\tredirect({ to: search.redirectTo ?? \"/dashboard\", throw: true });\n\t\t}\n\t},\n\tcomponent: LoginRouteComponent,\n});\n\nfunction LoginRouteComponent() {\n\tconst { redirectTo } = Route.useSearch();\n\tconst auth = useAuthSafe();\n\n\t// If auth context is not available (e.g., in tests), just render the login page\n\tif (!auth) {\n\t\treturn <LoginPage redirectTo={redirectTo} />;\n\t}\n\n\t// Show loading state while auth is initializing\n\tif (auth.isLoading) {\n\t\treturn <PrefectLoading />;\n\t}\n\n\t// Redirect to dashboard if already authenticated\n\t// (This handles the case where beforeLoad didn't catch it due to loading state)\n\tif (auth.isAuthenticated) {\n\t\treturn <Navigate to={redirectTo ?? \"/dashboard\"} replace={true} />;\n\t}\n\n\treturn <LoginPage redirectTo={redirectTo} />;\n}\n"],"names":["PrefectLogo","className","jsxs","jsx","LoginPage","redirectTo","password","setPassword","useState","error","setError","isSubmitting","setIsSubmitting","login","useAuth","navigate","useNavigate","handleSubmit","e","result","Card","CardHeader","CardTitle","CardContent","Input","Button","LoginRouteComponent","Route","useSearch","auth","useAuthSafe","isLoading","PrefectLoading","isAuthenticated","Navigate"],"mappings":"+VAIO,SAASA,EAAY,CAAE,UAAAC,EAAY,WAA+B,CACxE,OACCC,EAAAA,KAAC,MAAA,CACA,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,UAAAD,EACA,aAAW,eAEX,SAAA,CAAAE,EAAAA,IAAC,SAAM,SAAA,cAAA,CAAY,EACnBA,EAAAA,IAAC,OAAA,CACA,KAAK,eACL,SAAS,UACT,EAAE,gFACF,SAAS,SAAA,CAAA,EAEVA,EAAAA,IAAC,OAAA,CACA,KAAK,eACL,SAAS,UACT,EAAE,gFACF,SAAS,SAAA,CAAA,EAEVA,EAAAA,IAAC,OAAA,CACA,KAAK,eACL,SAAS,UACT,EAAE,6DACF,SAAS,SAAA,CAAA,CACV,CAAA,CAAA,CAGH,CCtBO,SAASC,EAAU,CAAE,WAAAC,EAAa,cAAgC,CACxE,KAAM,CAACC,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAE,EACrC,CAACC,EAAOC,CAAQ,EAAIF,EAAAA,SAAS,EAAE,EAC/B,CAACG,EAAcC,CAAe,EAAIJ,EAAAA,SAAS,EAAK,EAChD,CAAE,MAAAK,CAAA,EAAUC,EAAA,EACZC,EAAWC,EAAA,EAEXC,EAAgBC,GAAiB,CACtCA,EAAE,eAAA,EACE,EAAAP,GAAgB,CAACL,EAAS,UAE9BM,EAAgB,EAAI,EACpBF,EAAS,EAAE,EAENG,EAAMP,CAAQ,EAAE,KAAMa,GAAW,CACjCA,EAAO,QACLJ,EAAS,CAAE,GAAIV,EAAY,GAEhCK,EAASS,EAAO,OAAS,uBAAuB,EAChDP,EAAgB,EAAK,EAEvB,CAAC,EACF,EAEA,aACE,MAAA,CAAI,UAAU,gDACd,SAAAV,EAAAA,KAACkB,EAAA,CAAK,UAAU,uBACf,SAAA,CAAAlB,EAAAA,KAACmB,EAAA,CAAW,UAAU,mCACrB,SAAA,CAAAlB,EAAAA,IAACH,EAAA,CAAY,UAAU,SAAA,CAAU,EACjCG,EAAAA,IAACmB,GAAU,SAAA,OAAA,CAAK,CAAA,EACjB,QACCC,EAAA,CACA,SAAArB,OAAC,QAAK,SAAUe,EAAc,UAAU,sBACvC,SAAA,CAAAd,EAAAA,IAACqB,EAAA,CACA,KAAK,WACL,YAAY,aACZ,MAAOlB,EACP,SAAWY,GAAMX,EAAYW,EAAE,OAAO,KAAK,EAC3C,UAAS,GACT,SAAUP,CAAA,CAAA,EAEVF,GAASN,EAAAA,IAAC,IAAA,CAAE,UAAU,2BAA4B,SAAAM,EAAM,EACzDN,EAAAA,IAACsB,EAAA,CAAO,KAAK,SAAS,SAAUd,EAAc,UAAU,SACtD,SAAAA,EAAe,gBAAkB,OAAA,CACnC,CAAA,CAAA,CACD,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAEF,CCxCA,SAASe,GAAsB,CAC9B,KAAM,CAAErB,WAAAA,CAAAA,EAAesB,EAAMC,UAAAA,EACvBC,EAAOC,EAAAA,EAGb,OAAKD,EAKDA,EAAKE,gBACAC,EAAA,EAAc,EAKnBH,EAAKI,sBACAC,EAAA,CAAS,GAAI7B,GAAc,aAAc,QAAS,GAAK,EAGzDF,MAACC,GAAU,WAAAC,EAAuB,EAdjCF,MAACC,GAAU,WAAAC,EAAuB,CAe3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as h,r as c,j as o}from"./vendor-tanstack-BK8oseNA.js";import{u as g,m as x,E as b}from"./vendor-codemirror-CXN7nd_v.js";import{
|
|
2
|
-
//# sourceMappingURL=markdown-input-
|
|
1
|
+
import{c as h,r as c,j as o}from"./vendor-tanstack-BK8oseNA.js";import{u as g,m as x,E as b}from"./vendor-codemirror-CXN7nd_v.js";import{aW as w,q as v,I as y,y as C}from"./index-BvSl3DKP.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./vendor-date-7GxEwcQM.js";const j=[x(),b.lineWrapping],E=h.forwardRef(({className:l,value:r,onChange:u,copy:p=!1,onBlur:N,disabled:s,hideLineNumbers:f=!1,...m},i)=>{const e=c.useRef(null);let n;s&&(n={lineNumbers:!f,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:j,value:r,onChange:u,indentWithTab:!1,editable:!s,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const d=t=>{C.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return o.jsx("div",{className:w("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...m,children:p&&r&&o.jsx(v,{onClick:()=>d(r),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:o.jsx(y,{id:"Copy",className:"size-2"})})})});E.displayName="MarkdownInput";export{E as MarkdownInput};
|
|
2
|
+
//# sourceMappingURL=markdown-input-Dp0mBlkV.js.map
|
prefect/server/ui-v2/assets/{markdown-input-BesmAbLS.js.map → markdown-input-Dp0mBlkV.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-input-
|
|
1
|
+
{"version":3,"file":"markdown-input-Dp0mBlkV.js","sources":["../../src/components/ui/markdown-input.tsx"],"sourcesContent":["import { markdown } from \"@codemirror/lang-markdown\";\nimport {\n\ttype BasicSetupOptions,\n\tEditorView,\n\tuseCodeMirror,\n} from \"@uiw/react-codemirror\";\nimport React, { useEffect, useRef } from \"react\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/utils\";\nimport { Button } from \"./button\";\nimport { Icon } from \"./icons\";\n\nconst extensions = [markdown(), EditorView.lineWrapping];\n\ntype MarkdownInputProps = React.ComponentProps<\"div\"> & {\n\tvalue?: string;\n\tonChange?: (value: string) => void;\n\tonBlur?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport const MarkdownInput = React.forwardRef<\n\tHTMLDivElement,\n\tMarkdownInputProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tcopy = false,\n\t\t\tonBlur,\n\t\t\tdisabled,\n\t\t\thideLineNumbers = false,\n\t\t\t...props\n\t\t},\n\t\tforwardedRef,\n\t) => {\n\t\tconst editor = useRef<HTMLDivElement | null>(null);\n\t\t// Setting `basicSetup` messes up the tab order. We only change the basic setup\n\t\t// if the input is disabled, so we leave it undefined to maintain the tab order.\n\t\tlet basicSetup: BasicSetupOptions | undefined;\n\t\tif (disabled) {\n\t\t\tbasicSetup = {\n\t\t\t\tlineNumbers: !hideLineNumbers,\n\t\t\t\thighlightActiveLine: false,\n\t\t\t\tfoldGutter: false,\n\t\t\t\thighlightActiveLineGutter: false,\n\t\t\t};\n\t\t}\n\t\tconst { setContainer } = useCodeMirror({\n\t\t\tcontainer: editor.current,\n\t\t\textensions,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tonBlur,\n\t\t\tindentWithTab: false,\n\t\t\teditable: !disabled,\n\t\t\tbasicSetup,\n\t\t});\n\n\t\tuseEffect(() => {\n\t\t\tif (editor.current) {\n\t\t\t\tsetContainer(editor.current);\n\t\t\t}\n\t\t}, [setContainer]);\n\n\t\tconst handleCopy = (_value: string) => {\n\t\t\ttoast.success(\"Copied to clipboard\");\n\t\t\tvoid navigator.clipboard.writeText(_value);\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={(node) => {\n\t\t\t\t\teditor.current = node;\n\t\t\t\t\tif (typeof forwardedRef === \"function\") {\n\t\t\t\t\t\tforwardedRef(node);\n\t\t\t\t\t} else if (forwardedRef) {\n\t\t\t\t\t\tforwardedRef.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{copy && value && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={() => handleCopy(value)}\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName=\"absolute top-0 right-0 z-10\"\n\t\t\t\t\t\taria-label=\"copy\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Copy\" className=\"size-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nMarkdownInput.displayName = \"MarkdownInput\";\n"],"names":["extensions","markdown","EditorView","MarkdownInput","React","className","value","onChange","copy","onBlur","disabled","hideLineNumbers","props","forwardedRef","editor","useRef","basicSetup","setContainer","useCodeMirror","useEffect","handleCopy","_value","toast","jsx","cn","node","Button","Icon"],"mappings":"iXAYA,MAAMA,EAAa,CAACC,IAAYC,EAAW,YAAY,EAY1CC,EAAgBC,EAAM,WAIlC,CACC,CACC,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,GACP,OAAAC,EACA,SAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CAAA,EAEJC,IACI,CACJ,MAAMC,EAASC,EAAAA,OAA8B,IAAI,EAGjD,IAAIC,EACAN,IACHM,EAAa,CACZ,YAAa,CAACL,EACd,oBAAqB,GACrB,WAAY,GACZ,0BAA2B,EAAA,GAG7B,KAAM,CAAE,aAAAM,CAAA,EAAiBC,EAAc,CACtC,UAAWJ,EAAO,QAClB,WAAAd,EACA,MAAAM,EACA,SAAAC,EAEA,cAAe,GACf,SAAU,CAACG,EACX,WAAAM,CAAA,CACA,EAEDG,EAAAA,UAAU,IAAM,CACXL,EAAO,SACVG,EAAaH,EAAO,OAAO,CAE7B,EAAG,CAACG,CAAY,CAAC,EAEjB,MAAMG,EAAcC,GAAmB,CACtCC,EAAM,QAAQ,qBAAqB,EAC9B,UAAU,UAAU,UAAUD,CAAM,CAC1C,EAEA,OACCE,EAAAA,IAAC,MAAA,CACA,UAAWC,EACV,8HACAnB,CAAA,EAED,IAAMoB,GAAS,CACdX,EAAO,QAAUW,EACb,OAAOZ,GAAiB,WAC3BA,EAAaY,CAAI,EACPZ,IACVA,EAAa,QAAUY,EAEzB,EACC,GAAGb,EAEH,YAAQN,GACRiB,EAAAA,IAACG,EAAA,CACA,QAAS,IAAMN,EAAWd,CAAK,EAC/B,QAAQ,QACR,KAAK,OACL,UAAU,8BACV,aAAW,OAEX,SAAAiB,EAAAA,IAACI,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CAAA,CAIJ,CACD,EAEAxB,EAAc,YAAc"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/python-input-
|
|
2
|
-
import{j as e,r as s}from"./vendor-tanstack-BK8oseNA.js";import{
|
|
3
|
-
//# sourceMappingURL=python-example-snippet-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/python-input-y26XMqXw.js","assets/vendor-tanstack-BK8oseNA.js","assets/vendor-react-Bce9NwRC.js","assets/vendor-codemirror-CXN7nd_v.js","assets/index-BvSl3DKP.js","assets/vendor-radix-CznP1SOq.js","assets/vendor-recharts-D4imLXNl.js","assets/vendor-forms-DxqqmhL5.js","assets/vendor-date-7GxEwcQM.js","assets/index-NY089eTx.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as s}from"./vendor-tanstack-BK8oseNA.js";import{b5 as p,cc as c}from"./index-BvSl3DKP.js";const i=s.lazy(()=>c(()=>import("./python-input-y26XMqXw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(t=>({default:t.PythonInput})));function a({className:t,...n}){return e.jsx(s.Suspense,{fallback:e.jsx(p,{className:`min-h-[200px] ${t??""}`}),children:e.jsx(i,{className:t,...n})})}function h({codeExample:t,name:n}){const o=s.useMemo(()=>{const[,r=""]=t.match(/```python([\S\s]*?)```/)??[];return r.replace("BLOCK_NAME",n??"block-name").trim()},[t,n]);return e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(a,{className:"p-2",value:o,disabled:!0,copy:!0,hideLineNumbers:!0})})}export{h as P};
|
|
3
|
+
//# sourceMappingURL=python-example-snippet-BYwPjHI5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";0GAIA,MAAMA,EAAkBC,OAAK,IAAAC,EAAA,IAC5B,OAAO,4BAAgB,0CAAE,KAAMC,IAAS,CAAE,QAASA,EAAI,aAAc,CACtE,EAIO,SAASC,EAAgB,CAAE,UAAAC,EAAW,GAAGC,GAA+B,CAC9E,OACCC,MAACC,WAAA,CACA,SAAUD,MAACE,EAAA,CAAS,UAAW,iBAAiBJ,GAAa,EAAE,GAAI,EAEnE,SAAAE,MAACP,EAAA,CAAgB,UAAAK,EAAuB,GAAGC,CAAA,CAAO,GAGrD,CCXO,SAASI,EAAmB,CAClC,YAAAC,EACA,KAAAC,CACD,EAA4B,CAC3B,MAAMC,EAAUC,UAAQ,IAAM,CAC7B,KAAM,EAAGC,EAAiB,EAAE,EAC3BJ,EAAY,MAAM,wBAAwB,GAAK,GAKhD,OAJsBI,EAAe,QACpC,aACAH,GAAQ,cAEY,MACtB,EAAG,CAACD,EAAaC,CAAI,CAAC,EAEtB,OACCL,MAAC,OAAI,UAAU,sBACd,SAAAA,MAACS,EAAA,CACA,UAAU,MACV,MAAOH,EACP,SAAQ,GACR,KAAI,GACJ,gBAAe,KAEjB,CAEF","names":["PythonInputLazy","lazy","__vitePreload","mod","LazyPythonInput","className","props","jsx","Suspense","Skeleton","PythonBlockSnippet","codeExample","name","snippet","useMemo","genericSnippet","PythonInput"],"ignoreList":[],"sources":["../../src/components/ui/python-input-lazy.tsx","../../src/components/blocks/python-example-snippet.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { lazy, Suspense } from \"react\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\nconst PythonInputLazy = lazy(() =>\n\timport(\"./python-input\").then((mod) => ({ default: mod.PythonInput })),\n);\n\ntype LazyPythonInputProps = ComponentProps<typeof PythonInputLazy>;\n\nexport function LazyPythonInput({ className, ...props }: LazyPythonInputProps) {\n\treturn (\n\t\t<Suspense\n\t\t\tfallback={<Skeleton className={`min-h-[200px] ${className ?? \"\"}`} />}\n\t\t>\n\t\t\t<PythonInputLazy className={className} {...props} />\n\t\t</Suspense>\n\t);\n}\n","import { useMemo } from \"react\";\nimport { LazyPythonInput as PythonInput } from \"@/components/ui/python-input-lazy\";\n\ntype PythonBlockSnippetProps = {\n\tcodeExample: string;\n\tname: string | undefined | null;\n};\nexport function PythonBlockSnippet({\n\tcodeExample,\n\tname,\n}: PythonBlockSnippetProps) {\n\tconst snippet = useMemo(() => {\n\t\tconst [, genericSnippet = \"\"] =\n\t\t\tcodeExample.match(/```python([\\S\\s]*?)```/) ?? [];\n\t\tconst customSnippet = genericSnippet.replace(\n\t\t\t\"BLOCK_NAME\",\n\t\t\tname ?? \"block-name\",\n\t\t);\n\t\treturn customSnippet.trim();\n\t}, [codeExample, name]);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<PythonInput\n\t\t\t\tclassName=\"p-2\"\n\t\t\t\tvalue={snippet}\n\t\t\t\tdisabled\n\t\t\t\tcopy\n\t\t\t\thideLineNumbers\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"file":"python-example-snippet-
|
|
1
|
+
{"version":3,"mappings":";0GAIA,MAAMA,EAAkBC,OAAK,IAAAC,EAAA,IAC5B,OAAO,4BAAgB,0CAAE,KAAMC,IAAS,CAAE,QAASA,EAAI,aAAc,CACtE,EAIO,SAASC,EAAgB,CAAE,UAAAC,EAAW,GAAGC,GAA+B,CAC9E,OACCC,MAACC,WAAA,CACA,SAAUD,MAACE,EAAA,CAAS,UAAW,iBAAiBJ,GAAa,EAAE,GAAI,EAEnE,SAAAE,MAACP,EAAA,CAAgB,UAAAK,EAAuB,GAAGC,CAAA,CAAO,GAGrD,CCXO,SAASI,EAAmB,CAClC,YAAAC,EACA,KAAAC,CACD,EAA4B,CAC3B,MAAMC,EAAUC,UAAQ,IAAM,CAC7B,KAAM,EAAGC,EAAiB,EAAE,EAC3BJ,EAAY,MAAM,wBAAwB,GAAK,GAKhD,OAJsBI,EAAe,QACpC,aACAH,GAAQ,cAEY,MACtB,EAAG,CAACD,EAAaC,CAAI,CAAC,EAEtB,OACCL,MAAC,OAAI,UAAU,sBACd,SAAAA,MAACS,EAAA,CACA,UAAU,MACV,MAAOH,EACP,SAAQ,GACR,KAAI,GACJ,gBAAe,KAEjB,CAEF","names":["PythonInputLazy","lazy","__vitePreload","mod","LazyPythonInput","className","props","jsx","Suspense","Skeleton","PythonBlockSnippet","codeExample","name","snippet","useMemo","genericSnippet","PythonInput"],"ignoreList":[],"sources":["../../src/components/ui/python-input-lazy.tsx","../../src/components/blocks/python-example-snippet.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { lazy, Suspense } from \"react\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\nconst PythonInputLazy = lazy(() =>\n\timport(\"./python-input\").then((mod) => ({ default: mod.PythonInput })),\n);\n\ntype LazyPythonInputProps = ComponentProps<typeof PythonInputLazy>;\n\nexport function LazyPythonInput({ className, ...props }: LazyPythonInputProps) {\n\treturn (\n\t\t<Suspense\n\t\t\tfallback={<Skeleton className={`min-h-[200px] ${className ?? \"\"}`} />}\n\t\t>\n\t\t\t<PythonInputLazy className={className} {...props} />\n\t\t</Suspense>\n\t);\n}\n","import { useMemo } from \"react\";\nimport { LazyPythonInput as PythonInput } from \"@/components/ui/python-input-lazy\";\n\ntype PythonBlockSnippetProps = {\n\tcodeExample: string;\n\tname: string | undefined | null;\n};\nexport function PythonBlockSnippet({\n\tcodeExample,\n\tname,\n}: PythonBlockSnippetProps) {\n\tconst snippet = useMemo(() => {\n\t\tconst [, genericSnippet = \"\"] =\n\t\t\tcodeExample.match(/```python([\\S\\s]*?)```/) ?? [];\n\t\tconst customSnippet = genericSnippet.replace(\n\t\t\t\"BLOCK_NAME\",\n\t\t\tname ?? \"block-name\",\n\t\t);\n\t\treturn customSnippet.trim();\n\t}, [codeExample, name]);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<PythonInput\n\t\t\t\tclassName=\"p-2\"\n\t\t\t\tvalue={snippet}\n\t\t\t\tdisabled\n\t\t\t\tcopy\n\t\t\t\thideLineNumbers\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"file":"python-example-snippet-BYwPjHI5.js"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as d,r as c,j as s}from"./vendor-tanstack-BK8oseNA.js";import{u as g,p as x,E as
|
|
2
|
-
//# sourceMappingURL=python-input-
|
|
1
|
+
import{c as d,r as c,j as s}from"./vendor-tanstack-BK8oseNA.js";import{u as g,p as x,E as y}from"./vendor-codemirror-CXN7nd_v.js";import{aW as b,q as v,I as C,y as j}from"./index-BvSl3DKP.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./vendor-date-7GxEwcQM.js";const w=[x(),y.lineWrapping],E=d.forwardRef(({className:l,value:o,onChange:p,copy:u=!1,onBlur:N,disabled:r,hideLineNumbers:h=!1,...f},i)=>{const e=c.useRef(null);let n;r&&(n={lineNumbers:!h,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:w,value:o,onChange:p,indentWithTab:!1,editable:!r,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const m=t=>{j.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return s.jsx("div",{className:b("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...f,children:u&&o&&s.jsx(v,{onClick:()=>m(o),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:s.jsx(C,{id:"Copy",className:"size-2"})})})});E.displayName="PythonInput";export{E as PythonInput};
|
|
2
|
+
//# sourceMappingURL=python-input-y26XMqXw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python-input-
|
|
1
|
+
{"version":3,"file":"python-input-y26XMqXw.js","sources":["../../src/components/ui/python-input.tsx"],"sourcesContent":["import { python } from \"@codemirror/lang-python\";\nimport {\n\ttype BasicSetupOptions,\n\tEditorView,\n\tuseCodeMirror,\n} from \"@uiw/react-codemirror\";\nimport React, { useEffect, useRef } from \"react\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/utils\";\nimport { Button } from \"./button\";\nimport { Icon } from \"./icons\";\n\nconst extensions = [python(), EditorView.lineWrapping];\n\ntype PythonInputProps = React.ComponentProps<\"div\"> & {\n\tvalue?: string;\n\tonChange?: (value: string) => void;\n\tonBlur?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport const PythonInput = React.forwardRef<HTMLDivElement, PythonInputProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tcopy = false,\n\t\t\tonBlur,\n\t\t\tdisabled,\n\t\t\thideLineNumbers = false,\n\t\t\t...props\n\t\t},\n\t\tforwardedRef,\n\t) => {\n\t\tconst editor = useRef<HTMLDivElement | null>(null);\n\t\t// Setting `basicSetup` messes up the tab order. We only change the basic setup\n\t\t// if the input is disabled, so we leave it undefined to maintain the tab order.\n\t\tlet basicSetup: BasicSetupOptions | undefined;\n\t\tif (disabled) {\n\t\t\tbasicSetup = {\n\t\t\t\tlineNumbers: !hideLineNumbers,\n\t\t\t\thighlightActiveLine: false,\n\t\t\t\tfoldGutter: false,\n\t\t\t\thighlightActiveLineGutter: false,\n\t\t\t};\n\t\t}\n\t\tconst { setContainer } = useCodeMirror({\n\t\t\tcontainer: editor.current,\n\t\t\textensions,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tonBlur,\n\t\t\tindentWithTab: false,\n\t\t\teditable: !disabled,\n\t\t\tbasicSetup,\n\t\t});\n\n\t\tuseEffect(() => {\n\t\t\tif (editor.current) {\n\t\t\t\tsetContainer(editor.current);\n\t\t\t}\n\t\t}, [setContainer]);\n\n\t\tconst handleCopy = (_value: string) => {\n\t\t\ttoast.success(\"Copied to clipboard\");\n\t\t\tvoid navigator.clipboard.writeText(_value);\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={(node) => {\n\t\t\t\t\teditor.current = node;\n\t\t\t\t\tif (typeof forwardedRef === \"function\") {\n\t\t\t\t\t\tforwardedRef(node);\n\t\t\t\t\t} else if (forwardedRef) {\n\t\t\t\t\t\tforwardedRef.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{copy && value && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={() => handleCopy(value)}\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName=\"absolute top-0 right-0 z-10\"\n\t\t\t\t\t\taria-label=\"copy\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Copy\" className=\"size-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nPythonInput.displayName = \"PythonInput\";\n"],"names":["extensions","python","EditorView","PythonInput","React","className","value","onChange","copy","onBlur","disabled","hideLineNumbers","props","forwardedRef","editor","useRef","basicSetup","setContainer","useCodeMirror","useEffect","handleCopy","_value","toast","jsx","cn","node","Button","Icon"],"mappings":"iXAYA,MAAMA,EAAa,CAACC,IAAUC,EAAW,YAAY,EAYxCC,EAAcC,EAAM,WAChC,CACC,CACC,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,GACP,OAAAC,EACA,SAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CAAA,EAEJC,IACI,CACJ,MAAMC,EAASC,EAAAA,OAA8B,IAAI,EAGjD,IAAIC,EACAN,IACHM,EAAa,CACZ,YAAa,CAACL,EACd,oBAAqB,GACrB,WAAY,GACZ,0BAA2B,EAAA,GAG7B,KAAM,CAAE,aAAAM,CAAA,EAAiBC,EAAc,CACtC,UAAWJ,EAAO,QAClB,WAAAd,EACA,MAAAM,EACA,SAAAC,EAEA,cAAe,GACf,SAAU,CAACG,EACX,WAAAM,CAAA,CACA,EAEDG,EAAAA,UAAU,IAAM,CACXL,EAAO,SACVG,EAAaH,EAAO,OAAO,CAE7B,EAAG,CAACG,CAAY,CAAC,EAEjB,MAAMG,EAAcC,GAAmB,CACtCC,EAAM,QAAQ,qBAAqB,EAC9B,UAAU,UAAU,UAAUD,CAAM,CAC1C,EAEA,OACCE,EAAAA,IAAC,MAAA,CACA,UAAWC,EACV,8HACAnB,CAAA,EAED,IAAMoB,GAAS,CACdX,EAAO,QAAUW,EACb,OAAOZ,GAAiB,WAC3BA,EAAaY,CAAI,EACPZ,IACVA,EAAa,QAAUY,EAEzB,EACC,GAAGb,EAEH,YAAQN,GACRiB,EAAAA,IAACG,EAAA,CACA,QAAS,IAAMN,EAAWd,CAAK,EAC/B,QAAQ,QACR,KAAK,OACL,UAAU,8BACV,aAAW,OAEX,SAAAiB,EAAAA,IAACI,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CAAA,CAIJ,CACD,EAEAxB,EAAY,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,j as r}from"./vendor-tanstack-BK8oseNA.js";import{aj as i,ak as t,al as l}from"./vendor-radix-CznP1SOq.js";import{
|
|
2
|
-
//# sourceMappingURL=radio-group-
|
|
1
|
+
import{r as o,j as r}from"./vendor-tanstack-BK8oseNA.js";import{aj as i,ak as t,al as l}from"./vendor-radix-CznP1SOq.js";import{aW as c,cU as n}from"./index-BvSl3DKP.js";const d=o.forwardRef(({className:a,...s},e)=>r.jsx(i,{className:c("grid gap-2",a),...s,ref:e}));d.displayName=i.displayName;const m=o.forwardRef(({className:a,...s},e)=>r.jsx(t,{ref:e,className:c("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),...s,children:r.jsx(l,{className:"flex items-center justify-center",children:r.jsx(n,{className:"h-2.5 w-2.5 fill-current text-current"})})}));m.displayName=t.displayName;export{d as R,m as a};
|
|
2
|
+
//# sourceMappingURL=radio-group-D0van45v.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-
|
|
1
|
+
{"version":3,"file":"radio-group-D0van45v.js","sources":["../../src/components/ui/radio-group.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst RadioGroup = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Root\n\t\t\tclassName={cn(\"grid gap-2\", className)}\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t/>\n\t);\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n\t\t\t\t<Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n\t\t\t</RadioGroupPrimitive.Indicator>\n\t\t</RadioGroupPrimitive.Item>\n\t);\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n"],"names":["RadioGroup","React.forwardRef","className","props","ref","jsx","RadioGroupPrimitive.Root","cn","RadioGroupItem","RadioGroupPrimitive.Item","RadioGroupPrimitive.Indicator","Circle"],"mappings":"0KAMA,MAAMA,EAAaC,EAAAA,WAGjB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACC,EAAA,CACA,UAAWC,EAAG,aAAcL,CAAS,EACpC,GAAGC,EACJ,IAAAC,CAAA,CAAA,CAGF,EACDJ,EAAW,YAAcM,EAAyB,YAElD,MAAME,EAAiBP,EAAAA,WAGrB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACI,EAAA,CACA,IAAAL,EACA,UAAWG,EACV,2OACAL,CAAA,EAEA,GAAGC,EAEJ,SAAAE,EAAAA,IAACK,EAAA,CAA8B,UAAU,mCACxC,SAAAL,EAAAA,IAACM,EAAA,CAAO,UAAU,uCAAA,CAAwC,CAAA,CAC3D,CAAA,CAAA,CAGF,EACDH,EAAe,YAAcC,EAAyB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as s,j as e}from"./vendor-tanstack-BK8oseNA.js";import{C as f,o as R,cd as h,q as g,ce as j,aW as p}from"./index-BvSl3DKP.js";const N=5e3,v=3e4;function u(a){const t=N*2**a;return Math.min(t,v)}function E({error:a,onRetry:t}){const r=s.useRef(0),[m,l]=s.useState(u(0)/1e3),[c,n]=s.useState(!1),d=s.useCallback(()=>{n(!0),t(),r.current+=1;const i=u(r.current);l(i/1e3),setTimeout(()=>n(!1),500)},[t]),x=s.useCallback(()=>{n(!0),t(),r.current=0,l(u(0)/1e3),setTimeout(()=>n(!1),500)},[t]);return s.useEffect(()=>{const i=setInterval(()=>{l(o=>o<=1?(d(),o):o-1)},1e3);return()=>clearInterval(i)},[d]),e.jsx(f,{className:"mx-auto max-w-md",children:e.jsxs(R,{className:"flex flex-col items-center gap-4 pt-6 text-center",children:[e.jsx("div",{className:"rounded-full bg-destructive/10 p-3",children:e.jsx(h,{className:"size-8 text-destructive"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.message}),a.details&&e.jsx("p",{className:"text-sm text-muted-foreground",children:a.details})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs(g,{onClick:x,disabled:c,variant:"outline",className:"gap-2",children:[e.jsx(j,{className:p("size-4",c&&"animate-spin")}),c?"Retrying...":"Retry"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retrying in ",m,"s"]})]})]})})}export{E as R};
|
|
2
|
+
//# sourceMappingURL=route-error-state-CGGpuCGN.js.map
|
prefect/server/ui-v2/assets/{route-error-state-ALftyvGl.js.map → route-error-state-CGGpuCGN.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-error-state-
|
|
1
|
+
{"version":3,"file":"route-error-state-CGGpuCGN.js","sources":["../../src/components/ui/route-error-state.tsx"],"sourcesContent":["import { AlertCircle, RefreshCw } from \"lucide-react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ServerError } from \"@/api/error-utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport { cn } from \"@/utils\";\n\nconst BASE_RETRY_INTERVAL_MS = 5000;\nconst MAX_RETRY_INTERVAL_MS = 30000;\n\nfunction getRetryInterval(attempt: number): number {\n\tconst interval = BASE_RETRY_INTERVAL_MS * 2 ** attempt;\n\treturn Math.min(interval, MAX_RETRY_INTERVAL_MS);\n}\n\ntype RouteErrorStateProps = {\n\terror: ServerError;\n\tonRetry: () => void;\n};\n\nexport function RouteErrorState({ error, onRetry }: RouteErrorStateProps) {\n\tconst retryAttemptRef = useRef(0);\n\tconst [secondsUntilRetry, setSecondsUntilRetry] = useState(\n\t\tgetRetryInterval(0) / 1000,\n\t);\n\tconst [isRetrying, setIsRetrying] = useState(false);\n\n\tconst handleAutoRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current += 1;\n\t\tconst nextInterval = getRetryInterval(retryAttemptRef.current);\n\t\tsetSecondsUntilRetry(nextInterval / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tconst handleManualRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current = 0;\n\t\tsetSecondsUntilRetry(getRetryInterval(0) / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tuseEffect(() => {\n\t\tconst interval = setInterval(() => {\n\t\t\tsetSecondsUntilRetry((prev) => {\n\t\t\t\tif (prev <= 1) {\n\t\t\t\t\thandleAutoRetry();\n\t\t\t\t\treturn prev;\n\t\t\t\t}\n\t\t\t\treturn prev - 1;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [handleAutoRetry]);\n\n\treturn (\n\t\t<Card className=\"mx-auto max-w-md\">\n\t\t\t<CardContent className=\"flex flex-col items-center gap-4 pt-6 text-center\">\n\t\t\t\t<div className=\"rounded-full bg-destructive/10 p-3\">\n\t\t\t\t\t<AlertCircle className=\"size-8 text-destructive\" />\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t<h2 className=\"text-lg font-semibold\">{error.message}</h2>\n\t\t\t\t\t{error.details && (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground\">{error.details}</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex flex-col items-center gap-2\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={handleManualRetry}\n\t\t\t\t\t\tdisabled={isRetrying}\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tclassName=\"gap-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<RefreshCw className={cn(\"size-4\", isRetrying && \"animate-spin\")} />\n\t\t\t\t\t\t{isRetrying ? \"Retrying...\" : \"Retry\"}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<p className=\"text-xs text-muted-foreground\">\n\t\t\t\t\t\tRetrying in {secondsUntilRetry}s\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n"],"names":["BASE_RETRY_INTERVAL_MS","MAX_RETRY_INTERVAL_MS","getRetryInterval","attempt","interval","RouteErrorState","error","onRetry","retryAttemptRef","useRef","secondsUntilRetry","setSecondsUntilRetry","useState","isRetrying","setIsRetrying","handleAutoRetry","useCallback","nextInterval","handleManualRetry","useEffect","prev","Card","jsxs","CardContent","jsx","AlertCircle","Button","RefreshCw","cn"],"mappings":"uIAOA,MAAMA,EAAyB,IACzBC,EAAwB,IAE9B,SAASC,EAAiBC,EAAyB,CAClD,MAAMC,EAAWJ,EAAyB,GAAKG,EAC/C,OAAO,KAAK,IAAIC,EAAUH,CAAqB,CAChD,CAOO,SAASI,EAAgB,CAAE,MAAAC,EAAO,QAAAC,GAAiC,CACzE,MAAMC,EAAkBC,EAAAA,OAAO,CAAC,EAC1B,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SACjDV,EAAiB,CAAC,EAAI,GAAA,EAEjB,CAACW,EAAYC,CAAa,EAAIF,EAAAA,SAAS,EAAK,EAE5CG,EAAkBC,EAAAA,YAAY,IAAM,CACzCF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,SAAW,EAC3B,MAAMS,EAAef,EAAiBM,EAAgB,OAAO,EAC7DG,EAAqBM,EAAe,GAAI,EACxC,WAAW,IAAMH,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAENW,EAAoBF,EAAAA,YAAY,IAAM,CAC3CF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,QAAU,EAC1BG,EAAqBT,EAAiB,CAAC,EAAI,GAAI,EAC/C,WAAW,IAAMY,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAEZY,OAAAA,EAAAA,UAAU,IAAM,CACf,MAAMf,EAAW,YAAY,IAAM,CAClCO,EAAsBS,GACjBA,GAAQ,GACXL,EAAA,EACOK,GAEDA,EAAO,CACd,CACF,EAAG,GAAI,EAEP,MAAO,IAAM,cAAchB,CAAQ,CACpC,EAAG,CAACW,CAAe,CAAC,QAGlBM,EAAA,CAAK,UAAU,mBACf,SAAAC,EAAAA,KAACC,EAAA,CAAY,UAAU,oDACtB,SAAA,CAAAC,EAAAA,IAAC,OAAI,UAAU,qCACd,eAACC,EAAA,CAAY,UAAU,0BAA0B,CAAA,CAClD,EAEAH,EAAAA,KAAC,MAAA,CAAI,UAAU,YACd,SAAA,CAAAE,EAAAA,IAAC,KAAA,CAAG,UAAU,wBAAyB,SAAAlB,EAAM,QAAQ,EACpDA,EAAM,SACNkB,EAAAA,IAAC,KAAE,UAAU,gCAAiC,WAAM,OAAA,CAAQ,CAAA,EAE9D,EAEAF,EAAAA,KAAC,MAAA,CAAI,UAAU,mCACd,SAAA,CAAAA,EAAAA,KAACI,EAAA,CACA,QAASR,EACT,SAAUL,EACV,QAAQ,UACR,UAAU,QAEV,SAAA,CAAAW,MAACG,GAAU,UAAWC,EAAG,SAAUf,GAAc,cAAc,EAAG,EACjEA,EAAa,cAAgB,OAAA,CAAA,CAAA,EAG/BS,EAAAA,KAAC,IAAA,CAAE,UAAU,gCAAgC,SAAA,CAAA,eAC/BZ,EAAkB,GAAA,CAAA,CAChC,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as d,j as s,p as je}from"./vendor-tanstack-BK8oseNA.js";import{u as Oe}from"./use-debounce-callback-ClAx-Wwx.js";import{bF as Y,C as X,p as R,I as pe,ab as Z,ac as ee,ad as ne,ae as te,ag as re,af as se,ai as U,bn as Pe,ah as Q,F as Fe,o as z,L as ie,a5 as De,cC as Ee,cD as Ve,aU as Me,as as Ae,cE as Te,cF as $e,i as Ke}from"./index-WYPZo52S.js";import{D as Le,a as Be,b as Ue,d as N,e as Je}from"./dropdown-menu-xZ_3w9OP.js";import{m as B,b as F,i as ue,p as Re,g as ze,c as We,C as Ge,d as qe,e as le,D as He,f as Qe,S as Ye,v as Xe,s as Ze,K as en,P as nn,h as tn,B as rn,j as sn,k as on}from"./schema-form-input-string-format-datetime-BhL8C5NS.js";import{H as an,a4 as cn,e as un,f as fe}from"./vendor-date-7GxEwcQM.js";import{T as ln,a as fn}from"./toggle-group-D3zeurIL.js";import{T as dn}from"./textarea-D8LjlIx7.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./zod-DgSl2Nua.js";import"./timezone-select-BG3cL3-U.js";import"./form-BTub_PhK.js";const mn=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],hn=Y("eye-off",mn);const xn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jn=Y("eye",xn);const pn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],bn=Y("grip-vertical",pn);function I(e){return e!==void 0}function C(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!an(e)}function O(e){return Array.isArray(e)}function gn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function M(e){return"$ref"in e}function be(e){return"anyOf"in e&&I(e.anyOf)}function yn(e){return"oneOf"in e&&I(e.oneOf)}function Sn(e){return"allOf"in e&&I(e.allOf)}function vn(e){return"items"in e&&I(e.items)}function wn(e){return"definitions"in e&&C(e.definitions)}function A(e,n){if(wn(e)){const t=n.replace("#/definitions/",""),r=e.definitions?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}if("$defs"in e&&C(e.$defs)){const t=n.replace("#/$defs/",""),r=e.$defs?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}throw new Error("Schema does not contain definitions")}function ge(e,n){if(M(e)&&typeof e.$ref=="string"){const{$ref:t,...r}=e;return B({},A(n,t),r)}return e}function _n({property:e,value:n,onValueChange:t,errors:r,id:i}){const{schema:o}=F(),c=d.useMemo(()=>{const{allOf:a,...f}=e,u=a.reduce((h,p)=>{if(M(p)){const l=A(o,p.$ref);return B({},h,l)}return B({},h,p)},{});return B({},u,f)},[e,o]);return s.jsx(ae,{value:n,onValueChange:t,errors:r,property:c,id:i})}function In({value:e,property:n,schema:t}){const r=I(e)?e:n.default;if(!I(r))return 0;const i=kn(n,t);switch(typeof r){case"string":return i.findIndex(o=>o.type==="string");case"number":return i.findIndex(o=>o.type==="number"||o.type==="integer");case"boolean":return i.findIndex(o=>o.type==="boolean");case"object":return Cn(r,i);default:return-1}}function kn(e,n){return e.anyOf?e.anyOf.map(t=>M(t)?A(n,t.$ref):t):[]}function Cn(e,n){return C(e)?Nn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Nn(e,n){if(gn(e))return n.findIndex(o=>o.type==="object");const t=Object.keys(e),[r,i]=n.reduce(([o,c],a,f)=>{if(!("properties"in a)||!a.properties)return[o,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[f,h]:[o,c]},[0,0]);return i===0?-1:r}const On={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function Pn(e){if(e.type&&typeof e.type=="string")return On[e.type]}function oe(e,n){if(M(e)){const r=A(n,e.$ref);return oe(r,n)}const t=Pn(e)??"Field";return e.title??e.format??t}function q({value:e,property:n,onValueChange:t,errors:r}){const{schema:i}=F(),[o,c]=d.useState(In({value:e,property:n,schema:i})),a=d.useRef(new Map);function f(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(o,e),c(h),t(a.current.get(h))}return s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ln,{size:"sm",variant:"outline",type:"single",value:o.toString(),onValueChange:f,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=oe(u,i);return s.jsx(fn,{value:h.toString(),children:p},p)})}),s.jsx(X,{className:"p-2",children:s.jsx(Ce,{value:e,property:n.anyOf[o],onValueChange:t,errors:r,showLabel:!1,nested:!1,required:!1})})]})}const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function Fn(e,n=0){return(g[e[n+0]]+g[e[n+1]]+g[e[n+2]]+g[e[n+3]]+"-"+g[e[n+4]]+g[e[n+5]]+"-"+g[e[n+6]]+g[e[n+7]]+"-"+g[e[n+8]]+g[e[n+9]]+"-"+g[e[n+10]]+g[e[n+11]]+g[e[n+12]]+g[e[n+13]]+g[e[n+14]]+g[e[n+15]]).toLowerCase()}let H;const Dn=new Uint8Array(16);function En(){if(!H){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H=crypto.getRandomValues.bind(crypto)}return H(Dn)}const Vn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),de={randomUUID:Vn};function Mn(e,n,t){e=e||{};const r=e.random??e.rng?.()??En();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Fn(r)}function me(e,n,t){return de.randomUUID&&!e?de.randomUUID():Mn(e)}function An(e){return typeof e=="string"}function ye(e){return C(e)&&"property"in e}function Se(e){return C(e)&&"index"in e}function ve({errors:e}){const n=d.useMemo(()=>e.filter(t=>An(t)),[e]);return n.length===0?null:n.length===1?s.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):s.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>s.jsx("li",{children:t},t))})}function we(e){return L(e)?e.__prefect_kind:null}function L(e,n){return C(e)&&ue(e.__prefect_kind)?ue(n)?e.__prefect_kind===n:!0:!1}function Tn({value:e,property:n,schema:t,to:r}){const i=we(e);try{switch(i){case"json":return $n({json:e,property:n,schema:t,to:r});case"jinja":return Kn({jinja:e,property:n,schema:t,to:r});case"workspace_variable":return Ln({workspaceVariable:e,to:r});case null:return Bn({value:e,property:n,schema:t,to:r});default:throw new Error(`Unknown prefect kind value: ${i}`)}}catch(o){console.error(o);return}}function $n({json:e,property:n,schema:t,to:r}){switch(r){case"jinja":return{__prefect_kind:"jinja",template:e.value};case"json":return e;case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.value===void 0)return;try{const i=JSON.parse(e.value);return W({value:i,property:n,schema:t})}catch{throw new _e("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Kn({jinja:e,property:n,schema:t,to:r}){switch(r){case"jinja":return e;case"json":return{__prefect_kind:"json",value:e.template};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.template===void 0)return;try{const i=JSON.parse(e.template);return W({value:i,property:n,schema:t})}catch{throw new _e("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Ln({workspaceVariable:e,to:n}){switch(n){case"workspace_variable":return e;case"jinja":return{__prefect_kind:"jinja",template:void 0};case"json":return{__prefect_kind:"json",value:void 0};case null:return;default:throw new Error(`mapSchemaValueWorkspaceVariable missing case for kind: ${n}`)}}function Bn({value:e,property:n,schema:t,to:r}){switch(r){case"jinja":return{__prefect_kind:"jinja",template:e===void 0?void 0:JSON.stringify(e,null,2)};case"json":return{__prefect_kind:"json",value:e===void 0?void 0:JSON.stringify(e,null,2)};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:return W({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${r}`)}}function W({value:e,property:n,schema:t}){return O(n)?n.map(i=>J({value:e,property:i,schema:t})).find(i=>i!==void 0):J({value:e,property:n,schema:t})}function J({value:e,property:n,schema:t}){const r=ge(n,t);if(be(r))return W({value:e,property:r.anyOf,schema:t});switch(r.type){case"null":return null;case"string":return typeof e=="string"?e:void 0;case"boolean":return typeof e=="boolean"?e:void 0;case"number":return typeof e=="number"?e:void 0;case"integer":return typeof e=="number"?Math.round(e):void 0;case"array":return Un({value:e,property:r,schema:t});case"object":return Jn({value:e,property:r,schema:t});default:if(O(r.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${r.type}`)}}function Un({value:e,property:n,schema:t}){return O(e)?[...e].map(i=>J({value:i,property:n,schema:t})):void 0}function Jn({value:e,property:n,schema:t}){if(!C(e))return;if(n.properties===void 0)return e;const r={...e};for(const[i,o]of Object.entries(n.properties))J({value:e[i],property:o,schema:t})===void 0&&delete r[i];return r}class _e extends Error{constructor(n,t){super(`Unable to convert prefect kind value from "${n}" to "${t??"null"}"`)}}const Ie=({value:e,onValueChange:n,property:t,children:r,disableKinds:i,defaultValue:o,hasDefaultValue:c})=>{const{schema:a,kinds:f}=F(),[u,h]=d.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(o);function l(){c&&n(o)}function x(w){const S=Tn({value:e,property:t,schema:a,to:w});n(S)}const y=d.useMemo(()=>{const w=we(e);return Re.filter(S=>S!==w&&(f.includes(S)||S===null)&&!i)},[e,f,i]);return s.jsxs(Le,{open:u,onOpenChange:h,children:[s.jsx(Be,{asChild:!0,children:s.jsxs(R,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(pe,{id:"MoreVertical",className:"size-4"})]})}),s.jsxs(Ue,{align:"end",children:[y.map(w=>s.jsx(N,{onClick:()=>x(w),children:ze(w)},w)),c&&s.jsx(N,{onClick:l,disabled:p,children:"Use default value"}),s.jsx(Je,{}),r]})]})};function Rn({itemKey:e,items:n,value:t,onValueChange:r,errors:i,onDelete:o,first:c,last:a,canMove:f,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=F(),y=d.useId(),{attributes:w,listeners:S,setNodeRef:k,transform:D,transition:E,isDragging:$}=We({id:e,disabled:!f}),K={transform:Ge.Transform.toString(D),transition:E,opacity:$?.5:1},_=d.useMemo(()=>O(n)?{anyOf:n}:M(n)?A(x,n.$ref):n,[n,x]);return s.jsxs("div",{ref:k,style:K,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[f?s.jsx("button",{type:"button",className:"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none","aria-label":"Drag to reorder",...w,...S,children:s.jsx(bn,{className:"h-5 w-5"})}):s.jsx("div",{className:"w-5"}),s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ae,{value:t,onValueChange:r,property:_,errors:i,id:y}),s.jsx(ve,{errors:i})]}),s.jsxs(Ie,{value:t,onValueChange:r,property:n,children:[s.jsx(N,{onClick:o,children:"Delete"}),f&&!c&&s.jsxs(s.Fragment,{children:[s.jsx(N,{onClick:p,children:"Move to top"}),s.jsx(N,{onClick:u,children:"Move up"})]}),f&&!a&&s.jsxs(s.Fragment,{children:[s.jsx(N,{onClick:h,children:"Move down"}),s.jsx(N,{onClick:l,children:"Move to bottom"})]})]})]})}function zn({property:e,values:n,onValuesChange:t,errors:r}){const i=n===void 0||n.length===0,o=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=qe(le(nn),le(en,{coordinateGetter:Ze})),[f,u]=d.useState(n?.map(m=>({key:me(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return r.filter(b=>Se(b)&&b.index===m).flatMap(b=>b.errors)}function l(m){return m===0}function x(m){return m===(n?.length??0)-1}function y(m){return!(O(e.prefixItems)&&m<e.prefixItems.length)}function w(m,b){u(f.map(j=>j.key===m?{...j,value:b}:j))}function S(){const m=[...f,{key:me(),value:void 0}];u(m),t(m.map(({value:b})=>b))}function k(m,b){const j=[...f];j.splice(b,0,j.splice(m,1)[0]),u(j),t(j.map(({value:V})=>V))}function D(m){k(m,0)}function E(m){k(m,f.length-1)}function $(m){const b=f.filter(j=>j.key!==m);u(b),t(b.map(({value:j})=>j))}function K(m){const{active:b,over:j}=m;if(j&&b.id!==j.id){const V=f.findIndex(G=>G.key===b.id),ce=f.findIndex(G=>G.key===j.id);V!==-1&&ce!==-1&&k(V,ce)}}const _=f.slice(c).map(m=>m.key);return s.jsxs(X,{className:"flex flex-col gap-2 p-2",children:[i&&s.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),s.jsx(He,{sensors:a,collisionDetection:Qe,onDragEnd:K,children:s.jsx(Ye,{items:_,strategy:Xe,children:f?.map(({key:m,value:b},j)=>s.jsx(Rn,{itemKey:m,items:h(j),value:b,onValueChange:V=>w(m,V),errors:p(j),onDelete:()=>$(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>k(j,j-1),moveDown:()=>k(j,j+1),moveToTop:()=>D(j),moveToBottom:()=>E(j)},m))})}),o&&s.jsx("div",{className:"flex justify-end",children:s.jsx(R,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!o&&s.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function T({property:e,id:n,...t}){const[r,i]=d.useState(""),o=d.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(r.toLowerCase()))),[e.enum,r]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function f(l){const x=o[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){i("");const x=o[l];return t.multiple?p(x):h(x)}function h(l){if(t.multiple)throw new Error("onSingleSelect called on multiple value input");t.onValueChange(l)}function p(l){if(!t.multiple)throw new Error("onMultipleSelect called on single value input");if(!t.values){t.onValuesChange([l]);return}if(t.values?.includes(l)){t.onValuesChange(t.values.filter(x=>x!==l));return}t.onValuesChange([...t.values,l])}return s.jsxs(Z,{children:[s.jsx(ee,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),s.jsxs(ne,{children:[s.jsx(te,{value:r,onValueChange:i,placeholder:"Search..."}),s.jsx(re,{children:"No values found"}),s.jsx(se,{children:Object.entries(o).map(([l,x])=>s.jsx(U,{value:l,onSelect:u,selected:f(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>tn(typeof n))}function v(e,n){if(typeof e==typeof n())return e}function Wn(e){if(C(e))return e}function Gn(e){return v(e,String)??v(e,Number)??v(e,Boolean)}function ke(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>v(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>v(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>v(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>v(t,String)??v(t,Number)??v(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function qn({values:e,property:n,onValuesChange:t,errors:r,id:i}){const{schema:o}=F();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(vn(n)&&C(n.items)){let a=n.items;if(M(a)&&(a=A(o,a.$ref)),P(a)){const f={...n,...a};return s.jsx(T,{multiple:!0,values:ke(e,"primitive"),property:f,onValuesChange:c,id:i})}}return s.jsx(zn,{property:n,values:e,onValuesChange:c,errors:r})}const Hn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>s.jsx(d.Suspense,{children:s.jsx(Qn,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})}),Qn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>{const[i,o]=d.useState(""),c=d.useDeferredValue(i),{data:a}=je(Pe({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_types:{slug:{any_:[e]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1},...c?{name:{like_:c}}:{}},limit:50})),f=d.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=d.useMemo(()=>a.find(h=>h.id===n),[a,n]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),s.jsxs(ne,{children:[s.jsx(te,{value:i,onValueChange:o,placeholder:"Search for a block..."}),s.jsx(re,{children:"No block found"}),s.jsxs(se,{children:[s.jsx(Q,{children:f.map(h=>s.jsx(U,{selected:n===h.id,onSelect:p=>{t(p),o("")},value:h.id,children:h.name},h.id))}),r&&s.jsx(Q,{children:s.jsxs(U,{onSelect:()=>{r(),o("")},value:"__create_new__",closeOnSelect:!0,children:[s.jsx(pe,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function Yn({value:e,onValueChange:n,blockTypeSlug:t,id:r}){const[i,o]=d.useState(!1),c=e?.$ref,a=u=>{n(u?{$ref:u}:void 0)},f=u=>{n({$ref:u})};return s.jsxs("div",{id:r,children:[s.jsx(Hn,{blockTypeSlug:t,selectedBlockDocumentId:c,onSelect:a,onCreateNew:()=>o(!0)}),s.jsx(rn,{open:i,onOpenChange:o,blockTypeSlug:t,onCreated:f})]})}function Xn({value:e,onValueChange:n,property:t,id:r}){function i(o){n(v(o,Boolean))}return P(t)?s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r}):s.jsx(Fe,{checked:e,onCheckedChange:i,id:r})}function Zn({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:o=>i(o.target.value),id:r})}function et(){return s.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function nt({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:o=>i(o.target.value),id:r})}function tt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"jinja",template:i||void 0})};return s.jsx(ie,{value:e.template,onChange:r,id:t})}function rt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"json",value:i||void 0})};return s.jsx(ie,{value:e.value,onChange:r,id:t})}const st=({selectedVariableName:e,onSelect:n})=>s.jsx(d.Suspense,{children:s.jsx(it,{selectedVariableName:e,onSelect:n})}),it=({selectedVariableName:e,onSelect:n})=>{const[t,r]=d.useState(""),i=d.useDeferredValue(t),{data:o}=je(De({offset:0,sort:"NAME_ASC",variables:i?{operator:"and_",name:{like_:i}}:void 0,limit:50})),c=d.useMemo(()=>o.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())),[o,i]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),s.jsxs(ne,{children:[s.jsx(te,{value:t,onValueChange:r,placeholder:"Search for a variable..."}),s.jsx(re,{children:"No variable found"}),s.jsx(se,{children:s.jsx(Q,{children:c.map(a=>s.jsx(U,{selected:e===a.name,onSelect:f=>{n(f),r("")},value:a.name,children:a.name},a.id))})})]})]})};function ot({value:e,onValueChange:n,id:t}){const r=i=>{n({__prefect_kind:"workspace_variable",variable_name:i})};return s.jsx("div",{id:t,children:s.jsx(st,{selectedVariableName:e.variable_name,onSelect:r})})}const he="yyyy-MM-dd";function at({value:e,onValueChange:n,id:t}){const r=e?cn(e,he,un()):void 0,[i,o]=d.useState(r);function c(a){o(a),n(a?fe(a,he):void 0)}return s.jsxs(Ee,{children:[s.jsx(Ve,{asChild:!0,children:s.jsxs(R,{variant:"outline",className:Me("justify-start text-left font-normal w-full",!i&&"text-muted-foreground"),id:t,children:[s.jsx(Ae,{className:"mr-2 h-4 w-4"}),i?fe(i,"PPP"):s.jsx("span",{children:"Pick a date"})]})}),s.jsx(Te,{className:"w-auto p-0",children:s.jsx($e,{mode:"single",selected:i,onSelect:c,required:!0,autoFocus:!0})})]})}function ct({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n(i||void 0)};return s.jsx(ie,{value:e,onChange:r,id:t})}function ut({value:e,onValueChange:n,id:t}){const[r,i]=d.useState(!1),o=c=>{n(c.target.value||void 0)};return s.jsxs("div",{className:"relative",children:[s.jsx(z,{id:t,type:r?"text":"password",value:e??"",onChange:o,autoComplete:"off",className:"pr-10"}),s.jsx(R,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>i(!r),"aria-label":r?"Hide password":"Show password",children:r?s.jsx(hn,{className:"h-4 w-4"}):s.jsx(jn,{className:"h-4 w-4"})})]})}function lt({value:e,onValueChange:n,id:t}){function r(i){const o=i.target.value;if(o===""){n(void 0);return}const c=Number(o);Number.isNaN(c)||n(String(c))}return s.jsx(z,{type:"number",value:e??"",onChange:r,id:t,placeholder:"Duration in seconds",min:0})}function ft({value:e,onValueChange:n,property:t,id:r}){function i(o){n(o||void 0)}return P(t)?s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:i,id:r}):t.format==="date"?s.jsx(at,{value:e,onValueChange:i,id:r}):t.format==="date-time"?s.jsx(sn,{value:e,onValueChange:i,id:r}):t.format==="json-string"?s.jsx(ct,{value:e,onValueChange:i,id:r}):t.format==="time-delta"?s.jsx(lt,{value:e,onValueChange:i,id:r}):t.format==="password"?s.jsx(ut,{value:e,onValueChange:i,id:r}):s.jsx(dn,{value:e??"",rows:1,className:"min-h-min",onChange:o=>i(o.target.value),id:r})}function dt({value:e,onValueChange:n,property:t,id:r}){return d.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?s.jsx(T,{multiple:!1,value:Gn(e),property:t,onValueChange:n,id:r}):null}function ae({value:e,onValueChange:n,errors:t,property:r,id:i,nested:o=!0}){if(L(e)){if(L(e,"json"))return s.jsx(rt,{value:e,onValueChange:n,id:i});if(L(e,"jinja"))return s.jsx(tt,{value:e,onValueChange:n,id:i});if(L(e,"workspace_variable"))return s.jsx(ot,{value:e,onValueChange:n,id:i});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("blockTypeSlug"in r){const c=r.blockTypeSlug;if(typeof c=="string")return s.jsx(Yn,{value:e,onValueChange:n,blockTypeSlug:c,id:i})}if(be(r))return s.jsx(q,{value:e,property:r,onValueChange:n,errors:t});if(yn(r)){const c={...r,anyOf:r.oneOf};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(r.type)){const c={...r,anyOf:Object.values(r.type).map(a=>({type:a}))};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Sn(r))return s.jsx(_n,{value:e,onValueChange:n,errors:t,property:r,id:i});if(r.type==="string")return s.jsx(ft,{value:v(e,String),onValueChange:n,property:r,id:i});if(r.type==="integer")return s.jsx(Zn,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="number")return s.jsx(nt,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="boolean")return s.jsx(Xn,{value:v(e,Boolean),onValueChange:n,property:r,id:i});if(r.type==="object")return s.jsx(Ne,{values:Wn(e),property:r,onValuesChange:n,errors:t,nested:o});if(r.type==="array")return s.jsx(qn,{values:ke(e),property:r,onValuesChange:n,errors:t,id:i});if(r.type==="null")return s.jsx(et,{});if(r.type===void 0)return s.jsx(dt,{value:e,onValueChange:n,property:r,id:i});throw new Error(`Schema type not implemented: ${String(r.type)}`)}function xe({property:e}){const n=d.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&s.jsx("p",{className:"text-sm text-gray-500",children:n})}function mt({property:e,required:n,id:t}){const{schema:r}=F(),i=d.useMemo(()=>{const o=oe(e,r);return n?o:`${o} (Optional)`},[e,n,r]);return s.jsx(Ke,{htmlFor:t,children:i})}function Ce({property:e,value:n,onValueChange:t,required:r,errors:i,showLabel:o=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:f}=F(),u=d.useMemo(()=>ge(e,a),[e,a]),h=d.useMemo(()=>!I(u.type),[u.type]),p=d.useMemo(()=>i.filter(_=>ye(_)||Se(_)),[i]),[l,x]=d.useState(!1),[y,w]=d.useState(K),[S,k]=d.useState(!1),D=d.useId(),E=d.useCallback(_=>{w(_),t(_)},[t]),$=d.useCallback(()=>{const _=!S;k(_),t(_?void 0:y)},[S,t,y]);d.useEffect(()=>{l||f||(I(u.default)&&!I(n)&&t(u.default),x(!0))},[l,f,t,u.default,n]);function K(){if(I(n))return n;if(I(u.default)&&!f)return u.default}return s.jsxs("div",{className:"flex flex-col gap-2 group",children:[o&&s.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(mt,{property:u,required:r,id:D}),s.jsx(xe,{property:u})]}),s.jsx("div",{className:"ml-auto",children:s.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:I(u.default),children:s.jsx(N,{onClick:$,children:S?"Include value":"Omit value"})})})]}),!o&&s.jsx(xe,{property:u}),s.jsx("fieldset",{disabled:S,children:s.jsx(ae,{property:u,value:y,onValueChange:E,errors:p,id:D,nested:c})}),s.jsx(ve,{errors:i})]})}function ht(e,n){return(e.position??0)-(n.position??0)}function Ne({values:e,onValuesChange:n,property:t,errors:r,nested:i}){const o=d.useRef([]),c=Oe(d.useCallback(()=>{const l={...e};for(const{key:x,value:y}of o.current)l[x]=y,y===void 0&&delete l[x];if(o.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){o.current.push({key:l,value:x}),c()}function f(l){return e?.[l]}function u(l){return r.filter(ye).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=d.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>ht(l,x)),[t.properties]),p=s.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>s.jsx(Ce,{value:f(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return i?s.jsx(X,{className:"p-2",children:p}):p}const xt=({children:e,...n})=>s.jsx(on.Provider,{value:n,children:e}),Ft=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:r,onValuesChange:i,errors:o})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=d.useCallback(u=>{if(u===void 0){i({});return}i(u)},[i]),f={values:r,property:e,onValuesChange:a,errors:o};return s.jsx("div",{className:"flex flex-col gap-4",children:s.jsx(xt,{...c,children:s.jsx(Ne,{...f,nested:!1})})})};export{Ft as SchemaForm};
|
|
2
|
-
//# sourceMappingURL=schema-form-
|
|
1
|
+
import{r as d,j as s,p as je}from"./vendor-tanstack-BK8oseNA.js";import{u as Oe}from"./use-debounce-callback-ClAx-Wwx.js";import{bH as Y,C as X,q as R,I as pe,ac as Z,ad as ee,ae as ne,af as te,ah as re,ag as se,aj as U,bp as Pe,ai as Q,G as Fe,p as z,L as ie,a6 as De,cG as Ee,cH as Ve,aW as Me,at as Ae,cI as Te,cJ as $e,i as Ke}from"./index-BvSl3DKP.js";import{D as Le,a as Be,b as Ue,d as C,e as Je}from"./dropdown-menu-CT-s-V7d.js";import{m as B,b as F,i as ue,p as Re,g as ze,c as We,C as Ge,d as qe,e as le,D as He,f as Qe,S as Ye,v as Xe,s as Ze,K as en,P as nn,h as tn,B as rn,j as sn,k as on}from"./schema-form-input-string-format-datetime-CZt6AJ4z.js";import{H as an,a4 as cn,e as un,f as fe}from"./vendor-date-7GxEwcQM.js";import{T as ln,a as fn}from"./toggle-group-BJN1vjEh.js";import{T as dn}from"./textarea-BAtfAxtV.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./zod-DgSl2Nua.js";import"./timezone-select-QlQTZSsF.js";import"./form-CVSlEnl8.js";const mn=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],hn=Y("eye-off",mn);const xn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jn=Y("eye",xn);const pn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],gn=Y("grip-vertical",pn);function I(e){return e!==void 0}function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!an(e)}function O(e){return Array.isArray(e)}function bn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function M(e){return"$ref"in e}function ge(e){return"anyOf"in e&&I(e.anyOf)}function yn(e){return"oneOf"in e&&I(e.oneOf)}function Sn(e){return"allOf"in e&&I(e.allOf)}function vn(e){return"items"in e&&I(e.items)}function wn(e){return"definitions"in e&&N(e.definitions)}function A(e,n){if(wn(e)){const t=n.replace("#/definitions/",""),r=e.definitions?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}if("$defs"in e&&N(e.$defs)){const t=n.replace("#/$defs/",""),r=e.$defs?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}throw new Error("Schema does not contain definitions")}function be(e,n){if(M(e)&&typeof e.$ref=="string"){const{$ref:t,...r}=e;return B({},A(n,t),r)}return e}function _n({property:e,value:n,onValueChange:t,errors:r,id:i}){const{schema:o}=F(),c=d.useMemo(()=>{const{allOf:a,...f}=e,u=a.reduce((h,p)=>{if(M(p)){const l=A(o,p.$ref);return B({},h,l)}return B({},h,p)},{});return B({},u,f)},[e,o]);return s.jsx(ae,{value:n,onValueChange:t,errors:r,property:c,id:i})}function In({value:e,property:n,schema:t}){const r=I(e)?e:n.default;if(!I(r))return 0;const i=kn(n,t);switch(typeof r){case"string":return i.findIndex(o=>o.type==="string");case"number":return i.findIndex(o=>o.type==="number"||o.type==="integer");case"boolean":return i.findIndex(o=>o.type==="boolean");case"object":return Nn(r,i);default:return-1}}function kn(e,n){return e.anyOf?e.anyOf.map(t=>M(t)?A(n,t.$ref):t):[]}function Nn(e,n){return N(e)?Cn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Cn(e,n){if(bn(e))return n.findIndex(o=>o.type==="object");const t=Object.keys(e),[r,i]=n.reduce(([o,c],a,f)=>{if(!("properties"in a)||!a.properties)return[o,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[f,h]:[o,c]},[0,0]);return i===0?-1:r}const On={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function Pn(e){if(e.type&&typeof e.type=="string")return On[e.type]}function oe(e,n){if(M(e)){const r=A(n,e.$ref);return oe(r,n)}const t=Pn(e)??"Field";return e.title??e.format??t}function q({value:e,property:n,onValueChange:t,errors:r}){const{schema:i}=F(),[o,c]=d.useState(In({value:e,property:n,schema:i})),a=d.useRef(new Map);function f(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(o,e),c(h),t(a.current.get(h))}return s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ln,{size:"sm",variant:"outline",type:"single",value:o.toString(),onValueChange:f,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=oe(u,i);return s.jsx(fn,{value:h.toString(),children:p},p)})}),s.jsx(X,{className:"p-2",children:s.jsx(Ne,{value:e,property:n.anyOf[o],onValueChange:t,errors:r,showLabel:!1,nested:!1,required:!1})})]})}const b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));function Fn(e,n=0){return(b[e[n+0]]+b[e[n+1]]+b[e[n+2]]+b[e[n+3]]+"-"+b[e[n+4]]+b[e[n+5]]+"-"+b[e[n+6]]+b[e[n+7]]+"-"+b[e[n+8]]+b[e[n+9]]+"-"+b[e[n+10]]+b[e[n+11]]+b[e[n+12]]+b[e[n+13]]+b[e[n+14]]+b[e[n+15]]).toLowerCase()}let H;const Dn=new Uint8Array(16);function En(){if(!H){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H=crypto.getRandomValues.bind(crypto)}return H(Dn)}const Vn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),de={randomUUID:Vn};function Mn(e,n,t){e=e||{};const r=e.random??e.rng?.()??En();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Fn(r)}function me(e,n,t){return de.randomUUID&&!e?de.randomUUID():Mn(e)}function An(e){return typeof e=="string"}function ye(e){return N(e)&&"property"in e}function Se(e){return N(e)&&"index"in e}function ve({errors:e}){const n=d.useMemo(()=>e.filter(t=>An(t)),[e]);return n.length===0?null:n.length===1?s.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):s.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>s.jsx("li",{children:t},t))})}function we(e){return L(e)?e.__prefect_kind:null}function L(e,n){return N(e)&&ue(e.__prefect_kind)?ue(n)?e.__prefect_kind===n:!0:!1}function Tn({value:e,property:n,schema:t,to:r}){const i=we(e);try{switch(i){case"json":return $n({json:e,property:n,schema:t,to:r});case"jinja":return Kn({jinja:e,property:n,schema:t,to:r});case"workspace_variable":return Ln({workspaceVariable:e,to:r});case null:return Bn({value:e,property:n,schema:t,to:r});default:throw new Error(`Unknown prefect kind value: ${i}`)}}catch(o){console.error(o);return}}function $n({json:e,property:n,schema:t,to:r}){switch(r){case"jinja":return{__prefect_kind:"jinja",template:e.value};case"json":return e;case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.value===void 0)return;try{const i=JSON.parse(e.value);return W({value:i,property:n,schema:t})}catch{throw new _e("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Kn({jinja:e,property:n,schema:t,to:r}){switch(r){case"jinja":return e;case"json":return{__prefect_kind:"json",value:e.template};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.template===void 0)return;try{const i=JSON.parse(e.template);return W({value:i,property:n,schema:t})}catch{throw new _e("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Ln({workspaceVariable:e,to:n}){switch(n){case"workspace_variable":return e;case"jinja":return{__prefect_kind:"jinja",template:void 0};case"json":return{__prefect_kind:"json",value:void 0};case null:return;default:throw new Error(`mapSchemaValueWorkspaceVariable missing case for kind: ${n}`)}}function Bn({value:e,property:n,schema:t,to:r}){switch(r){case"jinja":return{__prefect_kind:"jinja",template:e===void 0?void 0:JSON.stringify(e,null,2)};case"json":return{__prefect_kind:"json",value:e===void 0?void 0:JSON.stringify(e,null,2)};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:return W({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${r}`)}}function W({value:e,property:n,schema:t}){return O(n)?n.map(i=>J({value:e,property:i,schema:t})).find(i=>i!==void 0):J({value:e,property:n,schema:t})}function J({value:e,property:n,schema:t}){const r=be(n,t);if(ge(r))return W({value:e,property:r.anyOf,schema:t});switch(r.type){case"null":return null;case"string":return typeof e=="string"?e:void 0;case"boolean":return typeof e=="boolean"?e:void 0;case"number":return typeof e=="number"?e:void 0;case"integer":return typeof e=="number"?Math.round(e):void 0;case"array":return Un({value:e,property:r,schema:t});case"object":return Jn({value:e,property:r,schema:t});default:if(O(r.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${r.type}`)}}function Un({value:e,property:n,schema:t}){return O(e)?[...e].map(i=>J({value:i,property:n,schema:t})):void 0}function Jn({value:e,property:n,schema:t}){if(!N(e))return;if(n.properties===void 0)return e;const r={...e};for(const[i,o]of Object.entries(n.properties))J({value:e[i],property:o,schema:t})===void 0&&delete r[i];return r}class _e extends Error{constructor(n,t){super(`Unable to convert prefect kind value from "${n}" to "${t??"null"}"`)}}const Ie=({value:e,onValueChange:n,property:t,children:r,disableKinds:i,defaultValue:o,hasDefaultValue:c})=>{const{schema:a,kinds:f}=F(),[u,h]=d.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(o);function l(){c&&n(o)}function x(w){const S=Tn({value:e,property:t,schema:a,to:w});n(S)}const y=d.useMemo(()=>{const w=we(e);return Re.filter(S=>S!==w&&(f.includes(S)||S===null)&&!i)},[e,f,i]);return s.jsxs(Le,{open:u,onOpenChange:h,children:[s.jsx(Be,{asChild:!0,children:s.jsxs(R,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(pe,{id:"MoreVertical",className:"size-4"})]})}),s.jsxs(Ue,{align:"end",children:[y.map(w=>s.jsx(C,{onClick:()=>x(w),children:ze(w)},w)),c&&s.jsx(C,{onClick:l,disabled:p,children:"Use default value"}),s.jsx(Je,{}),r]})]})};function Rn({itemKey:e,items:n,value:t,onValueChange:r,errors:i,onDelete:o,first:c,last:a,canMove:f,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=F(),y=d.useId(),{attributes:w,listeners:S,setNodeRef:k,transform:D,transition:E,isDragging:$}=We({id:e,disabled:!f}),K={transform:Ge.Transform.toString(D),transition:E,opacity:$?.5:1},_=d.useMemo(()=>O(n)?{anyOf:n}:M(n)?A(x,n.$ref):n,[n,x]);return s.jsxs("div",{ref:k,style:K,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[f?s.jsx("button",{type:"button",className:"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none","aria-label":"Drag to reorder",...w,...S,children:s.jsx(gn,{className:"h-5 w-5"})}):s.jsx("div",{className:"w-5"}),s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ae,{value:t,onValueChange:r,property:_,errors:i,id:y}),s.jsx(ve,{errors:i})]}),s.jsxs(Ie,{value:t,onValueChange:r,property:n,children:[s.jsx(C,{onClick:o,children:"Delete"}),f&&!c&&s.jsxs(s.Fragment,{children:[s.jsx(C,{onClick:p,children:"Move to top"}),s.jsx(C,{onClick:u,children:"Move up"})]}),f&&!a&&s.jsxs(s.Fragment,{children:[s.jsx(C,{onClick:h,children:"Move down"}),s.jsx(C,{onClick:l,children:"Move to bottom"})]})]})]})}function zn({property:e,values:n,onValuesChange:t,errors:r}){const i=n===void 0||n.length===0,o=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=qe(le(nn),le(en,{coordinateGetter:Ze})),[f,u]=d.useState(n?.map(m=>({key:me(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return r.filter(g=>Se(g)&&g.index===m).flatMap(g=>g.errors)}function l(m){return m===0}function x(m){return m===(n?.length??0)-1}function y(m){return!(O(e.prefixItems)&&m<e.prefixItems.length)}function w(m,g){u(f.map(j=>j.key===m?{...j,value:g}:j))}function S(){const m=[...f,{key:me(),value:void 0}];u(m),t(m.map(({value:g})=>g))}function k(m,g){const j=[...f];j.splice(g,0,j.splice(m,1)[0]),u(j),t(j.map(({value:V})=>V))}function D(m){k(m,0)}function E(m){k(m,f.length-1)}function $(m){const g=f.filter(j=>j.key!==m);u(g),t(g.map(({value:j})=>j))}function K(m){const{active:g,over:j}=m;if(j&&g.id!==j.id){const V=f.findIndex(G=>G.key===g.id),ce=f.findIndex(G=>G.key===j.id);V!==-1&&ce!==-1&&k(V,ce)}}const _=f.slice(c).map(m=>m.key);return s.jsxs(X,{className:"flex flex-col gap-2 p-2",children:[i&&s.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),s.jsx(He,{sensors:a,collisionDetection:Qe,onDragEnd:K,children:s.jsx(Ye,{items:_,strategy:Xe,children:f?.map(({key:m,value:g},j)=>s.jsx(Rn,{itemKey:m,items:h(j),value:g,onValueChange:V=>w(m,V),errors:p(j),onDelete:()=>$(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>k(j,j-1),moveDown:()=>k(j,j+1),moveToTop:()=>D(j),moveToBottom:()=>E(j)},m))})}),o&&s.jsx("div",{className:"flex justify-end",children:s.jsx(R,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!o&&s.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function T({property:e,id:n,...t}){const[r,i]=d.useState(""),o=d.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(r.toLowerCase()))),[e.enum,r]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function f(l){const x=o[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){i("");const x=o[l];return t.multiple?p(x):h(x)}function h(l){if(t.multiple)throw new Error("onSingleSelect called on multiple value input");t.onValueChange(l)}function p(l){if(!t.multiple)throw new Error("onMultipleSelect called on single value input");if(!t.values){t.onValuesChange([l]);return}if(t.values?.includes(l)){t.onValuesChange(t.values.filter(x=>x!==l));return}t.onValuesChange([...t.values,l])}return s.jsxs(Z,{children:[s.jsx(ee,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),s.jsxs(ne,{children:[s.jsx(te,{value:r,onValueChange:i,placeholder:"Search..."}),s.jsx(re,{children:"No values found"}),s.jsx(se,{children:Object.entries(o).map(([l,x])=>s.jsx(U,{value:l,onSelect:u,selected:f(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>tn(typeof n))}function v(e,n){if(typeof e==typeof n())return e}function Wn(e){if(N(e))return e}function Gn(e){return v(e,String)??v(e,Number)??v(e,Boolean)}function ke(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>v(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>v(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>v(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>v(t,String)??v(t,Number)??v(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function qn({values:e,property:n,onValuesChange:t,errors:r,id:i}){const{schema:o}=F();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(vn(n)&&N(n.items)){let a=n.items;if(M(a)&&(a=A(o,a.$ref)),P(a)){const f={...n,...a};return s.jsx(T,{multiple:!0,values:ke(e,"primitive"),property:f,onValuesChange:c,id:i})}}return s.jsx(zn,{property:n,values:e,onValuesChange:c,errors:r})}const Hn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>s.jsx(d.Suspense,{children:s.jsx(Qn,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})}),Qn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>{const[i,o]=d.useState(""),c=d.useDeferredValue(i),{data:a}=je(Pe({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_types:{slug:{any_:[e]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1},...c?{name:{like_:c}}:{}},limit:50})),f=d.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=d.useMemo(()=>a.find(h=>h.id===n),[a,n]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),s.jsxs(ne,{children:[s.jsx(te,{value:i,onValueChange:o,placeholder:"Search for a block..."}),s.jsx(re,{children:"No block found"}),s.jsxs(se,{children:[s.jsx(Q,{children:f.map(h=>s.jsx(U,{selected:n===h.id,onSelect:p=>{t(p),o("")},value:h.id,children:h.name},h.id))}),r&&s.jsx(Q,{children:s.jsxs(U,{onSelect:()=>{r(),o("")},value:"__create_new__",closeOnSelect:!0,children:[s.jsx(pe,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function Yn({value:e,onValueChange:n,blockTypeSlug:t,id:r}){const[i,o]=d.useState(!1),c=e?.$ref,a=u=>{n(u?{$ref:u}:void 0)},f=u=>{n({$ref:u})};return s.jsxs("div",{id:r,children:[s.jsx(Hn,{blockTypeSlug:t,selectedBlockDocumentId:c,onSelect:a,onCreateNew:()=>o(!0)}),s.jsx(rn,{open:i,onOpenChange:o,blockTypeSlug:t,onCreated:f})]})}function Xn({value:e,onValueChange:n,property:t,id:r}){function i(o){n(v(o,Boolean))}return P(t)?s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r}):s.jsx(Fe,{checked:e,onCheckedChange:i,id:r})}function Zn({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:o=>i(o.target.value),id:r})}function et(){return s.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function nt({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:o=>i(o.target.value),id:r})}function tt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"jinja",template:i||void 0})};return s.jsx(ie,{value:e.template,onChange:r,id:t})}function rt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"json",value:i||void 0})};return s.jsx(ie,{value:e.value,onChange:r,id:t})}const st=({selectedVariableName:e,onSelect:n})=>s.jsx(d.Suspense,{children:s.jsx(it,{selectedVariableName:e,onSelect:n})}),it=({selectedVariableName:e,onSelect:n})=>{const[t,r]=d.useState(""),i=d.useDeferredValue(t),{data:o}=je(De({offset:0,sort:"NAME_ASC",variables:i?{operator:"and_",name:{like_:i}}:void 0,limit:50})),c=d.useMemo(()=>o.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())),[o,i]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),s.jsxs(ne,{children:[s.jsx(te,{value:t,onValueChange:r,placeholder:"Search for a variable..."}),s.jsx(re,{children:"No variable found"}),s.jsx(se,{children:s.jsx(Q,{children:c.map(a=>s.jsx(U,{selected:e===a.name,onSelect:f=>{n(f),r("")},value:a.name,children:a.name},a.id))})})]})]})};function ot({value:e,onValueChange:n,id:t}){const r=i=>{n({__prefect_kind:"workspace_variable",variable_name:i})};return s.jsx("div",{id:t,children:s.jsx(st,{selectedVariableName:e.variable_name,onSelect:r})})}const he="yyyy-MM-dd";function at({value:e,onValueChange:n,id:t}){const r=e?cn(e,he,un()):void 0,[i,o]=d.useState(r);function c(a){o(a),n(a?fe(a,he):void 0)}return s.jsxs(Ee,{children:[s.jsx(Ve,{asChild:!0,children:s.jsxs(R,{variant:"outline",className:Me("justify-start text-left font-normal w-full",!i&&"text-muted-foreground"),id:t,children:[s.jsx(Ae,{className:"mr-2 h-4 w-4"}),i?fe(i,"PPP"):s.jsx("span",{children:"Pick a date"})]})}),s.jsx(Te,{className:"w-auto p-0",children:s.jsx($e,{mode:"single",selected:i,onSelect:c,required:!0,autoFocus:!0})})]})}function ct({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n(i||void 0)};return s.jsx(ie,{value:e,onChange:r,id:t})}function ut({value:e,onValueChange:n,id:t}){const[r,i]=d.useState(!1),o=c=>{n(c.target.value||void 0)};return s.jsxs("div",{className:"relative",children:[s.jsx(z,{id:t,type:r?"text":"password",value:e??"",onChange:o,autoComplete:"off",className:"pr-10"}),s.jsx(R,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>i(!r),"aria-label":r?"Hide password":"Show password",children:r?s.jsx(hn,{className:"h-4 w-4"}):s.jsx(jn,{className:"h-4 w-4"})})]})}function lt({value:e,onValueChange:n,id:t}){function r(i){const o=i.target.value;if(o===""){n(void 0);return}const c=Number(o);Number.isNaN(c)||n(String(c))}return s.jsx(z,{type:"number",value:e??"",onChange:r,id:t,placeholder:"Duration in seconds",min:0})}function ft({value:e,onValueChange:n,property:t,id:r}){function i(o){n(o||void 0)}return P(t)?s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:i,id:r}):t.format==="date"?s.jsx(at,{value:e,onValueChange:i,id:r}):t.format==="date-time"?s.jsx(sn,{value:e,onValueChange:i,id:r}):t.format==="json-string"?s.jsx(ct,{value:e,onValueChange:i,id:r}):t.format==="time-delta"?s.jsx(lt,{value:e,onValueChange:i,id:r}):t.format==="password"?s.jsx(ut,{value:e,onValueChange:i,id:r}):s.jsx(dn,{value:e??"",rows:1,className:"min-h-min",onChange:o=>i(o.target.value),id:r})}function dt({value:e,onValueChange:n,property:t,id:r}){return d.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?s.jsx(T,{multiple:!1,value:Gn(e),property:t,onValueChange:n,id:r}):null}function ae({value:e,onValueChange:n,errors:t,property:r,id:i,nested:o=!0}){if(L(e)){if(L(e,"json"))return s.jsx(rt,{value:e,onValueChange:n,id:i});if(L(e,"jinja"))return s.jsx(tt,{value:e,onValueChange:n,id:i});if(L(e,"workspace_variable"))return s.jsx(ot,{value:e,onValueChange:n,id:i});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("blockTypeSlug"in r){const c=r.blockTypeSlug;if(typeof c=="string")return s.jsx(Yn,{value:e,onValueChange:n,blockTypeSlug:c,id:i})}if(ge(r))return s.jsx(q,{value:e,property:r,onValueChange:n,errors:t});if(yn(r)){const c={...r,anyOf:r.oneOf};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(r.type)){const c={...r,anyOf:Object.values(r.type).map(a=>({type:a}))};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Sn(r))return s.jsx(_n,{value:e,onValueChange:n,errors:t,property:r,id:i});if(r.type==="string")return s.jsx(ft,{value:v(e,String),onValueChange:n,property:r,id:i});if(r.type==="integer")return s.jsx(Zn,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="number")return s.jsx(nt,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="boolean")return s.jsx(Xn,{value:v(e,Boolean),onValueChange:n,property:r,id:i});if(r.type==="object")return s.jsx(Ce,{values:Wn(e),property:r,onValuesChange:n,errors:t,nested:o});if(r.type==="array")return s.jsx(qn,{values:ke(e),property:r,onValuesChange:n,errors:t,id:i});if(r.type==="null")return s.jsx(et,{});if(r.type===void 0)return s.jsx(dt,{value:e,onValueChange:n,property:r,id:i});throw new Error(`Schema type not implemented: ${String(r.type)}`)}function xe({property:e}){const n=d.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&s.jsx("p",{className:"text-sm text-gray-500",children:n})}function mt({property:e,required:n,id:t}){const{schema:r}=F(),i=d.useMemo(()=>{const o=oe(e,r);return n?o:`${o} (Optional)`},[e,n,r]);return s.jsx(Ke,{htmlFor:t,children:i})}function Ne({property:e,value:n,onValueChange:t,required:r,errors:i,showLabel:o=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:f}=F(),u=d.useMemo(()=>be(e,a),[e,a]),h=d.useMemo(()=>!I(u.type),[u.type]),p=d.useMemo(()=>i.filter(_=>ye(_)||Se(_)),[i]),[l,x]=d.useState(!1),[y,w]=d.useState(K),[S,k]=d.useState(!1),D=d.useId(),E=d.useCallback(_=>{w(_),t(_)},[t]),$=d.useCallback(()=>{const _=!S;k(_),t(_?void 0:y)},[S,t,y]);d.useEffect(()=>{l||f||(I(u.default)&&!I(n)&&t(u.default),x(!0))},[l,f,t,u.default,n]);function K(){if(I(n))return n;if(I(u.default)&&!f)return u.default}return s.jsxs("div",{className:"flex flex-col gap-2 group",children:[o&&s.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(mt,{property:u,required:r,id:D}),s.jsx(xe,{property:u})]}),s.jsx("div",{className:"ml-auto",children:s.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:I(u.default),children:s.jsx(C,{onClick:$,children:S?"Include value":"Omit value"})})})]}),!o&&s.jsx(xe,{property:u}),s.jsx("fieldset",{disabled:S,children:s.jsx(ae,{property:u,value:y,onValueChange:E,errors:p,id:D,nested:c})}),s.jsx(ve,{errors:i})]})}function ht(e,n){return(e.position??0)-(n.position??0)}function Ce({values:e,onValuesChange:n,property:t,errors:r,nested:i}){const o=d.useRef([]),c=Oe(d.useCallback(()=>{const l={...e};for(const{key:x,value:y}of o.current)l[x]=y,y===void 0&&delete l[x];if(o.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){o.current.push({key:l,value:x}),c()}function f(l){return e?.[l]}function u(l){return r.filter(ye).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=d.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>ht(l,x)),[t.properties]),p=s.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>s.jsx(Ne,{value:f(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return i?s.jsx(X,{className:"p-2",children:p}):p}const xt=({children:e,...n})=>s.jsx(on.Provider,{value:n,children:e}),Ft=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:r,onValuesChange:i,errors:o})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=d.useCallback(u=>{if(u===void 0){i({});return}i(u)},[i]),f={values:r,property:e,onValuesChange:a,errors:o};return s.jsx("div",{className:"flex flex-col gap-4",children:s.jsx(xt,{...c,children:s.jsx(Ce,{...f,nested:!1})})})};export{Ft as SchemaForm};
|
|
2
|
+
//# sourceMappingURL=schema-form-2tg5SXM4.js.map
|