@lmvz-ds/components 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +3 -0
- package/assets/LMVZ_logo_175.svg +1 -0
- package/assets/card-placeholder.svg +4 -0
- package/assets/fonts/Router-Bold.woff +0 -0
- package/assets/fonts/Router-Book.woff +0 -0
- package/assets/fonts/Router-Medium.woff +0 -0
- package/assets/icons/Logo.svg +10 -0
- package/assets/icons/actions.svg +5 -0
- package/assets/icons/adduser.svg +3 -0
- package/assets/icons/alert.svg +3 -0
- package/assets/icons/apple.svg +3 -0
- package/assets/icons/arrow-down.svg +3 -0
- package/assets/icons/arrow-left.svg +3 -0
- package/assets/icons/arrow-right.svg +3 -0
- package/assets/icons/arrow-up.svg +3 -0
- package/assets/icons/book.svg +3 -0
- package/assets/icons/bookmark.svg +3 -0
- package/assets/icons/checkmark.svg +3 -0
- package/assets/icons/chevron-down.svg +3 -0
- package/assets/icons/chevron-left.svg +3 -0
- package/assets/icons/chevron-right.svg +3 -0
- package/assets/icons/chevron-up.svg +3 -0
- package/assets/icons/close-l.svg +3 -0
- package/assets/icons/close-sm.svg +3 -0
- package/assets/icons/cog.svg +4 -0
- package/assets/icons/computer.svg +3 -0
- package/assets/icons/dashboard.svg +6 -0
- package/assets/icons/delete.svg +3 -0
- package/assets/icons/download.svg +3 -0
- package/assets/icons/edit.svg +3 -0
- package/assets/icons/external.svg +3 -0
- package/assets/icons/facebook.svg +3 -0
- package/assets/icons/favorite.svg +3 -0
- package/assets/icons/filter.svg +3 -0
- package/assets/icons/group.svg +3 -0
- package/assets/icons/hide.svg +3 -0
- package/assets/icons/home.svg +3 -0
- package/assets/icons/info.svg +3 -0
- package/assets/icons/instagram.svg +3 -0
- package/assets/icons/letter.svg +3 -0
- package/assets/icons/linkedin.svg +5 -0
- package/assets/icons/logout.svg +3 -0
- package/assets/icons/map.svg +3 -0
- package/assets/icons/minus.svg +3 -0
- package/assets/icons/navigation.svg +3 -0
- package/assets/icons/plus.svg +3 -0
- package/assets/icons/qr-scan.svg +3 -0
- package/assets/icons/question.svg +10 -0
- package/assets/icons/reader.svg +3 -0
- package/assets/icons/reset.svg +3 -0
- package/assets/icons/school.svg +3 -0
- package/assets/icons/search.svg +3 -0
- package/assets/icons/send.svg +3 -0
- package/assets/icons/settings.svg +3 -0
- package/assets/icons/share.svg +10 -0
- package/assets/icons/shopping-cart.svg +3 -0
- package/assets/icons/show.svg +3 -0
- package/assets/icons/snapchat.svg +3 -0
- package/assets/icons/sort.svg +3 -0
- package/assets/icons/speech-bubble.svg +3 -0
- package/assets/icons/star.svg +3 -0
- package/assets/icons/student.svg +3 -0
- package/assets/icons/upload.svg +3 -0
- package/assets/icons/user.svg +3 -0
- package/assets/icons/warn-circle.svg +3 -0
- package/assets/icons/warn-triangle.svg +3 -0
- package/assets/icons/whatsapp.svg +4 -0
- package/assets/icons/world.svg +10 -0
- package/assets/icons/x.svg +3 -0
- package/assets/icons/youtube.svg +3 -0
- package/assets/zukunftslinie.svg +3 -0
- package/dist/cjs/Effect-BIlTHtLK.js +19172 -0
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +7 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/aria-validation-controller-B7unOPxT.js +2929 -0
- package/dist/cjs/axe-BNqwbBGU.js +32834 -0
- package/dist/cjs/component-CRc6eHcV.js +138 -0
- package/dist/cjs/element-activation-controller-DC_6T0Rt.js +31 -0
- package/dist/cjs/icons-DbL3LSmP.js +659 -0
- package/dist/cjs/index-9ZJx0550.js +2752 -0
- package/dist/cjs/index-CVw4GUo6.js +92 -0
- package/dist/cjs/index.cjs.js +96 -0
- package/dist/cjs/lmvz-action.cjs.entry.js +22 -0
- package/dist/cjs/lmvz-button.cjs.entry.js +72 -0
- package/dist/cjs/lmvz-card.cjs.entry.js +33 -0
- package/dist/cjs/lmvz-chip.cjs.entry.js +18 -0
- package/dist/cjs/lmvz-components.cjs.js +25 -0
- package/dist/cjs/lmvz-header.cjs.entry.js +134 -0
- package/dist/cjs/lmvz-icon.cjs.entry.js +76 -0
- package/dist/cjs/lmvz-input.cjs.entry.js +176 -0
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +32 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/collection/api/ds.constants.js +73 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/assets/LMVZ_logo_175.svg +1 -0
- package/dist/collection/assets/card-placeholder.svg +4 -0
- package/dist/collection/assets/fonts/Router-Bold.woff +0 -0
- package/dist/collection/assets/fonts/Router-Book.woff +0 -0
- package/dist/collection/assets/fonts/Router-Medium.woff +0 -0
- package/dist/collection/assets/icons/Logo.svg +10 -0
- package/dist/collection/assets/icons/actions.svg +5 -0
- package/dist/collection/assets/icons/adduser.svg +3 -0
- package/dist/collection/assets/icons/alert.svg +3 -0
- package/dist/collection/assets/icons/apple.svg +3 -0
- package/dist/collection/assets/icons/arrow-down.svg +3 -0
- package/dist/collection/assets/icons/arrow-left.svg +3 -0
- package/dist/collection/assets/icons/arrow-right.svg +3 -0
- package/dist/collection/assets/icons/arrow-up.svg +3 -0
- package/dist/collection/assets/icons/book.svg +3 -0
- package/dist/collection/assets/icons/bookmark.svg +3 -0
- package/dist/collection/assets/icons/checkmark.svg +3 -0
- package/dist/collection/assets/icons/chevron-down.svg +3 -0
- package/dist/collection/assets/icons/chevron-left.svg +3 -0
- package/dist/collection/assets/icons/chevron-right.svg +3 -0
- package/dist/collection/assets/icons/chevron-up.svg +3 -0
- package/dist/collection/assets/icons/close-l.svg +3 -0
- package/dist/collection/assets/icons/close-sm.svg +3 -0
- package/dist/collection/assets/icons/cog.svg +4 -0
- package/dist/collection/assets/icons/computer.svg +3 -0
- package/dist/collection/assets/icons/dashboard.svg +6 -0
- package/dist/collection/assets/icons/delete.svg +3 -0
- package/dist/collection/assets/icons/download.svg +3 -0
- package/dist/collection/assets/icons/edit.svg +3 -0
- package/dist/collection/assets/icons/external.svg +3 -0
- package/dist/collection/assets/icons/facebook.svg +3 -0
- package/dist/collection/assets/icons/favorite.svg +3 -0
- package/dist/collection/assets/icons/filter.svg +3 -0
- package/dist/collection/assets/icons/group.svg +3 -0
- package/dist/collection/assets/icons/hide.svg +3 -0
- package/dist/collection/assets/icons/home.svg +3 -0
- package/dist/collection/assets/icons/info.svg +3 -0
- package/dist/collection/assets/icons/instagram.svg +3 -0
- package/dist/collection/assets/icons/letter.svg +3 -0
- package/dist/collection/assets/icons/linkedin.svg +5 -0
- package/dist/collection/assets/icons/logout.svg +3 -0
- package/dist/collection/assets/icons/map.svg +3 -0
- package/dist/collection/assets/icons/minus.svg +3 -0
- package/dist/collection/assets/icons/navigation.svg +3 -0
- package/dist/collection/assets/icons/plus.svg +3 -0
- package/dist/collection/assets/icons/qr-scan.svg +3 -0
- package/dist/collection/assets/icons/question.svg +10 -0
- package/dist/collection/assets/icons/reader.svg +3 -0
- package/dist/collection/assets/icons/reset.svg +3 -0
- package/dist/collection/assets/icons/school.svg +3 -0
- package/dist/collection/assets/icons/search.svg +3 -0
- package/dist/collection/assets/icons/send.svg +3 -0
- package/dist/collection/assets/icons/settings.svg +3 -0
- package/dist/collection/assets/icons/share.svg +10 -0
- package/dist/collection/assets/icons/shopping-cart.svg +3 -0
- package/dist/collection/assets/icons/show.svg +3 -0
- package/dist/collection/assets/icons/snapchat.svg +3 -0
- package/dist/collection/assets/icons/sort.svg +3 -0
- package/dist/collection/assets/icons/speech-bubble.svg +3 -0
- package/dist/collection/assets/icons/star.svg +3 -0
- package/dist/collection/assets/icons/student.svg +3 -0
- package/dist/collection/assets/icons/upload.svg +3 -0
- package/dist/collection/assets/icons/user.svg +3 -0
- package/dist/collection/assets/icons/warn-circle.svg +3 -0
- package/dist/collection/assets/icons/warn-triangle.svg +3 -0
- package/dist/collection/assets/icons/whatsapp.svg +4 -0
- package/dist/collection/assets/icons/world.svg +10 -0
- package/dist/collection/assets/icons/x.svg +3 -0
- package/dist/collection/assets/icons/youtube.svg +3 -0
- package/dist/collection/assets/zukunftslinie.svg +3 -0
- package/dist/collection/collection-manifest.json +21 -0
- package/dist/collection/components/lmvz-action/lmvz-action.css +3 -0
- package/dist/collection/components/lmvz-action/lmvz-action.js +45 -0
- package/dist/collection/components/lmvz-button/lmvz-button.css +199 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +245 -0
- package/dist/collection/components/lmvz-card/lmvz-card.css +283 -0
- package/dist/collection/components/lmvz-card/lmvz-card.js +137 -0
- package/dist/collection/components/lmvz-chip/lmvz-chip.css +3 -0
- package/dist/collection/components/lmvz-chip/lmvz-chip.js +42 -0
- package/dist/collection/components/lmvz-header/lmvz-header.css +49 -0
- package/dist/collection/components/lmvz-header/lmvz-header.js +138 -0
- package/dist/collection/components/lmvz-icon/icons.js +36 -0
- package/dist/collection/components/lmvz-icon/lmvz-icon.css +82 -0
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +191 -0
- package/dist/collection/components/lmvz-icon/public.js +1 -0
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +89 -0
- package/dist/collection/components/lmvz-input/lmvz-input.css +201 -0
- package/dist/collection/components/lmvz-input/lmvz-input.js +847 -0
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.css +89 -0
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +97 -0
- package/dist/collection/index.js +3 -0
- package/dist/collection/integration/header-integration.js +28 -0
- package/dist/collection/styles/buttons.css +1 -0
- package/dist/collection/styles/router-font.css +1 -0
- package/dist/collection/styles/tokens.css +1 -0
- package/dist/collection/styles/typography.css +1 -0
- package/dist/collection/themes/all.css +1 -0
- package/dist/collection/themes/dark.css +1 -0
- package/dist/collection/themes/light.css +1 -0
- package/dist/collection/utils/component.js +268 -0
- package/dist/collection/utils/effect.js +6 -0
- package/dist/collection/utils/element-activation-controller.js +27 -0
- package/dist/collection/utils/http.js +24 -0
- package/dist/collection/utils/http.test.js +46 -0
- package/dist/collection/utils/list-keyboard-controller.js +44 -0
- package/dist/collection/utils/public.js +1 -0
- package/dist/collection/utils/reactive-controller-host.js +39 -0
- package/dist/collection/utils/typing.js +1 -0
- package/dist/collection/utils/url.js +7 -0
- package/dist/collection/utils/validation/aria-validation-controller.js +124 -0
- package/dist/collection/utils/validation/svg.js +24 -0
- package/dist/components/index.d.ts +53 -0
- package/dist/components/index.js +1 -0
- package/dist/components/lmvz-action.d.ts +11 -0
- package/dist/components/lmvz-action.js +1 -0
- package/dist/components/lmvz-button.d.ts +11 -0
- package/dist/components/lmvz-button.js +1 -0
- package/dist/components/lmvz-card.d.ts +11 -0
- package/dist/components/lmvz-card.js +1 -0
- package/dist/components/lmvz-chip.d.ts +11 -0
- package/dist/components/lmvz-chip.js +1 -0
- package/dist/components/lmvz-header.d.ts +11 -0
- package/dist/components/lmvz-header.js +1 -0
- package/dist/components/lmvz-icon.d.ts +11 -0
- package/dist/components/lmvz-icon.js +1 -0
- package/dist/components/lmvz-input.d.ts +11 -0
- package/dist/components/lmvz-input.js +1 -0
- package/dist/components/lmvz-menuitem.d.ts +11 -0
- package/dist/components/lmvz-menuitem.js +1 -0
- package/dist/components/p-B3JVFwO1.js +1 -0
- package/dist/components/p-B85MJLTf.js +1 -0
- package/dist/components/p-BFwzIh71.js +1 -0
- package/dist/components/p-BaPwpeMs.js +1 -0
- package/dist/components/p-CN0JX9-m.js +1 -0
- package/dist/components/p-D1HbKFuh.js +12 -0
- package/dist/components/p-DDmjv-N_.js +1 -0
- package/dist/components/p-DMLRPGid.js +6 -0
- package/dist/esm/Effect-D9S7OTyY.js +18963 -0
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +5 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/aria-validation-controller-C7nQzCCq.js +2926 -0
- package/dist/esm/axe-cRQ9Ux1I.js +32832 -0
- package/dist/esm/component-B3JVFwO1.js +132 -0
- package/dist/esm/element-activation-controller-CN0JX9-m.js +29 -0
- package/dist/esm/icons-B71gAZmE.js +655 -0
- package/dist/esm/index-Bt32KzDW.js +90 -0
- package/dist/esm/index-smGPjoDX.js +2741 -0
- package/dist/esm/index.js +85 -0
- package/dist/esm/lmvz-action.entry.js +20 -0
- package/dist/esm/lmvz-button.entry.js +70 -0
- package/dist/esm/lmvz-card.entry.js +31 -0
- package/dist/esm/lmvz-chip.entry.js +16 -0
- package/dist/esm/lmvz-components.js +21 -0
- package/dist/esm/lmvz-header.entry.js +132 -0
- package/dist/esm/lmvz-icon.entry.js +74 -0
- package/dist/esm/lmvz-input.entry.js +174 -0
- package/dist/esm/lmvz-menuitem.entry.js +30 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lmvz-components/assets/LMVZ_logo_175.svg +1 -0
- package/dist/lmvz-components/assets/card-placeholder.svg +4 -0
- package/dist/lmvz-components/assets/fonts/Router-Bold.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Book.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Medium.woff +0 -0
- package/dist/lmvz-components/assets/icons/Logo.svg +10 -0
- package/dist/lmvz-components/assets/icons/actions.svg +5 -0
- package/dist/lmvz-components/assets/icons/adduser.svg +3 -0
- package/dist/lmvz-components/assets/icons/alert.svg +3 -0
- package/dist/lmvz-components/assets/icons/apple.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-down.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-left.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-right.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-up.svg +3 -0
- package/dist/lmvz-components/assets/icons/book.svg +3 -0
- package/dist/lmvz-components/assets/icons/bookmark.svg +3 -0
- package/dist/lmvz-components/assets/icons/checkmark.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-down.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-left.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-right.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-up.svg +3 -0
- package/dist/lmvz-components/assets/icons/close-l.svg +3 -0
- package/dist/lmvz-components/assets/icons/close-sm.svg +3 -0
- package/dist/lmvz-components/assets/icons/cog.svg +4 -0
- package/dist/lmvz-components/assets/icons/computer.svg +3 -0
- package/dist/lmvz-components/assets/icons/dashboard.svg +6 -0
- package/dist/lmvz-components/assets/icons/delete.svg +3 -0
- package/dist/lmvz-components/assets/icons/download.svg +3 -0
- package/dist/lmvz-components/assets/icons/edit.svg +3 -0
- package/dist/lmvz-components/assets/icons/external.svg +3 -0
- package/dist/lmvz-components/assets/icons/facebook.svg +3 -0
- package/dist/lmvz-components/assets/icons/favorite.svg +3 -0
- package/dist/lmvz-components/assets/icons/filter.svg +3 -0
- package/dist/lmvz-components/assets/icons/group.svg +3 -0
- package/dist/lmvz-components/assets/icons/hide.svg +3 -0
- package/dist/lmvz-components/assets/icons/home.svg +3 -0
- package/dist/lmvz-components/assets/icons/info.svg +3 -0
- package/dist/lmvz-components/assets/icons/instagram.svg +3 -0
- package/dist/lmvz-components/assets/icons/letter.svg +3 -0
- package/dist/lmvz-components/assets/icons/linkedin.svg +5 -0
- package/dist/lmvz-components/assets/icons/logout.svg +3 -0
- package/dist/lmvz-components/assets/icons/map.svg +3 -0
- package/dist/lmvz-components/assets/icons/minus.svg +3 -0
- package/dist/lmvz-components/assets/icons/navigation.svg +3 -0
- package/dist/lmvz-components/assets/icons/plus.svg +3 -0
- package/dist/lmvz-components/assets/icons/qr-scan.svg +3 -0
- package/dist/lmvz-components/assets/icons/question.svg +10 -0
- package/dist/lmvz-components/assets/icons/reader.svg +3 -0
- package/dist/lmvz-components/assets/icons/reset.svg +3 -0
- package/dist/lmvz-components/assets/icons/school.svg +3 -0
- package/dist/lmvz-components/assets/icons/search.svg +3 -0
- package/dist/lmvz-components/assets/icons/send.svg +3 -0
- package/dist/lmvz-components/assets/icons/settings.svg +3 -0
- package/dist/lmvz-components/assets/icons/share.svg +10 -0
- package/dist/lmvz-components/assets/icons/shopping-cart.svg +3 -0
- package/dist/lmvz-components/assets/icons/show.svg +3 -0
- package/dist/lmvz-components/assets/icons/snapchat.svg +3 -0
- package/dist/lmvz-components/assets/icons/sort.svg +3 -0
- package/dist/lmvz-components/assets/icons/speech-bubble.svg +3 -0
- package/dist/lmvz-components/assets/icons/star.svg +3 -0
- package/dist/lmvz-components/assets/icons/student.svg +3 -0
- package/dist/lmvz-components/assets/icons/upload.svg +3 -0
- package/dist/lmvz-components/assets/icons/user.svg +3 -0
- package/dist/lmvz-components/assets/icons/warn-circle.svg +3 -0
- package/dist/lmvz-components/assets/icons/warn-triangle.svg +3 -0
- package/dist/lmvz-components/assets/icons/whatsapp.svg +4 -0
- package/dist/lmvz-components/assets/icons/world.svg +10 -0
- package/dist/lmvz-components/assets/icons/x.svg +3 -0
- package/dist/lmvz-components/assets/icons/youtube.svg +3 -0
- package/dist/lmvz-components/assets/zukunftslinie.svg +3 -0
- package/dist/lmvz-components/index.esm.js +1 -0
- package/dist/lmvz-components/lmvz-components.esm.js +1 -0
- package/dist/lmvz-components/p-87b01940.entry.js +1 -0
- package/dist/lmvz-components/p-9faac8f3.entry.js +1 -0
- package/dist/lmvz-components/p-B3JVFwO1.js +1 -0
- package/dist/lmvz-components/p-B85MJLTf.js +1 -0
- package/dist/lmvz-components/p-CN0JX9-m.js +1 -0
- package/dist/lmvz-components/p-D1HbKFuh.js +12 -0
- package/dist/lmvz-components/p-D9S7OTyY.js +1 -0
- package/dist/lmvz-components/p-DMLRPGid.js +6 -0
- package/dist/lmvz-components/p-DQuL1Twl.js +1 -0
- package/dist/lmvz-components/p-DlIX18fw.js +1 -0
- package/dist/lmvz-components/p-DlrjrWsu.js +1 -0
- package/dist/lmvz-components/p-a4615e4b.entry.js +1 -0
- package/dist/lmvz-components/p-a8c88454.entry.js +1 -0
- package/dist/lmvz-components/p-d4b68381.entry.js +1 -0
- package/dist/lmvz-components/p-e63e239a.entry.js +1 -0
- package/dist/lmvz-components/p-f956a5e7.entry.js +1 -0
- package/dist/lmvz-components/p-fefd2fe4.entry.js +1 -0
- package/dist/lmvz-components/p-smGPjoDX.js +2 -0
- package/dist/lmvz-components/styles/buttons.css +1 -0
- package/dist/lmvz-components/styles/router-font.css +1 -0
- package/dist/lmvz-components/styles/tokens.css +1 -0
- package/dist/lmvz-components/styles/typography.css +1 -0
- package/dist/lmvz-components/themes/all.css +1 -0
- package/dist/lmvz-components/themes/dark.css +1 -0
- package/dist/lmvz-components/themes/light.css +1 -0
- package/dist/manifest.d.ts +480 -0
- package/dist/manifest.json +5184 -0
- package/dist/types/api/aria-types.d.ts +9 -0
- package/dist/types/api/ds.constants.d.ts +8 -0
- package/dist/types/api/ds.types.d.ts +39 -0
- package/dist/types/api/index.d.ts +3 -0
- package/dist/types/components/lmvz-action/lmvz-action.d.ts +6 -0
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +25 -0
- package/dist/types/components/lmvz-card/lmvz-card.d.ts +11 -0
- package/dist/types/components/lmvz-chip/lmvz-chip.d.ts +4 -0
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +23 -0
- package/dist/types/components/lmvz-icon/icons.d.ts +8 -0
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +20 -0
- package/dist/types/components/lmvz-icon/public.d.ts +1 -0
- package/dist/types/components/lmvz-icon/test/icons.unit.d.ts +1 -0
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +63 -0
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +12 -0
- package/dist/types/components.d.ts +773 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/component.d.ts +36 -0
- package/dist/types/utils/effect.d.ts +3 -0
- package/dist/types/utils/element-activation-controller.d.ts +19 -0
- package/dist/types/utils/http.d.ts +24 -0
- package/dist/types/utils/http.test.d.ts +1 -0
- package/dist/types/utils/list-keyboard-controller.d.ts +13 -0
- package/dist/types/utils/public.d.ts +1 -0
- package/dist/types/utils/reactive-controller-host.d.ts +26 -0
- package/dist/types/utils/typing.d.ts +3 -0
- package/dist/types/utils/url.d.ts +8 -0
- package/dist/types/utils/validation/aria-validation-controller.d.ts +31 -0
- package/dist/types/utils/validation/svg.d.ts +11 -0
- package/hydrate/index.d.ts +287 -0
- package/hydrate/index.js +78213 -0
- package/hydrate/index.mjs +78203 -0
- package/hydrate/package.json +12 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +216 -0
- package/readme.md +193 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=function(t,e){if("function"==typeof t)return function(){return t(arguments)?e.apply(this,arguments):t=>e(t,...arguments)};switch(t){case 0:case 1:throw new RangeError(`Invalid arity ${t}`);case 2:return function(t,r){return arguments.length>=2?e(t,r):function(r){return e(r,t)}};case 3:return function(t,r,n){return arguments.length>=3?e(t,r,n):function(n){return e(n,t,r)}};case 4:return function(t,r,n,s){return arguments.length>=4?e(t,r,n,s):function(s){return e(s,t,r,n)}};case 5:return function(t,r,n,s,i){return arguments.length>=5?e(t,r,n,s,i):function(i){return e(i,t,r,n,s)}};default:return function(){if(arguments.length>=t)return e.apply(this,arguments);const r=arguments;return function(t){return e(t,...r)}}}},e=t=>t,r=t=>()=>t,n=r(!0),s=r(!1),i=r(void 0),o=i;function c(t,e,r,n,s,i,o,c,a){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return r(e(t));case 4:return n(r(e(t)));case 5:return s(n(r(e(t))));case 6:return i(s(n(r(e(t)))));case 7:return o(i(s(n(r(e(t))))));case 8:return c(o(i(s(n(r(e(t)))))));case 9:return a(c(o(i(s(n(r(e(t))))))));default:{let t=arguments[0];for(let e=1;e<arguments.length;e++)t=arguments[e](t);return t}}}const a=t=>(e,r)=>e===r||t(e,r),u=t(2,((t,e)=>a(((r,n)=>t(e(r),e(n)))))),h="effect/GlobalValue";let l;const f=(t,e)=>(l||(globalThis[h]??=new Map,l=globalThis[h]),l.has(t)||l.set(t,e()),l.get(t)),b=t=>"number"==typeof t,d=t=>"function"==typeof t,p=t=>(t=>"object"==typeof t&&null!==t)(t)||d(t),m=t(2,((t,e)=>p(t)&&e in t)),S=t(2,((t,e)=>m(t,"_tag")&&t._tag===e)),g=t=>null==t,y=t=>"string"==typeof t||m(t,Symbol.iterator),w=t=>`BUG: ${t} - please report an issue at https://github.com/Effect-TS/effect/issues`;let _=class t{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new t(this.self)}};class v{_state;constructor(t,e,r,n){return g(e)&&g(t)?(e=4294967295*Math.random()>>>0,t=0):g(e)&&(e=t,t=0),g(n)&&g(r)?(n=this._state?this._state[3]:4150755663,r=this._state?this._state[2]:335903614):g(n)&&(n=r,r=0),this._state=new Int32Array([0,0,r>>>0,(1|(n||0))>>>0]),this._next(),O(this._state,this._state[0],this._state[1],t>>>0,e>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(t){this._state[0]=t[0],this._state[1]=t[1],this._state[2]=t[2],this._state[3]=1|t[3]}integer(t){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%t}number(){return(1*(67108863&this._next())*134217728+1*(134217727&this._next()))/9007199254740992}_next(){const t=this._state[0]>>>0,e=this._state[1]>>>0;!function(t,e,r,n,s){let i=32557*(r>>>16)>>>0,o=19605*(65535&r)>>>0,c=32557*(65535&r)>>>0,a=19605*(r>>>16)+((o>>>16)+(i>>>16))>>>0;o=o<<16>>>0,c=c+o>>>0,c>>>0<o>>>0&&(a=a+1>>>0),i=i<<16>>>0,c=c+i>>>0,c>>>0<i>>>0&&(a=a+1>>>0),a=a+Math.imul(r,1481765933)>>>0,a=a+Math.imul(e,s)>>>0,t[0]=a,t[1]=c}(this._state,t,e,0,1284865837),O(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=t>>>18,n=(e>>>18|t<<14)>>>0;r=(r^t)>>>0,n=(n^e)>>>0;const s=(n>>>27|r<<5)>>>0,i=t>>>27;return(s>>>i|s<<((-i>>>0&31)>>>0))>>>0}}function O(t,e,r,n,s){let i=e+n>>>0;const o=r+s>>>0;o>>>0<r>>>0&&(i=i+1|0),t[0]=i,t[1]=o}const M=Symbol.for("effect/Utils/YieldWrap");class I{#t;constructor(t){this.#t=t}[M](){return this.#t}}function E(t){if("object"==typeof t&&null!==t&&M in t)return t[M]();throw new Error(w("yieldWrapGet"))}const k=f("effect/Utils/isStructuralRegion",(()=>({enabled:!1,tester:void 0}))),F={effect_internal_function:t=>t()},N=!0===F.effect_internal_function((()=>(new Error).stack))?.includes("effect_internal_function")?F.effect_internal_function:t=>{try{return t()}finally{}},j=f(Symbol.for("effect/Hash/randomHashCache"),(()=>new WeakMap)),C=Symbol.for("effect/Hash"),A=t=>{if(!0===k.enabled)return 0;switch(typeof t){case"number":return L(t);case"bigint":return D(t.toString(10));case"boolean":case"symbol":return D(String(t));case"string":return D(t);case"undefined":return D("undefined");case"function":case"object":return null===t?D("null"):t instanceof Date?Number.isNaN(t.getTime())?D("Invalid Date"):A(t.toISOString()):t instanceof URL?A(t.href):T(t)?t[C]():R(t);default:throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},R=t=>(j.has(t)||j.set(t,L(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),j.get(t)),x=t=>e=>53*e^t,$=t=>3221225471&t|t>>>1&1073741824,T=t=>m(t,C),L=t=>{if(t!=t||t===1/0)return 0;let e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return $(e)},D=t=>{let e=5381,r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return $(e)},P=t=>((t,e)=>{let r=12289;for(let n=0;n<e.length;n++)r^=c(D(e[n]),x(A(t[e[n]])));return $(r)})(t,Object.keys(t)),B=t=>{let e=6151;for(let r=0;r<t.length;r++)e=c(e,x(A(t[r])));return $(e)},q=function(){if(1===arguments.length){const t=arguments[0];return function(e){return Object.defineProperty(t,C,{value:()=>e,enumerable:!1}),e}}const t=arguments[1];return Object.defineProperty(arguments[0],C,{value:()=>t,enumerable:!1}),t},U=Symbol.for("effect/Equal");function J(){return 1===arguments.length?t=>G(t,arguments[0]):G(arguments[0],arguments[1])}function G(t,e){if(t===e)return!0;const r=typeof t;if(r!==typeof e)return!1;if("object"===r||"function"===r){if(null!==t&&null!==e){if(W(t)&&W(e))return!(A(t)!==A(e)||!t[U](e))||!(!k.enabled||!k.tester)&&k.tester(t,e);if(t instanceof Date&&e instanceof Date){const r=t.getTime(),n=e.getTime();return r===n||Number.isNaN(r)&&Number.isNaN(n)}if(t instanceof URL&&e instanceof URL)return t.href===e.href}if(k.enabled){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every(((t,r)=>G(t,e[r])));if(Object.getPrototypeOf(t)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const r=Object.keys(t),n=Object.keys(e);if(r.length===n.length){for(const n of r)if(!(n in e)||!G(t[n],e[n]))return!!k.tester&&k.tester(t,e);return!0}}return!!k.tester&&k.tester(t,e)}}return!(!k.enabled||!k.tester)&&k.tester(t,e)}const W=t=>m(t,U),V=()=>J,H=Symbol.for("nodejs.util.inspect.custom"),z=t=>{try{if(m(t,"toJSON")&&d(t.toJSON)&&0===t.toJSON.length)return t.toJSON();if(Array.isArray(t))return t.map(z)}catch{return{}}return et(t)},Y=t=>JSON.stringify(t,null,2),K=(t,e=2)=>{if("string"==typeof t)return t;try{return"object"==typeof t?Q(t,e):String(t)}catch{return String(t)}},Q=(t,e)=>{let r=[];const n=JSON.stringify(t,((t,e)=>"object"==typeof e&&null!==e?r.includes(e)?void 0:r.push(e)&&(void 0!==tt.fiberRefs&&X(e)?e[Z](tt.fiberRefs):e):e),e);return r=void 0,n},Z=Symbol.for("effect/Inspectable/Redactable"),X=t=>"object"==typeof t&&null!==t&&Z in t,tt=f("effect/Inspectable/redactableState",(()=>({fiberRefs:void 0}))),et=t=>X(t)&&void 0!==tt.fiberRefs?t[Z](tt.fiberRefs):t,rt=(t,e)=>{switch(e.length){case 0:return t;case 1:return e[0](t);case 2:return e[1](e[0](t));case 3:return e[2](e[1](e[0](t)));case 4:return e[3](e[2](e[1](e[0](t))));case 5:return e[4](e[3](e[2](e[1](e[0](t)))));case 6:return e[5](e[4](e[3](e[2](e[1](e[0](t))))));case 7:return e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))));case 8:return e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t))))))));case 9:return e[8](e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))))));default:{let r=t;for(let t=0,n=e.length;t<n;t++)r=e[t](r);return r}}},nt="Async",st="Commit",it="Failure",ot="OnFailure",ct="OnSuccess",at="OnSuccessAndFailure",ut="Success",ht="Sync",lt="Tag",ft="UpdateRuntimeFlags",bt="While",dt="Iterator",pt="WithRuntime",mt="Yield",St="RevertFlags",gt=()=>"3.19.14",yt=Symbol.for("effect/Effect"),wt=Symbol.for("effect/Stream"),_t=Symbol.for("effect/Sink"),vt=Symbol.for("effect/Channel"),Ot={_R:t=>t,_E:t=>t,_A:t=>t,_V:gt()},Mt={[yt]:Ot,[wt]:Ot,[_t]:{_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t},[vt]:{_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},[U](t){return this===t},[C](){return q(this,R(this))},[Symbol.iterator](){return new _(new I(this))},pipe(){return rt(this,arguments)}},It={[C](){return q(this,P(this))},[U](t){const e=Object.keys(this),r=Object.keys(t);if(e.length!==r.length)return!1;for(const r of e)if(!(r in t)||!J(this[r],t[r]))return!1;return!0}},Et={...Mt,_op:st},kt={...Et,...It},Ft=function(){function t(){}return t.prototype=Et,t}(),Nt=Symbol.for("effect/Option"),jt={...Mt,[Nt]:{_A:t=>t},[H](){return this.toJSON()},toString(){return Y(this.toJSON())}},Ct=Object.assign(Object.create(jt),{_tag:"Some",_op:"Some",[U](t){return xt(t)&&Tt(t)&&J(this.value,t.value)},[C](){return q(this,x(A(this._tag))(A(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:z(this.value)}}}),At=A("None"),Rt=Object.assign(Object.create(jt),{_tag:"None",_op:"None",[U]:t=>xt(t)&&$t(t),[C]:()=>At,toJSON(){return{_id:"Option",_tag:this._tag}}}),xt=t=>m(t,Nt),$t=t=>"None"===t._tag,Tt=t=>"Some"===t._tag,Lt=Object.create(Rt),Dt=t=>{const e=Object.create(Ct);return e.value=t,e},Pt=Symbol.for("effect/Either"),Bt={...Mt,[Pt]:{_R:t=>t},[H](){return this.toJSON()},toString(){return Y(this.toJSON())}},qt=Object.assign(Object.create(Bt),{_tag:"Right",_op:"Right",[U](t){return Jt(t)&&Wt(t)&&J(this.right,t.right)},[C](){return x(A(this._tag))(A(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:z(this.right)}}}),Ut=Object.assign(Object.create(Bt),{_tag:"Left",_op:"Left",[U](t){return Jt(t)&&Gt(t)&&J(this.left,t.left)},[C](){return x(A(this._tag))(A(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:z(this.left)}}}),Jt=t=>m(t,Pt),Gt=t=>"Left"===t._tag,Wt=t=>"Right"===t._tag,Vt=t=>{const e=Object.create(qt);return e.right=t,e},Ht=t=>{const e=Object.create(Ut);return e.left=t,e},zt=Gt,Yt=Wt,Kt=t(2,((t,{onLeft:e,onRight:r})=>zt(t)?e(t.left):r(t.right))),Qt=Kt({onLeft:e,onRight:e}),Zt=t(2,((t,e)=>{if(Yt(t))return t.right;throw e(t.left)})),Xt=t=>t.length>0,te=t=>(e,r)=>e===r?0:t(e,r),ee=te(((t,e)=>t<e?-1:1)),re=t(2,((t,e)=>te(((r,n)=>t(e(r),e(n)))))),ne=e=>t(2,((t,r)=>1===e(t,r))),se=()=>Lt,ie=Dt,oe=$t,ce=Tt,ae=t(2,((t,{onNone:e,onSome:r})=>oe(t)?e():r(t.value))),ue=t=>Gt(t)?Lt:Dt(t.right),he=t(2,((t,e)=>oe(t)?e():t.value)),le=t(2,((t,e)=>oe(t)?ie(e()):t)),fe=t=>null==t?se():ie(t),be=he(i),de=t(2,((t,e)=>{if(ce(t))return t.value;throw e()}))((()=>new Error("getOrThrow called on a None"))),pe=t(2,((t,e)=>oe(t)?se():ie(e(t.value)))),me=t(2,((t,e)=>oe(t)?se():e(t.value))),Se=(e=>t(2,((t,r)=>!oe(t)&&e(t.value,r))))(V()),ge=t=>(e,r)=>oe(e)?r:oe(r)?e:ie(t(e.value,r.value)),ye=(...t)=>t,we=t=>new Array(t),_e=t(2,((t,e)=>{const r=Math.max(1,Math.floor(t)),n=new Array(r);for(let t=0;t<r;t++)n[t]=e(t);return n})),ve=t=>Array.isArray(t)?t:Array.from(t),Oe=t(2,((t,e)=>[e,...t])),Me=t(2,((t,e)=>[...t,e])),Ie=t(2,((t,e)=>ve(t).concat(ve(e)))),Ee=Xt,ke=Xt,Fe=(t,e)=>t<0||t>=e.length,Ne=t(2,((t,e)=>{const r=Math.floor(e);return Fe(r,t)?se():ie(t[r])})),je=t(2,((t,e)=>{const r=Math.floor(e);if(Fe(r,t))throw new Error(`Index ${r} out of bounds`);return t[r]})),Ce=Ne(0),Ae=je(0),Re=t=>t[t.length-1],xe=t=>t.slice(1),$e=t(2,((t,e)=>Ue(t,((t,e)=>{let r=0;for(const n of t){if(!e(n,r))break;r++}return r})(t,e)))),Te=t(2,((t,e)=>{const r=ve(t);return r.slice(((t,e)=>Math.floor(Math.min(Math.max(0,t),e.length)))(e,r),r.length)})),Le=t=>Array.from(t).reverse(),De=t(2,((t,e)=>{const r=Array.from(t);return r.sort(e),r})),Pe=t(2,((t,e)=>Be(t,e,ye))),Be=t(3,((t,e,r)=>{const n=ve(t),s=ve(e);if(ke(n)&&ke(s)){const t=[r(Ae(n),Ae(s))],e=Math.min(n.length,s.length);for(let i=1;i<e;i++)t[i]=r(n[i],s[i]);return t}return[]})),qe=V(),Ue=t(2,((t,e)=>{const r=Array.from(t),n=Math.floor(e);return ke(r)?n>=1?Je(r,n):[[],r]:[r,[]]})),Je=t(2,((t,e)=>{const r=Math.max(1,Math.floor(e));return r>=t.length?[Ge(t),[]]:[Oe(t.slice(1,r),Ae(t)),t.slice(r)]})),Ge=t=>t.slice(),We=t(3,((t,e,r)=>{const n=ve(t),s=ve(e);return ke(n)?ke(s)?rr(r)(Ie(n,s)):n:s})),Ve=t(2,((t,e)=>We(t,e,qe))),He=()=>[],ze=t=>[t],Ye=t(2,((t,e)=>t.map(e))),Ke=t(2,((t,e)=>{if((t=>0===t.length)(t))return[];const r=[];for(let n=0;n<t.length;n++){const s=e(t[n],n);for(let t=0;t<s.length;t++)r.push(s[t])}return r}))(e),Qe=t(2,((t,e)=>{const r=ve(t),n=[];for(let t=0;t<r.length;t++){const s=e(r[t],t);ce(s)&&n.push(s.value)}return n})),Ze=t(2,((t,e)=>{const r=ve(t),n=[];for(let t=0;t<r.length;t++)e(r[t],t)&&n.push(r[t]);return n})),Xe=t(3,((t,e,r)=>ve(t).reduce(((t,e,n)=>r(t,e,n)),e))),tr=(t,e)=>{const r=[];let n,s=t;for(;ce(n=e(s));){const[t,e]=n.value;r.push(t),s=e}return r},er=t=>a(((e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0})),rr=t(2,((t,e)=>{const r=ve(t);if(ke(r)){const t=[Ae(r)],n=xe(r);for(const r of n)t.every((t=>!e(r,t)))&&t.push(r);return t}return[]})),nr=t=>rr(t,V()),sr=t(2,((t,e)=>ve(t).join(e))),ir=ee,or=Symbol.for("effect/Context/Tag"),cr=Symbol.for("effect/Context/Reference"),ar=Symbol.for("effect/STM"),ur={...Mt,_op:"Tag",[ar]:Ot,[or]:{_Service:t=>t,_Identifier:t=>t},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[H](){return this.toJSON()},of:t=>t,context(t){return mr(this,t)}},hr={...ur,[cr]:cr},lr=Symbol.for("effect/Context"),fr={[lr]:{_Services:t=>t},[U](t){if(dr(t)&&this.unsafeMap.size===t.unsafeMap.size){for(const e of this.unsafeMap.keys())if(!t.unsafeMap.has(e)||!J(this.unsafeMap.get(e),t.unsafeMap.get(e)))return!1;return!0}return!1},[C](){return q(this,L(this.unsafeMap.size))},pipe(){return rt(this,arguments)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(z)}},[H](){return this.toJSON()}},br=t=>{const e=Object.create(fr);return e.unsafeMap=t,e},dr=t=>m(t,lr),pr=br(new Map),mr=(t,e)=>br(new Map([[t.key,e]])),Sr=t(3,((t,e,r)=>{const n=new Map(t.unsafeMap);return n.set(e.key,r),br(n)})),gr=f("effect/Context/defaultValueCache",(()=>new Map)),yr=t=>{if(gr.has(t.key))return gr.get(t.key);const e=t.defaultValue();return gr.set(t.key,e),e},wr=t(2,((t,e)=>{if(!t.unsafeMap.has(e.key)){if(cr in e)return yr(e);throw(t=>{const e=new Error("Service not found"+(t.key?`: ${String(t.key)}`:""));if(t.stack){const r=t.stack.split("\n");if(r.length>2){const t=r[2].match(/at (.*)/);t&&(e.message=e.message+` (defined at ${t[1]})`)}}if(e.stack){const t=e.stack.split("\n");t.splice(1,3),e.stack=t.join("\n")}return e})(e)}return t.unsafeMap.get(e.key)})),_r=wr,vr=t(2,((t,e)=>t.unsafeMap.has(e.key)?Dt(t.unsafeMap.get(e.key)):m(e,cr)?Dt(yr(e)):Lt)),Or=t(2,((t,e)=>{const r=new Map(t.unsafeMap);for(const[t,n]of e.unsafeMap)r.set(t,n);return br(r)})),Mr=t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=e;const n=Object.create(ur);return Object.defineProperty(n,"stack",{get:()=>r.stack}),n.key=t,n},Ir=dr,Er=()=>pr,kr=mr,Fr=Sr,Nr=_r,jr=wr,Cr=vr,Ar=Or,Rr=()=>(t,e)=>{const r=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;function s(){}return Error.stackTraceLimit=r,Object.setPrototypeOf(s,hr),s.key=t,s.defaultValue=e.defaultValue,Object.defineProperty(s,"stack",{get:()=>n.stack}),s},xr=Symbol.for("effect/Chunk"),$r=[],Tr=(t=>a(((e,r)=>e.length===r.length&&Vr(e).every(((e,n)=>t(e,Qr(r,n)))))))(J),Lr={[xr]:{_A:t=>t},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Chunk",values:Vr(this).map(z)}},[H](){return this.toJSON()},[U](t){return Pr(t)&&Tr(this,t)},[C](){return q(this,B(Vr(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return $r[Symbol.iterator]();default:return Vr(this)[Symbol.iterator]()}},pipe(){return rt(this,arguments)}},Dr=t=>{const e=Object.create(Lr);switch(e.backing=t,t._tag){case"IEmpty":e.length=0,e.depth=0,e.left=e,e.right=e;break;case"IConcat":e.length=t.left.length+t.right.length,e.depth=1+Math.max(t.left.depth,t.right.depth),e.left=t.left,e.right=t.right;break;case"IArray":e.length=t.array.length,e.depth=0,e.left=Br,e.right=Br;break;case"ISingleton":e.length=1,e.depth=0,e.left=Br,e.right=Br;break;case"ISlice":e.length=t.length,e.depth=t.chunk.depth+1,e.left=Br,e.right=Br}return e},Pr=t=>m(t,xr),Br=Dr({_tag:"IEmpty"}),qr=()=>Br,Ur=(...t)=>Kr(t),Jr=t=>Dr({_tag:"ISingleton",a:t}),Gr=t=>Pr(t)?t:Yr(ve(t)),Wr=(t,e,r)=>{switch(t.backing._tag){case"IArray":!function(t,e,r,n,s){for(let e=0;e<Math.min(t.length,0+s);e++)r[n+e-0]=t[e]}(t.backing.array,0,e,r,t.length);break;case"IConcat":Wr(t.left,e,r),Wr(t.right,e,r+t.left.length);break;case"ISingleton":e[r]=t.backing.a;break;case"ISlice":{let n=0,s=r;for(;n<t.length;)e[s]=Qr(t,n),n+=1,s+=1;break}}},Vr=t=>{switch(t.backing._tag){case"IEmpty":return $r;case"IArray":return t.backing.array;default:{const e=new Array(t.length);return Wr(t,e,0),t.backing={_tag:"IArray",array:e},t.left=Br,t.right=Br,t.depth=0,e}}},Hr=t=>{switch(t.backing._tag){case"IEmpty":case"ISingleton":return t;case"IArray":return Dr({_tag:"IArray",array:Le(t.backing.array)});case"IConcat":return Dr({_tag:"IConcat",left:Hr(t.backing.right),right:Hr(t.backing.left)});case"ISlice":return Yr(Le(Vr(t)))}},zr=t(2,((t,e)=>e<0||e>=t.length?se():ie(Qr(t,e)))),Yr=t=>0===t.length?qr():1===t.length?Jr(t[0]):Dr({_tag:"IArray",array:t}),Kr=t=>Yr(t),Qr=t(2,((t,e)=>{switch(t.backing._tag){case"IEmpty":throw new Error("Index out of bounds");case"ISingleton":if(0!==e)throw new Error("Index out of bounds");return t.backing.a;case"IArray":if(e>=t.length||e<0)throw new Error("Index out of bounds");return t.backing.array[e];case"IConcat":return e<t.left.length?Qr(t.left,e):Qr(t.right,e-t.left.length);case"ISlice":return Qr(t.backing.chunk,e+t.backing.offset)}})),Zr=t(2,((t,e)=>rn(t,Jr(e)))),Xr=t(2,((t,e)=>rn(Jr(e),t))),tn=t(2,((t,e)=>{if(e<=0)return Br;if(e>=t.length)return t;switch(t.backing._tag){case"ISlice":return Dr({_tag:"ISlice",chunk:t.backing.chunk,length:e,offset:t.backing.offset});case"IConcat":return e>t.left.length?Dr({_tag:"IConcat",left:t.left,right:tn(t.right,e-t.left.length)}):tn(t.left,e);default:return Dr({_tag:"ISlice",chunk:t,offset:0,length:e})}})),en=t(2,((t,e)=>{if(e<=0)return t;if(e>=t.length)return Br;switch(t.backing._tag){case"ISlice":return Dr({_tag:"ISlice",chunk:t.backing.chunk,offset:t.backing.offset+e,length:t.backing.length-e});case"IConcat":return e>t.left.length?en(t.right,e-t.left.length):Dr({_tag:"IConcat",left:en(t.left,e),right:t.right});default:return Dr({_tag:"ISlice",chunk:t,offset:e,length:t.length-e})}})),rn=t(2,((t,e)=>{if("IEmpty"===t.backing._tag)return e;if("IEmpty"===e.backing._tag)return t;const r=e.depth-t.depth;if(Math.abs(r)<=1)return Dr({_tag:"IConcat",left:t,right:e});if(r<-1){if(t.left.depth>=t.right.depth){const r=rn(t.right,e);return Dr({_tag:"IConcat",left:t.left,right:r})}{const r=rn(t.right.right,e);if(r.depth===t.depth-3){const e=Dr({_tag:"IConcat",left:t.right.left,right:r});return Dr({_tag:"IConcat",left:t.left,right:e})}{const e=Dr({_tag:"IConcat",left:t.left,right:t.right.left});return Dr({_tag:"IConcat",left:e,right:r})}}}if(e.right.depth>=e.left.depth){const r=rn(t,e.left);return Dr({_tag:"IConcat",left:r,right:e.right})}{const r=rn(t,e.left.left);if(r.depth===e.depth-3){const t=Dr({_tag:"IConcat",left:r,right:e.left.right});return Dr({_tag:"IConcat",left:t,right:e.right})}{const t=Dr({_tag:"IConcat",left:e.left.right,right:e.right});return Dr({_tag:"IConcat",left:r,right:t})}}})),nn=t(2,((t,e)=>Yr(Qe(t,e)))),sn=t(2,((t,e)=>Yr(Ze(t,e)))),on=t=>0===t.length,cn=t=>t.length>0,an=zr(0),un=t=>Qr(t,0),hn=un,ln=t(2,((t,e)=>"ISingleton"===t.backing._tag?Jr(e(t.backing.a,0)):Yr(c(Vr(t),Ye(((t,r)=>e(t,r))))))),fn=t(2,((t,e)=>[tn(t,e),en(t,e)])),bn=t(2,((t,e)=>{let r=0;for(const n of Vr(t)){if(e(n))break;r++}return fn(t,r)})),dn=t=>en(t,1),pn=Xe,mn=Symbol.for("effect/Duration"),Sn=BigInt(0),gn=BigInt(24),yn=BigInt(60),wn=BigInt(1e3),_n=BigInt(1e6),vn=BigInt(1e9),On=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Mn=t=>{if(Nn(t))return t;if(b(t))return xn(t);if((t=>"bigint"==typeof t)(t))return An(t);if(Array.isArray(t)&&2===t.length&&t.every(b))return t[0]===-1/0||t[1]===-1/0||Number.isNaN(t[0])||Number.isNaN(t[1])?jn:t[0]===1/0||t[1]===1/0?Cn:An(BigInt(Math.round(1e9*t[0]))+BigInt(Math.round(t[1])));if((t=>"string"==typeof t)(t)){const e=On.exec(t);if(e){const[t,r,n]=e,s=Number(r);switch(n){case"nano":case"nanos":return An(BigInt(r));case"micro":case"micros":return Rn(BigInt(r));case"milli":case"millis":return xn(s);case"second":case"seconds":return $n(s);case"minute":case"minutes":return Tn(s);case"hour":case"hours":return Ln(s);case"day":case"days":return Dn(s);case"week":case"weeks":return Pn(s)}}}throw new Error("Invalid DurationInput")},In={_tag:"Millis",millis:0},En={_tag:"Infinity"},kn={[mn]:mn,[C](){return q(this,P(this.value))},[U](t){return Nn(t)&&Vn(this,t)},toString(){return`Duration(${Hn(this)})`},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",hrtime:qn(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},Fn=t=>{const e=Object.create(kn);return e.value=b(t)?isNaN(t)||t<=0?In:Number.isFinite(t)?Number.isInteger(t)?{_tag:"Millis",millis:t}:{_tag:"Nanos",nanos:BigInt(Math.round(1e6*t))}:En:t<=Sn?In:{_tag:"Nanos",nanos:t},e},Nn=t=>m(t,mn),jn=Fn(0),Cn=Fn(1/0),An=t=>Fn(t),Rn=t=>Fn(t*wn),xn=t=>Fn(t),$n=t=>Fn(1e3*t),Tn=t=>Fn(6e4*t),Ln=t=>Fn(36e5*t),Dn=t=>Fn(864e5*t),Pn=t=>Fn(6048e5*t),Bn=t=>Un(t,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),qn=t=>{const e=Mn(t);switch(e.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(e.value.nanos/vn),Number(e.value.nanos%vn)];case"Millis":return[Math.floor(e.value.millis/1e3),Math.round(e.value.millis%1e3*1e6)]}},Un=t(2,((t,e)=>{const r=Mn(t);switch(r.value._tag){case"Nanos":return e.onNanos(r.value.nanos);case"Infinity":return e.onMillis(1/0);case"Millis":return e.onMillis(r.value.millis)}})),Jn=t(3,((t,e,r)=>{const n=Mn(t),s=Mn(e);if("Infinity"===n.value._tag||"Infinity"===s.value._tag)return r.onMillis(Bn(n),Bn(s));if("Nanos"===n.value._tag||"Nanos"===s.value._tag){const t="Nanos"===n.value._tag?n.value.nanos:BigInt(Math.round(1e6*n.value.millis)),e="Nanos"===s.value._tag?s.value.nanos:BigInt(Math.round(1e6*s.value.millis));return r.onNanos(t,e)}return r.onMillis(n.value.millis,s.value.millis)})),Gn=t(2,((t,e)=>Jn(t,e,{onMillis:(t,e)=>t<=e,onNanos:(t,e)=>t<=e}))),Wn=t(2,((t,e)=>Jn(t,e,{onMillis:(t,e)=>t>=e,onNanos:(t,e)=>t>=e}))),Vn=t(2,((t,e)=>((t,e)=>Jn(t,e,{onMillis:(t,e)=>t===e,onNanos:(t,e)=>t===e}))(Mn(t),Mn(e)))),Hn=t=>{const e=Mn(t);if("Infinity"===e.value._tag)return"Infinity";if((t=>{switch(t.value._tag){case"Millis":return 0===t.value.millis;case"Nanos":return t.value.nanos===Sn;case"Infinity":return!1}})(e))return"0";const r=(t=>{const e=Mn(t);if("Infinity"===e.value._tag)return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};const r=(t=>{const e=Mn(t);switch(e.value._tag){case"Infinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return e.value.nanos;case"Millis":return BigInt(Math.round(1e6*e.value.millis))}})(e),n=r/_n,s=n/wn,i=s/yn,o=i/yn;return{days:Number(o/gn),hours:Number(o%gn),minutes:Number(i%yn),seconds:Number(s%yn),millis:Number(n%wn),nanos:Number(r%_n)}})(e),n=[];return 0!==r.days&&n.push(`${r.days}d`),0!==r.hours&&n.push(`${r.hours}h`),0!==r.minutes&&n.push(`${r.minutes}m`),0!==r.seconds&&n.push(`${r.seconds}s`),0!==r.millis&&n.push(`${r.millis}ms`),0!==r.nanos&&n.push(`${r.nanos}ns`),n.join(" ")},zn=Math.pow(2,5),Yn=zn-1,Kn=zn/2,Qn=zn/4;function Zn(t,e){return e>>>t&Yn}function Xn(t){return 1<<t}function ts(t,e){return r=t&e-1,r=(r=(858993459&(r-=r>>1&1431655765))+(r>>2&858993459))+(r>>4)&252645135,127&(r+=r>>8)+(r>>16);var r}function es(t,e,r,n){let s=n;if(!t){const t=n.length;s=new Array(t);for(let e=0;e<t;++e)s[e]=n[e]}return s[e]=r,s}function rs(t,e,r){const n=r.length-1;let s=0,i=0,o=r;if(t)s=i=e;else for(o=new Array(n);s<e;)o[i++]=r[s++];for(++s;s<=n;)o[i++]=r[s++];return t&&(o.length=n),o}class ns{_tag="EmptyNode";modify(t,e,r,n,s,i){const o=r(se());return oe(o)?new ns:(++i.value,new os(t,n,s,o))}}function ss(t){return S(t,"EmptyNode")}function is(t,e){return!ss(t)&&e===t.edit}class os{edit;hash;key;value;_tag="LeafNode";constructor(t,e,r,n){this.edit=t,this.hash=e,this.key=r,this.value=n}modify(t,e,r,n,s,i){if(J(s,this.key)){const e=r(this.value);return e===this.value?this:oe(e)?(--i.value,new ns):is(this,t)?(this.value=e,this):new os(t,n,s,e)}const o=r(se());return oe(o)?this:(++i.value,ls(t,e,this.hash,this,n,new os(t,n,s,o)))}}class cs{edit;hash;children;_tag="CollisionNode";constructor(t,e,r){this.edit=t,this.hash=e,this.children=r}modify(t,e,r,n,s,i){if(n===this.hash){const e=is(this,t),n=this.updateCollisionList(e,t,this.hash,this.children,r,s,i);return n===this.children?this:n.length>1?new cs(t,this.hash,n):n[0]}const o=r(se());return oe(o)?this:(++i.value,ls(t,e,this.hash,this,n,new os(t,n,s,o)))}updateCollisionList(t,e,r,n,s,i,o){const c=n.length;for(let a=0;a<c;++a){const c=n[a];if("key"in c&&J(i,c.key)){const u=c.value,h=s(u);return h===u?n:oe(h)?(--o.value,rs(t,a,n)):es(t,a,new os(e,r,i,h),n)}}const a=s(se());return oe(a)?n:(++o.value,es(t,c,new os(e,r,i,a),n))}}class as{edit;mask;children;_tag="IndexedNode";constructor(t,e,r){this.edit=t,this.mask=e,this.children=r}modify(t,e,r,n,s,i){const o=this.mask,c=this.children,a=Zn(e,n),u=Xn(a),h=ts(o,u),l=o&u,f=is(this,t);if(!l){const l=(new ns).modify(t,e+5,r,n,s,i);return l?c.length>=Kn?function(t,e,r,n,s){const i=[];let o=n,c=0;for(let t=0;o;++t)1&o&&(i[t]=s[c++]),o>>>=1;return i[e]=r,new us(t,c+1,i)}(t,a,l,o,c):new as(t,o|u,function(t,e,r,n){const s=n.length;if(t){let t=s;for(;t>=e;)n[t--]=n[t];return n[e]=r,n}let i=0,o=0;const c=new Array(s+1);for(;i<e;)c[o++]=n[i++];for(c[e]=r;i<s;)c[++o]=n[i++];return c}(f,h,l,c)):this}const b=c[h],d=b.modify(t,e+5,r,n,s,i);if(b===d)return this;let p,m=o;if(ss(d)){if(m&=~u,!m)return new ns;if(c.length<=2&&(ss(S=c[1^h])||"LeafNode"===S._tag||"CollisionNode"===S._tag))return c[1^h];p=rs(f,h,c)}else p=es(f,h,d,c);var S;return f?(this.mask=m,this.children=p,this):new as(t,m,p)}}class us{edit;size;children;_tag="ArrayNode";constructor(t,e,r){this.edit=t,this.size=e,this.children=r}modify(t,e,r,n,s,i){let o=this.size;const c=this.children,a=Zn(e,n),u=c[a],h=(u||new ns).modify(t,e+5,r,n,s,i);if(u===h)return this;const l=is(this,t);let f;if(ss(u)&&!ss(h))++o,f=es(l,a,h,c);else if(!ss(u)&&ss(h)){if(--o,o<=Qn)return function(t,e,r,n){const s=new Array(e-1);let i=0,o=0;for(let t=0,e=n.length;t<e;++t)if(t!==r){const e=n[t];e&&!ss(e)&&(s[i++]=e,o|=1<<t)}return new as(t,o,s)}(t,o,a,c);f=es(l,a,new ns,c)}else f=es(l,a,h,c);return l?(this.size=o,this.children=f,this):new us(t,o,f)}}function hs(t,e,r,n,s,i){if(r===s)return new cs(t,r,[i,n]);const o=Zn(e,r),c=Zn(e,s);if(o===c)return e=>new as(t,Xn(o)|Xn(c),[e]);{const e=o<c?[n,i]:[i,n];return new as(t,Xn(o)|Xn(c),e)}}function ls(t,e,r,n,s,i){let o,c=e;for(;;){const e=hs(t,c,r,n,s,i);if("function"!=typeof e){let t=e;for(;null!=o;)t=o.value(t),o=o.previous;return t}o={value:e,previous:o},c+=5}}const fs="effect/HashMap",bs=Symbol.for(fs),ds={[bs]:bs,[Symbol.iterator](){return new ms(this,((t,e)=>[t,e]))},[C](){let t=A(fs);for(const e of this)t^=c(A(e[0]),x(A(e[1])));return q(this,t)},[U](t){if(vs(t)){if(t._size!==this._size)return!1;for(const e of this){const r=c(t,Ms(e[0],A(e[0])));if(oe(r))return!1;if(!J(e[1],r.value))return!1}return!0}return!1},toString(){return Y(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},ps=(t,e,r,n)=>{const s=Object.create(ds);return s._editable=t,s._edit=e,s._root=r,s._size=n,s};class ms{map;f;v;constructor(t,e){this.map=t,this.f=e,this.v=gs(this.map._root,this.f,void 0)}next(){if(oe(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=Ss(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new ms(this.map,this.f)}}const Ss=t=>t?ys(t[0],t[1],t[2],t[3],t[4]):se(),gs=(t,e,r)=>{switch(t._tag){case"LeafNode":return ce(t.value)?ie({value:e(t.key,t.value.value),cont:r}):Ss(r);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const n=t.children;return ys(n.length,n,0,e,r)}default:return Ss(r)}},ys=(t,e,r,n,s)=>{for(;r<t;){const i=e[r++];if(i&&!ss(i))return gs(i,n,[t,e,r,n,s])}return Ss(s)},ws=ps(!1,0,new ns,0),_s=()=>ws,vs=t=>m(t,bs),Os=t(2,((t,e)=>Ms(t,e,A(e)))),Ms=t(3,((t,e,r)=>{let n=t._root,s=0;for(;;)switch(n._tag){case"LeafNode":return J(e,n.key)?n.value:se();case"CollisionNode":if(r===n.hash){const t=n.children;for(let r=0,n=t.length;r<n;++r){const n=t[r];if("key"in n&&J(e,n.key))return n.value}}return se();case"IndexedNode":{const t=Xn(Zn(s,r));if(n.mask&t){n=n.children[ts(n.mask,t)],s+=5;break}return se()}case"ArrayNode":if(n=n.children[Zn(s,r)],n){s+=5;break}return se();default:return se()}})),Is=t(2,((t,e)=>ce(Ms(t,e,A(e))))),Es=t(3,((t,e,r)=>Cs(t,e,(()=>ie(r))))),ks=t(3,((t,e,r)=>t._editable?(t._root=e,t._size=r,t):e===t._root?t:ps(t._editable,t._edit,e,r))),Fs=t=>new ms(t,(t=>t)),Ns=t=>t._size,js=t=>ps(!0,t._edit+1,t._root,t._size),Cs=t(3,((t,e,r)=>As(t,e,A(e),r))),As=t(4,((t,e,r,n)=>{const s={value:t._size},i=t._root.modify(t._editable?t._edit:NaN,0,n,r,e,s);return c(t,ks(i,s.value))})),Rs=t(2,((t,e)=>Cs(t,e,se))),xs=t(2,((t,e)=>Ts(t,_s(),((t,r,n)=>Es(t,n,e(r,n)))))),$s=t(2,((t,e)=>Ts(t,void 0,((t,r,n)=>e(r,n))))),Ts=t(3,((t,e,r)=>{const n=t._root;if("LeafNode"===n._tag)return ce(n.value)?r(e,n.value.value,n.key):e;if("EmptyNode"===n._tag)return e;const s=[n.children];let i;for(;i=s.pop();)for(let t=0,n=i.length;t<n;){const n=i[t++];n&&!ss(n)&&("LeafNode"===n._tag?ce(n.value)&&(e=r(e,n.value.value,n.key)):s.push(n.children))}return e})),Ls="effect/HashSet",Ds=Symbol.for(Ls),Ps={[Ds]:Ds,[Symbol.iterator](){return Fs(this._keyMap)},[C](){return q(this,x(A(this._keyMap))(A(Ls)))},[U](t){return!!qs(t)&&Ns(this._keyMap)===Ns(t._keyMap)&&J(this._keyMap,t._keyMap)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},Bs=t=>{const e=Object.create(Ps);return e._keyMap=t,e},qs=t=>m(t,Ds),Us=Bs(_s()),Js=()=>Us,Gs=t(2,((t,e)=>Is(t._keyMap,e))),Ws=t=>Bs(js(t._keyMap)),Vs=t=>(t._keyMap._editable=!1,t),Hs=t(2,((t,e)=>{const r=Ws(t);return e(r),Vs(r)})),zs=t(2,((t,e)=>t._keyMap._editable?(Es(e,!0)(t._keyMap),t):Bs(Es(e,!0)(t._keyMap)))),Ys=t(2,((t,e)=>t._keyMap._editable?(Rs(e)(t._keyMap),t):Bs(Rs(e)(t._keyMap)))),Ks=t(2,((t,e)=>Hs(t,(t=>{for(const r of e)Ys(t,r)})))),Qs=t(2,((t,e)=>Hs(Js(),(r=>{Zs(t,(t=>zs(r,t)));for(const t of e)zs(r,t)})))),Zs=t(2,((t,e)=>$s(t._keyMap,((t,r)=>e(r))))),Xs=t(3,((t,e,r)=>Ts(t._keyMap,e,((t,e,n)=>r(t,n))))),ti=Js,ei=(...t)=>{const e=Ws(Js());for(const r of t)zs(e,r);return Vs(e)},ri=Gs,ni=t=>Ns(t._keyMap),si=zs,ii=Ys,oi=Ks,ci=Qs,ai=Xs,ui=Symbol.for("effect/MutableRef"),hi={[ui]:ui,toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableRef",current:z(this.current)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},li=t=>{const e=Object.create(hi);return e.current=t,e},fi=t(3,((t,e,r)=>!!J(e,t.current)&&(t.current=r,!0))),bi=t=>t.current,di=t(2,((t,e)=>(t.current=e,t))),pi="effect/FiberId",mi=Symbol.for(pi),Si="None",gi="Runtime",yi="Composite",wi=D(`${pi}-${Si}`);let _i=class{[mi]=mi;_tag=Si;id=-1;startTimeMillis=-1;[C](){return wi}[U](t){return Ii(t)&&t._tag===Si}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[H](){return this.toJSON()}};class vi{id;startTimeMillis;[mi]=mi;_tag=gi;constructor(t,e){this.id=t,this.startTimeMillis=e}[C](){return q(this,D(`${pi}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[U](t){return Ii(t)&&t._tag===gi&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[H](){return this.toJSON()}}class Oi{left;right;[mi]=mi;_tag=yi;constructor(t,e){this.left=t,this.right=e}_hash;[C](){return c(D(`${pi}-${this._tag}`),x(A(this.left)),x(A(this.right)),q(this))}[U](t){return Ii(t)&&t._tag===yi&&J(this.left,t.left)&&J(this.right,t.right)}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:z(this.left),right:z(this.right)}}[H](){return this.toJSON()}}const Mi=new _i,Ii=t=>m(t,mi),Ei=t(2,((t,e)=>t._tag===Si?e:e._tag===Si?t:new Oi(t,e))),ki=t=>{switch(t._tag){case Si:return ti();case gi:return ei(t.id);case yi:return c(ki(t.left),ci(ki(t.right)))}},Fi=f(Symbol.for("effect/Fiber/Id/_fiberCounter"),(()=>li(0))),Ni=t=>Array.from(ki(t)).map((t=>`#${t}`)).join(","),ji=Mi,Ci=Ei,Ai=t=>c(t,ai(Mi,((t,e)=>Ei(e)(t)))),Ri=Ni,xi=()=>{const t=bi(Fi);return c(Fi,di(t+1)),new vi(t,Date.now())},$i=_s,Ti=Os,Li=Es,Di=Fs,Pi=Cs,Bi=xs,qi=Ts,Ui=Symbol.for("effect/List"),Ji=t=>ve(t),Gi=(()=>u(er(J),Ji))(),Wi={[Ui]:Ui,_tag:"Cons",toString(){return Y(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:Ji(this).map(z)}},[H](){return this.toJSON()},[U](t){return Ki(t)&&this._tag===t._tag&&Gi(this,t)},[C](){return q(this,B(Ji(this)))},[Symbol.iterator](){let t=!1,e=this;return{next(){if(t)return this.return();if("Nil"===e._tag)return t=!0,this.return();const r=e.head;return e=e.tail,{done:t,value:r}},return:e=>(t||(t=!0),{done:!0,value:e})}},pipe(){return rt(this,arguments)}},Vi=(t,e)=>{const r=Object.create(Wi);return r.head=t,r.tail=e,r},Hi=D("Nil"),zi={[Ui]:Ui,_tag:"Nil",toString(){return Y(this.toJSON())},toJSON:()=>({_id:"List",_tag:"Nil"}),[H](){return this.toJSON()},[C]:()=>Hi,[U](t){return Ki(t)&&this._tag===t._tag},[Symbol.iterator]:()=>({next:()=>({done:!0,value:void 0})}),pipe(){return rt(this,arguments)}},Yi=Object.create(zi),Ki=t=>m(t,Ui),Qi=t=>"Nil"===t._tag,Zi=(t,e)=>Vi(t,e),Xi=()=>Yi,to=t=>Vi(t,Yi),eo=t(2,((t,e)=>no(e,t))),ro=t(2,((t,e)=>Zi(e,t))),no=t(2,((t,e)=>{if(Qi(t))return e;if(Qi(e))return t;{const r=Vi(e.head,t);let n=r,s=e.tail;for(;!Qi(s);){const e=Vi(s.head,t);n.tail=e,n=e,s=s.tail}return r}})),so=t(3,((t,e,r)=>{let n=e,s=t;for(;!Qi(s);)n=r(n,s.head),s=s.tail;return n})),io=t=>{let e=Xi(),r=t;for(;!Qi(r);)e=ro(e,r.head),r=r.tail;return e},oo=function(){function t(t){t&&Object.assign(this,t)}return t.prototype=It,t}(),co=t=>Object.assign(Object.create(It),t),ao=Symbol.for("effect/DifferContextPatch");function uo(t){return t}const ho={...oo.prototype,[ao]:{_Value:uo,_Patch:uo}},lo=Object.create(Object.assign(Object.create(ho),{_tag:"Empty"})),fo=()=>lo,bo=Object.assign(Object.create(ho),{_tag:"AndThen"}),po=Object.assign(Object.create(ho),{_tag:"AddService"}),mo=(t,e)=>{const r=Object.create(po);return r.key=t,r.service=e,r},So=Object.assign(Object.create(ho),{_tag:"RemoveService"}),go=t=>{const e=Object.create(So);return e.key=t,e},yo=Object.assign(Object.create(ho),{_tag:"UpdateService"}),wo=(t,e)=>{const r=Object.create(yo);return r.key=t,r.update=e,r},_o=t(2,((t,e)=>((t,e)=>{const r=Object.create(bo);return r.first=t,r.second=e,r})(t,e))),vo=t(2,((t,e)=>{if("Empty"===t._tag)return e;let r=!1,n=Jr(t);const s=new Map(e.unsafeMap);for(;cn(n);){const t=hn(n),e=dn(n);switch(t._tag){case"Empty":n=e;break;case"AddService":s.set(t.key,t.service),n=e;break;case"AndThen":n=Xr(Xr(e,t.second),t.first);break;case"RemoveService":s.delete(t.key),n=e;break;case"UpdateService":s.set(t.key,t.update(s.get(t.key))),r=!0,n=e}}if(!r)return br(s);const i=new Map;for(const[t]of e.unsafeMap)s.has(t)&&(i.set(t,s.get(t)),s.delete(t));for(const[t,e]of s)i.set(t,e);return br(i)})),Oo=Symbol.for("effect/DifferHashSetPatch");function Mo(t){return t}const Io={...oo.prototype,[Oo]:{_Value:Mo,_Key:Mo,_Patch:Mo}},Eo=Object.create(Object.assign(Object.create(Io),{_tag:"Empty"})),ko=()=>Eo,Fo=Object.assign(Object.create(Io),{_tag:"AndThen"}),No=Object.assign(Object.create(Io),{_tag:"Add"}),jo=t=>{const e=Object.create(No);return e.value=t,e},Co=Object.assign(Object.create(Io),{_tag:"Remove"}),Ao=t(2,((t,e)=>((t,e)=>{const r=Object.create(Fo);return r.first=t,r.second=e,r})(t,e))),Ro=t(2,((t,e)=>{if("Empty"===t._tag)return e;let r=e,n=Jr(t);for(;cn(n);){const t=hn(n),e=dn(n);switch(t._tag){case"Empty":n=e;break;case"AndThen":n=Xr(t.first)(Xr(t.second)(e));break;case"Add":r=si(t.value)(r),n=e;break;case"Remove":r=ii(t.value)(r),n=e}}return r})),xo=Symbol.for("effect/DifferReadonlyArrayPatch");function $o(t){return t}const To={...oo.prototype,[xo]:{_Value:$o,_Patch:$o}},Lo=Object.create(Object.assign(Object.create(To),{_tag:"Empty"})),Do=()=>Lo,Po=Object.assign(Object.create(To),{_tag:"AndThen"}),Bo=Object.assign(Object.create(To),{_tag:"Append"}),qo=Object.assign(Object.create(To),{_tag:"Slice"}),Uo=Object.assign(Object.create(To),{_tag:"Update"}),Jo=(t,e)=>{const r=Object.create(Uo);return r.index=t,r.patch=e,r},Go=t(2,((t,e)=>((t,e)=>{const r=Object.create(Po);return r.first=t,r.second=e,r})(t,e))),Wo=t(3,((t,e,r)=>{if("Empty"===t._tag)return e;let n=e.slice(),s=ze(t);for(;Ee(s);){const t=Ae(s),e=xe(s);switch(t._tag){case"Empty":s=e;break;case"AndThen":e.unshift(t.first,t.second),s=e;break;case"Append":for(const e of t.values)n.push(e);s=e;break;case"Slice":n=n.slice(t.from,t.until),s=e;break;case"Update":n[t.index]=r.patch(t.patch,n[t.index]),s=e}}return n})),Vo=Symbol.for("effect/Differ"),Ho={[Vo]:{_P:e,_V:e},pipe(){return rt(this,arguments)}},zo=t=>{const e=Object.create(Ho);return e.empty=t.empty,e.diff=t.diff,e.combine=t.combine,e.patch=t.patch,e},Yo=()=>Ko(((t,e)=>e)),Ko=t=>zo({empty:e,combine:(t,r)=>t===e?r:r===e?t:e=>r(t(e)),diff:(t,n)=>J(t,n)?e:r(n),patch:(e,r)=>t(r,e(r))}),Qo=255,Zo=t=>t&Qo,Xo=t=>t>>8&Qo,tc=(t,e)=>(t&Qo)+((e&t&Qo)<<8),ec=tc(0,0),rc=t(2,((t,e)=>tc(Zo(t)&~e,Xo(t)))),nc=t(2,((t,e)=>t|e)),sc=t(2,((t,e)=>t|e)),ic=t=>oc(t)&&!lc(t),oc=t=>cc(t,1),cc=t(2,((t,e)=>!!(t&e))),ac=(...t)=>t.reduce(((t,e)=>t|e),0),uc=ac(0),hc=t=>cc(t,4),lc=t=>cc(t,16),fc=t(2,((t,e)=>tc(t^e,e))),bc=t(2,((t,e)=>t&(~Zo(e)>>>0&Qo|Xo(e))|Zo(e)&Xo(e))),dc=zo({empty:ec,diff:(t,e)=>fc(t,e),combine:(t,e)=>nc(e)(t),patch:(t,e)=>bc(e,t)}),pc=t=>tc(t,0),mc=rc,Sc=(t,e)=>({_tag:"Par",left:t,right:e}),gc=(t,e)=>({_tag:"Seq",left:t,right:e}),yc=t=>{let e=t,r=Mc(),n=Xi(),s=Xi();for(;;)switch(e._tag){case"Empty":if(Qi(n))return[r,s];e=n.head,n=n.tail;break;case"Par":n=Zi(e.right,n),e=e.left;break;case"Seq":{const t=e.left,r=e.right;switch(t._tag){case"Empty":e=r;break;case"Par":{const n=t.right;e=Sc(gc(t.left,r),gc(n,r));break}case"Seq":e=gc(t.left,gc(t.right,r));break;case"Single":e=t,s=Zi(r,s)}break}case"Single":if(r=Ic(r,e),Qi(n))return[r,s];e=n.head,n=n.tail}throw new Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},wc=(t,e)=>{if(Qi(t))return to(Nc(e));if(kc(e))return t;const r=$c(t.head),n=Fc(e);return 1===r.length&&1===n.length&&J(r[0],n[0])?Zi(xc(t.head,Nc(e)),t.tail):Zi(Nc(e),t)},_c=Symbol.for("effect/RequestBlock/RequestBlockParallel"),vc={_R:t=>t};class Oc{map;[_c]=vc;constructor(t){this.map=t}}const Mc=()=>new Oc($i()),Ic=(t,e)=>new Oc(Pi(t.map,e.dataSource,(t=>le(pe(t,Zr(e.blockedRequest)),(()=>Jr(e.blockedRequest)))))),Ec=(t,e)=>new Oc(qi(t.map,e.map,((t,e,r)=>Li(t,r,ae(Ti(t,r),{onNone:()=>e,onSome:t=>rn(e,t)}))))),kc=t=>(t=>t&&ss(t._root))(t.map),Fc=t=>Array.from(Di(t.map)),Nc=t=>Rc(Bi(t.map,(t=>Jr(t)))),jc=Symbol.for("effect/RequestBlock/RequestBlockSequential"),Cc={_R:t=>t};class Ac{map;[jc]=Cc;constructor(t){this.map=t}}const Rc=t=>new Ac(t),xc=(t,e)=>new Ac(qi(e.map,t.map,((t,e,r)=>Li(t,r,ae(Ti(t,r),{onNone:()=>qr(),onSome:t=>rn(t,e)}))))),$c=t=>Array.from(Di(t.map)),Tc="Die",Lc="Empty",Dc="Fail",Pc="Interrupt",Bc="Parallel",qc="Sequential",Uc="effect/Cause",Jc=Symbol.for(Uc),Gc={[Jc]:{_E:t=>t},[C](){return c(A(Uc),x(A(ha(this))),q(this))},[U](t){return Qc(t)&&ua(this,t)},pipe(){return rt(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:z(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:z(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:z(this.left),right:z(this.right)}}},toString(){return wa(this)},[H](){return this.toJSON()}},Wc=(()=>{const t=Object.create(Gc);return t._tag=Lc,t})(),Vc=t=>{const e=Object.create(Gc);return e._tag=Dc,e.error=t,e},Hc=t=>{const e=Object.create(Gc);return e._tag=Tc,e.defect=t,e},zc=t=>{const e=Object.create(Gc);return e._tag=Pc,e.fiberId=t,e},Yc=(t,e)=>{const r=Object.create(Gc);return r._tag=Bc,r.left=t,r.right=e,r},Kc=(t,e)=>{const r=Object.create(Gc);return r._tag=qc,r.left=t,r.right=e,r},Qc=t=>m(t,Jc),Zc=t=>t._tag===Tc,Xc=t=>ce(ia(t)),ta=t=>ya(void 0,da)(t),ea=t=>Hr(ga(t,qr(),((t,e)=>e._tag===Tc?ie(c(t,Xr(e.defect))):se()))),ra=t=>ga(t,ti(),((t,e)=>e._tag===Pc?ie(c(t,si(e.fiberId))):se())),na=t=>{const e=(t=>fa(t,(t=>t._tag===Dc?ie(t.error):se())))(t);switch(e._tag){case"None":return Vt(t);case"Some":return Ht(e.value)}},sa=t=>Sa(t,{onEmpty:ie(Wc),onFail:pe(Vc),onDie:t=>ie(Hc(t)),onInterrupt:t=>ie(zc(t)),onSequential:ge(Kc),onParallel:ge(Yc)}),ia=t=>fa(t,(t=>t._tag===Pc?ie(t.fiberId):se())),oa=t=>Sa(t,{onEmpty:Wc,onFail:()=>Wc,onDie:Hc,onInterrupt:zc,onSequential:Kc,onParallel:Yc}),ca=t(2,((t,e)=>aa(t,(t=>Vc(e(t)))))),aa=t(2,((t,e)=>Sa(t,{onEmpty:Wc,onFail:t=>e(t),onDie:t=>Hc(t),onInterrupt:t=>zc(t),onSequential:(t,e)=>Kc(t,e),onParallel:(t,e)=>Yc(t,e)}))),ua=(t,e)=>{let r=Jr(t),n=Jr(e);for(;cn(r)&&cn(n);){const[t,e]=c(hn(r),ga([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return ie([c(t,ci(n)),c(e,rn(s))])}))),[s,i]=c(hn(n),ga([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return ie([c(t,ci(n)),c(e,rn(s))])})));if(!J(t,s))return!1;r=e,n=i}return!0},ha=t=>la(Jr(t),qr()),la=(t,e)=>{for(;;){const[r,n]=c(t,Xe([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return[c(t,ci(n)),c(e,rn(s))]}))),s=ni(r)>0?c(e,Xr(r)):e;if(on(n))return Hr(s);t=n,e=s}throw new Error(w("Cause.flattenCauseLoop"))},fa=t(2,((t,e)=>{const r=[t];for(;r.length>0;){const t=r.pop(),n=e(t);switch(n._tag){case"None":switch(t._tag){case qc:case Bc:r.push(t.right),r.push(t.left)}break;case"Some":return n}}return se()})),ba=t=>{let e=t;const r=[];let n=ti(),s=qr();for(;void 0!==e;)switch(e._tag){case Lc:if(0===r.length)return[n,s];e=r.pop();break;case Dc:if(n=si(n,Ur(e._tag,e.error)),0===r.length)return[n,s];e=r.pop();break;case Tc:if(n=si(n,Ur(e._tag,e.defect)),0===r.length)return[n,s];e=r.pop();break;case Pc:if(n=si(n,Ur(e._tag,e.fiberId)),0===r.length)return[n,s];e=r.pop();break;case qc:switch(e.left._tag){case Lc:e=e.right;break;case qc:e=Kc(e.left.left,Kc(e.left.right,e.right));break;case Bc:e=Yc(Kc(e.left.left,e.right),Kc(e.left.right,e.right));break;default:s=Xr(s,e.right),e=e.left}break;case Bc:r.push(e.right),e=e.left}throw new Error(w("Cause.evaluateCauseLoop"))},da={emptyCase:n,failCase:s,dieCase:s,interruptCase:n,sequentialCase:(t,e,r)=>e&&r,parallelCase:(t,e,r)=>e&&r},pa="SequentialCase",ma="ParallelCase",Sa=t(2,((t,{onDie:e,onEmpty:r,onFail:n,onInterrupt:s,onParallel:i,onSequential:o})=>ya(t,void 0,{emptyCase:()=>r,failCase:(t,e)=>n(e),dieCase:(t,r)=>e(r),interruptCase:(t,e)=>s(e),sequentialCase:(t,e,r)=>o(e,r),parallelCase:(t,e,r)=>i(e,r)}))),ga=t(3,((t,e,r)=>{let n=e,s=t;const i=[];for(;void 0!==s;){const t=r(n,s);switch(n=ce(t)?t.value:n,s._tag){case qc:case Bc:i.push(s.right),s=s.left;break;default:s=void 0}void 0===s&&i.length>0&&(s=i.pop())}return n})),ya=t(3,((t,e,r)=>{const n=[t],s=[];for(;n.length>0;){const t=n.pop();switch(t._tag){case Lc:s.push(Vt(r.emptyCase(e)));break;case Dc:s.push(Vt(r.failCase(e,t.error)));break;case Tc:s.push(Vt(r.dieCase(e,t.defect)));break;case Pc:s.push(Vt(r.interruptCase(e,t.fiberId)));break;case qc:n.push(t.right),n.push(t.left),s.push(Ht({_tag:pa}));break;case Bc:n.push(t.right),n.push(t.left),s.push(Ht({_tag:ma}))}}const i=[];for(;s.length>0;){const t=s.pop();switch(t._tag){case"Left":switch(t.left._tag){case pa:{const t=i.pop(),n=i.pop(),s=r.sequentialCase(e,t,n);i.push(s);break}case ma:{const t=i.pop(),n=i.pop(),s=r.parallelCase(e,t,n);i.push(s);break}}break;case"Right":i.push(t.right)}}if(0===i.length)throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return i.pop()})),wa=(t,e)=>ta(t)?"All fibers interrupted without errors.":Fa(t).map((function(t){return!0!==e?.renderErrorCause||void 0===t.cause?t.stack:`${t.stack} {\n${_a(t.cause," ")}\n}`})).join("\n"),_a=(t,e)=>{const r=t.stack.split("\n");let n=`${e}[cause]: ${r[0]}`;for(let t=1,s=r.length;t<s;t++)n+=`\n${e}${r[t]}`;return t.cause&&(n+=` {\n${_a(t.cause,`${e} `)}\n${e}}`),n};class va extends globalThis.Error{span=void 0;constructor(t){const e="object"==typeof t&&null!==t,r=Error.stackTraceLimit;Error.stackTraceLimit=1,super(Oa(t),e&&"cause"in t&&void 0!==t.cause?{cause:new va(t.cause)}:void 0),""===this.message&&(this.message="An error has occurred"),Error.stackTraceLimit=r,this.name=t instanceof Error?t.name:"Error",e&&(ka in t&&(this.span=t[ka]),Object.keys(t).forEach((e=>{e in this||(this[e]=t[e])}))),this.stack=Ea(`${this.name}: ${this.message}`,t instanceof Error&&t.stack?t.stack:"",this.span)}}const Oa=t=>{if("string"==typeof t)return t;if("object"==typeof t&&null!==t&&t instanceof Error)return t.message;try{if(m(t,"toString")&&d(t.toString)&&t.toString!==Object.prototype.toString&&t.toString!==globalThis.Array.prototype.toString)return t.toString()}catch{}return Q(t)},Ma=/\((.*)\)/g,Ia=f("effect/Tracer/spanToTrace",(()=>new WeakMap)),Ea=(t,e,r)=>{const n=[t],s=e.startsWith(t)?e.slice(t.length).split("\n"):e.split("\n");for(let t=1;t<s.length;t++)if(s[t].includes(" at new BaseEffectError")||s[t].includes(" at new YieldableError"))t++;else{if(s[t].includes("Generator.next"))break;if(s[t].includes("effect_internal_function"))break;n.push(s[t].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(r){let t=r,e=0;for(;t&&"Span"===t._tag&&e<10;){const r=Ia.get(t);if("function"==typeof r){const e=r();if("string"==typeof e){const r=e.matchAll(Ma);let s=!1;for(const[,e]of r)s=!0,n.push(` at ${t.name} (${e})`);s||n.push(` at ${t.name} (${e.replace(/^at /,"")})`)}else n.push(` at ${t.name}`)}else n.push(` at ${t.name}`);t=be(t.parent),e++}}return n.join("\n")},ka=Symbol.for("effect/SpanAnnotation"),Fa=t=>ya(t,void 0,{emptyCase:()=>[],dieCase:(t,e)=>[new va(e)],failCase:(t,e)=>[new va(e)],interruptCase:()=>[],parallelCase:(t,e,r)=>[...e,...r],sequentialCase:(t,e,r)=>[...e,...r]}),Na="Pending",ja="Done",Ca=Symbol.for("effect/Deferred"),Aa={_E:t=>t,_A:t=>t},Ra=t=>({_tag:ja,effect:t});class xa{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new xa(this.self)}}const $a=(t,e)=>{const r=new Da("Blocked");return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r},Ta=Symbol.for("effect/Effect");class La{patch;op;_op=St;constructor(t,e){this.patch=t,this.op=e}}class Da{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t}[U](t){return this===t}[C](){return q(this,R(this))}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:z(this.effect_instruction_i0),effect_instruction_i1:z(this.effect_instruction_i1),effect_instruction_i2:z(this.effect_instruction_i2)}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new I(this))}}class Pa{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t,this._tag=t}[U](t){return Uh(t)&&"Failure"===t._op&&J(this.effect_instruction_i0,t.effect_instruction_i0)}[C](){return c(D(this._tag),x(A(this.effect_instruction_i0)),q(this))}get cause(){return this.effect_instruction_i0}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new I(this))}}class Ba{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t,this._tag=t}[U](t){return Uh(t)&&"Success"===t._op&&J(this.effect_instruction_i0,t.effect_instruction_i0)}[C](){return c(D(this._tag),x(A(this.effect_instruction_i0)),q(this))}get value(){return this.effect_instruction_i0}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:z(this.value)}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new I(this))}}const qa=t=>m(t,Ta),Ua=t=>{const e=new Da(pt);return e.effect_instruction_i0=t,e},Ja=t(3,((t,e,r)=>$u((n=>hu(t,(t=>hu(nu(ju((()=>n(e(t))))),(e=>ju((()=>r(t,e))).pipe(du({onFailure:t=>{switch(e._tag){case it:return ou(Kc(e.effect_instruction_i0,t));case ut:return ou(t)}},onSuccess:()=>e})))))))))),Ga=t(2,((t,e)=>hu(t,(()=>Nu(e))))),Wa=t=>Ga(t,void 0),Va=function(){const t=new Da(st);switch(arguments.length){case 2:t.effect_instruction_i0=arguments[0],t.commit=arguments[1];break;case 3:t.effect_instruction_i0=arguments[0],t.effect_instruction_i1=arguments[1],t.commit=arguments[2];break;case 4:t.effect_instruction_i0=arguments[0],t.effect_instruction_i1=arguments[1],t.effect_instruction_i2=arguments[2],t.commit=arguments[3];break;default:throw new Error(w("you're not supposed to end up here"))}return t},Ha=(t,e=ji)=>{const r=new Da(nt);let n;return r.effect_instruction_i0=e=>{n=t(e)},r.effect_instruction_i1=e,Eu(r,(()=>qa(n)?n:Tu))},za=(t,e=ji)=>ju((()=>Ha(t,e))),Ya=(t,e=ji)=>Va(t,(function(){let t,r;function n(e){t?t(e):void 0===r&&(r=e)}const s=new Da(nt);let i,o;return s.effect_instruction_i0=e=>{t=e,r&&e(r)},s.effect_instruction_i1=e,1!==this.effect_instruction_i0.length?(o=new AbortController,i=N((()=>this.effect_instruction_i0(n,o.signal)))):i=N((()=>this.effect_instruction_i0(n))),i||o?Eu(s,(()=>(o&&o.abort(),i??Tu))):s})),Ka=t(2,((t,e)=>{const r=new Da(ot);return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r})),Qa=t(2,((t,e)=>pu(t,{onFailure:e,onSuccess:Nu}))),Za=Symbol.for("effect/OriginalAnnotation"),Xa=(t,e)=>ce(e)?new Proxy(t,{has:(t,e)=>e===ka||e===Za||e in t,get:(r,n)=>n===ka?e.value:n===Za?t:r[n]}):t,tu=t=>p(t)&&!(ka in t)?Ua((e=>ou(Hc(Xa(t,wl(e)))))):ou(Hc(t)),eu=t=>cu((()=>Hc(new Th(t)))),ru=t=>pu(t,{onFailure:t=>Nu(Ht(t)),onSuccess:t=>Nu(Vt(t))}),nu=t=>bu(t,{onFailure:Hh,onSuccess:Qh}),su=t=>p(t)&&!(ka in t)?Ua((e=>ou(Vc(Xa(t,wl(e)))))):ou(Vc(t)),iu=t=>hu(Cu(t),su),ou=t=>{const e=new Pa(it);return e.effect_instruction_i0=t,e},cu=t=>hu(Cu(t),ou),au=Ua((t=>Nu(t.id()))),uu=t=>Ua((e=>t(e.id()))),hu=t(2,((t,e)=>{const r=new Da(ct);return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r})),lu=t=>{const e=new Da("OnStep");return e.effect_instruction_i0=t,e},fu=t=>hu(t,e),bu=t(2,((t,e)=>du(t,{onFailure:t=>Nu(e.onFailure(t)),onSuccess:t=>Nu(e.onSuccess(t))}))),du=t(2,((t,e)=>{const r=new Da(at);return r.effect_instruction_i0=t,r.effect_instruction_i1=e.onFailure,r.effect_instruction_i2=e.onSuccess,r})),pu=t(2,((t,e)=>du(t,{onFailure:t=>{if(ea(t).length>0)return ou((t=>Sa(t,{onEmpty:Wc,onFail:Hc,onDie:Hc,onInterrupt:zc,onSequential:Kc,onParallel:Yc}))(t));const r=(t=>Hr(ga(t,qr(),((t,e)=>e._tag===Dc?ie(c(t,Xr(e.error))):se()))))(t);return r.length>0?e.onFailure(un(r)):ou(t)},onSuccess:e.onSuccess}))),mu=t(2,((t,e)=>ju((()=>{const r=ve(t),n=we(r.length);let s=0;return Ga(Du({while:()=>s<r.length,body:()=>e(r[s],s),step:t=>{n[s++]=t}}),n)})))),Su=t(2,((t,e)=>ju((()=>{const r=ve(t);let n=0;return Du({while:()=>n<r.length,body:()=>e(r[n],n),step:()=>{n++}})})))),gu=hu(au,(t=>yu(t))),yu=t=>ou(zc(t)),wu=t=>{const e=new Da(ft);return e.effect_instruction_i0=tc(r=1,r),e.effect_instruction_i1=()=>t,e;var r},_u=t(2,((t,e)=>$u((r=>hu(nu(r(t)),(t=>al(e,t))))))),vu=t(2,((t,e)=>hu(t,(t=>Cu((()=>e(t))))))),Ou=t(2,((t,e)=>pu(t,{onFailure:t=>iu((()=>e.onFailure(t))),onSuccess:t=>Cu((()=>e.onSuccess(t)))}))),Mu=t(2,((t,e)=>du(t,{onFailure:t=>{const r=na(t);switch(r._tag){case"Left":return iu((()=>e(r.left)));case"Right":return ou(r.right)}},onSuccess:Nu}))),Iu=t(2,((t,e)=>$u((r=>du(r(t),{onFailure:t=>{const r=Hh(t);return du(e(r),{onFailure:e=>Hh(Kc(t,e)),onSuccess:()=>r})},onSuccess:t=>{const r=Qh(t);return Wu(e(r),r)}}))))),Eu=t(2,((t,e)=>Iu(t,Yh({onFailure:t=>ta(t)?Wa(e(ra(t))):Tu,onSuccess:()=>Tu})))),ku=t(2,((t,e)=>Ru(t,e,Nu))),Fu=t(2,((t,e)=>pu(t,{onFailure:t=>tu(e(t)),onSuccess:Nu}))),Nu=t=>{const e=new Ba(ut);return e.effect_instruction_i0=t,e},ju=t=>{const e=new Da(st);return e.commit=t,e},Cu=t=>{const e=new Da(ht);return e.effect_instruction_i0=t,e},Au=t((t=>3===t.length||2===t.length&&!(p(t[1])&&"onlyEffect"in t[1])),((t,e)=>hu(t,(t=>{const r="function"==typeof e?e(t):e;return qa(r)?Ga(r,t):m(n=r,"then")&&d(n.then)?Ha((e=>{r.then((()=>e(Nu(t))),(t=>e(su(new qh(t,"An unknown error occurred in Effect.tap")))))})):Nu(t);var n})))),Ru=t(3,((t,e,r)=>du(t,{onFailure:t=>ea(t).length>0?ou(de((t=>Sa(t,{onEmpty:se(),onFail:t=>ie(Hc(t)),onDie:t=>ie(Hc(t)),onInterrupt:()=>se(),onSequential:ge(Kc),onParallel:ge(Yc)}))(t))):e(),onSuccess:r}))),xu=t=>{const e=new Da(ft);return e.effect_instruction_i0=pc(1),e.effect_instruction_i1=()=>t,e},$u=t=>Va(t,(function(){const t=new Da(ft);return t.effect_instruction_i0=pc(1),t.effect_instruction_i1=t=>oc(t)?N((()=>this.effect_instruction_i0(wu))):N((()=>this.effect_instruction_i0(xu))),t})),Tu=Nu(void 0),Lu=t(2,((t,e)=>hu(e,(e=>e?c(t,vu(ie)):Nu(se()))))),Du=t=>{const e=new Da(bt);return e.effect_instruction_i0=t.while,e.effect_instruction_i1=t.body,e.effect_instruction_i2=t.step,e},Pu=t=>ju((()=>{const e=new Da(dt);return e.effect_instruction_i0=t(),e})),Bu=function(){const t=1===arguments.length?arguments[0]:arguments[1].bind(arguments[0]);return Pu((()=>t(c)))},qu=(t,...e)=>Object.defineProperty(0===e.length?function(...e){return Pu((()=>t.apply(this,e)))}:function(...r){let n=Pu((()=>t.apply(this,r)));for(const t of e)n=t(n,...r);return n},"length",{value:t.length,configurable:!0}),Uu=t=>{const e=new Da(mt);return void 0!==t?.priority?yh(e,t.priority):e},Ju=t(2,((t,e)=>hu(t,(t=>vu(e,(e=>[t,e])))))),Gu=t(2,((t,e)=>hu(t,(t=>Ga(e,t))))),Wu=t(2,((t,e)=>hu(t,(()=>e)))),Vu=t(3,((t,e,r)=>hu(t,(t=>vu(e,(e=>r(t,e))))))),Hu=t=>hu(au,(e=>c(t,zu(e)))),zu=t(2,((t,e)=>hu(t.interruptAsFork(e),(()=>t.await)))),Yu={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return rt(this,arguments)}},Ku={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return rt(this,arguments)}},Qu={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return rt(this,arguments)}},Zu={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return rt(this,arguments)}},Xu=Symbol.for("effect/FiberRef"),th={_A:t=>t},eh=t=>Ua((e=>Qh(e.getFiberRef(t)))),rh=t(2,((t,e)=>hu(eh(t),e))),nh=t(2,((t,e)=>sh(t,(()=>[void 0,e])))),sh=t(2,((t,e)=>Ua((r=>{const[n,s]=e(r.getFiberRef(t));return r.setFiberRef(t,s),Nu(n)})))),ih=t(3,((t,e,r)=>Ja(Gu(eh(e),nh(e,r)),(()=>t),(t=>nh(e,t))))),oh=t(3,((t,e,r)=>rh(e,(n=>ih(t,e,r(n)))))),ch=(t,r)=>lh(t,{differ:Yo(),fork:r?.fork??e,join:r?.join}),ah=t=>{const e=zo({empty:ko(),combine:(t,e)=>Ao(e)(t),diff:(t,e)=>((t,e)=>{const[r,n]=ai([t,ko()],(([t,e],r)=>ri(r)(t)?[ii(r)(t),e]:[t,Ao(jo(r))(e)]))(e);return ai(n,((t,e)=>Ao((t=>{const e=Object.create(Co);return e.value=t,e})(e))(t)))(r)})(t,e),patch:(t,e)=>Ro(e)(t)});return lh(t,{differ:e,fork:e.empty})},uh=t=>{const e=(t=>zo({empty:Do(),combine:(t,e)=>Go(t,e),diff:(e,r)=>(t=>{let e=0,r=Do();for(;e<t.oldValue.length&&e<t.newValue.length;){const n=t.differ.diff(t.oldValue[e],t.newValue[e]);J(n,t.differ.empty)||(r=Go(r,Jo(e,n))),e+=1}return e<t.oldValue.length&&(r=Go(r,((t,e)=>{const r=Object.create(qo);return r.from=0,r.until=e,r})(0,e))),e<t.newValue.length&&(r=Go(r,(t=>{const e=Object.create(Bo);return e.values=t,e})(Te(e)(t.newValue)))),r})({oldValue:e,newValue:r,differ:t}),patch:(e,r)=>Wo(e,r,t)}))(Yo());return lh(t,{differ:e,fork:e.empty})},hh=t=>{const e=zo({empty:fo(),combine:(t,e)=>_o(e)(t),diff:(t,e)=>((t,e)=>{const r=new Map(t.unsafeMap);let n=fo();for(const[t,s]of e.unsafeMap.entries())if(r.has(t)){const e=r.get(t);r.delete(t),J(e,s)||(n=_o(wo(t,(()=>s)))(n))}else r.delete(t),n=_o(mo(t,s))(n);for(const[t]of r.entries())n=_o(go(t))(n);return n})(t,e),patch:(t,e)=>vo(e)(t)});return lh(t,{differ:e,fork:e.empty})},lh=(t,e)=>({...Et,[Xu]:th,initial:t,commit(){return eh(this)},diff:(t,r)=>e.differ.diff(t,r),combine:(t,r)=>e.differ.combine(t,r),patch:t=>r=>e.differ.patch(t,r),fork:e.fork,join:e.join??((t,e)=>e)}),fh=t=>lh(t,{differ:dc,fork:dc.empty}),bh=f(Symbol.for("effect/FiberRef/currentContext"),(()=>hh(Er()))),dh=f(Symbol.for("effect/FiberRef/currentSchedulingPriority"),(()=>ch(0))),ph=f(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),(()=>ch(2048))),mh=f(Symbol.for("effect/FiberRef/currentLogAnnotation"),(()=>ch($i()))),Sh=f(Symbol.for("effect/FiberRef/currentLogLevel"),(()=>ch(Qu))),gh=f(Symbol.for("effect/FiberRef/currentLogSpan"),(()=>ch(Xi()))),yh=t(2,((t,e)=>ih(t,dh,e))),wh=f(Symbol.for("effect/FiberRef/currentConcurrency"),(()=>ch("unbounded"))),_h=f(Symbol.for("effect/FiberRef/currentRequestBatching"),(()=>ch(!0))),vh=f(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),(()=>ch(ie(Zu)))),Oh=f(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),(()=>ch(ie(Ku)))),Mh=f(Symbol.for("effect/FiberRef/currentMetricLabels"),(()=>uh([]))),Ih=f(Symbol.for("effect/FiberRef/currentForkScopeOverride"),(()=>ch(se(),{fork:()=>se(),join:t=>t}))),Eh=f(Symbol.for("effect/FiberRef/currentInterruptedCause"),(()=>ch(Wc,{fork:()=>Wc,join:t=>t}))),kh=Symbol.for("effect/Scope"),Fh=Symbol.for("effect/CloseableScope"),Nh=(t,e)=>t.addFinalizer((()=>Wa(e))),jh=(t,e)=>t.addFinalizer(e),Ch=(t,e)=>t.close(e),Ah=(t,e)=>t.fork(e),Rh=function(){class t extends globalThis.Error{commit(){return su(this)}toJSON(){const t={...this};return this.message&&(t.message=this.message),this.cause&&(t.cause=this.cause),t}[H](){return this.toString!==globalThis.Error.prototype.toString?this.stack?`${this.toString()}\n${this.stack.split("\n").slice(1).join("\n")}`:this.toString():"Bun"in globalThis?wa(Vc(this),{renderErrorCause:!0}):this}}return Object.assign(t.prototype,kt),t}(),xh=(t,e)=>{class r extends Rh{_tag=e}return Object.assign(r.prototype,t),r.prototype.name=e,r},$h=Symbol.for("effect/Cause/errors/RuntimeException"),Th=xh({[$h]:$h},"RuntimeException"),Lh=Symbol.for("effect/Cause/errors/InterruptedException"),Dh=Symbol.for("effect/Cause/errors/NoSuchElement"),Ph=xh({[Dh]:Dh},"NoSuchElementException"),Bh=Symbol.for("effect/Cause/errors/UnknownException"),qh=function(){class t extends Rh{_tag="UnknownException";error;constructor(t,e){super(e??"An unknown error occurred",{cause:t}),this.error=t}}return Object.assign(t.prototype,{[Bh]:Bh,name:"UnknownException"}),t}(),Uh=t=>qa(t)&&"_tag"in t&&("Success"===t._tag||"Failure"===t._tag),Jh=t(2,((t,e)=>{switch(t._tag){case it:return Hh(t.effect_instruction_i0);case ut:return Qh(e)}})),Gh=t=>Jh(t,void 0),Wh=(t,e)=>rl(t,e?.parallel?Yc:Kc),Vh=t=>Hh(Vc(t)),Hh=t=>{const e=new Pa(it);return e.effect_instruction_i0=t,e},zh=t(2,((t,e)=>{switch(t._tag){case it:return Hh(t.effect_instruction_i0);case ut:return Qh(e(t.effect_instruction_i0))}})),Yh=t(2,((t,{onFailure:e,onSuccess:r})=>{switch(t._tag){case it:return e(t.effect_instruction_i0);case ut:return r(t.effect_instruction_i0)}})),Kh=t(2,((t,{onFailure:e,onSuccess:r})=>{switch(t._tag){case it:return e(t.effect_instruction_i0);case ut:return r(t.effect_instruction_i0)}})),Qh=t=>{const e=new Ba(ut);return e.effect_instruction_i0=t,e},Zh=Qh(void 0),Xh=t(2,((t,e)=>el(t,e,{onSuccess:(t,e)=>[t,e],onFailure:Kc}))),tl=t(2,((t,e)=>el(t,e,{onSuccess:(t,e)=>e,onFailure:Kc}))),el=t(3,((t,e,{onFailure:r,onSuccess:n})=>{switch(t._tag){case it:switch(e._tag){case ut:return Hh(t.effect_instruction_i0);case it:return Hh(r(t.effect_instruction_i0,e.effect_instruction_i0))}case ut:switch(e._tag){case ut:return Qh(n(t.effect_instruction_i0,e.effect_instruction_i0));case it:return Hh(e.effect_instruction_i0)}}})),rl=(t,e)=>{const r=Gr(t);return cn(r)?c(dn(r),Xe(c(hn(r),zh(Jr)),((t,r)=>c(t,el(r,{onSuccess:(t,e)=>c(t,Xr(e)),onFailure:e})))),zh(Hr),zh((t=>Vr(t))),ie):se()},nl=t=>{var e;return{...Et,[Ca]:Aa,state:li((e=[],{_tag:Na,joiners:e})),commit(){return ol(this)},blockingOn:t}},sl=()=>hu(au,(t=>il(t))),il=t=>Cu((()=>nl(t))),ol=t=>za((e=>{const r=bi(t.state);switch(r._tag){case ja:return e(r.effect);case Na:return r.joiners.push(e),bl(t,e)}}),t.blockingOn),cl=t(2,((t,e)=>Cu((()=>{const r=bi(t.state);switch(r._tag){case ja:return!1;case Na:di(t.state,Ra(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e);return!0}})))),al=t(2,((t,e)=>cl(t,e))),ul=t(2,((t,e)=>cl(t,ou(e)))),hl=t(2,((t,e)=>cl(t,yu(e)))),ll=t(2,((t,e)=>cl(t,Nu(e)))),fl=(t,e)=>{const r=bi(t.state);if(r._tag===Na){di(t.state,Ra(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e)}},bl=(t,e)=>Cu((()=>{const r=bi(t.state);if(r._tag===Na){const t=r.joiners.indexOf(e);t>=0&&r.joiners.splice(t,1)}})),dl=Ua((t=>Qh(t.currentContext))),pl=()=>dl,ml=t=>hu(pl(),t),Sl=t(2,((t,e)=>ih(bh,e)(t))),gl=t(2,((t,e)=>oh(bh,(t=>Ar(t,e)))(t))),yl=t(2,((t,e)=>ml((r=>Sl(t,e(r)))))),wl=t=>{const e=t.currentSpan;return void 0!==e&&"Span"===e._tag?ie(e):se()},_l=sl,vl=ol,Ol=al,Ml=ul,Il=t=>hu(au,(e=>cl(t,yu(e)))),El=t=>Cu((()=>bi(t.state)._tag===ja)),kl=ll,Fl=nl,Nl=t=>"Failure"===t._tag,jl=t=>"Success"===t._tag,Cl=Wh,Al=t=>Hh(Hc(t)),Rl=Vh,xl=Hh,$l=zh,Tl=Yh,Ll=Qh,Dl=Zh,Pl=Xh,Bl=tl,ql=Symbol.for("effect/MutableHashMap"),Ul={[ql]:ql,[Symbol.iterator](){return new Jl(this)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}};class Jl{self;referentialIterator;bucketIterator;constructor(t){this.self=t,this.referentialIterator=t.referential[Symbol.iterator]()}next(){if(void 0!==this.bucketIterator)return this.bucketIterator.next();const t=this.referentialIterator.next();return t.done?(this.bucketIterator=new Gl(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new Jl(this.self)}}class Gl{backing;constructor(t){this.backing=t}currentBucket;next(){if(void 0===this.currentBucket){const t=this.backing.next();if(t.done)return t;this.currentBucket=t.value[Symbol.iterator]()}const t=this.currentBucket.next();return t.done?(this.currentBucket=void 0,this.next()):t}}const Wl=()=>{const t=Object.create(Ul);return t.referential=new Map,t.buckets=new Map,t.bucketsSize=0,t},Vl=t(2,((t,e)=>{if(!1===W(e))return t.referential.has(e)?ie(t.referential.get(e)):se();const r=e[C](),n=t.buckets.get(r);return void 0===n?se():Hl(t,n,e)})),Hl=(t,e,r,n=!1)=>{for(let s=0,i=e.length;s<i;s++)if(r[U](e[s][0])){const r=e[s][1];return n&&(e.splice(s,1),t.bucketsSize--),ie(r)}return se()},zl=t(2,((t,e)=>ce(Vl(t,e)))),Yl=t(3,((t,e,r)=>{if(!1===W(e))return t.referential.set(e,r),t;const n=e[C](),s=t.buckets.get(n);return void 0===s?(t.buckets.set(n,[[e,r]]),t.bucketsSize++,t):(Kl(t,s,e),s.push([e,r]),t.bucketsSize++,t)})),Kl=(t,e,r)=>{for(let n=0,s=e.length;n<s;n++)if(r[U](e[n][0]))return e.splice(n,1),void t.bucketsSize--},Ql=t(2,((t,e)=>{if(!1===W(e))return t.referential.delete(e),t;const r=e[C](),n=t.buckets.get(r);return void 0===n||(Kl(t,n,e),0===n.length&&t.buckets.delete(r)),t})),Zl=t=>t.referential.size+t.bucketsSize,Xl=Symbol.for("effect/MutableList"),tf={[Xl]:Xl,[Symbol.iterator](){let t=!1,e=this.head;return{next(){if(t)return this.return();if(null==e)return t=!0,this.return();const r=e.value;return e=e.next,{done:t,value:r}},return:e=>(t||(t=!0),{done:!0,value:e})}},toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},ef=t=>0===rf(t),rf=t=>t._length,nf=t(2,((t,e)=>{const r=(t=>({value:t,removed:!1,prev:void 0,next:void 0}))(e);return void 0===t.head&&(t.head=r),void 0===t.tail||(t.tail.next=r,r.prev=t.tail),t.tail=r,t._length+=1,t})),sf=Symbol.for("effect/MutableQueue"),of=Symbol.for("effect/mutable/MutableQueue/Empty"),cf={[sf]:sf,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},af=t=>{const e=Object.create(cf);return e.queue=(()=>{const t=Object.create(tf);return t.head=void 0,t.tail=void 0,t._length=0,t})(),e.capacity=t,e},uf=t=>af(t),hf=()=>af(void 0),lf=t=>rf(t.queue),ff=t=>ef(t.queue),bf=t=>void 0===t.capacity?1/0:t.capacity,df=t(2,((t,e)=>{const r=rf(t.queue);return(void 0===t.capacity||r!==t.capacity)&&(nf(e)(t.queue),!0)})),pf=t(2,((t,e)=>{const r=e[Symbol.iterator]();let n,s=qr(),i=!0;for(;i&&(n=r.next())&&!n.done;)i=df(n.value)(t);for(;null!=n&&!n.done;)s=Xr(n.value)(s),n=r.next();return Hr(s)})),mf=t(2,((t,e)=>ef(t.queue)?e:(t=>{const e=t.head;if(void 0!==e)return((t,e)=>{e.removed||(e.removed=!0,void 0!==e.prev&&void 0!==e.next?(e.prev.next=e.next,e.next.prev=e.prev):void 0!==e.prev?(t.tail=e.prev,e.prev.next=void 0):void 0!==e.next?(t.head=e.next,e.next.prev=void 0):(t.tail=void 0,t.head=void 0),t._length>0&&(t._length-=1))})(t,e),e.value})(t.queue))),Sf=t(2,((t,e)=>{let r=qr(),n=0;for(;n<e;){const e=mf(of)(t);if(e===of)break;r=Xr(e)(r),n+=1}return Hr(r)})),gf=Symbol.for("effect/Clock"),yf=Mr("effect/Clock"),wf={unsafeSchedule(t,e){const r=Bn(e);if(r>2147483647)return s;let n=!1;const i=setTimeout((()=>{n=!0,t()}),r);return()=>(clearTimeout(i),!n)}},_f=function(){const t=BigInt(1e6);if("undefined"==typeof performance||"function"!=typeof performance.now)return()=>BigInt(Date.now())*t;let e;return()=>(void 0===e&&(e=BigInt(Date.now())*t-BigInt(Math.round(1e6*performance.now()))),e+BigInt(Math.round(1e6*performance.now())))}(),vf=function(){const t="object"==typeof process&&"hrtime"in process&&"function"==typeof process.hrtime.bigint?process.hrtime:void 0;if(!t)return _f;const e=_f()-t.bigint();return()=>e+t.bigint()}();class Of{[gf]=gf;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return vf()}currentTimeMillis=Cu((()=>this.unsafeCurrentTimeMillis()));currentTimeNanos=Cu((()=>this.unsafeCurrentTimeNanos()));scheduler(){return Nu(wf)}sleep(t){return Ya((e=>{const r=wf.unsafeSchedule((()=>e(Tu)),t);return Wa(Cu(r))}))}}const Mf=()=>new Of,If="InvalidData",Ef="MissingData",kf="SourceUnavailable",Ff="Unsupported",Nf=Symbol.for("effect/ConfigError"),jf={_tag:"ConfigError",[Nf]:Nf},Cf=(t,e)=>{const r=Object.create(jf);return r._op="And",r.left=t,r.right=e,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Af=(t,e)=>{const r=Object.create(jf);return r._op="Or",r.left=t,r.right=e,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Rf=(t,e,r={pathDelim:"."})=>{const n=Object.create(jf);return n._op=If,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Invalid data at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},xf=(t,e,r={pathDelim:"."})=>{const n=Object.create(jf);return n._op=Ef,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Missing data at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},$f=(t,e,r,n={pathDelim:"."})=>{const s=Object.create(jf);return s._op=kf,s.path=t,s.message=e,s.cause=r,Object.defineProperty(s,"toString",{enumerable:!1,value(){return`(Source unavailable at ${c(this.path,sr(n.pathDelim))}: "${this.message}")`}}),s},Tf=(t,e,r={pathDelim:"."})=>{const n=Object.create(jf);return n._op=Ff,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},Lf=t(2,((t,e)=>{switch(t._op){case"And":return Cf(Lf(t.left,e),Lf(t.right,e));case"Or":return Af(Lf(t.left,e),Lf(t.right,e));case If:return Rf([...e,...t.path],t.message);case Ef:return xf([...e,...t.path],t.message);case kf:return $f([...e,...t.path],t.message,t.cause);case Ff:return Tf([...e,...t.path],t.message)}})),Df={_tag:"Empty"},Pf=t(2,((t,e)=>{let r=to(e),n=t;for(;"Cons"===r._tag;){const t=r.head;switch(t._tag){case"Empty":r=r.tail;break;case"AndThen":r=Zi(t.first,Zi(t.second,r.tail));break;case"MapName":n=Ye(n,t.f),r=r.tail;break;case"Nested":n=Oe(n,t.name),r=r.tail;break;case"Unnested":if(!c(Ce(n),Se(t.name)))return Ht(xf(n,`Expected ${t.name} to be in path in ConfigProvider#unnested`));n=xe(n),r=r.tail}}return Vt(n)})),Bf=(t,e)=>[...t,...e],qf=Symbol.for("effect/ConfigProvider"),Uf=Mr("effect/ConfigProvider"),Jf=Symbol.for("effect/ConfigProviderFlat"),Gf=t=>({[qf]:qf,pipe(){return rt(this,arguments)},...t}),Wf=t=>{const{pathDelim:e,seqDelim:r}=Object.assign({},{pathDelim:"_",seqDelim:","},t),n=()=>"undefined"!=typeof process&&"env"in process&&"object"==typeof process.env?process.env:{};return s=(t=>({[Jf]:Jf,patch:t.patch,load:(e,r,n=!0)=>t.load(e,r,n),enumerateChildren:t.enumerateChildren}))({load:(t,s,i=!0)=>{const o=(t=>c(t,sr(e)))(t),a=n();return c(o in a?ie(a[o]):se(),Mu((()=>xf(t,`Expected ${o} to exist in the process context`))),hu((e=>zf(e,t,s,r,i))))},enumerateChildren:t=>Cu((()=>{const r=n();return(t=>{const e=Ws(Js());for(const r of t)zs(e,r);return Vs(e)})(Object.keys(r).map((t=>t.toUpperCase().split(e))).filter((e=>{for(let r=0;r<t.length;r++){const n=c(t,je(r)),s=e[r];if(void 0===s||n!==s)return!1}return!0})).flatMap((e=>e.slice(t.length,t.length+1))))})),patch:Df}),Gf({load:t=>hu(Vf(s,[],t,!1),(e=>ae(Ce(e),{onNone:()=>su(xf([],`Expected a single value having structure: ${t}`)),onSome:Nu}))),flattened:s});var s},Vf=(t,e,r,n)=>{const s=r;switch(s._tag){case"Constant":return Nu(ze(s.value));case"Described":return ju((()=>Vf(t,e,s.config,n)));case"Fail":return su(xf(e,s.message));case"Fallback":return c(ju((()=>Vf(t,e,s.first,n))),Qa((r=>s.condition(r)?c(Vf(t,e,s.second,n),Qa((t=>su(Af(r,t))))):su(r))));case"Lazy":return ju((()=>Vf(t,e,s.config(),n)));case"MapOrFail":return ju((()=>c(Vf(t,e,s.original,n),hu(mu((t=>c(s.mapOrFail(t),Mu(Lf(((t,e)=>{let r=e;if("Nested"===r._tag){const e=t.slice();for(;"Nested"===r._tag;)e.push(r.name),r=r.config;return e}return t})(e,s.original))))))))));case"Nested":return ju((()=>Vf(t,Bf(e,ze(s.name)),s.config,n)));case"Primitive":return c(Pf(e,t.patch),hu((e=>c(t.load(e,s,n),hu((t=>{if(0===t.length){const t=c(ke(r=e)?ie(Re(r)):se(),he((()=>"<n/a>")));return su(xf([],`Expected ${s.description} with name ${t}`))}var r;return Nu(t)}))))));case"Sequence":return c(Pf(e,t.patch),hu((r=>c(t.enumerateChildren(r),hu(Kf),hu((r=>0===r.length?ju((()=>vu(Vf(t,e,s.config,!0),ze))):c(mu(r,(r=>Vf(t,Me(e,`[${r}]`),s.config,!0))),vu((t=>{const e=Ke(t);return ze(0===e.length?[]:e)})))))))));case"HashMap":return ju((()=>c(Pf(e,t.patch),hu((e=>c(t.enumerateChildren(e),hu((r=>c(r,mu((r=>Vf(t,Bf(e,ze(r)),s.valueConfig,n))),vu((t=>0===t.length?ze($i()):c(Yf(t),Ye((t=>(t=>{const e=js(_s());for(const r of t)Es(e,r[0],r[1]);return(r=e)._editable=!1,r;var r})(Pe(ve(r),t))))))))))))))));case"ZipWith":return ju((()=>c(Vf(t,e,s.left,n),ru,hu((r=>c(Vf(t,e,s.right,n),ru,hu((t=>{if(zt(r)&&zt(t))return su(Cf(r.left,t.left));if(zt(r)&&Yt(t))return su(r.left);if(Yt(r)&&zt(t))return su(t.left);if(Yt(r)&&Yt(t)){const n=c(e,sr(".")),i=Hf(e,n),[o,a]=((t,e,r,n)=>{const s=tr(r.length,(e=>e>=n.length?se():ie([t(e),e+1]))),i=tr(n.length,(t=>t>=r.length?se():ie([e(t),t+1])));return[Bf(r,s),Bf(n,i)]})(i,i,c(r.right,Ye(Vt)),c(t.right,Ye(Vt)));return c(o,Pe(a),mu((([t,e])=>c(Ju(t,e),vu((([t,e])=>s.zip(t,e)))))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")}))))))))}},Hf=(t,e)=>r=>Ht(xf(t,`The element at index ${r} in a sequence at path "${e}" was missing`)),zf=(t,e,r,n,s)=>s?c(((t,e)=>{const r=t.split(new RegExp(`\\s*${(t=>t.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"))(e)}\\s*`));return r})(t,n),mu((t=>r.parse(t.trim()))),Mu(Lf(e))):c(r.parse(t),Ou({onFailure:Lf(e),onSuccess:ze})),Yf=t=>Object.keys(t[0]).map((e=>t.map((t=>t[e])))),Kf=t=>c(mu(t,Zf),Ou({onFailure:()=>[],onSuccess:De(ir)}),ru,vu(Qt)),Qf=/^(\[(\d+)\])$/,Zf=t=>{const e=t.match(Qf);if(null!==e){const t=e[2];return c(void 0!==t&&t.length>0?ie(t):se(),me(Xf))}return se()},Xf=t=>{const e=Number.parseInt(t);return Number.isNaN(e)?se():ie(e)},tb=Symbol.for("effect/Console"),eb=Mr("effect/Console"),rb={[tb]:tb,assert:(t,...e)=>Cu((()=>{console.assert(t,...e)})),clear:Cu((()=>{console.clear()})),count:t=>Cu((()=>{console.count(t)})),countReset:t=>Cu((()=>{console.countReset(t)})),debug:(...t)=>Cu((()=>{console.debug(...t)})),dir:(t,e)=>Cu((()=>{console.dir(t,e)})),dirxml:(...t)=>Cu((()=>{console.dirxml(...t)})),error:(...t)=>Cu((()=>{console.error(...t)})),group:t=>Cu(t?.collapsed?()=>console.groupCollapsed(t?.label):()=>console.group(t?.label)),groupEnd:Cu((()=>{console.groupEnd()})),info:(...t)=>Cu((()=>{console.info(...t)})),log:(...t)=>Cu((()=>{console.log(...t)})),table:(t,e)=>Cu((()=>{console.table(t,e)})),time:t=>Cu((()=>console.time(t))),timeEnd:t=>Cu((()=>console.timeEnd(t))),timeLog:(t,...e)=>Cu((()=>{console.timeLog(t,...e)})),trace:(...t)=>Cu((()=>{console.trace(...t)})),warn:(...t)=>Cu((()=>{console.warn(...t)})),unsafe:console},nb=Symbol.for("effect/Random"),sb=Mr("effect/Random");class ib{seed;[nb]=nb;PRNG;constructor(t){this.seed=t,this.PRNG=new v(t)}get next(){return Cu((()=>this.PRNG.number()))}get nextBoolean(){return vu(this.next,(t=>t>.5))}get nextInt(){return Cu((()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER)))}nextRange(t,e){return vu(this.next,(r=>(e-t)*r+t))}nextIntBetween(t,e){return Cu((()=>this.PRNG.integer(e-t)+t))}shuffle(t){return ob(t,(t=>this.nextIntBetween(0,t)))}}const ob=(t,e)=>ju((()=>c(Cu((()=>Array.from(t))),hu((t=>{const r=[];for(let e=t.length;e>=2;e-=1)r.push(e);return c(r,Su((r=>c(e(r),vu((e=>cb(t,r-1,e)))))),Ga(Gr(t)))}))))),cb=(t,e,r)=>{const n=t[e];return t[e]=t[r],t[r]=n,t},ab=t=>new ib(A(t)),ub=Symbol.for("effect/Tracer"),hb=t=>({[ub]:ub,...t}),lb=Mr("effect/Tracer"),fb=Mr("effect/ParentSpan"),bb=function(){return function(t){let e="";for(let r=0;r<t;r++)e+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return e}}();class db{name;parent;context;startTime;kind;_tag="Span";spanId;traceId="native";sampled=!0;status;attributes;events=[];links;constructor(t,e,r,n,s,i){this.name=t,this.parent=e,this.context=r,this.startTime=s,this.kind=i,this.status={_tag:"Started",startTime:s},this.attributes=new Map,this.traceId="Some"===e._tag?e.value.traceId:bb(32),this.spanId=bb(16),this.links=Array.from(n)}end(t,e){this.status={_tag:"Ended",endTime:t,exit:e,startTime:this.status.startTime}}attribute(t,e){this.attributes.set(t,e)}event(t,e,r){this.events.push([t,e,r??{}])}addLinks(t){this.links.push(...t)}}const pb=hb({span:(t,e,r,n,s,i)=>new db(t,e,r,n,s,i),context:t=>t()}),mb=c(Er(),Fr(yf,Mf()),Fr(eb,rb),Fr(sb,ab(Math.random())),Fr(Uf,Wf()),Fr(lb,pb)),Sb=f(Symbol.for("effect/DefaultServices/currentServices"),(()=>hh(mb))),gb=t=>(t=>Ua((e=>t(e.currentDefaultServices))))((e=>t(e.unsafeMap.get(yf.key)))),yb=gb((t=>t.currentTimeMillis)),wb=gb,_b=Symbol.for("effect/FiberRefs");class vb{locals;[_b]=_b;constructor(t){this.locals=t}pipe(){return rt(this,arguments)}}const Ob=t(3,((t,e,r)=>{const n=new Map(t.locals);return r.locals.forEach(((t,r)=>{const s=t[0][1];if(!t[0][0][U](e)){if(!n.has(r)){if(J(s,r.initial))return;return void n.set(r,[[e,r.join(r.initial,s)]])}const i=n.get(r),[o,c]=((t,e,r,n=!1)=>{const s=t;let i,o=e,c=r,a=n;for(;void 0===i;)if(ke(o)&&ke(c)){const t=Ae(o)[0],e=xe(o),r=Ae(c)[0],n=Ae(c)[1],s=xe(c);t.startTimeMillis<r.startTimeMillis?(c=s,a=!0):t.startTimeMillis>r.startTimeMillis?o=e:t.id<r.id?(c=s,a=!0):t.id>r.id?o=e:i=[n,a]}else i=[s.initial,!0];return i})(r,i,t);if(c){const t=r.diff(o,s),c=i[0][1],a=r.join(c,r.patch(t)(c));if(!J(c,a)){let t;const s=i[0][0];t=s[U](e)?[[s,a],...i.slice(1)]:[[e,a],...i],n.set(r,t)}}}})),new vb(n)})),Mb=t(2,((t,e)=>{const r=new Map;return Ib(t,r,e),new vb(r)})),Ib=(t,e,r)=>{t.locals.forEach(((t,n)=>{const s=t[0][1],i=n.patch(n.fork)(s);J(s,i)?e.set(n,t):e.set(n,[[r,i],...t])}))},Eb=t(2,((t,e)=>{const r=new Map(t.locals);return r.delete(e),new vb(r)})),kb=t(2,((t,e)=>t.locals.has(e)?ie(Ae(t.locals.get(e))[1]):se())),Fb=t(2,((t,e)=>c(kb(t,e),he((()=>e.initial))))),Nb=t(2,((t,{fiberId:e,fiberRef:r,value:n})=>{if(0===t.locals.size)return new vb(new Map([[r,[[e,n]]]]));const s=new Map(t.locals);return jb(s,e,r,n),new vb(s)})),jb=(t,e,r,n)=>{const s=t.get(r)??[];let i;if(ke(s)){const[t,r]=Ae(s);if(t[U](e)){if(J(r,n))return;i=[[e,n],...s.slice(1)]}else i=[[e,n],...s]}else i=[[e,n]];t.set(r,i)},Cb=t(2,((t,{entries:e,forkAs:r})=>{if(0===t.locals.size)return new vb(new Map(e));const n=new Map(t.locals);return void 0!==r&&Ib(t,n,r),e.forEach((([t,e])=>{1===e.length?jb(n,e[0][0],t,e[0][1]):e.forEach((([e,r])=>{jb(n,e,t,r)}))})),new vb(n)})),Ab=Fb,Rb=Cb,xb=function(){return t=new Map,new vb(t);var t},$b=Yu,Tb=Ku,Lb=Qu,Db=ne(c(ir,re((t=>t.ordinal)))),Pb=t=>t.replace(/[\s="]/g,"_"),Bb=t=>e=>`${Pb(e.label)}=${t-e.startTime}ms`,qb=Mt,Ub=Ft;class Jb extends Ub{}const Gb=Symbol.for("effect/Readable"),Wb=Symbol.for("effect/Ref"),Vb={_A:t=>t};class Hb extends Jb{ref;commit(){return this.get}[Wb]=Vb;[Gb]=Gb;constructor(t){super(),this.ref=t,this.get=Cu((()=>bi(this.ref)))}get;modify(t){return Cu((()=>{const e=bi(this.ref),[r,n]=t(e);return e!==n&&di(n)(this.ref),r}))}}const zb=t=>new Hb(li(t)),Yb=t=>Cu((()=>zb(t))),Kb=t=>t.get,Qb=t(2,((t,e)=>t.modify((()=>[void 0,e])))),Zb=t(2,((t,e)=>t.modify(e))),Xb=t(2,((t,e)=>t.modify((t=>[void 0,e(t)])))),td="Empty",ed="Remove",rd="Update",nd="AndThen",sd={_tag:td},id=(t,e)=>{const r=new Map(t.locals);let n=sd;for(const[t,s]of e.locals.entries()){const e=Ae(s)[1],i=r.get(t);if(void 0!==i){const r=Ae(i)[1];J(r,e)||(n=od({_tag:rd,fiberRef:t,patch:t.diff(r,e)})(n))}else n=od({_tag:"Add",fiberRef:t,value:e})(n);r.delete(t)}for(const[t]of r.entries())n=od({_tag:ed,fiberRef:t})(n);return n},od=t(2,((t,e)=>({_tag:nd,first:t,second:e}))),cd=t(3,((t,e,r)=>{let n=r,s=ze(t);for(;ke(s);){const t=Ae(s),r=xe(s);switch(t._tag){case td:s=r;break;case"Add":n=Nb(n,{fiberId:e,fiberRef:t.fiberRef,value:t.value}),s=r;break;case ed:n=Eb(n,t.fiberRef),s=r;break;case rd:{const i=Fb(n,t.fiberRef);n=Nb(n,{fiberId:e,fiberRef:t.fiberRef,value:t.fiberRef.patch(t.patch)(i)}),s=r;break}case nd:s=Oe(t.first)(Oe(t.second)(r))}}return n})),ad="effect/MetricLabel",ud=Symbol.for(ad);class hd{key;value;[ud]=ud;_hash;constructor(t,e){this.key=t,this.value=e,this._hash=D(ad+this.key+this.value)}[C](){return this._hash}[U](t){return fd(t)&&this.key===t.key&&this.value===t.value}pipe(){return rt(this,arguments)}}const ld=(t,e)=>new hd(t,e),fd=t=>m(t,ud),bd=t(2,((t,e)=>du(t,{onFailure:t=>{const r=e(t);switch(r._tag){case"None":return ou(t);case"Some":return r.value}},onSuccess:Nu}))),dd=wb,pd=t(2,((t,e)=>pu(t,{onFailure:t=>Nu(e.onFailure(t)),onSuccess:t=>Nu(e.onSuccess(t))}))),md=Ua((t=>Nu(t.getFiberRefs()))),Sd=t=>(...e)=>{const r=fe(t);let n;for(let t=0,r=e.length;t<r;t++){const r=e[t];Qc(r)&&(n=void 0!==n?Kc(n,r):r,e=[...e.slice(0,t),...e.slice(t+1)],t--)}return void 0===n&&(n=Wc),Ua((t=>(t.log(e,n,r),Tu)))},gd=Sd(Tb),yd=Sd($b),wd=t(2,((t,e)=>du(t,{onFailure:t=>cu((()=>e(t))),onSuccess:Nu}))),_d=t(2,((t,e)=>ku(t,(()=>Cu(e))))),vd=t(3,((t,e,r)=>ml((n=>Sl(t,Fr(n,e,r)))))),Od=t(3,((t,e,r)=>ml((n=>hu(r,(r=>Sl(t,c(n,Fr(e,r))))))))),Md=t=>{const e=Mn(t);return gb((t=>t.sleep(e)))},Id=Nu(se()),Ed=t(3,((t,e,r)=>hu(e,(n=>hu(t,(t=>vu(e,(e=>[r(n,e),t])))))))),kd=t(2,((t,e)=>du(t,{onFailure:t=>{const r=na(t);switch(r._tag){case"Left":return Wu(e(r.left),ou(t));case"Right":return ou(t)}},onSuccess:Nu}))),Fd=t(2,((t,e)=>du(t,{onFailure:t=>Wu(e(t),ou(t)),onSuccess:Nu}))),Nd=t(2,((t,e)=>ju((()=>e()?vu(t,ie):Nu(se()))))),jd="Sequential",Cd="Parallel",Ad={_tag:jd},Rd={_tag:Cd},xd=Ad,$d=Rd,Td=t=>({_tag:"ParallelN",parallelism:t}),Ld=id,Dd=cd,Pd="effect/FiberStatus",Bd=Symbol.for(Pd),qd="Done",Ud="Running",Jd="Suspended",Gd=D(`${Pd}-${qd}`);class Wd{[Bd]=Bd;_tag=qd;[C](){return Gd}[U](t){return zd(t)&&t._tag===qd}}class Vd{runtimeFlags;[Bd]=Bd;_tag=Ud;constructor(t){this.runtimeFlags=t}[C](){return c(A(Pd),x(A(this._tag)),x(A(this.runtimeFlags)),q(this))}[U](t){return zd(t)&&t._tag===Ud&&this.runtimeFlags===t.runtimeFlags}}class Hd{runtimeFlags;blockingOn;[Bd]=Bd;_tag=Jd;constructor(t,e){this.runtimeFlags=t,this.blockingOn=e}[C](){return c(A(Pd),x(A(this._tag)),x(A(this.runtimeFlags)),x(A(this.blockingOn)),q(this))}[U](t){return zd(t)&&t._tag===Jd&&this.runtimeFlags===t.runtimeFlags&&J(this.blockingOn,t.blockingOn)}}const zd=t=>m(t,Bd),Yd=new Wd,Kd=t=>new Vd(t),Qd=Symbol.for("effect/Micro"),Zd=Symbol.for("effect/Micro/MicroExit"),Xd=Symbol.for("effect/Micro/MicroCause"),tp={_E:e};class ep extends globalThis.Error{_tag;traces;[Xd];constructor(t,e,r){const n=`MicroCause.${t}`;let s,i,o;if(e instanceof globalThis.Error){s=`(${n}) ${e.name}`,i=e.message;const t=i.split("\n").length;o=e.stack?`(${n}) ${e.stack.split("\n").slice(0,t+3).join("\n")}`:`${s}: ${i}`}else s=n,i=K(e,0),o=`${s}: ${i}`;r.length>0&&(o+=`\n ${r.join("\n ")}`),super(i),this._tag=t,this.traces=r,this[Xd]=tp,this.name=s,this.stack=o}pipe(){return rt(this,arguments)}toString(){return this.stack}[H](){return this.stack}}class rp extends ep{defect;constructor(t,e=[]){super("Die",t,e),this.defect=t}}class np extends ep{constructor(t=[]){super("Interrupt","interrupted",t)}}const sp=(t=[])=>new np(t),ip=Symbol.for("effect/Micro/MicroFiber"),op={_A:e,_E:e};class cp{context;interruptible;[ip];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(t,e=!0){this.context=t,this.interruptible=e,this[ip]=op}getRef(t){return(e=this.context).unsafeMap.has((r=t).key)?e.unsafeMap.get(r.key):yr(r);var e,r}addObserver(t){return this._exit?(t(this._exit),o):(this._observers.push(t),()=>{const e=this._observers.indexOf(t);e>=0&&this._observers.splice(e,1)})}_interrupted=!1;unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(Ap))}unsafePoll(){return this._exit}evaluate(t){if(this._exit)return;if(void 0!==this._yielded){const t=this._yielded;this._yielded=void 0,t()}const e=this.runLoop(t);if(e===pp)return;const r=ap.interruptChildren&&ap.interruptChildren(this);if(void 0!==r)return this.evaluate(kp(r,(()=>e)));this._exit=e;for(let t=0;t<this._observers.length;t++)this._observers[t](e);this._observers.length=0}runLoop(t){let e=!1,r=t;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!e&&this.getRef(Bp).shouldYield(this)){e=!0;const t=r;r=kp(Mp,(()=>t))}if(r=r[lp](this),r===pp){const t=this._yielded;return Zd in t?(this._yielded=void 0,t):pp}}}catch(t){return m(r,lp)?Rp(t):Rp(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const e=this._stack.pop();if(!e)return;const r=e[dp]&&e[dp](this);if(r)return{[t]:r};if(e[t])return e}}_yielded=void 0;yieldWith(t){return this._yielded=t,pp}children(){return this._children??=new Set}}const ap=f("effect/Micro/fiberMiddleware",(()=>({interruptChildren:void 0}))),up=Symbol.for("effect/Micro/identifier"),hp=Symbol.for("effect/Micro/args"),lp=Symbol.for("effect/Micro/evaluate"),fp=Symbol.for("effect/Micro/successCont"),bp=Symbol.for("effect/Micro/failureCont"),dp=Symbol.for("effect/Micro/ensureCont"),pp=Symbol.for("effect/Micro/Yield"),mp={_A:e,_E:e,_R:e},Sp={...qb,_op:"Micro",[Qd]:mp,pipe(){return rt(this,arguments)},[Symbol.iterator](){return new _(new I(this))},toJSON(){return{_id:"Micro",op:this[up],...hp in this?{args:this[hp]}:void 0}},toString(){return Y(this)},[H](){return Y(this)}};function gp(){return Rp("Micro.evaluate: Not implemented")}const yp=t=>({...Sp,[up]:t.op,[lp]:t.eval??gp,[fp]:t.contA,[bp]:t.contE,[dp]:t.ensure}),wp=t=>{const e=yp(t);return function(){const r=Object.create(e);return r[hp]=!1===t.single?arguments:arguments[0],r}},_p=t=>{const e={...yp(t),[Zd]:Zd,_tag:t.op,get[t.prop](){return this[hp]},toJSON(){return{_id:"MicroExit",_tag:t.op,[t.prop]:this[hp]}},[U](e){return Np(e)&&e._tag===t.op&&J(this[hp],e[hp])},[C](){return q(this,x(D(t.op))(A(this[hp])))}};return function(t){const r=Object.create(e);return r[hp]=t,r[fp]=void 0,r[bp]=void 0,r[dp]=void 0,r}},vp=_p({op:"Success",prop:"value",eval(t){const e=t.getCont(fp);return e?e[fp](this[hp],t):t.yieldWith(this)}}),Op=_p({op:"Failure",prop:"cause",eval(t){let e=t.getCont(bp);for(;"Interrupt"===this[hp]._tag&&e&&t.interruptible;)e=t.getCont(bp);return e?e[bp](this[hp],t):t.yieldWith(this)}}),Mp=wp({op:"Yield",eval(t){let e=!1;return t.getRef(Bp).scheduleTask((()=>{e||t.evaluate(xp)}),this[hp]??0),t.yieldWith((()=>{e=!0}))}})(0),Ip=vp(void 0),Ep=wp({op:"WithMicroFiber",eval(t){return this[hp](t)}}),kp=t(2,((t,e)=>{const r=Object.create(Fp);return r[hp]=t,r[fp]=e,r})),Fp=yp({op:"OnSuccess",eval(t){return t._stack.push(this),this[hp]}}),Np=t=>m(t,Zd),jp=vp,Cp=Op,Ap=Cp(sp()),Rp=t=>Cp(((t,e=[])=>new rp(t,e))(t)),xp=jp(void 0),$p="setImmediate"in globalThis?globalThis.setImmediate:t=>setTimeout(t,0);class Tp{tasks=[];running=!1;scheduleTask(t,e){this.tasks.push(t),this.running||(this.running=!0,$p(this.afterScheduled))}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){const t=this.tasks;this.tasks=[];for(let e=0,r=t.length;e<r;e++)t[e]()}shouldYield(t){return t.currentOpCount>=t.getRef(Pp)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const Lp=t(2,((t,e)=>Ep((r=>{const n=r.context;return r.context=e(n),Jp(t,(()=>(r.context=n,Ip)))})))),Dp=t(2,((t,e)=>Lp(t,Ar(e))));class Pp extends(Rr()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048})){}class Bp extends(Rr()("effect/Micro/currentScheduler",{defaultValue:()=>new Tp})){}const qp=t(2,((t,e)=>{const r=Object.create(Up);return r[hp]=t,r[fp]=e.onSuccess,r[bp]=e.onFailure,r})),Up=yp({op:"OnSuccessAndFailure",eval(t){return t._stack.push(this),this[hp]}}),Jp=t(2,((t,e)=>Vp((r=>qp(r(t),{onFailure:t=>kp(e(Cp(t)),(()=>Op(t))),onSuccess:t=>kp(e(jp(t)),(()=>vp(t)))}))))),Gp=wp({op:"SetInterruptible",ensure(t){if(t.interruptible=this[hp],t._interrupted&&t.interruptible)return()=>Ap}}),Wp=t=>Ep((e=>e.interruptible?t:(e.interruptible=!0,e._stack.push(Gp(!1)),e._interrupted?Ap:t))),Vp=t=>Ep((r=>r.interruptible?(r.interruptible=!1,r._stack.push(Gp(!0)),t(Wp)):t(e)));class Hp{buckets=[];scheduleTask(t,e){const r=this.buckets.length;let n,s=0;for(;s<r&&this.buckets[s][0]<=e;s++)n=this.buckets[s];n&&n[0]===e?n[1].push(t):s===r?this.buckets.push([e,[t]]):this.buckets.splice(s,0,[e,[t]])}}class zp{maxNextTickBeforeTimer;running=!1;tasks=new Hp;constructor(t){this.maxNextTickBeforeTimer=t}starveInternal(t){const e=this.tasks.buckets;this.tasks.buckets=[];for(const[t,r]of e)for(let t=0;t<r.length;t++)r[t]();0===this.tasks.buckets.length?this.running=!1:this.starve(t)}starve(t=0){t>=this.maxNextTickBeforeTimer?setTimeout((()=>this.starveInternal(0)),0):Promise.resolve(void 0).then((()=>this.starveInternal(t+1)))}shouldYield(t){return t.currentOpCount>t.getFiberRef(ph)&&t.getFiberRef(dh)}scheduleTask(t,e){this.tasks.scheduleTask(t,e),this.running||(this.running=!0,this.starve())}}const Yp=f(Symbol.for("effect/Scheduler/defaultScheduler"),(()=>new zp(2048))),Kp=f(Symbol.for("effect/FiberRef/currentScheduler"),(()=>ch(Yp))),Qp=f(Symbol.for("effect/FiberRef/currentRequestMap"),(()=>ch(new Map))),Zp=(t,e,r,n)=>{switch(t){case void 0:return e();case"unbounded":return r();case"inherit":return rh(wh,(t=>"unbounded"===t?r():t>1?n(t):e()));default:return t>1?n(t):e()}},Xp="InterruptSignal",tm="Stateful",em="Resume",rm="YieldNow",nm=t=>({_tag:Xp,cause:t}),sm=t=>({_tag:tm,onFiber:t}),im=t=>({_tag:em,effect:t}),om=Symbol.for("effect/FiberScope");class cm{[om]=om;fiberId=ji;roots=new Set;add(t,e){this.roots.add(e),e.addObserver((()=>{this.roots.delete(e)}))}}class am{fiberId;parent;[om]=om;constructor(t,e){this.fiberId=t,this.parent=e}add(t,e){this.parent.tell(sm((t=>{t.addChild(e),e.addObserver((()=>{t.removeChild(e)}))})))}}const um=f(Symbol.for("effect/FiberScope/Global"),(()=>new cm)),hm=Symbol.for("effect/Fiber"),lm={_E:t=>t,_A:t=>t},fm=Symbol.for("effect/Fiber"),bm=t=>t.await,dm=t=>t.inheritAll,pm=t=>Gu(fu(t.await),t.inheritAll),mm="effect/FiberCurrent",Sm=Symbol.for("effect/Logger"),gm={_Message:t=>t,_Output:t=>t},ym=t=>({[Sm]:gm,log:t,pipe(){return rt(this,arguments)}}),wm=/^[^\s"=]*$/,_m=(t,e)=>({annotations:r,cause:n,date:s,fiberId:i,logLevel:o,message:c,spans:a})=>{const u=(e,r)=>`${Pb(e)}=${(e=>e.match(wm)?e:t(e))(r)}`,h=(t,e)=>" "+u(t,e);let l=u("timestamp",s.toISOString());l+=h("level",o.label),l+=h("fiber",Ni(i));const f=(b=c,Array.isArray(b)?b:[b]);var b;for(let t=0;t<f.length;t++)l+=h("message",K(f[t],e));(t=>t._tag===Lc)(n)||(l+=h("cause",wa(n,{renderErrorCause:!0})));for(const t of a)l+=" "+Bb(s.getTime())(t);for(const[t,n]of r)l+=h(t,K(n,e));return l},vm=ym(_m((t=>`"${t.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`)));"object"==typeof process&&null!==process&&"object"==typeof process.stdout&&null!==process.stdout&&process;const Om="effect/MetricBoundaries",Mm=Symbol.for(Om);class Im{values;[Mm]=Mm;constructor(t){this.values=t,this._hash=c(D(Om),x(B(this.values)))}_hash;[C](){return this._hash}[U](t){return Em(t)&&J(this.values,t.values)}pipe(){return rt(this,arguments)}}const Em=t=>m(t,Mm),km=t=>{const e=c(t,Ie(Jr(Number.POSITIVE_INFINITY)),nr);return new Im(e)},Fm=t=>c(_e(t.count-1,(e=>t.start*Math.pow(t.factor,e))),Yr,km),Nm=Symbol.for("effect/MetricKeyType"),jm="effect/MetricKeyType/Counter",Cm=Symbol.for(jm),Am=Symbol.for("effect/MetricKeyType/Frequency"),Rm=Symbol.for("effect/MetricKeyType/Gauge"),xm="effect/MetricKeyType/Histogram",$m=Symbol.for(xm),Tm=Symbol.for("effect/MetricKeyType/Summary"),Lm={_In:t=>t,_Out:t=>t};class Dm{incremental;bigint;[Nm]=Lm;[Cm]=Cm;constructor(t,e){this.incremental=t,this.bigint=e,this._hash=D(jm)}_hash;[C](){return this._hash}[U](t){return Bm(t)}pipe(){return rt(this,arguments)}}class Pm{boundaries;[Nm]=Lm;[$m]=$m;constructor(t){this.boundaries=t,this._hash=c(D(xm),x(A(this.boundaries)))}_hash;[C](){return this._hash}[U](t){return qm(t)&&J(this.boundaries,t.boundaries)}pipe(){return rt(this,arguments)}}const Bm=t=>m(t,Cm),qm=t=>m(t,$m),Um=Symbol.for("effect/MetricKey"),Jm={_Type:t=>t},Gm=er(J);class Wm{name;keyType;description;tags;[Um]=Jm;constructor(t,e,r,n=[]){this.name=t,this.keyType=e,this.description=r,this.tags=n,this._hash=c(D(this.name+this.description),x(A(this.keyType)),x(B(this.tags)))}_hash;[C](){return this._hash}[U](t){return Vm(t)&&this.name===t.name&&J(this.keyType,t.keyType)&&J(this.description,t.description)&&Gm(this.tags,t.tags)}pipe(){return rt(this,arguments)}}const Vm=t=>m(t,Um),Hm=t(2,((t,e)=>0===e.length?t:new Wm(t.name,t.keyType,t.description,Ve(t.tags,e)))),zm=Symbol.for("effect/MetricState"),Ym="effect/MetricState/Counter",Km=Symbol.for(Ym),Qm="effect/MetricState/Frequency",Zm=Symbol.for(Qm),Xm="effect/MetricState/Gauge",tS=Symbol.for(Xm),eS="effect/MetricState/Histogram",rS=Symbol.for(eS),nS="effect/MetricState/Summary",sS=Symbol.for(nS),iS={_A:t=>t};class oS{count;[zm]=iS;[Km]=Km;constructor(t){this.count=t}[C](){return c(A(Ym),x(A(this.count)),q(this))}[U](t){return fS(t)&&this.count===t.count}pipe(){return rt(this,arguments)}}const cS=er(J);class aS{occurrences;[zm]=iS;[Zm]=Zm;constructor(t){this.occurrences=t}_hash;[C](){return c(D(Qm),x(B(ve(this.occurrences.entries()))),q(this))}[U](t){return bS(t)&&cS(ve(this.occurrences.entries()),ve(t.occurrences.entries()))}pipe(){return rt(this,arguments)}}class uS{value;[zm]=iS;[tS]=tS;constructor(t){this.value=t}[C](){return c(A(Xm),x(A(this.value)),q(this))}[U](t){return dS(t)&&this.value===t.value}pipe(){return rt(this,arguments)}}class hS{buckets;count;min;max;sum;[zm]=iS;[rS]=rS;constructor(t,e,r,n,s){this.buckets=t,this.count=e,this.min=r,this.max=n,this.sum=s}[C](){return c(A(eS),x(A(this.buckets)),x(A(this.count)),x(A(this.min)),x(A(this.max)),x(A(this.sum)),q(this))}[U](t){return pS(t)&&J(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return rt(this,arguments)}}class lS{error;quantiles;count;min;max;sum;[zm]=iS;[sS]=sS;constructor(t,e,r,n,s,i){this.error=t,this.quantiles=e,this.count=r,this.min=n,this.max=s,this.sum=i}[C](){return c(A(nS),x(A(this.error)),x(A(this.quantiles)),x(A(this.count)),x(A(this.min)),x(A(this.max)),x(A(this.sum)),q(this))}[U](t){return mS(t)&&this.error===t.error&&J(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return rt(this,arguments)}}const fS=t=>m(t,Km),bS=t=>m(t,Zm),dS=t=>m(t,tS),pS=t=>m(t,rS),mS=t=>m(t,sS),SS=Symbol.for("effect/MetricHook"),gS={_In:t=>t,_Out:t=>t},yS=t=>({[SS]:gS,pipe(){return rt(this,arguments)},...t}),wS=BigInt(0),_S=(t,e,r)=>{const n=r.length;if(!ke(e))return[];const s=e[0],i=e.slice(1),o=vS(t,n,se(),0,s,r),c=ze(o);return i.forEach((e=>{c.push(vS(t,n,o.value,o.consumed,e,o.rest))})),Ye(c,(t=>[t.quantile,t.value]))},vS=(t,e,r,n,s,i)=>{let o=t,c=e,a=r,u=n,h=s,l=i,f=t,b=e,d=r,p=n,m=s,S=i;for(;;){if(!ke(l))return{quantile:h,value:se(),consumed:u,rest:[]};if(1===h)return{quantile:h,value:ie(Re(l)),consumed:u+l.length,rest:[]};const t=Ae(l),e=$e(l,(e=>e===t)),r=h*c,n=o/2*r,s=u+e[0].length,i=Math.abs(s-r);if(s<r-n)f=o,b=c,d=Ce(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;else{if(s>r+n)return{quantile:h,value:oe(a)?ie(t):a,consumed:u,rest:l};switch(a._tag){case"None":f=o,b=c,d=Ce(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;continue;case"Some":if(i<Math.abs(r-a.value)){f=o,b=c,d=Ce(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;continue}return{quantile:h,value:ie(a.value),consumed:u,rest:l}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},OS=Symbol.for("effect/MetricPair"),MS={_Type:t=>t},IS=(t,e)=>({[OS]:MS,metricKey:t,metricState:e,pipe(){return rt(this,arguments)}}),ES=Symbol.for("effect/MetricRegistry");class kS{[ES]=ES;map=Wl();snapshot(){const t=[];for(const[e,r]of this.map)t.push(IS(e,r.get()));return t}get(t){const e=c(this.map,Vl(t),be);if(null==e){if(Bm(t.keyType))return this.getCounter(t);if(m(t.keyType,Rm))return this.getGauge(t);if(m(t.keyType,Am))return this.getFrequency(t);if(qm(t.keyType))return this.getHistogram(t);if((t=>m(t,Tm))(t.keyType))return this.getSummary(t);throw new Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}return e}getCounter(t){let e=c(this.map,Vl(t),be);if(null==e){const r=(t=>{let e=t.keyType.bigint?wS:0;const r=t.keyType.incremental?t.keyType.bigint?t=>t>=wS:t=>t>=0:()=>!0,n=t=>{r(t)&&(e+=t)};return yS({get:()=>new oS(e),update:n,modify:n})})(t);c(this.map,zl(t))||c(this.map,Yl(t,r)),e=r}return e}getFrequency(t){let e=c(this.map,Vl(t),be);if(null==e){const r=(t=>{const e=new Map;for(const r of t.keyType.preregisteredWords)e.set(r,0);const r=t=>{const r=e.get(t)??0;e.set(t,r+1)};return yS({get:()=>new aS(e),update:r,modify:r})})(t);c(this.map,zl(t))||c(this.map,Yl(t,r)),e=r}return e}getGauge(t){let e=c(this.map,Vl(t),be);if(null==e){const r=((t,e)=>{let r=e;return yS({get:()=>new uS(r),update:t=>{r=t},modify:t=>{r+=t}})})(0,t.keyType.bigint?BigInt(0):0);c(this.map,zl(t))||c(this.map,Yl(t,r)),e=r}return e}getHistogram(t){let e=c(this.map,Vl(t),be);if(null==e){const r=(t=>{const e=t.keyType.boundaries.values,r=e.length,n=new Uint32Array(r+1),s=new Float64Array(r);let i=0,o=0,a=Number.MAX_VALUE,u=Number.MIN_VALUE;c(e,De(ir),Ye(((t,e)=>{s[e]=t})));const h=t=>{let e=0,c=r;for(;e!==c;){const r=Math.floor(e+(c-e)/2);t<=s[r]?c=r:e=r,c===e+1&&(t<=s[e]?c=e:e=c)}n[e]=n[e]+1,i+=1,o+=t,t<a&&(a=t),t>u&&(u=t)},l=()=>{const t=we(r);let e=0;for(let i=0;i<r;i++)e+=n[i],t[i]=[s[i],e];return t};return yS({get:()=>{return t={buckets:l(),count:i,min:a,max:u,sum:o},new hS(t.buckets,t.count,t.min,t.max,t.sum);var t},update:h,modify:h})})(t);c(this.map,zl(t))||c(this.map,Yl(t,r)),e=r}return e}getSummary(t){let e=c(this.map,Vl(t),be);if(null==e){const r=(t=>{const{error:e,maxAge:r,maxSize:n,quantiles:s}=t.keyType,i=c(s,De(ir)),o=we(n);let a=0,u=0,h=0,l=0,f=0;const b=t=>{const s=[];let c=0;for(;c!==n-1;){const e=o[c];if(null!=e){const[n,i]=e,o=xn(t-n);Wn(o,jn)&&Gn(o,r)&&s.push(i)}c+=1}return _S(e,i,De(s,ir))},d=(t,e)=>{n>0&&(a+=1,o[a%n]=[e,t]),l=0===u?t:Math.min(l,t),f=0===u?t:Math.max(f,t),u+=1,h+=t};return yS({get:()=>{return t={error:e,quantiles:b(Date.now()),count:u,min:l,max:f,sum:h},new lS(t.error,t.quantiles,t.count,t.min,t.max,t.sum);var t},update:([t,e])=>d(t,e),modify:([t,e])=>d(t,e)})})(t);c(this.map,zl(t))||c(this.map,Yl(t,r)),e=r}return e}}const FS=Symbol.for("effect/Metric"),NS={_Type:t=>t,_In:t=>t,_Out:t=>t},jS=f(Symbol.for("effect/Metric/globalMetricRegistry"),(()=>new kS)),CS=function(t,e,r,n){const s=Object.assign((t=>Au(t,(t=>LS(s,t)))),{[FS]:NS,keyType:t,unsafeUpdate:e,unsafeValue:r,unsafeModify:n,register(){return this.unsafeValue([]),this},pipe(){return rt(this,arguments)}});return s},AS=(t,e)=>RS(((t,e)=>new Wm(t,(t=>new Dm(t?.incremental??!1,t?.bigint??!1))(e),fe(e?.description)))(t,e)),RS=t=>{let e;const r=new WeakMap,n=n=>{if(0===n.length)return void 0!==e||(e=jS.get(t)),e;let s=r.get(n);return void 0!==s||(s=jS.get(Hm(t,n)),r.set(n,s)),s};return CS(t.keyType,((t,e)=>n(e).update(t)),(t=>n(t).get()),((t,e)=>n(e).modify(t)))},xS=(t,e,r)=>RS(((t,e,r)=>new Wm(t,(t=>new Pm(t))(e),fe(r)))(t,e,r)),$S=t(3,((t,e,r)=>TS(t,[ld(e,r)]))),TS=t(2,((t,e)=>CS(t.keyType,((r,n)=>t.unsafeUpdate(r,Ve(e,n))),(r=>t.unsafeValue(Ve(e,r))),((r,n)=>t.unsafeModify(r,Ve(e,n)))))),LS=t(2,((t,e)=>rh(Mh,(r=>Cu((()=>t.unsafeUpdate(e,r))))))),DS=t(2,((t,e)=>rh(Qp,(r=>Cu((()=>{if(r.has(t)){const n=r.get(t);n.state.completed||(n.state.completed=!0,fl(n.result,e))}})))))),PS=Symbol.for("effect/Supervisor"),BS={_T:t=>t};class qS{underlying;value0;[PS]=BS;constructor(t,e){this.underlying=t,this.value0=e}get value(){return this.value0}onStart(t,e,r,n){this.underlying.onStart(t,e,r,n)}onEnd(t,e){this.underlying.onEnd(t,e)}onEffect(t,e){this.underlying.onEffect(t,e)}onSuspend(t){this.underlying.onSuspend(t)}onResume(t){this.underlying.onResume(t)}map(t){return new qS(this,c(this.value,vu(t)))}zip(t){return new US(this,t)}}class US{left;right;_tag="Zip";[PS]=BS;constructor(t,e){this.left=t,this.right=e}get value(){return Ju(this.left.value,this.right.value)}onStart(t,e,r,n){this.left.onStart(t,e,r,n),this.right.onStart(t,e,r,n)}onEnd(t,e){this.left.onEnd(t,e),this.right.onEnd(t,e)}onEffect(t,e){this.left.onEffect(t,e),this.right.onEffect(t,e)}onSuspend(t){this.left.onSuspend(t),this.right.onSuspend(t)}onResume(t){this.left.onResume(t),this.right.onResume(t)}map(t){return new qS(this,c(this.value,vu(t)))}zip(t){return new US(this,t)}}const JS=t=>m(t,PS)&&S(t,"Zip");class GS{effect;[PS]=BS;constructor(t){this.effect=t}get value(){return this.effect}onStart(t,e,r,n){}onEnd(t,e){}onEffect(t,e){}onSuspend(t){}onResume(t){}map(t){return new qS(this,c(this.value,vu(t)))}zip(t){return new US(this,t)}onRun(t,e){return t()}}const WS=f("effect/Supervisor/none",(()=>new GS(Tu))),VS="Empty",HS="AddSupervisor",zS="RemoveSupervisor",YS="AndThen",KS={_tag:VS},QS=(t,e)=>({_tag:YS,first:t,second:e}),ZS=(t,e)=>J(t,e)?WS:JS(t)?ZS(t.left,e).zip(ZS(t.right,e)):t,XS=t=>J(t,WS)?ti():JS(t)?c(XS(t.left),ci(XS(t.right))):ei(t),tg=zo({empty:KS,patch:(t,e)=>((t,e)=>{let r=t,n=e;for(;cn(n);){const t=hn(n);switch(t._tag){case VS:n=dn(n);break;case HS:r=r.zip(t.supervisor),n=dn(n);break;case zS:r=ZS(r,t.supervisor),n=dn(n);break;case YS:n=Xr(t.first)(Xr(t.second)(dn(n)))}}return r})(e,Jr(t)),combine:QS,diff:(t,e)=>{if(J(t,e))return KS;const r=XS(t),n=XS(e),s=c(n,oi(r),ai(KS,((t,e)=>QS(t,{_tag:HS,supervisor:e})))),i=c(r,oi(n),ai(KS,((t,e)=>QS(t,{_tag:zS,supervisor:e}))));return QS(s,i)}}),eg=AS("effect_fiber_started",{incremental:!0}),rg=AS("effect_fiber_active"),ng=AS("effect_fiber_successes",{incremental:!0}),sg=AS("effect_fiber_failures",{incremental:!0}),ig=$S(xS("effect_fiber_lifetimes",Fm({start:.5,factor:2,count:35})),"time_unit","milliseconds"),og="Continue",cg="Yield",ag={_E:t=>t,_A:t=>t},ug=t=>{throw new Error(`BUG: FiberRuntime - ${K(t)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},hg=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),lg=f("effect/internal/fiberRuntime/yieldedOpChannel",(()=>({currentOp:null}))),fg={[ct]:(t,e,r)=>N((()=>e.effect_instruction_i1(r))),OnStep:(t,e,r)=>Qh(Qh(r)),[at]:(t,e,r)=>N((()=>e.effect_instruction_i2(r))),[St]:(t,e,r)=>(t.patchRuntimeFlags(t.currentRuntimeFlags,e.patch),ic(t.currentRuntimeFlags)&&t.isInterrupted()?Hh(t.getInterruptedCause()):Qh(r)),[bt]:(t,e,r)=>(N((()=>e.effect_instruction_i2(r))),N((()=>e.effect_instruction_i0()))?(t.pushStack(e),N((()=>e.effect_instruction_i1()))):Tu),[dt]:(t,e,r)=>{for(;;){const n=N((()=>e.effect_instruction_i0.next(r)));if(n.done)return Qh(n.value);const s=E(n.value);if(!Uh(s))return t.pushStack(e),s;if("Failure"===s._tag)return s;r=s.value}}},bg={[Xp]:(t,e,r,n)=>(t.processNewInterruptSignal(n.cause),ic(e)?Hh(n.cause):r),[em]:()=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[tm]:(t,e,r,n)=>(n.onFiber(t,Kd(e)),r),[rm]:(t,e,r)=>hu(Uu(),(()=>r))},dg=gt();class pg extends Jb{[hm]=lm;[fm]=ag;_fiberRefs;_fiberId;_queue=new Array;_children=null;_observers=new Array;_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(t,e,r){if(super(),this.currentRuntimeFlags=r,this._fiberId=t,this._fiberRefs=e,hc(r)){const t=this.getFiberRef(Mh);eg.unsafeUpdate(1,t),rg.unsafeUpdate(1,t)}this.refreshRefCache()}commit(){return pm(this)}id(){return this._fiberId}resume(t){this.tell(im(t))}get status(){return this.ask(((t,e)=>e))}get runtimeFlags(){return this.ask(((t,e)=>e._tag===qd?t.currentRuntimeFlags:e.runtimeFlags))}scope(){return new am((t=this).id(),t);var t}get children(){return this.ask((t=>Array.from(t.getChildren())))}getChildren(){return null===this._children&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(Eh)}fiberRefs(){return this.ask((t=>t.getFiberRefs()))}ask(t){return ju((()=>{const e=nl(this._fiberId);return this.tell(sm(((r,n)=>{fl(e,Cu((()=>t(r,n))))}))),ol(e)}))}tell(t){this._queue.push(t),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Ya((t=>{const e=e=>t(Nu(e));return this.tell(sm((t=>{null!==t._exitValue?e(this._exitValue):t.addObserver(e)}))),Cu((()=>this.tell(sm((t=>{t.removeObserver(e)})))))}),this.id())}get inheritAll(){return Ua(((t,e)=>{const r=t.id(),n=t.getFiberRefs(),s=e.runtimeFlags,i=this.getFiberRefs(),o=Ob(n,r,i);t.setFiberRefs(o);const a=t.getFiberRef(Vg);return(t=>{const e=new Da(ft);return e.effect_instruction_i0=t,e.effect_instruction_i1=void 0,e})(c(fc(s,a),mc(1),mc(16)))}))}get poll(){return Cu((()=>fe(this._exitValue)))}unsafePoll(){return this._exitValue}interruptAsFork(t){return Cu((()=>this.tell(nm(zc(t)))))}unsafeInterruptAsFork(t){this.tell(nm(zc(t)))}addObserver(t){null!==this._exitValue?t(this._exitValue):this._observers.push(t)}removeObserver(t){this._observers=this._observers.filter((e=>e!==t))}getFiberRefs(){return this.setFiberRef(Vg,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(t){this._fiberRefs=Eb(this._fiberRefs,t)}getFiberRef(t){return this._fiberRefs.locals.has(t)?this._fiberRefs.locals.get(t)[0][1]:t.initial}setFiberRef(t,e){this._fiberRefs=Nb(this._fiberRefs,{fiberId:this._fiberId,fiberRef:t,value:e}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Sb),this.currentTracer=this.currentDefaultServices.unsafeMap.get(lb.key),this.currentSupervisor=this.getFiberRef(Hg),this.currentScheduler=this.getFiberRef(Kp),this.currentContext=this.getFiberRef(bh),this.currentSpan=this.currentContext.unsafeMap.get(fb.key)}setFiberRefs(t){this._fiberRefs=t,this.refreshRefCache()}addChild(t){this.getChildren().add(t)}removeChild(t){this.getChildren().delete(t)}transferChildren(t){const e=this._children;if(this._children=null,null!==e&&e.size>0)for(const r of e)null===r._exitValue&&t.add(this.currentRuntimeFlags,r)}drainQueueOnCurrentThread(){let t=!0;for(;t;){let e=og;const r=globalThis[mm];globalThis[mm]=this;try{for(;e===og;)e=0===this._queue.length?"Done":this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[mm]=r}this._queue.length>0&&!this._running?(this._running=!0,e===cg?(this.drainQueueLaterOnExecutor(),t=!1):t=!0):t=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(dh))}drainQueueWhileRunning(t,e){let r=e;for(;this._queue.length>0;){const e=this._queue.splice(0,1)[0];r=bg[e._tag](this,t,r,e)}return r}isInterrupted(){return!((t=this.getFiberRef(Eh))._tag===Lc||ga(t,!0,((t,e)=>{switch(e._tag){case Lc:return ie(t);case Tc:case Dc:case Pc:return ie(!1);default:return se()}})));var t}addInterruptedCause(t){const e=this.getFiberRef(Eh);this.setFiberRef(Eh,Kc(e,t))}processNewInterruptSignal(t){this.addInterruptedCause(t),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(null===this._children||0===this._children.size)return!1;let t=!1;for(const e of this._children)e.tell(nm(zc(this.id()))),t=!0;return t}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const t=this._children.values();this._children=null;let e=!1;return Du({while:()=>!e,body:()=>{const r=t.next();return r.done?Cu((()=>{e=!0})):Wa(r.value.await)},step:()=>{}})}return null}reportExitValue(t){if(hc(this.currentRuntimeFlags)){const e=this.getFiberRef(Mh),r=this.id().startTimeMillis,n=Date.now();switch(ig.unsafeUpdate(n-r,e),rg.unsafeUpdate(-1,e),t._tag){case ut:ng.unsafeUpdate(1,e);break;case it:sg.unsafeUpdate(1,e)}}if("Failure"===t._tag){const e=this.getFiberRef(vh);ta(t.cause)||"Some"!==e._tag||this.log("Fiber terminated with an unhandled error",t.cause,e)}}setExitValue(t){this._exitValue=t,this.reportExitValue(t);for(let e=this._observers.length-1;e>=0;e--)this._observers[e](t);this._observers=[]}getLoggers(){return this.getFiberRef(yg)}log(t,e,r){const n=ce(r)?r.value:this.getFiberRef(Sh),s=this.getFiberRef(mg);if(Db(s,n))return;const i=this.getFiberRef(gh),o=this.getFiberRef(mh),c=this.getLoggers(),a=this.getFiberRefs();if(ni(c)>0){const r=Nr(this.getFiberRef(Sb),yf),s=new Date(r.unsafeCurrentTimeMillis());((t,e)=>{const r=tt.fiberRefs;tt.fiberRefs=t;try{return e()}finally{tt.fiberRefs=r}})(a,(()=>{for(const r of c)r.log({fiberId:this.id(),logLevel:n,message:t,cause:e,context:a,spans:i,annotations:o,date:s})}))}}evaluateMessageWhileSuspended(t){switch(t._tag){case rm:return cg;case Xp:return this.processNewInterruptSignal(t.cause),null!==this._asyncInterruptor&&(this._asyncInterruptor(Hh(t.cause)),this._asyncInterruptor=null),og;case em:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(t.effect),og;case tm:return t.onFiber(this,null!==this._exitValue?Yd:new Hd(this.currentRuntimeFlags,this._asyncBlockingOn)),og;default:return ug(t)}}evaluateEffect(t){this.currentSupervisor.onResume(this);try{let e=ic(this.currentRuntimeFlags)&&this.isInterrupted()?Hh(this.getInterruptedCause()):t;for(;null!==e;){const t=this.runLoop(e);if(t===hg){const t=lg.currentOp;lg.currentOp=null,t._op===mt?cc(this.currentRuntimeFlags,32)?(this.tell({_tag:rm}),this.tell(im(Zh)),e=null):e=Zh:t._op===nt&&(e=null)}else{this.currentRuntimeFlags=c(this.currentRuntimeFlags,sc(16));const r=this.interruptAllChildren();null!==r?e=hu(r,(()=>t)):(0===this._queue.length?this.setExitValue(t):this.tell(im(t)),e=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(t){if(this._running)this.tell(im(t));else{this._running=!0;const e=globalThis[mm];globalThis[mm]=this;try{this.evaluateEffect(t)}finally{this._running=!1,globalThis[mm]=e,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(t){this.tell(im(t))}patchRuntimeFlags(t,e){const r=bc(t,e);return globalThis[mm]=this,this.currentRuntimeFlags=r,r}initiateAsync(t,e){let r=!1;const n=t=>{r||(r=!0,this.tell(im(t)))};ic(t)&&(this._asyncInterruptor=n);try{e(n)}catch(t){n(ou(Hc(t)))}}pushStack(t){this._stack.push(t),"OnStep"===t._op&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){const t=this._stack.pop();if(t)return"OnStep"===t._op&&this._steps.pop(),t}getNextSuccessCont(){let t=this.popStack();for(;t;){if(t._op!==ot)return t;t=this.popStack()}}getNextFailCont(){let t=this.popStack();for(;t;){if(t._op!==ct&&t._op!==bt&&t._op!==dt)return t;t=this.popStack()}}[lt](t){return Cu((()=>jr(this.currentContext,t)))}Left(t){return su(t.left)}None(t){return su(new Ph)}Right(t){return Qh(t.right)}Some(t){return Qh(t.value)}Micro(t){return Ha((e=>{let r=e;const n=(t=>{const e=new cp(Bp.context(new Tp));return e.evaluate(t),e})(Dp(t,this.currentContext));return n.addObserver((t=>{if("Success"===t._tag)return r(Qh(t.value));switch(t.cause._tag){case"Interrupt":return r(Hh(zc(ji)));case"Fail":return r(su(t.cause.error));case"Die":return r(tu(t.cause.defect))}})),Ha((t=>{r=()=>{t(Tu)},n.unsafeInterrupt()}))}))}[ht](t){const e=N((()=>t.effect_instruction_i0())),r=this.getNextSuccessCont();return void 0!==r?(r._op in fg||ug(r),fg[r._op](this,r,e)):(lg.currentOp=Qh(e),hg)}[ut](t){const e=t,r=this.getNextSuccessCont();return void 0!==r?(r._op in fg||ug(r),fg[r._op](this,r,e.effect_instruction_i0)):(lg.currentOp=e,hg)}[it](t){const e=t.effect_instruction_i0,r=this.getNextFailCont();if(void 0===r)return lg.currentOp=Hh(e),hg;switch(r._op){case ot:case at:return ic(this.currentRuntimeFlags)&&this.isInterrupted()?Hh(oa(e)):N((()=>r.effect_instruction_i1(e)));case"OnStep":return ic(this.currentRuntimeFlags)&&this.isInterrupted()?Hh(oa(e)):Qh(Hh(e));case St:return this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),ic(this.currentRuntimeFlags)&&this.isInterrupted()?Hh(Kc(e,this.getInterruptedCause())):Hh(e);default:ug(r)}}[pt](t){return N((()=>t.effect_instruction_i0(this,Kd(this.currentRuntimeFlags))))}Blocked(t){const e=this.getFiberRefs(),r=this.currentRuntimeFlags;if(this._steps.length>0){const n=[],s=this._steps[this._steps.length-1];let i=this.popStack();for(;i&&"OnStep"!==i._op;)n.push(i),i=this.popStack();this.setFiberRefs(s.refs),this.currentRuntimeFlags=s.flags;const o=Ld(s.refs,e),c=fc(s.flags,r);return Qh($a(t.effect_instruction_i0,Ua((e=>{for(;n.length>0;)e.pushStack(n.pop());return e.setFiberRefs(Dd(e.id(),e.getFiberRefs())(o)),e.currentRuntimeFlags=bc(c)(e.currentRuntimeFlags),t.effect_instruction_i1}))))}return $u((e=>hu(Ig((t=>{const e=new Da("RunBlocked");return e.effect_instruction_i0=t,e})(t.effect_instruction_i0)),(()=>e(t.effect_instruction_i1)))))}RunBlocked(t){return Su((t=>{let e=to(t),r=Xi();for(;;){const[t,n]=so(e,[Mc(),Xi()],(([t,e],r)=>{const[n,s]=yc(r);return[Ec(t,n),eo(e,s)]}));if(r=wc(r,t),Qi(n))return io(r);e=n}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")})(t.effect_instruction_i0),(t=>Og((t=>Array.from(t.map))(t),(([t,e])=>{const r=new Map,n=[];for(const t of e){n.push(Vr(t));for(const e of t)r.set(e.request,e)}const s=n.flat();return ih(Xg(t.runAll(n),s,(()=>s.forEach((t=>{t.listeners.interrupted=!0})))),Qp,r)}),!1,!1)))}[ft](t){const e=t.effect_instruction_i0,r=this.currentRuntimeFlags,n=bc(r,e);if(ic(n)&&this.isInterrupted())return Hh(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,e),t.effect_instruction_i1){const e=fc(n,r);return this.pushStack(new La(e,t)),N((()=>t.effect_instruction_i1(r)))}return Zh}[ct](t){return this.pushStack(t),t.effect_instruction_i0}OnStep(t){return this.pushStack(t),t.effect_instruction_i0}[ot](t){return this.pushStack(t),t.effect_instruction_i0}[at](t){return this.pushStack(t),t.effect_instruction_i0}[nt](t){return this._asyncBlockingOn=t.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,t.effect_instruction_i0),lg.currentOp=t,hg}[mt](t){return this._isYielding=!1,lg.currentOp=t,hg}[bt](t){const e=t.effect_instruction_i1;return(0,t.effect_instruction_i0)()?(this.pushStack(t),e()):Zh}[dt](t){return fg[dt](this,t,void 0)}[st](t){return N((()=>t.commit()))}runLoop(t){let e=t;for(this.currentOpCount=0;;){if(2&this.currentRuntimeFlags&&this.currentSupervisor.onEffect(this,e),this._queue.length>0&&(e=this.drainQueueWhileRunning(this.currentRuntimeFlags,e)),!this._isYielding){this.currentOpCount+=1;const t=this.currentScheduler.shouldYield(this);if(!1!==t){this._isYielding=!0,this.currentOpCount=0;const r=e;e=hu(Uu({priority:t}),(()=>r))}}try{if(e=this.currentTracer.context((()=>{if(dg!==e[Ta]._V){const t=this.getFiberRef(Oh);"Some"===t._tag&&this.log(`Executing an Effect versioned ${e[Ta]._V} with a Runtime of version 3.19.14, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,Wc,t)}return this[e._op](e)}),this),e===hg){const t=lg.currentOp;return t._op===mt||t._op===nt?hg:(lg.currentOp=null,t._op===ut||t._op===it?t:Hh(Hc(t)))}}catch(t){e=e!==hg&&!m(e,"_op")||!(e._op in this)?eu(`Not a valid effect: ${K(e)}`):m(t,Lh)?Hh(Kc(Hc(t),zc(ji))):tu(t)}}}run=()=>{this.drainQueueOnCurrentThread()}}const mg=f("effect/FiberRef/currentMinimumLogLevel",(()=>ch(Lb))),Sg=f(Symbol.for("effect/Logger/defaultLogger"),(()=>{return t=vm,ym((e=>{const r=Ab(e.context,Sb);Nr(r,eb).unsafe.log(t.log(e))}));var t})),gg=f(Symbol.for("effect/Logger/tracerLogger"),(()=>ym((({annotations:t,cause:e,context:r,fiberId:n,logLevel:s,message:i})=>{const o=Cr(Fb(r,bh),fb);if("None"===o._tag||"ExternalSpan"===o.value._tag)return;const c=jr(Fb(r,Sb),yf),a={};for(const[e,r]of t)a[e]=r;a["effect.fiberId"]=Ri(n),a["effect.logLevel"]=s.label,null!==e&&"Empty"!==e._tag&&(a["effect.cause"]=wa(e,{renderErrorCause:!0})),o.value.event(K(Array.isArray(i)&&1===i.length?i[0]:i),c.unsafeCurrentTimeNanos(),a)})))),yg=f(Symbol.for("effect/FiberRef/currentLoggers"),(()=>ah(ei(Sg,gg)))),wg=(t,r)=>{const[n,s]=(t=>{if(Array.isArray(t)||y(t))return[t,se()];const e=Object.keys(t),r=e.length;return[e.map((e=>t[e])),ie((t=>{const n={};for(let s=0;s<r;s++)n[e[s]]=t[s];return n}))]})(t);return"validate"===r?.mode?((t,r,n)=>{const s=[];for(const e of t)s.push(ru(e));return hu(_g(s,e,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(t=>{const e=se(),s=t.length,i=new Array(s),o=new Array(s);let c=!1;for(let r=0;r<s;r++){const n=t[r];"Left"===n._tag?(i[r]=ie(n.left),c=!0):(o[r]=n.right,i[r]=e)}return c?su("Some"===r._tag?r.value(i):i):n?.discard?Tu:Nu("Some"===r._tag?r.value(o):o)}))})(n,s,r):"either"===r?.mode?((t,r,n)=>{const s=[];for(const e of t)s.push(ru(e));return n?.discard?_g(s,e,{concurrency:n?.concurrency,batching:n?.batching,discard:!0,concurrentFinalizers:n?.concurrentFinalizers}):vu(_g(s,e,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(t=>"Some"===r._tag?r.value(t):t))})(n,s,r):!0!==r?.discard&&"Some"===s._tag?vu(_g(n,e,r),s.value):_g(n,e,r)},_g=t((t=>y(t[0])),((t,e,r)=>Ua((n=>{const s=!0===r?.batching||"inherit"===r?.batching&&n.getFiberRef(_h);return r?.discard?Zp(r.concurrency,(()=>Ag(xd,r?.concurrentFinalizers)((r=>s?Og(t,((t,n)=>r(e(t,n))),!0,!1,1):Su(t,((t,n)=>r(e(t,n))))))),(()=>Ag($d,r?.concurrentFinalizers)((r=>Og(t,((t,n)=>r(e(t,n))),s,!1)))),(n=>Ag(Td(n),r?.concurrentFinalizers)((r=>Og(t,((t,n)=>r(e(t,n))),s,!1,n))))):Zp(r?.concurrency,(()=>Ag(xd,r?.concurrentFinalizers)((r=>s?Mg(t,1,((t,n)=>r(e(t,n))),!0):mu(t,((t,n)=>r(e(t,n))))))),(()=>Ag($d,r?.concurrentFinalizers)((r=>vg(t,((t,n)=>r(e(t,n))),s)))),(n=>Ag(Td(n),r?.concurrentFinalizers)((r=>Mg(t,n,((t,n)=>r(e(t,n))),s)))))})))),vg=(t,e,r)=>ju((()=>{const n=ve(t),s=new Array(n.length);return Wu(Og(n,((t,r)=>hu(e(t,r),(t=>Cu((()=>s[r]=t))))),r,!1),Nu(s))})),Og=(t,e,r,n,s)=>$u((i=>(t=>Ua((e=>{const r=c(e.getFiberRef(Ih),he((()=>e.scope())));return t(ih(Ih,ie(r)))})))((o=>Ua((c=>{let a=Array.from(t).reverse(),u=a.length;if(0===u)return Tu;let h=0,l=!1;const f=s?Math.min(a.length,s):a.length,b=new Set,d=new Array,p=new Array,m=new Array,S=new Array,g=()=>{const t=d.filter((({exit:t})=>"Failure"===t._tag)).sort(((t,e)=>t.index<e.index?-1:t.index===e.index?0:1)).map((({exit:t})=>t));return 0===t.length&&t.push(Zh),t},y=(t,e=!1)=>{const r=xu(o(t)),n=kg(r,c,c.currentRuntimeFlags,um);return c.currentScheduler.scheduleTask((()=>{e&&n.unsafeInterruptAsFork(c.id()),n.resume(r)}),0),n},w=()=>{n||(u-=a.length,a=[]),l=!0,b.forEach((t=>{t.currentScheduler.scheduleTask((()=>{t.unsafeInterruptAsFork(c.id())}),0)}))},_=r?lu:nu,v=y(Ya((t=>{const n=(t,e)=>{"Blocked"===t._op?S.push(t):(d.push({index:e,exit:t}),"Failure"!==t._op||l||w())},o=()=>{if(a.length>0){const f=a.pop();let w=h++;const v=()=>{const t=a.pop();return w=h++,hu(Uu(),(()=>hu(_(i(e(t,w))),O)))},O=t=>a.length>0&&(n(t,w),a.length>0)?v():Nu(t),M=hu(_(i(e(f,w))),O),I=y(M);p.push(I),b.add(I),l&&I.currentScheduler.scheduleTask((()=>{I.unsafeInterruptAsFork(c.id())}),0),I.addObserver((e=>{let i;if(i="Failure"===e._op?e:e.effect_instruction_i0,m.push(I),b.delete(I),n(i,w),d.length===u)t(Nu(he(Wh(g(),{parallel:!0}),(()=>Zh))));else if(S.length+d.length===u){const e=g(),n=S.map((t=>t.effect_instruction_i0)).reduce(Sc);t(Nu($a(n,Og([he(Wh(e,{parallel:!0}),(()=>Zh)),...S.map((t=>t.effect_instruction_i1))],(t=>t),r,!0,s))))}else o()}))}};for(let t=0;t<f;t++)o()})));return Wa(Iu(fu(i(pm(v))),Yh({onFailure:t=>{w();const e=S.length+1,r=Math.min("number"==typeof s?s:S.length,S.length),n=Array.from(S);return Ya((s=>{let i=0;const o=(r,o)=>()=>{i++,i===e&&s(Qh(Hh(t))),n.length>0&&o&&c()},c=()=>{y(n.pop(),!0).addObserver(o(0,!0))};v.addObserver(o(0,!1));for(let t=0;t<r;t++)c()}))},onSuccess:()=>mu(m,(t=>t.inheritAll))})))})))))),Mg=(t,e,r,n)=>ju((()=>{const s=ve(t),i=new Array(s.length);return Wu(Og(s,((t,e)=>vu(r(t,e),(t=>i[e]=t))),n,!1,e),Nu(i))})),Ig=t=>Ng(t,um),Eg=(t,e,r,n=null)=>{const s=Fg(t,e,r,n);return s.resume(t),s},kg=(t,e,r,n=null)=>Fg(t,e,r,n),Fg=(t,e,r,n=null)=>{const s=xi(),i=e.getFiberRefs(),o=Mb(i,s),a=new pg(s,o,r),u=Fb(o,bh),h=a.currentSupervisor;return h.onStart(u,t,ie(e),a),a.addObserver((t=>h.onEnd(t,a))),(null!==n?n:c(e.getFiberRef(Ih),he((()=>e.scope())))).add(r,a),a},Ng=(t,e)=>Ua(((r,n)=>Nu(Eg(t,r,n.runtimeFlags,e)))),jg=t=>ml((e=>ae(Cr(e,Pg),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Parallel":return t;case"Sequential":case"ParallelN":return hu(Ah(e,$d),(e=>Gg(t,e)))}}}))),Cg=t=>e=>ml((r=>ae(Cr(r,Pg),{onNone:()=>e,onSome:r=>"ParallelN"===r.strategy._tag&&r.strategy.parallelism===t?e:hu(Ah(r,Td(t)),(t=>Gg(e,t)))}))),Ag=(t,r)=>n=>ml((s=>ae(Cr(s,Pg),{onNone:()=>n(e),onSome:s=>{if(!0!==r)return n(e);{const e="Parallel"===t._tag?jg:"Sequential"===t._tag?xg:Cg(t.parallelism);switch(s.strategy._tag){case"Parallel":return e(n(jg));case"Sequential":return e(n(xg));case"ParallelN":return e(n(Cg(s.strategy.parallelism)))}}}}))),Rg=t=>hu(Jg(),(e=>Iu(t(e),(t=>e.close(t))))),xg=t=>ml((e=>ae(Cr(e,Pg),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Sequential":return t;case"Parallel":case"ParallelN":return hu(Ah(e,xd),(e=>Gg(t,e)))}}}))),$g=t((t=>qa(t[1])),((t,e,r)=>Dg(t,e,((t,e)=>[t,e]),r))),Tg=t((t=>qa(t[1])),((t,e,r)=>!0===r?.concurrent||void 0!==r?.batching&&!1!==r.batching?Dg(t,e,(t=>t),r):Gu(t,e))),Lg=t((t=>qa(t[1])),((t,e,r)=>!0===r?.concurrent||void 0!==r?.batching&&!1!==r.batching?Dg(t,e,((t,e)=>e),r):Wu(t,e))),Dg=t((t=>qa(t[1])),((t,e,r,n)=>vu(wg([t,e],{concurrency:n?.concurrent?2:1,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(([t,e])=>r(t,e))))),Pg=Mr("effect/Scope"),Bg=Pg,qg={[kh]:kh,[Fh]:Fh,pipe(){return rt(this,arguments)},fork(t){return Cu((()=>{const e=Ug(t);if("Closed"===this.state._tag)return e.state=this.state,e;const r={};return this.state.finalizers.set(r,(t=>e.close(t))),((t,e)=>{"Open"===t.state._tag&&t.state.finalizers.set({},e)})(e,(()=>Cu((()=>{"Open"===this.state._tag&&this.state.finalizers.delete(r)})))),e}))},close(t){return ju((()=>{if("Closed"===this.state._tag)return Tu;const e=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:t},0===e.length?Tu:this.strategy._tag===jd?c(mu(e,(e=>nu(e(t)))),hu((t=>c(Wh(t),pe(Gh),he((()=>Zh)))))):(()=>this.strategy._tag===Cd)()?c(vg(e,(e=>nu(e(t))),!1),hu((t=>c(Wh(t,{parallel:!0}),pe(Gh),he((()=>Zh)))))):c(Mg(e,this.strategy.parallelism,(e=>nu(e(t))),!1),hu((t=>c(Wh(t,{parallel:!0}),pe(Gh),he((()=>Zh))))))}))},addFinalizer(t){return ju((()=>"Closed"===this.state._tag?t(this.state.exit):(this.state.finalizers.set({},t),Tu)))}},Ug=(t=Ad)=>{const e=Object.create(qg);return e.strategy=t,e.state={_tag:"Open",finalizers:new Map},e},Jg=(t=Ad)=>Cu((()=>Ug(t))),Gg=t(2,((t,e)=>yl(t,Ar(kr(Pg,e))))),Wg=t=>lh(t,{differ:tg,fork:KS}),Vg=fh(uc),Hg=Wg(WS),zg=t(3,((t,e,r)=>Kg(t,e,{onSelfWin:(t,e)=>hu(t.await,(n=>{switch(n._tag){case ut:return hu(t.inheritAll,(()=>r.onSelfDone(n,e)));case it:return r.onSelfDone(n,e)}})),onOtherWin:(t,e)=>hu(t.await,(n=>{switch(n._tag){case ut:return hu(t.inheritAll,(()=>r.onOtherDone(n,e)));case it:return r.onOtherDone(n,e)}}))}))),Yg=t(2,((t,e)=>uu((r=>zg(t,e,{onSelfDone:(t,e)=>Kh(t,{onFailure:t=>c(pm(e),wd((e=>Yc(t,e)))),onSuccess:t=>c(e,zu(r),Ga(t))}),onOtherDone:(t,e)=>Kh(t,{onFailure:t=>c(pm(e),wd((e=>Yc(e,t)))),onSuccess:t=>c(e,zu(r),Ga(t))})}))))),Kg=t(3,((t,e,r)=>Ua(((n,s)=>{const i=s.runtimeFlags,o=li(!0),c=Fg(t,n,i,r.selfScope),a=Fg(e,n,i,r.otherScope);return Ya((n=>{c.addObserver((()=>Qg(c,a,r.onSelfWin,o,n))),a.addObserver((()=>Qg(a,c,r.onOtherWin,o,n))),c.startFork(t),a.startFork(e)}),Ci(c.id(),a.id()))})))),Qg=(t,e,r,n,s)=>{fi(!0,!1)(n)&&s(r(t,e))},Zg=t(2,((t,e)=>$u((r=>du(r(t),{onFailure:t=>du(e,{onFailure:e=>ou(Kc(t,e)),onSuccess:()=>ou(t)}),onSuccess:t=>Ga(e,t)}))))),Xg=(t,e,r)=>uu((n=>hu(hu(Ig(wu(t)),(t=>Ya((n=>{const s=e.map((t=>t.listeners.count)),i=()=>{s.every((t=>0===t))&&e.every((t=>"Pending"===t.result.state.current._tag||!("Done"!==t.result.state.current._tag||!Uh(t.result.state.current.effect)||"Failure"!==t.result.state.current.effect._tag||!Xc(t.result.state.current.effect.cause))))&&(o.forEach((t=>t())),r?.(),n(Hu(t)))};t.addObserver((t=>{o.forEach((t=>t())),n(t)}));const o=e.map(((t,e)=>{const r=t=>{s[e]=t,i()};return t.listeners.addObserver(r),()=>t.listeners.removeObserver(r)}));return i(),Cu((()=>{o.forEach((t=>t()))}))})))),(()=>ju((()=>{const t=e.flatMap((t=>t.state.completed?[]:[t]));return Su(t,(t=>DS(t.request,(t=>Hh(zc(t)))(n))))})))))),ty=Symbol.for("effect/ScheduleInterval"),ey={[ty]:ty,startMillis:0,endMillis:0},ry=(t,e)=>t>e?ey:{[ty]:ty,startMillis:t,endMillis:e},ny=t(2,((t,e)=>sy(t,e)===t)),sy=t(2,((t,e)=>t.endMillis<=e.startMillis?t:e.endMillis<=t.startMillis?e:t.startMillis<e.startMillis?t:e.startMillis<t.startMillis?e:t.endMillis<=e.endMillis?t:e)),iy=t(2,((t,e)=>{const r=Math.max(t.startMillis,e.startMillis),n=Math.min(t.endMillis,e.endMillis);return ry(r,n)})),oy=ey,cy=ny,ay=iy,uy=Symbol.for("effect/ScheduleIntervals"),hy=t=>({[uy]:uy,intervals:t}),ly=t(2,((t,e)=>fy(t.intervals,e.intervals,qr()))),fy=(t,e,r)=>{let n=t,s=e,i=r;for(;cn(n)&&cn(s);){const t=c(hn(n),ay(hn(s))),e=(o=t).startMillis>=o.endMillis?i:c(i,Xr(t));c(hn(n),cy(hn(s)))?n=dn(n):s=dn(s),i=e}var o;return hy(Hr(i))},by=t=>c(t.intervals,an,he((()=>oy))).startMillis,dy=t(2,((t,e)=>by(t)<by(e))),py=hy,my=ly,Sy=by,gy=t=>c(t.intervals,an,he((()=>oy))).endMillis,yy=dy,wy="Continue",_y="Done",vy={_tag:_y},Oy=t=>t._tag===wy,My=t=>t._tag===_y,Iy=Nh,Ey=jh,ky=Ch,Fy=Gg,Ny=Ah,jy=Jg;class Cy{permits;waiters=new Set;taken=0;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take=t=>za((e=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),this.taken+=t,e(Nu(t)))};return this.waiters.add(r),Cu((()=>{this.waiters.delete(r)}))}return this.taken+=t,e(Nu(t))}));updateTakenUnsafe(t,e){return this.taken=e(this.taken),this.waiters.size>0&&t.getFiberRef(Kp).scheduleTask((()=>{const t=this.waiters.values();let e=t.next();for(;!1===e.done&&this.free>0;)e.value(),e=t.next()}),t.getFiberRef(dh)),Nu(this.free)}updateTaken(t){return Ua((e=>this.updateTakenUnsafe(e,t)))}resize=t=>Wa(Ua((e=>(this.permits=t,this.free<0?Tu:this.updateTakenUnsafe(e,(t=>t))))));release=t=>this.updateTaken((e=>e-t));releaseAll=this.updateTaken((()=>0));withPermits=t=>e=>$u((r=>hu(r(this.take(t)),(t=>Zg(r(e),this.release(t))))));withPermitsIfAvailable=t=>e=>$u((r=>ju((()=>this.free<t?Id:(this.taken+=t,Zg(r((t=>vu(t,ie))(e)),this.release(t)))))))}const Ay=t=>new Cy(t),Ry=t(2,((t,e)=>Ua(((r,n)=>{const s=e,i=Eg(t,r,n.runtimeFlags,um);if("Open"===s.state._tag){const t=()=>uu((t=>J(t,i.id())?Tu:Wa(Hu(i)))),e={};s.state.finalizers.set(e,t),i.addObserver((()=>{"Closed"!==s.state._tag&&s.state.finalizers.delete(e)}))}else i.unsafeInterruptAsFork(r.id());return Nu(i)})))),xy=t(2,((t,e)=>c(nu(t),Yg(nu(e)),(t=>fu(t))))),$y=Symbol.for("effect/Ref/SynchronizedRef"),Ty={_A:t=>t};class Ly extends Jb{ref;withLock;[$y]=Ty;[Wb]=Vb;[Gb]=Gb;constructor(t,e){super(),this.ref=t,this.withLock=e,this.get=Kb(this.ref)}get;commit(){return this.get}modify(t){return this.modifyEffect((e=>Nu(t(e))))}modifyEffect(t){return this.withLock(c(hu(Kb(this.ref),t),hu((([t,e])=>Ga(Qb(this.ref,e),t)))))}}const Dy=t=>{const e=zb(t),r=Ay(1);return new Ly(e,r.withPermits(1))},Py=Symbol.for("effect/ManagedRuntime"),By=t=>function(){if(1===arguments.length){const e=arguments[0];return(r,...n)=>t(e,r,...n)}return t.apply(this,arguments)},qy=By(((t,e,r)=>{const n=xi(),s=[[bh,[[n,t.context]]]];r?.scheduler&&s.push([Kp,[[n,r.scheduler]]]);let i=Rb(t.fiberRefs,{entries:s,forkAs:n});r?.updateRefs&&(i=r.updateRefs(i,n));const o=new pg(n,i,t.runtimeFlags);let c=e;r?.scope&&(c=hu(Ny(r.scope,Ad),(t=>Wu(Nh(t,uu((t=>J(t,o.id())?Tu:zu(o,t)))),Iu(e,(e=>ky(t,e)))))));const a=o.currentSupervisor;return a!==WS&&(a.onStart(t.context,c,se(),o),o.addObserver((t=>a.onEnd(t,o)))),um.add(t.runtimeFlags,o),!1===r?.immediate?o.resume(c):o.start(c),o})),Uy=Symbol.for("effect/Runtime/FiberFailure"),Jy=Symbol.for("effect/Runtime/FiberFailure/Cause");class Gy extends Error{[Uy];[Jy];constructor(t){const e=Fa(t)[0];super(e?.message||"An error has occurred"),this[Uy]=Uy,this[Jy]=t,this.name=e?`(FiberFailure) ${e.name}`:"FiberFailure",e?.stack&&(this.stack=e.stack)}toJSON(){return{_id:"FiberFailure",cause:this[Jy].toJSON()}}toString(){return"(FiberFailure) "+wa(this[Jy],{renderErrorCause:!0})}[H](){return this.toString()}}const Wy=By(((t,e,r)=>Vy(t,e,r).then((t=>{switch(t._tag){case ut:return t.effect_instruction_i0;case it:throw(t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=0;const r=new Gy(t);return Error.stackTraceLimit=e,r})(t.effect_instruction_i0)}})))),Vy=By(((t,e,r)=>new Promise((n=>{const s=(t=>{const e=t;switch(e._op){case"Failure":case"Success":return e;case"Left":return Vh(e.left);case"Right":return Qh(e.right);case"Some":return Qh(e.value);case"None":return Vh(new Ph)}})(e);s&&n(s);const i=qy(t)(e);i.addObserver((t=>{n(t)})),void 0!==r?.signal&&(r.signal.aborted?i.unsafeInterruptAsFork(i.id()):r.signal.addEventListener("abort",(()=>{i.unsafeInterruptAsFork(i.id())}),{once:!0}))}))));class Hy{context;runtimeFlags;fiberRefs;constructor(t,e,r){this.context=t,this.runtimeFlags=e,this.fiberRefs=r}pipe(){return rt(this,arguments)}}const zy=t=>new Hy(t.context,t.runtimeFlags,t.fiberRefs),Yy=ac(1,32,4),Ky=zy({context:Er(),runtimeFlags:Yy,fiberRefs:xb()}),Qy=qy(Ky),Zy=Wy(Ky),Xy=t(2,((t,e)=>t.modifyEffect(e))),tw=Symbol.for("effect/Layer"),ew={[tw]:{_RIn:t=>t,_E:t=>t,_ROut:t=>t},pipe(){return rt(this,arguments)}},rw=Symbol.for("effect/Layer/MemoMap"),nw=Rr()("effect/Layer/CurrentMemoMap",{defaultValue:()=>ow()});class sw{ref;[rw];constructor(t){this.ref=t,this[rw]=rw}getOrElseMemoize(t,e){return c(Xy(this.ref,(r=>{const n=r.get(t);if(void 0!==n){const[t,s]=n,i=c(t,hu((([t,e])=>c((t=>{return e=(e,r)=>c(t,cd(e,r)),Ua((t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),Tu)));var e})(t),Ga(e)))),Iu(Yh({onFailure:()=>Tu,onSuccess:()=>jh(e,s)})));return Nu([i,r])}return c(Yb(0),hu((n=>c(sl(),hu((s=>c(Yb((()=>Tu)),vu((i=>{const o=$u((o=>c(Jg(),hu((a=>c(o(hu(uw(t,a,!0),(t=>{return e=t(this),Ed(e,md,id);var e}))),nu,hu((o=>{switch(o._tag){case it:return c(ul(s,o.effect_instruction_i0),Wu(Ch(a,o)),Wu(ou(o.effect_instruction_i0)));case ut:return c(Qb(i,(t=>c(Ch(a,t),Lu(Zb(n,(t=>[1===t,t-1]))),Wa))),Wu(Xb(n,(t=>t+1))),Wu(jh(e,(e=>c(Cu((()=>r.delete(t))),Wu(Kb(i)),hu((t=>t(e))))))),Wu(ll(s,o.effect_instruction_i0)),Ga(o.effect_instruction_i0[1]))}})))))))),a=[c(ol(s),Iu(Kh({onFailure:()=>Tu,onSuccess:()=>Xb(n,(t=>t+1))}))),t=>c(Kb(i),hu((e=>e(t))))];return[o,(u=t,"Fresh"===u._op_layer?r:r.set(t,a))];var u})))))))))})),fu)}}const iw=ju((()=>{return vu((t=new Map,Cu((()=>Dy(t)))),(t=>new sw(t)));var t})),ow=()=>new sw(Dy(new Map)),cw=t(2,((t,e)=>hu(iw,(r=>aw(t,r,e))))),aw=t(3,((t,e,r)=>hu(uw(t,r),(t=>vd(t(e),nw,e))))),uw=(t,e,r=!1)=>{const n=t;switch(n._op_layer){case"Locally":return Cu((()=>t=>n.f(t.getOrElseMemoize(n.self,e))));case"ExtendScope":return Cu((()=>t=>{return e=e=>t.getOrElseMemoize(n.layer,e),hu(Pg,e);var e}));case"Fold":return Cu((()=>t=>c(t.getOrElseMemoize(n.layer,e),du({onFailure:r=>t.getOrElseMemoize(n.failureK(r),e),onSuccess:r=>t.getOrElseMemoize(n.successK(r),e)}))));case"Fresh":return Cu((()=>()=>c(n.layer,cw(e))));case"FromEffect":return Cu(r?()=>()=>n.effect:()=>r=>r.getOrElseMemoize(t,e));case"Provide":return Cu((()=>t=>c(t.getOrElseMemoize(n.first,e),hu((r=>c(t.getOrElseMemoize(n.second,e),Sl(r)))))));case"Scoped":return Cu(r?()=>()=>Gg(n.effect,e):()=>r=>r.getOrElseMemoize(t,e));case"Suspend":return Cu((()=>t=>t.getOrElseMemoize(n.evaluate(),e)));case"ProvideMerge":return Cu((()=>t=>c(t.getOrElseMemoize(n.first,e),Vu(t.getOrElseMemoize(n.second,e),n.zipK))));case"ZipWith":return Bu((function*(){const t=yield*Ah(e,Rd),r=yield*Ah(t,Ad),s=yield*Ah(t,Ad);return t=>c(t.getOrElseMemoize(n.first,r),Dg(t.getOrElseMemoize(n.second,s),n.zipK,{concurrent:!0}))}));case"MergeAll":{const t=n.layers;return vu(Ah(e,Rd),(e=>r=>{const n=new Array(t.length);return vu(Og(t,qu((function*(t,s){const i=yield*Ah(e,Ad),o=yield*r.getOrElseMemoize(t,i);n[s]=o})),!1,!1),(()=>((...t)=>{const e=new Map;for(let r=0;r<t.length;r++)t[r].unsafeMap.forEach(((t,r)=>{e.set(r,t)}));return br(e)})(...n)))}))}}},hw=t(2,((t,e)=>Rg((r=>hu(cw(e,r),(e=>gl(t,e))))))),lw=t(2,((t,e)=>{const r=Ld(Ky.fiberRefs,e.fiberRefs),n=fc(Ky.runtimeFlags,e.runtimeFlags);return $u((s=>Ua((i=>{const o=i.getFiberRef(bh),c=i.getFiberRefs(),a=Dd(i.id(),c)(r),u=i.currentRuntimeFlags,h=bc(n)(u),l=Ld(a,c),f=fc(h,u);return i.setFiberRefs(a),i.currentRuntimeFlags=h,Zg(gl(s(t),Ar(o,e.context)),Ua((t=>(t.setFiberRefs(Dd(t.id(),t.getFiberRefs())(l)),t.currentRuntimeFlags=bc(f)(t.currentRuntimeFlags),Tu))))}))))})),fw=t(2,((t,e)=>Array.isArray(e)?hw(t,((...t)=>{const e=Object.create(ew);return e._op_layer="MergeAll",e.layers=t,e})(...e)):m(e,tw)?hw(t,e):Ir(e)?gl(t,e):Py in e?hu(e.runtimeEffect,(e=>lw(t,e))):lw(t,e))),bw=Symbol.for("effect/Schedule"),dw=Symbol.for("effect/ScheduleDriver"),pw={start:0,now:0,input:void 0,output:void 0,elapsed:jn,elapsedSincePrevious:jn,recurrence:0},mw=Rr()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>pw}),Sw={_Out:t=>t,_In:t=>t,_R:t=>t},gw={_Out:t=>t,_In:t=>t,_R:t=>t};class yw{initial;step;[bw]=Sw;constructor(t,e){this.initial=t,this.step=e}pipe(){return rt(this,arguments)}}const ww=(t,e,r,n)=>Xb(t,(t=>0===t.recurrence?{now:e,input:r,output:n,recurrence:t.recurrence+1,elapsed:jn,elapsedSincePrevious:jn,start:e}:{now:e,input:r,output:n,recurrence:t.recurrence+1,elapsed:xn(e-t.start),elapsedSincePrevious:xn(e-t.now),start:t.start}));class _w{schedule;ref;[dw]=gw;constructor(t,e){this.schedule=t,this.ref=e}get state(){return vu(Kb(this.ref),(t=>t[1]))}get last(){return hu(Kb(this.ref),(([t,e])=>{switch(t._tag){case"None":return iu((()=>new Ph));case"Some":return Nu(t.value)}}))}iterationMeta=zb(pw);get reset(){return Qb(this.ref,[se(),this.schedule.initial]).pipe(Gu(Qb(this.iterationMeta,pw)))}next(t){return c(vu(Kb(this.ref),(t=>t[1])),hu((e=>c(yb,hu((r=>c(ju((()=>this.schedule.step(r,t,e))),hu((([e,n,s])=>{const i=Qb(this.ref,[ie(n),e]);if(My(s))return i.pipe(Wu(su(se())));const o=Sy(s.intervals)-r;if(o<=0)return i.pipe(Wu(ww(this.iterationMeta,r,t,n)),Ga(n));const a=xn(o);return c(i,Wu(ww(this.iterationMeta,r,t,n)),Wu(Md(a)),Ga(n))})))))))))}}const vw=(t,e)=>new yw(t,e),Ow=t(2,((t,e)=>Mw(t,((t,r)=>Cu((()=>e(t,r))))))),Mw=t(2,((t,e)=>vw(t.initial,((r,n,s)=>hu(t.step(r,n,s),(([t,r,s])=>My(s)?Nu([t,r,vy]):vu(e(n,r),(e=>e?[t,r,s]:[t,r,vy])))))))),Iw=t(2,((t,e)=>Ew(t,e,my))),Ew=t(3,((t,e,r)=>vw([t.initial,e.initial],((n,s,i)=>c(Vu(t.step(n,s,i[0]),e.step(n,s,i[1]),((t,e)=>[t,e])),hu((([[n,i,o],[c,a,u]])=>Oy(o)&&Oy(u)?kw(t,e,s,n,i,o.intervals,c,a,u.intervals,r):Nu([[n,c],[i,a],vy])))))))),kw=(t,e,r,n,s,i,o,a,u,h)=>{const l=h(i,u);return(t=>cn(t.intervals))(l)?Nu([[n,o],[s,a],(f=l,{_tag:wy,intervals:f})]):c(i,yy(u))?hu(t.step(gy(i),r,n),(([n,s,i])=>My(i)?Nu([[n,o],[s,a],vy]):kw(t,e,r,n,s,i.intervals,o,a,u,h))):hu(e.step(gy(u),r,o),(([o,c,a])=>My(a)?Nu([[n,o],[s,c],vy]):kw(t,e,r,n,s,i,o,c,a.intervals,h)));var f},Fw=t(2,((t,e)=>Nw(t,(t=>Cu((()=>e(t))))))),Nw=t(2,((t,e)=>vw(t.initial,((r,n,s)=>hu(t.step(r,n,s),(([t,r,n])=>vu(e(r),(e=>[t,e,n])))))))),jw=(t,e)=>vw(t,((t,r,n)=>Cu((()=>{return[e(n),n,(s=t,r=ry(s,Number.POSITIVE_INFINITY),{_tag:wy,intervals:py(Jr(r))})];var r,s})))),Cw=t(2,((t,e)=>Mw(t,(t=>(t=>vu(t,(t=>!t)))(e(t)))))),Aw=t(2,((t,e)=>Mw(t,(t=>e(t))))),Rw=t(2,((t,e)=>Ow(t,((t,r)=>e(r))))),xw=Symbol.for("effect/Schedule/ScheduleDefect");class $w{error;[xw];constructor(t){this.error=t,this[xw]=xw}}const Tw=t=>Qa(t,(t=>tu(new $w(t)))),Lw=t(2,((t,e)=>Pw(t,e,(t=>su(t))))),Dw=t(2,((t,e)=>{if(m(e,bw))return Lw(t,e);const r=e.schedule??(t=>vw(t.initial,((e,r,n)=>c(t.step(e,r,n),vu((([t,e,n])=>[t,r,n]))))))(qw),n=e.while?Aw(r,(t=>{const r=e.while(t);return"boolean"==typeof r?Nu(r):Tw(r)})):r,s=e.until?Cw(n,(t=>{const r=e.until(t);return"boolean"==typeof r?Nu(r):Tw(r)})):n,i=e.times?Iw(s,(o=e.times,Rw(qw,(t=>t<o)))).pipe(Fw((t=>t[0]))):s;var o,a;return a=Lw(t,i),Ka(a,(t=>ou((t=>ae(fa(t,(t=>Zc(t)&&m(t.defect,xw)?ie(t.defect):se())),{onNone:()=>t,onSome:t=>Vc(t.error)}))(t))))})),Pw=t(3,((t,e,r)=>hu((t=>c(Yb([se(),t.initial]),vu((e=>new _w(t,e)))))(e),(e=>pu(t,{onFailure:t=>r(t,se()),onSuccess:n=>Bw(Od(t,mw,Kb(e.iterationMeta)),e,((t,n)=>Od(r(t,n),mw,Kb(e.iterationMeta))),n)}))))),Bw=(t,r,n,s)=>pu(r.next(s),{onFailure:()=>(t=>Fu(t,e))(r.last),onSuccess:e=>pu(t,{onFailure:t=>n(t,ie(e)),onSuccess:e=>Bw(t,r,n,e)})}),qw=jw(0,(t=>t+1)),Uw=qa,Jw=wg,Gw=_g,Ww=Ya,Vw=Ua,Hw=su,zw=ou,Yw=eu,Kw=Bu,Qw=t=>Ya(t.length>=1?(e,r)=>{try{t(r).then((t=>e(Nu(t))),(t=>e(tu(t))))}catch(t){e(tu(t))}}:e=>{try{t().then((t=>e(Nu(t))),(t=>e(tu(t))))}catch(t){e(tu(t))}}),Zw=Nu,Xw=ju,t_=Cu,e_=Tu,r_=Qa,n_=Ka,s_=bd,i_=t=>pd(t,{onFailure:o,onSuccess:o}),o_=t=>{let e,r;return"function"==typeof t?e=t:(e=t.try,r=t.catch),ju((()=>{try{return Nu(N(e))}catch(t){return su(r?N((()=>r(t))):new qh(t,"An unknown error occurred in Effect.try"))}}))},c_=t=>{let e,r;"function"==typeof t?e=t:(e=t.try,r=t.catch);const n=t=>r?iu((()=>r(t))):su(new qh(t,"An unknown error occurred in Effect.tryPromise"));return Ya(e.length>=1?(t,r)=>{try{e(r).then((e=>t(Nu(e))),(e=>t(n(e))))}catch(e){t(n(e))}}:t=>{try{e().then((e=>t(Nu(e))),(e=>t(n(e))))}catch(e){t(n(e))}})},a_=gu,u_=wu,h_=xu,l_=$u,f_=Ga,b_=Wa,d_=vu,p_=Mu,m_=Ja,S_=Zg,g_=Bg,y_=Rg,w_=uu,__=Ig,v_=Ry,O_=fw,M_=nu,I_=_u,E_=Nd,k_=hu,F_=fu,N_=Yg,j_=xy,C_=zg,A_=Au,R_=kd,x_=Fd,$_=t=>{const e=hu(hu(t,(()=>Uu())),(()=>e));return e},T_=Dw,L_=pd,D_=bu,P_=du,B_=gd,q_=yd,U_=_d,J_=()=>Ua(((t,e)=>Nu(new Hy(t.getFiberRef(bh),e.runtimeFlags,t.getFiberRefs())))),G_=t=>Cu((()=>Ay(t))),W_=Qy,V_=Zy,H_=$g,z_=Tg,Y_=Lg,K_=Dg;export{Ll as $,ie as A,be as B,Fl as C,Yl as D,co as E,hu as F,Ql as G,Wl as H,dd as I,df as J,fi as K,mf as L,of as M,di as N,li as O,hf as P,C as Q,c as R,q as S,x as T,A as U,U as V,m as W,J as X,Wa as Y,Nd as Z,vl as _,Vt as a,uf as a$,Bn as a0,Eu as a1,Wu as a2,Il as a3,Ol as a4,nu as a5,Sl as a6,Rh as a7,Kw as a8,c_ as a9,rt as aA,Qa as aB,gu as aC,bi as aD,lf as aE,xu as aF,Ua as aG,Lu as aH,ll as aI,Og as aJ,ol as aK,ve as aL,He as aM,Ue as aN,on as aO,nl as aP,Gr as aQ,Sf as aR,fl as aS,Xr as aT,ff as aU,sn as aV,rn as aW,Zr as aX,pf as aY,hl as aZ,qr as a_,o_ as aa,B_ as ab,U_ as ac,Cn as ad,Yb as ae,Zb as af,Kb as ag,Xb as ah,Xc as ai,Vc as aj,na as ak,sa as al,ca as am,Hc as an,zc as ao,Zc as ap,ra as aq,ta as ar,pm as as,Hu as at,bm as au,dm as av,zu as aw,t as ax,sl as ay,Jb as az,Ht as b,J_ as b$,bf as b0,Tu as b1,Nl as b2,Uw as b3,Kt as b4,e_ as b5,i_ as b6,K_ as b7,M_ as b8,Bl as b9,xd as bA,m_ as bB,v_ as bC,El as bD,kl as bE,ni as bF,Ai as bG,I_ as bH,z_ as bI,x_ as bJ,Iy as bK,zw as bL,F_ as bM,w_ as bN,a_ as bO,Ml as bP,Rl as bQ,D_ as bR,y_ as bS,Qr as bT,o as bU,g_ as bV,Vw as bW,jy as bX,Fy as bY,ky as bZ,C_ as b_,t_ as ba,O_ as bb,P_ as bc,Y_ as bd,k_ as be,__ as bf,u_ as bg,Xw as bh,S_ as bi,h_ as bj,d_ as bk,H_ as bl,xl as bm,Tl as bn,Gw as bo,Cl as bp,he as bq,Dl as br,Yw as bs,n_ as bt,Al as bu,$l as bv,l_ as bw,Jw as bx,Ny as by,_l as bz,r_ as c,A_ as c0,Ey as c1,G_ as c2,E_ as c3,N_ as c4,f_ as c5,T_ as c6,b_ as c7,Pl as c8,j_ as c9,$_ as ca,Jr as cb,Hw as cc,p_ as cd,pn as ce,ln as cf,L_ as cg,bn as ch,jl as ci,an as cj,nn as ck,s_ as cl,Yr as cm,W_ as cn,Qw as co,Ww as cp,Yt as d,ue as e,Mn as f,Zt as g,vu as h,e as i,wg as j,pl as k,q_ as l,ae as m,au as n,Qt as o,Cu as p,Zl as q,V_ as r,Zw as s,R_ as t,ju as u,Vl as v,Nu as w,se as x,zl as y,ce as z}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{g as r}from"./p-B85MJLTf.js";var n,t,e={exports:{}},o=(n||(n=1,t=e,function(){var r={}.hasOwnProperty;function n(){for(var r="",n=0;n<arguments.length;n++){var t=arguments[n];t&&(r=o(r,e(t)))}return r}function e(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var f in t)r.call(t,f)&&t[f]&&(e=o(e,f));return e}function o(r,n){return n?r?r+" "+n:r+n:r}t.exports?(n.default=n,t.exports=n):window.classNames=n}()),e.exports),f=r(o);
|
|
2
|
+
/*!
|
|
3
|
+
Copyright (c) 2018 Jed Watson.
|
|
4
|
+
Licensed under the MIT License (MIT), see
|
|
5
|
+
http://jedwatson.github.io/classnames
|
|
6
|
+
*/export{f as c}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,a as s,b as e,i,d as r,e as n,m as a,f as o,h as c,j as h,k as u,n as l,o as d,p as f,q as v,u as p,v as m,w as g,x as y,y as w,z as S,A as x,B as b,C,D as E,E as k,F as _,G as O,H as R,I as P,J as L,K as V,L as j,M as B,N as M,O as N,P as T,Q as A,R as F,S as D,T as z,U as G,V as K,W as U,X as $,Y as H,_ as I,Z as J,$ as W,a0 as X,a1 as Y,a2 as q,a3 as Q,a4 as Z,a5 as tt,a6 as st,a7 as et,a8 as it,a9 as rt,aa as nt,t as at,ab as ot,ac as ct,ad as ht}from"./p-D9S7OTyY.js";import{a as ut}from"./p-smGPjoDX.js";const lt=Symbol.for("effect/Brand/Refined"),dt=(t,s,e,i)=>k({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),ft=(t,s)=>k({_tag:"Pending",key:t,deferred:s}),vt=Symbol.for("effect/Cache/MapKey");class pt{current;[vt]=vt;previous=void 0;next=void 0;constructor(t){this.current=t}[A](){return F(G(this.current),z(G(this.previous)),z(G(this.next)),D(this))}[K](t){return this===t||gt(t)&&$(this.current,t.current)&&$(this.previous,t.previous)&&$(this.next,t.next)}}const mt=t=>new pt(t),gt=t=>U(t,vt);class yt{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const wt=Symbol.for("effect/Cache"),St={_Key:t=>t,_Error:t=>t,_Value:t=>t},xt=Symbol.for("effect/ConsumerCache"),bt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Ct=t=>({loadedMillis:t});class Et{capacity;context;fiberId;lookup;timeToLive;[wt]=St;[xt]=bt;cacheState;constructor(t,s,e,i,r){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=r,this.cacheState={map:R(),keys:new yt,accesses:T(),updating:N(!1),hits:0,misses:0}}get(t){return c(this.getEither(t),d)}get cacheStats(){return f((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:v(this.cacheState.map)})))}getOption(t){return p((()=>a(m(this.cacheState.map,t),{onNone:()=>{const s=mt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return p((()=>a(m(this.cacheState.map,t),{onNone:()=>{const s=mt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return f((()=>w(this.cacheState.map,t)))}entryStats(t){return f((()=>{const s=m(this.cacheState.map,t);if(S(s))switch(s.value._tag){case"Complete":return x(Ct(s.value.entryStats.loadedMillis));case"Pending":return y();case"Refreshing":return x(Ct(s.value.complete.entryStats.loadedMillis))}return y()}))}getEither(t){return p((()=>{const i=t;let r,n,o=b(m(this.cacheState.map,i));return void 0===o&&(n=C(this.fiberId),r=mt(i),w(this.cacheState.map,i)?o=b(m(this.cacheState.map,i)):E(this.cacheState.map,i,ft(r,n))),void 0===o?(this.trackAccess(r),this.trackMiss(),c(this.lookupValueOf(t,n),s)):_(this.resolveMapValue(o),a({onNone:()=>this.getEither(t),onSome:t=>g(e(t))}))}))}invalidate(t){return f((()=>{O(this.cacheState.map,t)}))}invalidateWhen(t,s){return f((()=>{const e=m(this.cacheState.map,t);S(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&O(this.cacheState.map,t)}))}get invalidateAll(){return f((()=>{this.cacheState.map=R()}))}refresh(t){return P((s=>p((()=>{const e=t,i=C(this.fiberId);let r=b(m(this.cacheState.map,e));if(void 0===r&&(w(this.cacheState.map,e)?r=b(m(this.cacheState.map,e)):E(this.cacheState.map,e,ft(mt(e),i))),void 0===r)return H(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=b(m(this.cacheState.map,e));return $(s,r)&&O(this.cacheState.map,e),H(this.get(t))}return F(this.lookupValueOf(t,i),J((()=>{const t=b(m(this.cacheState.map,e));if($(t,r)){const t=((t,s)=>k({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return E(this.cacheState.map,e,t),!0}return!1})),H);case"Pending":case"Refreshing":return I(r.deferred)}}))))}set(t,s){return P((e=>f((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=W(s),a=dt(mt(r),n,Ct(i),i+X(o(this.timeToLive(n))));E(this.cacheState.map,r,a)}))))}get size(){return f((()=>v(this.cacheState.map)))}get values(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return P((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(O(this.cacheState.map,t.key.current),g(y())):(this.trackHit(),c(t.exit,x));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?g(y()):c(I(t.deferred),x);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?g(y()):c(I(t.deferred),x):c(t.complete.exit,x)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(L(this.cacheState.accesses,t),V(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=j(this.cacheState.accesses,B);s===B?t=!1:this.cacheState.keys.add(s)}let s=v(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?w(this.cacheState.map,e.current)&&(O(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}M(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return P((e=>p((()=>{const i=t;return F(this.lookup(t),st(this.context),tt,_((t=>{const r=e.unsafeCurrentTimeMillis(),n=Ct(r),a=dt(mt(i),t,n,r+X(o(this.timeToLive(t))));return E(this.cacheState.map,i,a),q(Z(s,t),t)})),Y((()=>q(Q(s),f((()=>{O(this.cacheState.map,i)}))))))}))))}}const kt=t=>{const s=o(t.timeToLive);return(t=>c(h([u(),l]),(([s,e])=>new Et(t.capacity,s,e,t.lookup,(s=>o(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})},_t=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends et{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),Ot=t=>{const s={BaseEffectError:class extends _t{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};class Rt extends(Ot("FetchError")){}class Pt extends(Ot("NotFoundError")){}class Lt extends(Ot("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}Ot("URLCreationError");const Vt=function(...o){const c=2===o.length?t=>o[0](t)?s(t):e(o[1](t)):t=>a(o[0](t),{onNone:()=>s(t),onSome:e});return Object.assign((s=>t(c(s),i)),{[lt]:lt,option:t=>n(c(t)),either:c,is:t=>r(c(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class jt extends(Ot("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}const Bt=()=>Vt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>');let Mt=null;function Nt(t){const s=t;return it((function*(){return Mt||(Mt=yield*kt({capacity:200,timeToLive:ht,lookup:t=>it((function*(){const s=t,e=yield*(i=`./icons/${s}.svg`,nt((()=>ut(["/assets",i].filter(Boolean).join("/").replace("//","/")))).pipe(at((()=>ot(`Failed to create URL for icon "${i}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!\n Falling back to /assets/`))),ct((()=>window.location.origin+"/assets/"+i))));var i;const r=yield*(n=e,it((function*(){const t=yield*rt({try:()=>fetch(n,void 0),catch:t=>new Rt({cause:t})});return 404===t.status?yield*new Pt({url:t.url}):t})));var n;const a=yield*(t=>rt({try:()=>t.text(),catch:t=>new Lt(t)}))(r);return yield*(o=a,nt({try:()=>Vt(o),catch:t=>new jt(t,"SVGString")}));var o}))})),yield*Mt.get(s)}))}function Tt(){return it((function*(){Mt?yield*Mt.invalidateAll:ot("Attempted to clear icon cache before it was initialized")}))}export{Tt as c,Bt as e,Nt as f}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as t}from"./p-smGPjoDX.js";import{ae as s,af as e,ag as i,ah as n,ai as r,aj as o,ak as c,al as a,am as h,an as u,ao as l,ap as d,aq as f,ar as b,as as v,at as m,au as p,av as S,aw as y,R as w,F as g,p as _,ax as F,h as E,O,P as C,ay as D,az as k,aA as x,u as R,aB as j,aC as P,aD as A,x as I,A as L,aE as z,aF as N,aG as B,N as U,Y as W,aH as Q,aI as q,a2 as T,aJ as V,aK as M,L as H,M as K,w as Y,aL as G,aM as X,aN as Z,aO as J,aP as $,a1 as tt,J as st,aQ as et,aR as it,aS as nt,aT as rt,aU as ot,aV as ct,aW as at,aX as ht,aY as ut,aZ as lt,a_ as dt,a$ as ft,b0 as bt,b1 as vt,n as mt,b2 as pt,W as St,b3 as yt,i as wt,b4 as gt,b5 as _t,b6 as Ft,b7 as Et,b8 as Ot,b9 as Ct,ba as Dt,bb as kt,bc as xt,bd as Rt,be as jt,bf as Pt,bg as At,bh as It,bi as Lt,bj as zt,bk as Nt,bl as Bt,$ as Ut,bm as Wt,bn as Qt,bo as qt,s as Tt,z as Vt,bp as Mt,bq as Ht,br as Kt,bs as Yt,bt as Gt,bu as Xt,bv as Zt,bw as Jt,bx as $t,by as ts,bz as ss,bA as es,bB as is,bC as ns,bD as rs,bE as os,bF as cs,bG as as,_ as hs,bH as us,bI as ls,bJ as ds,bK as fs,bL as bs,bM as vs,bN as ms,bO as ps,b as Ss,a as ys,bP as ws,bQ as gs,bR as _s,bS as Fs,bT as Es,bU as Os,bV as Cs,a8 as Ds,bW as ks,bX as xs,bY as Rs,bZ as js,b_ as Ps,b$ as As,c0 as Is,c1 as Ls,c2 as zs,c3 as Ns,c4 as Bs,c5 as Us,m as Ws,c6 as Qs,c7 as qs,X as Ts,c8 as Vs,c9 as Ms,ca as Hs,cb as Ks,cc as Ys,cd as Gs,ce as Xs,cf as Zs,cg as Js,ch as $s,ci as te,cj as se,ck as ee,c as ie,cl as ne,cm as re,cn as oe,co as ce,cp as ae}from"./p-D9S7OTyY.js";const he=s,ue=i,le=e,de=n,fe=o,be=u,ve=l,me=d,pe=r,Se=b,ye=f,we=c,ge=a,_e=h,Fe=p,Ee=S,Oe=m,Ce=y,De=v,ke=Symbol.for("effect/QueueEnqueue"),xe=Symbol.for("effect/QueueDequeue"),Re=Symbol.for("effect/QueueStrategy"),je=Symbol.for("effect/BackingQueue"),Pe={_A:t=>t},Ae={_A:t=>t},Ie={_In:t=>t},Le={_Out:t=>t};class ze extends k{queue;takers;shutdownHook;shutdownFlag;strategy;[ke]=Ie;[xe]=Le;constructor(t,s,e,i,n){super(),this.queue=t,this.takers=s,this.shutdownHook=e,this.shutdownFlag=i,this.strategy=n}pipe(){return x(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return R((()=>j(this.unsafeSize(),(()=>P))))}unsafeSize(){return A(this.shutdownFlag)?I():L(this.queue.length()-z(this.takers)+this.strategy.surplusSize())}get isEmpty(){return E(this.size,(t=>t<=0))}get isFull(){return E(this.size,(t=>t>=this.capacity()))}get shutdown(){return N(B((t=>(w(this.shutdownFlag,U(!0)),w(V(Ge(this.takers),(s=>lt(s,t.id())),!1,!1),T(this.strategy.shutdown),Q(q(this.shutdownHook,void 0)),W)))))}get isShutdown(){return _((()=>A(this.shutdownFlag)))}get awaitShutdown(){return M(this.shutdownHook)}isActive(){return!A(this.shutdownFlag)}unsafeOffer(t){if(A(this.shutdownFlag))return!1;let s;if(0===this.queue.length()){const e=w(this.takers,H(K));e!==K?(Ke(e,t),s=!0):s=!1}else s=!1;if(s)return!0;const e=this.queue.offer(t);return Je(this.strategy,this.queue,this.takers),e}offer(t){return R((()=>{if(A(this.shutdownFlag))return P;let s;if(0===this.queue.length()){const e=w(this.takers,H(K));e!==K?(Ke(e,t),s=!0):s=!1}else s=!1;if(s)return Y(!0);const e=this.queue.offer(t);return Je(this.strategy,this.queue,this.takers),e?Y(!0):this.strategy.handleSurplus([t],this.queue,this.takers,this.shutdownFlag)}))}offerAll(t){return R((()=>{if(A(this.shutdownFlag))return P;const s=G(t),e=0===this.queue.length()?G(Xe(this.takers,s.length)):X,[i,n]=w(s,Z(e.length));for(let t=0;t<e.length;t++)Ke(e[t],i[t]);if(0===n.length)return Y(!0);const r=this.queue.offerAll(n);return Je(this.strategy,this.queue,this.takers),J(r)?Y(!0):this.strategy.handleSurplus(r,this.queue,this.takers,this.shutdownFlag)}))}get take(){return B((t=>{if(A(this.shutdownFlag))return P;const s=this.queue.poll(K);if(s!==K)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Y(s);{const s=$(t.id());return w(R((()=>(w(this.takers,st(s)),Je(this.strategy,this.queue,this.takers),A(this.shutdownFlag)?P:M(s)))),tt((()=>_((()=>Ze(this.takers,s))))))}}))}get takeAll(){return R((()=>A(this.shutdownFlag)?P:_((()=>{const t=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),et(t)}))))}takeUpTo(t){return R((()=>A(this.shutdownFlag)?P:_((()=>{const s=this.queue.pollUpTo(t);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),et(s)}))))}takeBetween(t,s){return R((()=>Ne(this,t,s,dt())))}}const Ne=(t,s,e,i)=>e<s?Y(i):w(Te(t,e),g((n=>{const r=s-n.length;return 1===r?w(qe(t),E((t=>w(i,at(n),ht(t))))):r>1?w(qe(t),g((s=>Ne(t,r-1,e-n.length-1,w(i,at(n),ht(s)))))):Y(w(i,at(n)))}))),Be=(t,s)=>w(D(),E((e=>((t,s,e,i,n)=>new ze(t,s,e,i,n))(t,C(),e,O(!1),s))));class Ue{mutable;[je]=Ae;constructor(t){this.mutable=t}poll(t){return H(this.mutable,t)}pollUpTo(t){return it(this.mutable,t)}offerAll(t){return ut(this.mutable,t)}offer(t){return st(this.mutable,t)}capacity(){return bt(this.mutable)}length(){return z(this.mutable)}}const We=t=>new Ue(t),Qe=F(2,((t,s)=>t.offer(s))),qe=t=>t.take,Te=F(2,((t,s)=>t.takeUpTo(s))),Ve=F(3,((t,s,e)=>t.takeBetween(s,e)));class Me{[Re]=Pe;putters=C();surplusSize(){return z(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!ot(this.putters)&&!ot(t);){const s=H(t,void 0),e=H(this.putters,void 0);e[2]&&Ke(e[1],!0),Ke(s,e[0])}}get shutdown(){return w(mt,g((t=>w(_((()=>Ge(this.putters))),g((s=>V(s,(([s,e,i])=>i?w(lt(e,t),W):vt),!1,!1)))))))}handleSurplus(t,s,e,i){return B((n=>{const r=$(n.id());return w(R((()=>(this.unsafeOffer(t,r),this.unsafeOnQueueEmptySpace(s,e),Je(this,s,e),A(i)?P:M(r)))),tt((()=>_((()=>this.unsafeRemove(r))))))}))}unsafeOnQueueEmptySpace(t,s){let e=!0;for(;e&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const i=w(this.putters,H(K));if(i===K)e=!1;else{const e=t.offer(i[0]);e&&i[2]?Ke(i[1],!0):e||Ye(this.putters,w(Ge(this.putters),rt(i))),Je(this,t,s)}}}unsafeOffer(t,s){const e=G(t);for(let t=0;t<e.length;t++){const i=e[t];w(this.putters,st(t===e.length-1?[i,s,!0]:[i,s,!1]))}}unsafeRemove(t){Ye(this.putters,w(Ge(this.putters),ct((([,s])=>s!==t))))}}class He{[Re]=Pe;surplusSize(){return 0}get shutdown(){return vt}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,s,e,i){return Y(!1)}unsafeOnQueueEmptySpace(t,s){}}const Ke=(t,s)=>nt(t,Y(s)),Ye=(t,s)=>w(t,ut(s)),Ge=t=>w(t,it(Number.POSITIVE_INFINITY)),Xe=(t,s)=>w(t,it(s)),Ze=(t,s)=>{Ye(t,w(Ge(t),ct((t=>s!==t))))},Je=(t,s,e)=>{let i=!0;for(;i&&0!==s.length();){const n=w(e,H(K));if(n!==K){const r=s.poll(K);r!==K?(Ke(n,r),t.unsafeOnQueueEmptySpace(s,e)):Ye(e,w(Ge(e),rt(n))),i=!0}else i=!1}i&&0===s.length()&&!ot(e)&&t.onCompleteTakersWithEmptyQueue(e)},$e=t=>w(_((()=>ft(t))),g((t=>Be(We(t),new Me)))),ti=()=>w(_((()=>C())),g((t=>Be(We(t),new He)))),si=t=>t.shutdown,ei=Qe,ii=qe,ni=Ve,ri="Continue",oi=Symbol.for("effect/ChannelChildExecutorDecision"),ci={[oi]:oi},ai=()=>{const t=Object.create(ci);return t._tag=ri,t},hi="ContinuationK",ui=Symbol.for("effect/ChannelContinuation"),li={_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutDone:t=>t,_OutErr2:t=>t,_OutElem:t=>t,_OutDone2:t=>t};class di{onSuccess;onHalt;_tag=hi;[ui]=li;constructor(t,s){this.onSuccess=t,this.onHalt=s}onExit(t){return pt(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}class fi{finalizer;_tag="ContinuationFinalizer";[ui]=li;constructor(t){this.finalizer=t}}const bi="PullAfterNext",vi=Symbol.for("effect/ChannelUpstreamPullStrategy"),mi={[vi]:{_A:t=>t}},pi=t=>{const s=Object.create(mi);return s._tag=bi,s.emitSeparator=t,s},Si="BracketOut",yi="Bridge",wi="ConcatAll",gi="Emit",_i="Ensuring",Fi="Fail",Ei="Fold",Oi="FromEffect",Ci="PipeTo",Di="Read",ki="Succeed",xi="SucceedNow",Ri="Suspend",ji=Symbol.for("effect/Channel"),Pi={[ji]:{_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},pipe(){return x(this,arguments)}},Ai=t=>St(t,ji)||yt(t),Ii=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=Si,e.acquire=()=>t,e.finalizer=s,e})),Li=(t,s,e)=>{const i=Object.create(Pi);return i._tag=wi,i.combineInners=s,i.combineAll=e,i.onPull=()=>pi(I()),i.onEmit=()=>ai,i.value=()=>t,i.k=wt,i},zi=F(4,((t,s,e,i)=>{const n=Object.create(Pi);return n._tag=wi,n.combineInners=e,n.combineAll=i,n.onPull=()=>pi(I()),n.onEmit=()=>ai,n.value=()=>t,n.k=s,n})),Ni=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=yi,e.input=s,e.channel=t,e})),Bi=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=_i,e.channel=t,e.finalizer=s,e})),Ui=t=>Wi(fe(t)),Wi=t=>Qi((()=>t)),Qi=t=>{const s=Object.create(Pi);return s._tag=Fi,s.error=t,s},qi=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=Ei,e.channel=t,e.k=new di(s,Wi),e})),Ti=t=>{const s=Object.create(Pi);return s._tag=Oi,s.effect=()=>t,s},Vi=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=Ci,e.left=()=>t,e.right=()=>s,e})),Mi=t=>Hi({onInput:t.onInput,onFailure:s=>gt(we(s),{onLeft:t.onFailure,onRight:Wi}),onDone:t.onDone}),Hi=t=>{const s=Object.create(Pi);return s._tag=Di,s.more=t.onInput,s.done=new di(t.onDone,t.onFailure),s},Ki=t=>Xi((()=>t)),Yi=t=>{const s=Object.create(Pi);return s._tag=xi,s.terminal=t,s},Gi=t=>{const s=Object.create(Pi);return s._tag=Ri,s.channel=t,s},Xi=t=>{const s=Object.create(Pi);return s._tag=ki,s.evaluate=t,s},Zi=Yi(void 0),Ji=t=>{const s=Object.create(Pi);return s._tag=gi,s.out=t,s},$i="Done",tn="Emit",sn="FromEffect",en="Read",nn=Symbol.for("effect/ChannelState"),rn={[nn]:{_E:t=>t,_R:t=>t}},on=()=>{const t=Object.create(rn);return t._tag=$i,t},cn=()=>{const t=Object.create(rn);return t._tag=tn,t},an=t=>{const s=Object.create(rn);return s._tag=sn,s.effect=t,s},hn=(t,s,e,i)=>{const n=Object.create(rn);return n._tag=en,n.upstream=t,n.onEffect=s,n.onEmit=e,n.onDone=i,n},un=t=>t._tag===sn,ln=t=>un(t)?Ft(t.effect):void 0,dn="PullFromChild",fn="PullFromUpstream",bn="DrainChildExecutors",vn="Emit";class mn{childExecutor;parentSubexecutor;onEmit;_tag=dn;constructor(t,s,e){this.childExecutor=t,this.parentSubexecutor=s,this.onEmit=e}close(t){const s=this.childExecutor.close(t),e=this.parentSubexecutor.close(t);return void 0!==s&&void 0!==e?Et(Ot(s),Ot(e),((t,s)=>w(t,Ct(s)))):void 0!==s?s:void 0!==e?e:void 0}enqueuePullFromChild(t){return this}}class pn{upstreamExecutor;createChild;lastDone;activeChildExecutors;combineChildResults;combineWithChildResult;onPull;onEmit;_tag=fn;constructor(t,s,e,i,n,r,o,c){this.upstreamExecutor=t,this.createChild=s,this.lastDone=e,this.activeChildExecutors=i,this.combineChildResults=n,this.combineWithChildResult=r,this.onPull=o,this.onEmit=c}close(t){const s=this.upstreamExecutor.close(t);return[...this.activeChildExecutors.map((s=>void 0!==s?s.childExecutor.close(t):void 0)),s].reduce(((t,s)=>void 0!==t&&void 0!==s?Et(t,Ot(s),((t,s)=>Ct(t,s))):void 0!==t?t:void 0!==s?Ot(s):void 0),void 0)}enqueuePullFromChild(t){return new pn(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class Sn{upstreamExecutor;lastDone;activeChildExecutors;upstreamDone;combineChildResults;combineWithChildResult;onPull;_tag=bn;constructor(t,s,e,i,n,r,o){this.upstreamExecutor=t,this.lastDone=s,this.activeChildExecutors=e,this.upstreamDone=i,this.combineChildResults=n,this.combineWithChildResult=r,this.onPull=o}close(t){const s=this.upstreamExecutor.close(t);return[...this.activeChildExecutors.map((s=>void 0!==s?s.childExecutor.close(t):void 0)),s].reduce(((t,s)=>void 0!==t&&void 0!==s?Et(t,Ot(s),((t,s)=>Ct(t,s))):void 0!==t?t:void 0!==s?Ot(s):void 0),void 0)}enqueuePullFromChild(t){return new Sn(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class yn{value;next;_tag=vn;constructor(t,s){this.value=t,this.next=s}close(t){return this.next.close(t)}enqueuePullFromChild(t){return this}}const wn=Symbol.for("effect/ChannelUpstreamPullRequest"),gn={[wn]:{_A:t=>t}},_n=t=>{const s=Object.create(gn);return s._tag="Pulled",s.value=t,s};class Fn{_activeSubexecutor=void 0;_cancelled=void 0;_closeLastSubstream=void 0;_currentChannel;_done=void 0;_doneStack=[];_emitted=void 0;_executeCloseLastSubstream;_input=void 0;_inProgressFinalizer=void 0;_providedEnv;constructor(t,s,e){this._currentChannel=t,this._executeCloseLastSubstream=e,this._providedEnv=s}run(){let t;for(;void 0===t;)if(void 0!==this._cancelled)t=this.processCancellation();else if(void 0!==this._activeSubexecutor)t=this.runSubexecutor();else try{if(void 0===this._currentChannel)t=on();else switch(yt(this._currentChannel)&&(this._currentChannel=Ti(this._currentChannel)),this._currentChannel._tag){case Si:t=this.runBracketOut(this._currentChannel);break;case yi:{const s=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,void 0!==this._input){const e=this._input;this._input=void 0;const i=()=>jt(s.awaitRead(),(()=>It((()=>{const t=e.run();switch(t._tag){case $i:return Qt(e.getDone(),{onFailure:t=>s.error(t),onSuccess:t=>s.done(t)});case tn:return jt(s.emit(e.getEmit()),(()=>i()));case sn:return xt(t.effect,{onFailure:t=>s.error(t),onSuccess:()=>i()});case en:return Cn(t,(()=>i()),(t=>s.error(t)))}}))));t=an(jt(Pt(At(i())),(t=>Dt((()=>this.addFinalizer((s=>jt(Oe(t),(()=>It((()=>{const t=this.restorePipe(s,e);return void 0!==t?t:_t})))))))))))}break}case wi:{const t=new Fn(this._currentChannel.value(),this._providedEnv,(t=>Dt((()=>{this._closeLastSubstream=w(void 0===this._closeLastSubstream?_t:this._closeLastSubstream,Rt(t))}))));t._input=this._input;const s=this._currentChannel;this._activeSubexecutor=new pn(t,(t=>s.k(t)),void 0,[],((t,e)=>s.combineInners(t,e)),((t,e)=>s.combineAll(t,e)),(t=>s.onPull(t)),(t=>s.onEmit(t))),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case gi:this._emitted=this._currentChannel.out,this._currentChannel=void 0!==this._activeSubexecutor?void 0:Zi,t=cn();break;case _i:this.runEnsuring(this._currentChannel);break;case Fi:t=this.doneHalt(this._currentChannel.error());break;case Ei:this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break;case Oi:{const s=void 0===this._providedEnv?this._currentChannel.effect():w(this._currentChannel.effect(),kt(this._providedEnv));t=an(xt(s,{onFailure:t=>{const s=this.doneHalt(t);return void 0!==s&&un(s)?s.effect:_t},onSuccess:t=>{const s=this.doneSucceed(t);return void 0!==s&&un(s)?s.effect:_t}}));break}case Ci:{const t=this._input,s=new Fn(this._currentChannel.left(),this._providedEnv,(t=>this._executeCloseLastSubstream(t)));s._input=t,this._input=s,this.addFinalizer((s=>{const e=this.restorePipe(s,t);return void 0!==e?e:_t})),this._currentChannel=this._currentChannel.right();break}case"Provide":{const t=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer((()=>Dt((()=>{this._providedEnv=t}))));break}case Di:{const s=this._currentChannel;t=hn(this._input,wt,(t=>{try{this._currentChannel=s.more(t)}catch(t){this._currentChannel=s.done.onExit(Xt(t))}}),(t=>{this._currentChannel=(t=>s.done.onExit(t))(t)}));break}case ki:t=this.doneSucceed(this._currentChannel.evaluate());break;case xi:t=this.doneSucceed(this._currentChannel.terminal);break;case Ri:this._currentChannel=this._currentChannel.channel()}}catch(t){this._currentChannel=Wi(be(t))}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(t){this._cancelled=t}clearInProgressFinalizer(){this._inProgressFinalizer=void 0}storeInProgressFinalizer(t){this._inProgressFinalizer=t}popAllFinalizers(t){const s=[];let e=this._doneStack.pop();for(;e;)"ContinuationFinalizer"===e._tag&&s.push(e.finalizer),e=this._doneStack.pop();const i=0===s.length?_t:On(s,t);return this.storeInProgressFinalizer(i),i}popNextFinalizers(){const t=[];for(;0!==this._doneStack.length;){const s=this._doneStack[this._doneStack.length-1];if(s._tag===hi)return t;t.push(s),this._doneStack.pop()}return t}restorePipe(t,s){const e=this._input;return this._input=s,void 0!==e?e.close(t):_t}close(t){let s;const e=this._inProgressFinalizer;let i;void 0!==e&&(s=w(e,Lt(Dt((()=>this.clearInProgressFinalizer())))));const n=this.popAllFinalizers(t);void 0!==n&&(i=w(n,Lt(Dt((()=>this.clearInProgressFinalizer())))));const r=void 0===this._activeSubexecutor?void 0:this._activeSubexecutor.close(t);if(void 0!==r||void 0!==s||void 0!==i)return w(Ot(En(r)),Bt(Ot(En(s))),Bt(Ot(En(i))),Nt((([[t,s],e])=>w(t,Ct(s),Ct(e)))),zt,jt((t=>It((()=>t)))))}doneSucceed(t){if(0===this._doneStack.length)return this._done=Ut(t),this._currentChannel=void 0,on();const s=this._doneStack[this._doneStack.length-1];if(s._tag===hi)return this._doneStack.pop(),void(this._currentChannel=s.onSuccess(t));const e=this.popNextFinalizers();if(0===this._doneStack.length)return this._doneStack=e.reverse(),this._done=Ut(t),this._currentChannel=void 0,on();const i=On(e.map((t=>t.finalizer)),Ut(t));this.storeInProgressFinalizer(i);const n=w(i,Lt(Dt((()=>this.clearInProgressFinalizer()))),zt,jt((()=>Dt((()=>this.doneSucceed(t))))));return an(n)}doneHalt(t){if(0===this._doneStack.length)return this._done=Wt(t),this._currentChannel=void 0,on();const s=this._doneStack[this._doneStack.length-1];if(s._tag===hi){this._doneStack.pop();try{this._currentChannel=s.onHalt(t)}catch(t){this._currentChannel=Wi(be(t))}return}const e=this.popNextFinalizers();if(0===this._doneStack.length)return this._doneStack=e.reverse(),this._done=Wt(t),this._currentChannel=void 0,on();const i=On(e.map((t=>t.finalizer)),Wt(t));this.storeInProgressFinalizer(i);const n=w(i,Lt(Dt((()=>this.clearInProgressFinalizer()))),zt,jt((()=>Dt((()=>this.doneHalt(t))))));return an(n)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,on()}runBracketOut(t){const s=zt(xt(this.provide(t.acquire()),{onFailure:t=>Dt((()=>{this._currentChannel=Wi(t)})),onSuccess:s=>Dt((()=>{this.addFinalizer((e=>this.provide(t.finalizer(s,e)))),this._currentChannel=Ji(s)}))}));return an(s)}provide(t){return void 0===this._providedEnv?t:w(t,kt(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new fi(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case dn:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case fn:return this.pullFromUpstream(t);case bn:return this.drainChildExecutors(t);case vn:return this._emitted=t.value,this._activeSubexecutor=t.next,cn()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const s=Qt(t,{onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)});return this._activeSubexecutor=void 0,void 0===s?_t:un(e=s)?e.effect:_t;var e}finishSubexecutorWithCloseEffect(t,...s){this.addFinalizer((()=>w(s,qt((s=>w(Dt((()=>s(t))),jt((t=>void 0!==t?t:_t)))),{discard:!0}))));const e=w(t,Qt({onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)}));return this._activeSubexecutor=void 0,e}applyUpstreamPullStrategy(t,s,e){switch(e._tag){case bi:{const i=!t||s.some((t=>void 0!==t));return[e.emitSeparator,i?[void 0,...s]:s]}case"PullAfterAllEnqueued":{const i=!t||s.some((t=>void 0!==t));return[e.emitSeparator,i?[...s,void 0]:s]}}}pullFromChild(t,s,e,i){return hn(t,wt,(n=>{const r=e(n);switch(r._tag){case ri:break;case"Close":this.finishWithDoneValue(t,s,r.value);break;case"Yield":{const t=s.enqueuePullFromChild(i);this.replaceSubexecutor(t);break}}this._activeSubexecutor=new yn(n,this._activeSubexecutor)}),Qt({onFailure:e=>{const i=this.handleSubexecutorFailure(t,s,e);return void 0===i?void 0:ln(i)},onSuccess:e=>{this.finishWithDoneValue(t,s,e)}}))}finishWithDoneValue(t,s,e){const i=s;switch(i._tag){case fn:{const s=new pn(i.upstreamExecutor,i.createChild,void 0!==i.lastDone?i.combineChildResults(i.lastDone,e):e,i.activeChildExecutors,i.combineChildResults,i.combineWithChildResult,i.onPull,i.onEmit);this._closeLastSubstream=t.close(Ut(e)),this.replaceSubexecutor(s);break}case bn:{const s=new Sn(i.upstreamExecutor,void 0!==i.lastDone?i.combineChildResults(i.lastDone,e):e,i.activeChildExecutors,i.upstreamDone,i.combineChildResults,i.combineWithChildResult,i.onPull);this._closeLastSubstream=t.close(Ut(e)),this.replaceSubexecutor(s);break}}}handleSubexecutorFailure(t,s,e){return this.finishSubexecutorWithCloseEffect(Wt(e),(t=>s.close(t)),(s=>t.close(s)))}pullFromUpstream(t){if(0===t.activeChildExecutors.length)return this.performPullFromUpstream(t);const s=t.activeChildExecutors[0],e=new pn(t.upstreamExecutor,t.createChild,t.lastDone,t.activeChildExecutors.slice(1),t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit);if(void 0===s)return this.performPullFromUpstream(e);this.replaceSubexecutor(new mn(s.childExecutor,e,s.onEmit))}performPullFromUpstream(t){return hn(t.upstreamExecutor,(t=>{const s=void 0===this._closeLastSubstream?_t:this._closeLastSubstream;return this._closeLastSubstream=void 0,w(this._executeCloseLastSubstream(s),Rt(t))}),(s=>{if(void 0!==this._closeLastSubstream){const e=this._closeLastSubstream;return this._closeLastSubstream=void 0,w(this._executeCloseLastSubstream(e),Nt((()=>{const e=new Fn(t.createChild(s),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[i,n]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(_n(s)));this._activeSubexecutor=new mn(e,new pn(t.upstreamExecutor,t.createChild,t.lastDone,n,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Vt(i)&&(this._activeSubexecutor=new yn(i.value,this._activeSubexecutor))})))}const e=new Fn(t.createChild(s),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[i,n]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(_n(s)));this._activeSubexecutor=new mn(e,new pn(t.upstreamExecutor,t.createChild,t.lastDone,n,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Vt(i)&&(this._activeSubexecutor=new yn(i.value,this._activeSubexecutor))}),(s=>{if(t.activeChildExecutors.some((t=>void 0!==t))){const s=new Sn(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(void 0!==this._closeLastSubstream){const t=this._closeLastSubstream;return this._closeLastSubstream=void 0,w(this._executeCloseLastSubstream(t),Nt((()=>this.replaceSubexecutor(s))))}return void this.replaceSubexecutor(s)}const e=this._closeLastSubstream,i=this.finishSubexecutorWithCloseEffect(w(s,Zt((s=>t.combineWithChildResult(t.lastDone,s)))),(()=>e),(s=>t.upstreamExecutor.close(s)));return void 0===i?void 0:ln(i)}))}drainChildExecutors(t){if(0===t.activeChildExecutors.length){const s=this._closeLastSubstream;return void 0!==s&&this.addFinalizer((()=>Tt(s))),this.finishSubexecutorWithCloseEffect(t.upstreamDone,(()=>s),(s=>t.upstreamExecutor.close(s)))}const s=t.activeChildExecutors[0],e=t.activeChildExecutors.slice(1);if(void 0===s){const[s,i]=this.applyUpstreamPullStrategy(!0,e,t.onPull((t=>{const s=Object.create(gn);return s._tag="NoUpstream",s.activeDownstreamCount=t,s})(e.reduce(((t,s)=>void 0!==s?t+1:t),0))));return this.replaceSubexecutor(new Sn(t.upstreamExecutor,t.lastDone,i,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),Vt(s)?(this._emitted=s.value,cn()):void 0}const i=new Sn(t.upstreamExecutor,t.lastDone,e,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new mn(s.childExecutor,i,s.onEmit))}}const En=t=>void 0!==t?t:_t,On=(t,s)=>w(qt(t,(t=>Ot(t(s)))),Nt((t=>w(Mt(t),Ht((()=>Kt))))),jt((t=>It((()=>t))))),Cn=(t,s,e)=>{const i=[t],n=()=>{const t=i.pop();if(void 0===t||void 0===t.upstream)return Yt("Unexpected end of input for channel execution");const r=t.upstream.run();switch(r._tag){case tn:{const r=t.onEmit(t.upstream.getEmit());return 0===i.length?void 0===r?It(s):w(r,xt({onFailure:e,onSuccess:s})):void 0===r?It((()=>n())):w(r,xt({onFailure:e,onSuccess:()=>n()}))}case $i:{const r=t.onDone(t.upstream.getDone());return 0===i.length?void 0===r?It(s):w(r,xt({onFailure:e,onSuccess:s})):void 0===r?It((()=>n())):w(r,xt({onFailure:e,onSuccess:()=>n()}))}case sn:return i.push(t),w(t.onEffect(r.effect),Gt((s=>It((()=>{const e=t.onDone(Wt(s));return void 0===e?_t:e})))),xt({onFailure:e,onSuccess:()=>n()}));case en:return i.push(t),i.push(r),It((()=>n()))}};return n()},Dn=F(2,((t,s)=>Jt((e=>$t([ts(s,es),ss(),ss()]).pipe(jt((([i,n,r])=>e(((s,e,i)=>is(Dt((()=>new Fn(t,void 0,wt))),(t=>It((()=>kn(t.run(),t).pipe(us(s),Rt(hs(s)),ls(hs(e)))))),((t,s)=>{const e=t.close(s);return void 0===e?_t:ds(e,(t=>fs(i,bs(t))))})))(n,r,i)).pipe(ns(s),jt((t=>s.addFinalizer((s=>{const e=pt(s)?ye(s.cause):void 0;return rs(n).pipe(jt((s=>s?os(r,void 0).pipe(Rt(Fe(t)),Rt(Ee(t))):os(r,void 0).pipe(Rt(e&&cs(e)>0?Ce(t,as(e)):Oe(t)),Rt(Ee(t))))))})).pipe(Rt(e(hs(n)))))))))))))),kn=(t,s)=>{const e=t;switch(e._tag){case sn:return w(e.effect,jt((()=>kn(s.run(),s))));case tn:return kn(s.run(),s);case $i:return It((()=>s.getDone()));case en:return Cn(e,(()=>kn(s.run(),s)),bs)}},xn=Symbol.for("effect/ChannelMergeDecision"),Rn={[xn]:{_R:t=>t,_E0:t=>t,_Z0:t=>t,_E:t=>t,_Z:t=>t}},jn=t=>{const s=Object.create(Rn);return s._tag="Await",s.f=t,s},Pn="BothRunning",An="LeftDone",In="RightDone",Ln=Symbol.for("effect/ChannelMergeState"),zn={[Ln]:Ln},Nn=(t,s)=>{const e=Object.create(zn);return e._tag=Pn,e.left=t,e.right=s,e},Bn=t=>{const s=Object.create(zn);return s._tag=An,s.f=t,s},Un=t=>{const s=Object.create(zn);return s._tag=In,s.f=t,s},Wn="BackPressure",Qn="BufferSliding",qn=Symbol.for("effect/ChannelMergeStrategy"),Tn={[qn]:qn},Vn=()=>{const t=Object.create(Tn);return t._tag=Wn,t},Mn=()=>{const t=Object.create(Tn);return t._tag=Qn,t},Hn=F(2,((t,{onBackPressure:s,onBufferSliding:e})=>{switch(t._tag){case Wn:return s();case Qn:return e()}})),Kn="Empty",Yn="Emit",Gn="Error",Xn="Done",Zn=t=>({_tag:Kn,notifyProducer:t}),Jn=t=>({_tag:Yn,notifyConsumers:t}),$n=t=>({_tag:Gn,cause:t});class tr{ref;constructor(t){this.ref=t}awaitRead(){return vs(le(this.ref,(t=>t._tag===Kn?[hs(t.notifyProducer),t]:[_t,t])))}get close(){return ms((t=>this.error(ve(t))))}done(t){return vs(le(this.ref,(s=>{switch(s._tag){case Kn:return[hs(s.notifyProducer),s];case Yn:return[qt(s.notifyConsumers,(s=>os(s,Ss(t))),{discard:!0}),(e=t,{_tag:Xn,done:e})];case Gn:case Xn:return[ps,s]}var e})))}emit(t){return jt(ss(),(s=>vs(le(this.ref,(e=>{switch(e._tag){case Kn:return[hs(e.notifyProducer),e];case Yn:{const i=e.notifyConsumers[0],n=e.notifyConsumers.slice(1);if(void 0!==i)return[os(i,ys(t)),0===n.length?Zn(s):Jn(n)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case Gn:case Xn:return[ps,e]}})))))}error(t){return vs(le(this.ref,(s=>{switch(s._tag){case Kn:return[hs(s.notifyProducer),s];case Yn:return[qt(s.notifyConsumers,(s=>ws(s,t)),{discard:!0}),$n(t)];case Gn:case Xn:return[ps,s]}})))}get take(){return this.takeWith((t=>Wt(_e(t,Ss))),(t=>Ut(t)),(t=>gs(ys(t))))}takeWith(t,s,e){return jt(ss(),(i=>vs(le(this.ref,(n=>{switch(n._tag){case Kn:return[Rt(os(n.notifyProducer,void 0),_s(hs(i),{onFailure:t,onSuccess:gt({onLeft:e,onRight:s})})),Jn([i])];case Yn:return[_s(hs(i),{onFailure:t,onSuccess:gt({onLeft:e,onRight:s})}),Jn([...n.notifyConsumers,i])];case Gn:return[Tt(t(n.cause)),n];case Xn:return[Tt(e(n.done)),n]}})))))}}const sr=()=>w(ss(),jt((t=>he(Zn(t)))),Nt((t=>new tr(t)))),er=F(2,((t,s)=>zi(t,s,(()=>{}),(()=>{})))),ir=t=>{const s=Hi({onInput:()=>s,onFailure:Wi,onDone:Ki});return Vi(t,s)},nr=F(2,((t,s)=>Bi(t,(()=>s)))),rr=t=>pr(t.takeWith(Wi,(s=>qi(Ji(s),(()=>rr(t)))),Ki)),or=()=>Mi({onInput:t=>qi(Ji(t),(()=>or())),onFailure:Ui,onDone:Yi}),cr=F(2,((t,s)=>qi(t,(t=>Xi((()=>s(t))))))),ar=F(2,((t,s)=>{const e=Mi({onInput:t=>qi(Ji(s(t)),(()=>e)),onFailure:Ui,onDone:Yi});return Vi(t,e)})),hr=F(3,((t,s,e)=>yr((i=>Ds((function*(){const n=yield*sr(),r=rr(n),o=yield*$e(e);yield*fs(i,si(o));const c=yield*ss(),a=e===Number.POSITIVE_INFINITY?()=>wt:(yield*zs(e)).withPermits,h=yield*r.pipe(Vi(t),vr(i));yield*h.pipe(xt({onFailure:t=>ei(o,bs(t)),onSuccess:gt({onLeft:t=>Rt(At(a(e)(_t)),qs(ei(o,Tt(Ss(t))))),onRight:t=>Ds((function*(){const e=yield*ss(),n=yield*ss();yield*ei(o,Nt(hs(e),ys)),yield*os(n,void 0).pipe(Rt(Jt((e=>Ot(e(hs(c))).pipe(Ms(Ot(e(s(t)))),jt(wt)))).pipe(ds((t=>ws(c,t))),us(e))),a(1),ns(i)),yield*hs(n)}))})}),Hs,At,ns(i));const u=pr(_s(vs(ii(o)),{onFailure:Wi,onSuccess:gt({onLeft:Yi,onRight:t=>qi(Ji(t),(()=>u))})}));return Ni(u,n)})))))),ur=F(3,((t,s,e)=>(t=>s=>(({bufferSize:t=16,concurrency:s,mergeStrategy:e=Vn()})=>(i,n)=>yr((r=>Ds((function*(){const o="unbounded"===s?Number.MAX_SAFE_INTEGER:s,c=yield*sr(),a=rr(c),h=yield*$e(t);yield*fs(r,si(h));const u=yield*ti();yield*fs(r,si(u));const l=yield*he(I()),d=yield*ss(),f=(yield*zs(o)).withPermits,b=yield*vr(Vi(a,i),r);function v(t){return t.pipe(jt(gt({onLeft:t=>Tt(L(t)),onRight:t=>Us(ei(h,Tt(ys(t))),I())})),Qs({until:t=>Vt(t)}),jt((t=>de(l,Ws({onNone:()=>L(t.value),onSome:s=>L(n(s,t.value))})))),Gt((t=>pe(t)?bs(t):ei(h,bs(t)).pipe(Rt(os(d,void 0)),qs))))}yield*b.pipe(xt({onFailure:t=>ei(h,bs(t)).pipe(Rt(Tt(!1))),onSuccess:gt({onLeft:t=>Ps(At(hs(d)),At(f(o)(_t)),{onSelfDone:(t,s)=>Us(Oe(s),!1),onOtherDone:(s,e)=>Rt(Oe(e),ue(l).pipe(jt(Ws({onNone:()=>ei(h,Tt(Ss(t))),onSome:s=>ei(h,Tt(Ss(n(s,t))))})),Us(!1)))}),onRight:t=>Hn(e,{onBackPressure:()=>Ds((function*(){const s=yield*ss(),e=Fs((s=>vr(Vi(a,t),s).pipe(jt((t=>Bs(Ot(v(t)),Ot(At(hs(d)))))),jt(wt))));return yield*os(s,void 0).pipe(Rt(e),f(1),ns(r)),yield*hs(s),!(yield*rs(d))})),onBufferSliding:()=>Ds((function*(){const s=yield*ss(),e=yield*ss(),i=yield*(n=u,n.size);var n;yield*ii(u).pipe(jt((t=>os(t,void 0))),Ns((()=>i>=o))),yield*ei(u,s);const c=Fs((e=>vr(Vi(a,t),e).pipe(jt((t=>Ot(v(t)).pipe(Bs(Ot(At(hs(d)))),Bs(Ot(At(hs(s))))))),jt(wt))));return yield*os(e,void 0).pipe(Rt(c),f(1),ns(r)),yield*hs(e),!(yield*rs(d))}))})})}),Qs({while:t=>t}),ns(r));const m=w(ii(h),vs,_s({onFailure:Wi,onSuccess:gt({onLeft:Yi,onRight:t=>qi(Ji(t),(()=>m))})}),pr);return Ni(m,c)})))))(t)(s,Os))(e)(ar(t,s)))),lr=F(2,((t,s)=>yr((function(e){return Ds((function*(){const i=yield*sr(),n=rr(i),r=yield*vr(Vi(n,t),e),o=yield*vr(Vi(n,s.other),e);function c(t,s,i){return(n,r,o)=>{function c(t){const e=t;return"Done"===e._tag?Tt(Ti(Rt(Oe(s),e.effect))):Nt(Fe(s),Qt({onFailure:t=>Ti(e.f(Wt(t))),onSuccess:gt({onLeft:t=>Ti(e.f(Ut(t))),onRight:t=>Fr(Ji(t),a(o(e.f)))})}))}return Qt(t,{onFailure:t=>c(n(Wt(t))),onSuccess:gt({onLeft:t=>c(n(Ut(t))),onRight:t=>Tt(qi(Ji(t),(()=>qi(Ti(ns(At(i),e)),(t=>a(r(t,s)))))))})})}}function a(t){switch(t._tag){case Pn:{const e=At(De(t.left)),i=At(De(t.right));return pr(Ps(e,i,{onSelfDone:(e,i)=>Rt(Oe(i),c(e,t.right,r)(s.onSelfDone,Nn,(t=>Bn(t)))),onOtherDone:(e,i)=>Rt(Oe(i),c(e,t.left,o)(s.onOtherDone,((t,s)=>Nn(s,t)),(t=>Un(t))))}))}case An:return pr(Nt(Ot(o),Qt({onFailure:s=>Ti(t.f(Wt(s))),onSuccess:gt({onLeft:s=>Ti(t.f(Ut(s))),onRight:s=>qi(Ji(s),(()=>a(Bn(t.f))))})})));case In:return pr(Nt(Ot(r),Qt({onFailure:s=>Ti(t.f(Wt(s))),onSuccess:gt({onLeft:s=>Ti(t.f(Ut(s))),onRight:s=>qi(Ji(s),(()=>a(Un(t.f))))})})))}}return Ti(ks((t=>{const s=ks((s=>(s.transferChildren(t.scope()),_t))),i=At(r).pipe(Lt(s),ns(e)),n=At(o).pipe(Lt(s),ns(e));return Et(i,n,((t,s)=>Nn(t,s)))}))).pipe(qi(a),Ni(i))}))})))),dr=F(2,((t,s)=>Gi((()=>{let e;const i=Mi({onInput:t=>qi(Ji(t),(()=>i)),onFailure:t=>(e=Or(t),Wi(be(e))),onDone:Yi}),n=Hi({onInput:t=>w(Ji(t),qi((()=>n))),onFailure:t=>me(t)&&Cr(t.defect)&&Ts(t.defect,e)?Ui(t.defect.error):Wi(t),onDone:Yi});return Vi(Vi(Vi(t,i),s),n)})))),fr=t=>(t=>Fs((s=>Dn(t,s))))(ir(t)),br=t=>Sr(Nt(Cs,(s=>qi(Ti(t(s)),Ji)))),vr=F(2,((t,s)=>Bt(Dt((()=>new Fn(t,void 0,wt))),As()).pipe(Is((([t,e])=>Ls(s,(s=>{const i=t.close(s);return void 0!==i?kt(i,e):_t})))),zt,Nt((([t])=>It((()=>mr(t.run(),t)))))))),mr=(t,s)=>{const e=t;switch(e._tag){case $i:return Qt(s.getDone(),{onFailure:bs,onSuccess:t=>Tt(Ss(t))});case tn:return Tt(ys(s.getEmit()));case sn:return w(e.effect,jt((()=>mr(s.run(),s))));case en:return Cn(e,(()=>mr(s.run(),s)),(t=>bs(t)))}},pr=t=>{return s=Ti(t),qi(s,wt);var s},Sr=t=>{return Li((s=t,pr(Jt((t=>Nt(xs(),(e=>Ii(ds(t(Rs(s,e)),(t=>js(e,Wt(t)))),((t,s)=>js(e,s))))))))),(t=>t),(t=>t));var s},yr=t=>Li(br(t),(t=>t),(t=>t)),wr=t=>gr(0,t.length,t),gr=(t,s,e)=>t===s?Zi:w(Ji(w(e,Es(t))),qi((()=>gr(t+1,s,e)))),_r=F((t=>Ai(t[1])),((t,s,e)=>e?.concurrent?lr(t,{other:s,onSelfDone:t=>jn((s=>It((()=>Vs(t,s))))),onOtherDone:t=>jn((s=>It((()=>Vs(s,t)))))}):qi(t,(t=>cr(s,(s=>[t,s])))))),Fr=F((t=>Ai(t[1])),((t,s,e)=>e?.concurrent?cr(_r(t,s,{concurrent:!0}),(t=>t[1])):qi(t,(()=>s)))),Er=Symbol.for("effect/Channel/ChannelException"),Or=t=>({_tag:"ChannelException",[Er]:Er,error:t}),Cr=t=>St(t,Er),Dr=Symbol.for("effect/Sink"),kr={_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t};class xr{channel;[Dr]=kr;constructor(t){this.channel=t}pipe(){return x(this,arguments)}}const Rr=new xr(ir(or())),jr=t=>yt(t)?jr(new xr(Ti(t))):t.channel,Pr=Symbol.for("effect/Take"),Ar={_A:t=>t,_E:t=>t};class Ir{exit;[Pr]=Ar;constructor(t){this.exit=t}pipe(){return x(this,arguments)}}const Lr=t=>new Ir(Ut(t)),zr=new Ir(gs(I())),Nr=Symbol.for("effect/Stream"),Br={_R:t=>t,_E:t=>t,_A:t=>t};class Ur{channel;[Nr]=Br;constructor(t){this.channel=t}pipe(){return x(this,arguments)}}const Wr=t=>St(t,Nr)||yt(t),Qr=F(2,((t,s)=>new Ur(w(Kr(t),nr(s))))),qr=F((t=>Wr(t[0])),((t,s,e)=>{const i=e?.bufferSize??16;return e?.switch?Tr(e?.concurrency,(()=>Vr(t,1,i,s)),(e=>Vr(t,e,i,s))):Tr(e?.concurrency,(()=>new Ur(er(Kr(t),(t=>w(t,Zs((t=>Kr(s(t)))),Xs(Zi,((t,s)=>w(t,Fr(s))))))))),(()=>new Ur(w(Kr(t),er(wr),ur((t=>Kr(s(t))),e)))))})),Tr=(t,s,e)=>{switch(t){case void 0:return s();case"unbounded":return e(Number.MAX_SAFE_INTEGER);default:return t>1?e(t):s()}},Vr=F(4,((t,s,e,i)=>new Ur(w(Kr(t),er(wr),ur((t=>Kr(i(t))),{concurrency:s,mergeStrategy:Mn(),bufferSize:e}))))),Mr=F((t=>Wr(t[0])),((t,s)=>qr(t,wt,s))),Hr=t=>(t=>{const s=Hi({onInput:t=>qi(wr(t),(()=>s)),onFailure:Wi,onDone:()=>Zi});return new Ur(w(Kr(t),Vi(s)))})((t=>{const s=Hi({onInput:t=>((t,s)=>{const[e,i]=w(t,$s((t=>!te(t)))),n=w(se(i),Ws({onNone:()=>s,onSome:Qt({onFailure:t=>Ws(ge(t),{onNone:()=>Zi,onSome:Wi}),onSuccess:()=>Zi})}));return w(Ji(w(e,ee((t=>te(t)?L(t.value):I())))),qi((()=>n)))})(t,s),onFailure:t=>Wi(t),onDone:()=>Zi});return new Ur(w(Kr(t),Vi(s)))})(w(t,Zr((t=>t.exit))))),Kr=t=>{if("channel"in t)return t.channel;if(yt(t))return Kr(Yr(t));throw new TypeError("Expected a Stream.")},Yr=t=>w(t,Gs(L),Gr),Gr=t=>new Ur(pr(Js(t,{onFailure:Ws({onNone:()=>Zi,onSome:Ui}),onSuccess:t=>Ji(Ks(t))}))),Xr=(t,s)=>w(ni(t,1,s?.maxChunkSize??4096),Gt((s=>w(t.isShutdown,jt((t=>t&&pe(s)?Ys(I()):(t=>Gs(bs(t),L))(s)))))),to,s?.shutdown?Qr(si(t)):wt),Zr=F(2,((t,s)=>new Ur(w(Kr(t),ar(Zs(s)))))),Jr=F(2,((t,s)=>{const e=t=>{const i=t.next();return i.done?Hi({onInput:t=>e(t[Symbol.iterator]()),onFailure:Wi,onDone:Ki}):pr(Nt(s(i.value),(s=>qi(Ji(Ks(s)),(()=>e(t))))))};return new Ur(w(Kr(t),Vi(Gi((()=>e(dt()[Symbol.iterator]()))))))})),$r=F(3,((t,s,e)=>new Ur(w(Kr(t),er(wr),hr(e,s),ar(Ks))))),to=t=>eo(t,(t=>w(Nt(t,(s=>L([s,t]))),ie(Ws({onNone:()=>Tt(I()),onSome:Ys}))))),so=F(2,((t,s)=>Kr(t).pipe(dr(jr(s)),fr))),eo=(t,s)=>{return e=()=>{const e=t=>pr(Nt(s(t),Ws({onNone:()=>Zi,onSome:([t,s])=>qi(Ji(t),(()=>e(s)))})));return new Ur(e(t))},new Ur(Gi((()=>Kr(e()))));var e},io=Symbol.for("effect/GroupBy"),no={_R:t=>t,_E:t=>t,_K:t=>t,_V:t=>t},ro=F((t=>St(t[0],io)),((t,s,e)=>qr(t.grouped,(([t,e])=>s(t,Hr(Xr(e,{shutdown:!0})))),{concurrency:"unbounded",bufferSize:e?.bufferSize??16}))),oo=t=>({[io]:no,pipe(){return x(this,arguments)},grouped:t}),co=F((t=>"function"!=typeof t[0]),((t,s,e)=>e?.key?ro(ao(t,e.key,{bufferSize:e.bufferSize}),((t,e)=>Jr(e,s))):Tr(e?.concurrency,(()=>Jr(t,s)),(i=>e?.unordered?qr(t,(t=>Yr(s(t))),{concurrency:i}):$r(t,i,s))))),ao=F((t=>"function"!=typeof t[0]),((t,s,e)=>{const i=(t,n)=>Hi({onInput:r=>qi(Ti(qt(ho(r,s),(([s,i])=>{const r=t.get(s);return void 0===r?w($e(e?.bufferSize??16),jt((e=>w(Dt((()=>{t.set(s,e)})),Rt(ei(n,new Ir(Ut(Ks([s,e]))))),Rt(w(ei(e,Lr(i)),ne((t=>Se(t)?L(_t):I())))))))):ne(ei(r,Lr(i)),(t=>Se(t)?L(_t):I()))}),{discard:!0})),(()=>i(t,n))),onFailure:t=>Ti(ei(n,(t=>new Ir(Wt(w(t,_e(L)))))(t))),onDone:()=>Ti(w(qt(t.entries(),(([t,s])=>w(ei(s,zr),ne((t=>Se(t)?L(_t):I())))),{discard:!0}),Rt(ei(n,zr))))});return oo((t=>Mr((t=>new Ur(br((s=>t(s).pipe(Nt(Ks))))))((s=>t(s)))))((s=>Ds((function*(){const e=new Map,n=yield*ti();return yield*fs(s,si(n)),yield*Kr(t).pipe(Vi(i(e,n)),ir,Dn(s),ns(s),Us(Hr(Xr(n,{shutdown:!0}))))})))))})),ho=F(2,((t,s)=>{const e=[],i=t[Symbol.iterator](),n=new Map;let r;for(;(r=i.next())&&!r.done;){const t=r.value,i=s(t);if(n.has(i))n.get(i).push(t);else{const s=[t];e.push([i,s]),n.set(i,s)}}return re(e.map((t=>[t[0],re(t[1])])))})),uo=Xr,lo=co;class fo{controllers=new Set;addController(t){this.controllers.add(t)}removeController(t){this.controllers.delete(t)}get activeControllers(){return Array.from(this.controllers).filter((t=>!t.disabled))}connectedCallback(){this.controllers.size||console.warn("ReactiveControllerHost connected with no controllers registered.",this),this.activeControllers.forEach((t=>t.hostConnected?.()))}disconnectedCallback(){this.activeControllers.forEach((t=>t.hostDisconnected?.()))}componentWillLoad(){this.activeControllers.forEach((t=>t.hostWillLoad?.()))}componentDidLoad(){this.activeControllers.forEach((t=>t.hostDidLoad?.()))}componentWillRender(){this.activeControllers.forEach((t=>t.hostWillRender?.()))}componentDidRender(){this.activeControllers.forEach((t=>t.hostDidRender?.()))}componentWillUpdate(){this.activeControllers.forEach((t=>t.hostWillUpdate?.()))}componentDidUpdate(){this.activeControllers.forEach((t=>t.hostDidUpdate?.()))}}class bo{host;config;static get globalValidationEnabled(){return t.isDev}static axe=this.globalValidationEnabled?import("./p-D1HbKFuh.js").then((function(t){return t.a})):null;static axeQueue=null;static axeStreamFiber=null;visibilityObserver;elementQueued=!1;elementValidated=!1;knownValidationErrors=[];get disabled(){return!0}constructor(t,s){this.host=t,this.config=s,bo.initializeAxeStream()}static initializeAxeStream(){if(!this.globalValidationEnabled)return;if(this.axeStreamFiber)return;const t=Ds((function*(){const t=bo.axeQueue=yield*$e(100),s=yield*ce((()=>bo.axe));if(!s)return void console.error("Axe library not available, ARIA validation will not run.");const e=uo(t).pipe(lo((({context:t,onComplete:e})=>ae((i=>{s.run(t,{},((t,s)=>{e(t,s),i(_t)}))})))));var i;yield*(i=e,so(i,Rr))}));this.axeStreamFiber=oe(t)}hostDidLoad(){this.elementQueued||this.elementValidated||(this.host.el.checkVisibility()?this.enqueueValidation():this.observeVisibilityOnce())}hostDidUpdate(){this.checkLazyValidation()}hostDisconnected(){this.discardVisibilityObserver()}observeVisibilityOnce(){this.visibilityObserver=new IntersectionObserver((t=>{for(const s of t)s.target===this.host.el&&s.isIntersecting&&(this.checkLazyValidation(),this.discardVisibilityObserver())}),{root:this.host.el.parentElement,rootMargin:"0px",threshold:.01}),this.visibilityObserver.observe(this.host.el)}checkLazyValidation(){(this.config?.reValidateOnPropChanges||!this.elementQueued&&!this.elementValidated)&&this.enqueueValidation()}enqueueValidation(){}discardVisibilityObserver(){this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=void 0)}}export{bo as A,fo as R}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as r,a as t,h as a,H as o}from"./p-smGPjoDX.js";const n=class{constructor(t){e(this,t),this.primaryAction=r(this,"primaryAction")}cardTitle;imageUrl;description;primaryActionLabel="";primaryAction;_onPrimaryClick(){this.primaryAction.emit()}_onOverflowClick(e){console.log(e)}render(){const e={backgroundImage:`url(${this.imageUrl??t("./card-placeholder.svg")})`};return a(o,{key:"d17230c2587b87c1fa5514875e15b7d7930857bc",role:"article"},a("div",{key:"bf8c631ee99651a10c01774a4da20142d04342db",class:"top"},a("div",{key:"fb8224ec00bc8e0c5b1668a6ed63e36b52a11d55",class:"image-wrapper",style:e},a("div",{key:"26c65e0c8083faec2854a332e83b5e8abaf8c2fd",class:"chip-slot"},a("slot",{key:"b5406113b36fcb23dd08cc75e34ae64923357cd3",name:"chip"})))),a("div",{key:"1eb0b6682830da00fa006fcaa9763e8d33adf446",class:"bottom"},a("header",{key:"5930f28a48304296be40fc337a6990a1444cdcdb"},a("h2",{key:"0138cdc21b5ac8b40b40988937ba24292532e069",class:"title"},this.cardTitle)),a("p",{key:"45a9e7947ae99d1db67efa4aa04c3186d02a97c7",class:"description"},this.description),a("div",{key:"940a8a5e7e38f65efa0d7bb25a56131e4456c248",class:"actions"},a("button",{key:"35b0a7ae68fb9ac8c62e181b0087a312a85da185",class:"primary",onClick:this._onPrimaryClick.bind(this),"data-testid":"primary"},this.primaryActionLabel),a("button",{key:"6d391205d50a8ab92336bad0bd70fd24f00b5cda",class:"tertiary","aria-label":"More actions",onClick:this._onOverflowClick},a("span",{key:"dca656b4c1758c1fdcc3c7d971e58b6a63fcd0d1",class:"icon-placeholder"},"...")))))}static get assetsDirs(){return["../../assets"]}};n.style="@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } .sc-lmvz-card-h { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: flex; min-width: var(--lmvz-other-component-card-minwidth, 20.4375rem); max-width: var(--lmvz-other-component-card-maxwidth, 21.6875rem); flex-direction: column; align-items: flex-start; border-radius: var(--lmvz-semantic-border-radius-lg, 14px); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); background: var(--lmvz-semantic-color-surface-primary, #ffffff); } *.sc-lmvz-card { color: var(--lmvz-semantic-color-on-surface-primary, #000000); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .top.sc-lmvz-card { display: flex; padding: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); flex-direction: column; justify-content: center; align-items: center; align-self: stretch; } .bottom.sc-lmvz-card { display: flex; min-width: 150px; padding: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)); flex-direction: column; align-items: flex-start; align-self: stretch; } .title.sc-lmvz-card { margin: 0; display: flex; justify-content: center; align-items: center; align-self: stretch; padding-bottom: var(--lmvz-global-s4, 4px); overflow-wrap: break-word; font: var(--lmvz-typography-heading-2xl, 500 clamp(2rem, 1.94rem + 0.26vw, 2.25rem) / 1.2 Router); } .description.sc-lmvz-card { display: flex; margin: 0; padding-bottom: var(--lmvz-component-body-sm-padding-bottom, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-items: flex-start; align-self: stretch; white-space: pre-line; font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .image-wrapper.sc-lmvz-card { aspect-ratio: 4 / 3; width: 100%; background-size: cover; background-position: center; flex: 1 0 0; align-self: stretch; border-radius: var(--lmvz-semantic-border-radius-md, 6px); } .actions.sc-lmvz-card { margin-top: var(--lmvz-component-form-wrapper-gap-y, clamp(1.13rem, 0.97rem + 0.65vw, 1.75rem)); display: flex; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-self: stretch; } button.primary.sc-lmvz-card, lmvz-button.primary.sc-lmvz-card { display: flex; justify-content: center; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); flex: 1 0 0; }";export{n as lmvz_card}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,r as o,c as r,h as e,H as n}from"./p-smGPjoDX.js";import{c as a}from"./p-DMLRPGid.js";import{i as l,f as m}from"./p-B3JVFwO1.js";import{E as i}from"./p-CN0JX9-m.js";import{R as s,A as d}from"./p-DlrjrWsu.js";import"./p-B85MJLTf.js";import"./p-D9S7OTyY.js";const c=class extends s{get el(){return t(this)}inheritedAttributes={};formEl=null;formButtonEl=null;lmvzActivation;get ti(){return 0}scale="default";variant="secondary";disabled=!1;type="button";form;constructor(t){super(),o(this,t),this.lmvzActivation=r(this,"lmvzActivation"),this.addController(new d(this)),this.addController(new i(this,{localHandler:this.handleClick.bind(this),keys:["Enter"]}))}connectedCallback(){this.inheritedAttributes=l(this.el)}renderHiddenButton(){const t=this.formEl=m(this.form,this.el);if(!t)return;const{formButtonEl:o}=this;if(null!==o&&t.contains(o))return;const r=this.formButtonEl=document.createElement("button");r.type="submit",r.style.display="none",r.disabled=this.disabled,t.appendChild(r)}submitForm(t){this.formEl&&this.formButtonEl&&(t.preventDefault(),this.formButtonEl.click())}handleClick=t=>{"submit"===this.type&&this.submitForm(t)};render(){return this.renderHiddenButton(),e(n,{key:"1c96281344dd604e2e4c919ea72907a9e934e5c6","aria-disabled":this.disabled?"true":null},e("button",{key:"16728ce6fee7d121e7120aa993031777f6d8570e",disabled:this.disabled,class:a(this.variant,{[this.scale??""]:!!this.scale,disabled:this.disabled}),...this.inheritedAttributes},e("slot",{key:"e1b0d95953bdbd42885eecdeef8b457070e7e247"})))}static get delegatesFocus(){return!0}};c.style=" @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } :host { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: contents; } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } ";export{c as lmvz_button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as t,H as r}from"./p-smGPjoDX.js";const a=class{constructor(t){s(this,t)}text;render(){return t(r,{key:"b247f41d22bcf77998bf5a49669f1aa8d7fd3a63"},this.text)}};a.style=":host{display:block}";export{a as lmvz_chip}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,r as e,c as r,h as i}from"./p-smGPjoDX.js";import{c as o}from"./p-DMLRPGid.js";import{a}from"./p-B3JVFwO1.js";import{R as s,A as n}from"./p-DlrjrWsu.js";import"./p-B85MJLTf.js";import"./p-D9S7OTyY.js";let l=0;const c=class extends s{get el(){return t(this)}lmvzInput;internals;nativeInputElement;inputId="lmvz-input-"+l++;initialValue="";nativeError=!1;errorFromProp=!1;get helperId(){return this.helperText?`${this.inputId}-helper`:void 0}get showErrorMessage(){return this.error&&Boolean(this.errorMessage)}get errorId(){return`${this.inputId}-error`}get describedBy(){const t=[];return this.helperId&&t.push(this.helperId),this.showErrorMessage&&t.push(this.errorId),t.length>0?t.join(" "):void 0}value;label;helperText;placeholder;disabled=!1;readonly=!1;required=!1;name;type="text";errorMessage;autocomplete;inputmode;autocorrect;autocapitalize;spellcheck;autofocus=!1;minlength;maxlength;pattern;min;max;step;form;get error(){return this.errorFromProp||this.nativeError}set error(t){this.errorFromProp=t}async setValue(t){this.value=this.nativeInputElement.value=t??"",this.internals.setFormValue?.(t),this.lmvzInput.emit(t)}async focusInput(){this.nativeInputElement?.focus()}async blurInput(){this.nativeInputElement?.blur()}async select(){this.nativeInputElement?.select()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getInputElement(){return this.nativeInputElement||await new Promise((t=>a(this.el,t))),Promise.resolve(this.nativeInputElement)}constructor(t){super(),e(this,t),this.lmvzInput=r(this,"lmvzInput"),t.$hostElement$["s-ei"]?this.internals=t.$hostElement$["s-ei"]:(this.internals=t.$hostElement$.attachInternals(),t.$hostElement$["s-ei"]=this.internals),this.addController(new n(this,{reValidateOnPropChanges:!0}))}componentWillLoad(){this.initialValue=this.value}formAssociatedCallback(t){t&&this.internals.setFormValue?.(this.value)}formResetCallback(){this.internals.setValidity({}),this.setValue(this.initialValue)}formStateRestoreCallback(t){this.setValue(t)}handleValueChange(t){this.nativeInputElement&&(this.nativeInputElement.value===t||this.setValue(t))}handleDisabledChange(t){t&&this.nativeInputElement&&this.nativeInputElement.blur()}handleInput=t=>{this.setValue(t.target.value)};handleChange=t=>{this.updateNativeError(t.target??this.nativeInputElement)};handleFocus=()=>{};handleBlur=t=>{const e=t.target;e.reportValidity?.()};updateNativeError(t){const e=t??this.nativeInputElement;e&&(this.nativeError=!(e.checkValidity?.()??1))}render(){const t=Boolean(this.value),e=t||Boolean(this.placeholder);return i("div",{key:"402189a211eec970a9f5b8fcc551c6c3508bec05",class:o("input-container",{"interaction-filled":t})},i("div",{key:"1cbe6011f14774e1226406ef4fe301fd94338444",class:"input-wrapper"},i("slot",{key:"ea0f30124315c88e9721bb4457126bd6cf18110a",name:"before-input"}),i("div",{key:"f630b5f3a33a961f94b5a782b0ce6b4d49d1958c",class:"label-input-group"},i("label",{key:"dbb3fe066ebf93f7fcbe6973a1e37685d7206888",htmlFor:this.inputId,class:o({floating:e})},this.label,this.required&&i("span",{key:"7c1a2458b66becb45c730bfe3ff0c570293f702f",class:"required-indicator","aria-hidden":"true"}," ","*")),i("input",{key:"14b14457e200d20faf9053848662743dfe1cf417",id:this.inputId,ref:t=>this.nativeInputElement=t,type:this.type,min:this.min,max:this.max,step:this.step,value:this.value,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,form:this.form,autocomplete:this.autocomplete,inputmode:this.inputmode,autocorrect:this.autocorrect,autocapitalize:this.autocapitalize,spellcheck:this.spellcheck,autofocus:this.autofocus,minlength:this.minlength,maxlength:this.maxlength,pattern:this.pattern,"aria-invalid":this.error?"true":"false","aria-required":this.required?"true":"false","aria-describedby":this.describedBy,"aria-errormessage":this.errorId,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur})),i("slot",{key:"4b530738ff7404eb1bcecc10a0388570e2243cf3",name:"after-input"})),this.helperText&&i("div",{key:"f1a287047e9b4d58aa90af157d50b3d564555e9b",id:this.helperId,class:"helper-text"},this.helperText),this.showErrorMessage&&i("div",{key:"2a25c4a88a63363cdd814f1d4fead5e8a238621b",id:this.errorId,class:"error-message",role:"alert"},this.errorMessage))}static get formAssociated(){return!0}static get watchers(){return{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}}};c.style="@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --input-border-color-focus: var(--lmvz-semantic-color-status-on-selected, #0e7ab4); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: 48px; --input-padding-x: 16px; --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); --label-floating-scale: 0.85; --label-minimized-top: -6px; --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: 8px; } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); outline: 2px solid var(--input-border-color-focus); outline-offset: 2px; } .input-container.sc-lmvz-input:has(input:focus-visible) .input-wrapper.sc-lmvz-input { box-shadow: 0 0 0 3px rgb(0 86 214 / 20%); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } [error].sc-lmvz-input-h:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); outline-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: 14px; font-family: Router, sans-serif; font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: normal; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0; transform: translateY(-50%) scale(0.85); transform-origin: left top; background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 500; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: 14px; outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } .helper-text.sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--helper-text-color); font-family: Router, sans-serif; font-weight: 500; } .error-message.sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--error-text-color); font-family: Router, sans-serif; font-weight: 500; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: 4px; }";export{c as lmvz_input}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,r as a,h as t,H as r}from"./p-smGPjoDX.js";import{g as n,c as s}from"./p-B3JVFwO1.js";import{R as i,A as l}from"./p-DlrjrWsu.js";import"./p-D9S7OTyY.js";class o{host;elements=[];constructor(e){this.host=e}hostDidRender(){this.host.el.addEventListener("keydown",this.handleKeydown)}updateElements(e){this.elements=e}handleKeydown=e=>{const{key:a}=e;if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(a))return;const t=n(document),r=this.getNextFocusableElement(t,["ArrowDown","ArrowRight"].includes(a)?"down":"up");r&&(e.preventDefault(),r.focus?.())};getNextFocusableElement(e,a){const{elements:t}=this,r=t.indexOf(e);if(-1===r)return null;let n=null;if("down"===a?n=(r+1)%t.length:"up"===a&&(n=(r-1+t.length)%t.length),null==n)return null;const i=t[n];return s(i)?i:this.getNextFocusableElement(i,a)}}const c=class extends i{get el(){return e(this)}primarySlot;secondarySlot;secondaryNav;keyboardNavigationController=new o(this);get primaryMenuitems(){return this.primarySlot.assignedElements({flatten:!1})}get secondaryMenuitems(){return this.secondarySlot.assignedElements({flatten:!0})}get role(){return"banner"}lmvzActiveNav;get secondarySlotName(){return`connect-nav-${this.lmvzActiveNav}`}constructor(e){super(),a(this,e),this.addController(new l(this,{reValidateOnPropChanges:!0})),this.addController(this.keyboardNavigationController)}handleActiveNavChange(){this.updateElementsActive()}componentDidLoad(){this.primarySlot.addEventListener("slotchange",this.handlePrimaryNavChange.bind(this)),this.handlePrimaryNavChange(),this.secondarySlot.addEventListener("slotchange",this.handleSecondaryNavChange.bind(this))}handlePrimaryNavChange(){const e=this.primaryMenuitems;e.length?(e.forEach((e=>{e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-controls","nav-secondary")})),this.updateElementsActive()):console.warn("Primary slot has no assigned elements. Please add navigation items to the primary slot.")}handleSecondaryNavChange(){this.secondaryMenuitems.length&&this.keyboardNavigationController.updateElements([...this.primaryMenuitems,...this.secondaryMenuitems])}updateElementsActive(){let e;this.primaryMenuitems.forEach((a=>{const t=a.id===this.lmvzActiveNav;t&&(e=a.textContent||a.id),a.setAttribute("aria-expanded",t?"true":"false")})),this.secondaryNav.setAttribute("aria-label",`Untermenü für ${e}`)}delegateFocus(){const e=this.primaryMenuitems[0];e&&e.focus()}render(){return t(r,{key:"58934683ff442801eb34f025ac809631f93a27e8",onFocus:this.delegateFocus.bind(this)},t("div",{key:"35d3eadfabb70f83b313f946c8d31f9c223e8344",class:"brand"},t("slot",{key:"5ce98314d980d63e1c87f508d96119aca2e702a9",name:"brand"},t("lmvz-icon",{key:"b24e61a9071d81948d506a8c545e012d3f0e5dd2",id:"fallback-logo-lmvz",icon:"Logo",size:"inherit","aria-label":"Lehrmittelverlag Zürich"}))),t("nav",{key:"1d5cc9010ef90e6cebc8a7b054db595f35f9e040","aria-label":"Hauptnavigation"},t("div",{key:"488a1b1544242562b57d76169f1988d84c611de4",role:"menubar",class:"primary-menubar"},t("slot",{key:"59c6dd1442290931ed9a55f7bacc65ea4bb9ff6d",name:"nav-primary",ref:e=>this.primarySlot=e}),t("separator",{key:"2729f0e8b115614c50c4a16b6684a3bdb21856b8"}),t("div",{key:"6b5bed5951bad9173fefdc78039e71c4ccc120b2",role:"menu",id:"nav-secondary",class:"secondary-menubar",hidden:!this.lmvzActiveNav,ref:e=>this.secondaryNav=e},t("slot",{key:"02f5a13e8851372c1698e3f786a8757a0a09c32f",name:this.secondarySlotName,ref:e=>this.secondarySlot=e})))),t("div",{key:"53aafe8139bcea27d3039f64a48974cdb5aac5f9",class:"actions"},t("slot",{key:"f12ee19831073253e6ba8e251ba31ec403c21035",name:"actions"})))}static get watchers(){return{lmvzActiveNav:[{handleActiveNavChange:0}]}}};c.style=":host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}";export{c as lmvz_header}
|