diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-BzihuQgX.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-BD_vK45_.js similarity index 93% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-BzihuQgX.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-BD_vK45_.js index 4faf7e8ba..6c4784bfa 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-BzihuQgX.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-BD_vK45_.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_id-CKC6mgIR.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/ec2-DcwXjFvB.js","assets/aws-client-DrLAG3yq.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/back-link-B8ejy5Fm.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/info-tip-Cxa2GEOd.js","assets/visuallyHidden-BHQz5bmH.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/useValueChanged-wii0yYWk.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/security-group-details-CdE6iD9s.js","assets/select-UwOVJofC.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useRegisterFieldControl-DkI655of.js","assets/useControlled-NIWPmeG5.js","assets/clamp-D0kAXd-u.js","assets/x-mlA6pp-8.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/plus-BK_7eO_G.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/instance-overview-I3DWLmM0.js","assets/useQuery-D6TojLgI.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/state-badge-CQPRxt3J.js","assets/zod-nOHMBkds.js","assets/index.esm-C31mnnYl.js","assets/ec2-CM16SST3.js","assets/instance-type-size-DoyCeynC.js","assets/resource-delete-dialog-D3NYuO-k.js"])))=>i.map(i=>d[i]); -import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{w as a}from"./ec2-DcwXjFvB.js";import{r as o}from"./panel-search-LDLf8HCe.js";var s=t(`/_auth/ec2/(security-groups)/describe-security-groups/$id`)({validateSearch:e({tab:o.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await e.queryClient.query({...a(t.id),staleTime:`static`})},head:({params:e})=>({meta:[{title:`${e.id} | Security Group | Mulga`}]}),component:n(()=>i(()=>import(`./_id-CKC6mgIR.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83])),`component`)});export{s as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_id-Decv9LyH.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/ec2-DcwXjFvB.js","assets/aws-client-DrLAG3yq.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/back-link-B8ejy5Fm.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/info-tip-Cxa2GEOd.js","assets/visuallyHidden-BHQz5bmH.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/useValueChanged-wii0yYWk.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/security-group-details-Dc-1r5cD.js","assets/select-UwOVJofC.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useRegisterFieldControl-DkI655of.js","assets/useControlled-NIWPmeG5.js","assets/clamp-D0kAXd-u.js","assets/x-mlA6pp-8.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/plus-BK_7eO_G.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/instance-overview-DWnPG_Ut.js","assets/useQuery-D6TojLgI.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/state-badge-CQPRxt3J.js","assets/zod-nOHMBkds.js","assets/index.esm-C31mnnYl.js","assets/ec2-CM16SST3.js","assets/instance-type-size-DoyCeynC.js","assets/resource-delete-dialog-D3NYuO-k.js"])))=>i.map(i=>d[i]); +import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{w as a}from"./ec2-DcwXjFvB.js";import{r as o}from"./panel-search-LDLf8HCe.js";var s=t(`/_auth/ec2/(security-groups)/describe-security-groups/$id`)({validateSearch:e({tab:o.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await e.queryClient.query({...a(t.id),staleTime:`static`})},head:({params:e})=>({meta:[{title:`${e.id} | Security Group | Mulga`}]}),component:n(()=>i(()=>import(`./_id-Decv9LyH.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83])),`component`)});export{s as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-DVp0ns8g.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-CcCuzlb5.js similarity index 90% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-DVp0ns8g.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-CcCuzlb5.js index 8ab0b6d34..6d40506ff 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-DVp0ns8g.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-CcCuzlb5.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_id-D-4sj3aj.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/instances-page-BPnRMywb.js","assets/select-UwOVJofC.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/useControlled-NIWPmeG5.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/useQuery-D6TojLgI.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/table-BLvCYTga.js","assets/useNavigate-cMdr_EJ0.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/eye-yi4wz0yh.js","assets/globe-D4RJ05Is.js","assets/maximize-2-BAlKoEj8.js","assets/button-group-CpOcyma9.js","assets/play-qJowxtRp.js","assets/plus-BK_7eO_G.js","assets/refresh-cw-Cb2whnur.js","assets/rotate-cw-DhHI5fTM.js","assets/server-D03m5B1l.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/radio-group-TE8lo9RG.js","assets/CompositeRoot-CmHoR-Tk.js","assets/CompositeItem-DqJfacHh.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/auth-BS4WytAe.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/dropdown-menu-BDPQio-M.js","assets/switch-CFqwHFZR.js","assets/textarea-BG1iGvVs.js","assets/create-panel-BF47ohJ2.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/filter-bar-DNltk5ao.js","assets/input-group-TEGNx6dm.js","assets/toggle-group-CED1FjZ4.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/state-badge-CQPRxt3J.js","assets/table-cells-Dh4yWZC8.js","assets/use-row-selection-DB6L9NiD.js","assets/console-output-B2nAhrwp.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/gpu-instance-type-select-DsB5oPSo.js","assets/metric-format-DCnx-pFz.js","assets/metric-format-CnsZ1jie.css","assets/instance-overview-I3DWLmM0.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/zod-nOHMBkds.js","assets/index.esm-C31mnnYl.js","assets/ec2-CM16SST3.js","assets/instance-type-size-DoyCeynC.js","assets/system-managed-Dk7ySh_E.js","assets/choice-tile-CEc-Vca5.js","assets/form-fields-CcTBfvl9.js","assets/security-group-picker-CRcCOtjC.js","assets/switch-list-X53OOONN.js","assets/back-link-B8ejy5Fm.js"])))=>i.map(i=>d[i]); -import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{c as a}from"./ec2-DcwXjFvB.js";import{r as o}from"./panel-search-LDLf8HCe.js";var s=t(`/_auth/ec2/(instances)/describe-instances/$id`)({validateSearch:e({tab:o.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>await e.queryClient.query({...a(t.id),staleTime:`static`}),head:({loaderData:e})=>({meta:[{title:`${e?.Reservations?.[0]?.Instances?.[0]?.InstanceId??`Instance`} | EC2 | Mulga`}]}),component:n(()=>i(()=>import(`./_id-D-4sj3aj.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116])),`component`)});export{s as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_id-Cpa-pqWX.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/instances-page-Ol-kg3ZZ.js","assets/select-UwOVJofC.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/useControlled-NIWPmeG5.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/useQuery-D6TojLgI.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/table-BLvCYTga.js","assets/useNavigate-cMdr_EJ0.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/eye-yi4wz0yh.js","assets/globe-D4RJ05Is.js","assets/maximize-2-BAlKoEj8.js","assets/button-group-CpOcyma9.js","assets/play-qJowxtRp.js","assets/plus-BK_7eO_G.js","assets/refresh-cw-Cb2whnur.js","assets/rotate-cw-DhHI5fTM.js","assets/server-D03m5B1l.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/radio-group-TE8lo9RG.js","assets/CompositeRoot-CmHoR-Tk.js","assets/CompositeItem-DqJfacHh.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/auth-BS4WytAe.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/dropdown-menu-BDPQio-M.js","assets/switch-CFqwHFZR.js","assets/textarea-BG1iGvVs.js","assets/create-panel-BF47ohJ2.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/filter-bar-DNltk5ao.js","assets/input-group-TEGNx6dm.js","assets/toggle-group-CED1FjZ4.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/state-badge-CQPRxt3J.js","assets/table-cells-Dh4yWZC8.js","assets/use-row-selection-DB6L9NiD.js","assets/console-output-B2nAhrwp.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/gpu-instance-type-select-DsB5oPSo.js","assets/metric-format-DCnx-pFz.js","assets/metric-format-CnsZ1jie.css","assets/instance-overview-DWnPG_Ut.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/zod-nOHMBkds.js","assets/index.esm-C31mnnYl.js","assets/ec2-CM16SST3.js","assets/instance-type-size-DoyCeynC.js","assets/system-managed-Dk7ySh_E.js","assets/choice-tile-CEc-Vca5.js","assets/form-fields-CcTBfvl9.js","assets/security-group-picker-CRcCOtjC.js","assets/switch-list-X53OOONN.js","assets/subnet-routing-CyGJGaO-.js","assets/back-link-B8ejy5Fm.js"])))=>i.map(i=>d[i]); +import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{c as a}from"./ec2-DcwXjFvB.js";import{r as o}from"./panel-search-LDLf8HCe.js";var s=t(`/_auth/ec2/(instances)/describe-instances/$id`)({validateSearch:e({tab:o.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>await e.queryClient.query({...a(t.id),staleTime:`static`}),head:({loaderData:e})=>({meta:[{title:`${e?.Reservations?.[0]?.Instances?.[0]?.InstanceId??`Instance`} | EC2 | Mulga`}]}),component:n(()=>i(()=>import(`./_id-Cpa-pqWX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117])),`component`)});export{s as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-D-4sj3aj.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-Cpa-pqWX.js similarity index 89% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-D-4sj3aj.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-Cpa-pqWX.js index 17c969622..b053294ea 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-D-4sj3aj.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-Cpa-pqWX.js @@ -1 +1 @@ -import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{a as r,i}from"./instances-page-BPnRMywb.js";import{c as a}from"./ec2-DcwXjFvB.js";import{t as o}from"./_id-DVp0ns8g.js";import{t as s}from"./back-link-B8ejy5Fm.js";var c=t(),l=e();function u(){let e=(0,c.c)(14),{id:t}=o.useParams(),{tab:u}=o.useSearch(),d=o.useNavigate(),f;e[0]===t?f=e[1]:(f=a(t),e[0]=t,e[1]=f);let{data:p}=n(f),m=p.Reservations?.[0]?.Instances?.[0];if(!m?.InstanceId){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{to:`/ec2/describe-instances`,children:`Back to instances`}),(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance not found.`})]}),e[2]=t):t=e[2],t}let h;e[3]===m?h=e[4]:(h=i(m),e[3]=m,e[4]=h);let g,_;e[5]===d?(g=e[6],_=e[7]):(g=()=>{d({to:`/ec2/describe-instances`})},_=e=>{d({search:{tab:e},replace:!0})},e[5]=d,e[6]=g,e[7]=_);let v;return e[8]!==m||e[9]!==h||e[10]!==g||e[11]!==_||e[12]!==u?(v=(0,l.jsx)(r,{instance:m,layout:`page`,name:h,onClose:g,onTabChange:_,tab:u}),e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=u,e[13]=v):v=e[13],v}export{u as component}; \ No newline at end of file +import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{a as r,i}from"./instances-page-Ol-kg3ZZ.js";import{c as a}from"./ec2-DcwXjFvB.js";import{t as o}from"./_id-CcCuzlb5.js";import{t as s}from"./back-link-B8ejy5Fm.js";var c=t(),l=e();function u(){let e=(0,c.c)(14),{id:t}=o.useParams(),{tab:u}=o.useSearch(),d=o.useNavigate(),f;e[0]===t?f=e[1]:(f=a(t),e[0]=t,e[1]=f);let{data:p}=n(f),m=p.Reservations?.[0]?.Instances?.[0];if(!m?.InstanceId){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{to:`/ec2/describe-instances`,children:`Back to instances`}),(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance not found.`})]}),e[2]=t):t=e[2],t}let h;e[3]===m?h=e[4]:(h=i(m),e[3]=m,e[4]=h);let g,_;e[5]===d?(g=e[6],_=e[7]):(g=()=>{d({to:`/ec2/describe-instances`})},_=e=>{d({search:{tab:e},replace:!0})},e[5]=d,e[6]=g,e[7]=_);let v;return e[8]!==m||e[9]!==h||e[10]!==g||e[11]!==_||e[12]!==u?(v=(0,l.jsx)(r,{instance:m,layout:`page`,name:h,onClose:g,onTabChange:_,tab:u}),e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=u,e[13]=v):v=e[13],v}export{u as component}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-CKC6mgIR.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-Decv9LyH.js similarity index 88% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-CKC6mgIR.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-Decv9LyH.js index c936e1cd4..07bb025af 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-CKC6mgIR.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/_id-Decv9LyH.js @@ -1 +1 @@ -import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{w as r}from"./ec2-DcwXjFvB.js";import{t as i}from"./_id-BzihuQgX.js";import{t as a}from"./back-link-B8ejy5Fm.js";import{t as o}from"./security-group-details-CdE6iD9s.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{id:t}=i.useParams(),{tab:l}=i.useSearch(),u=i.useNavigate(),d;e[0]===t?d=e[1]:(d=r(t),e[0]=t,e[1]=d);let{data:f}=n(d),p=f.SecurityGroups?.[0];if(!p?.GroupId){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{to:`/ec2/describe-security-groups`,children:`Back to security groups`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Security group not found.`})]}),e[2]=t):t=e[2],t}let m,h;e[3]===u?(m=e[4],h=e[5]):(m=()=>{u({to:`/ec2/describe-security-groups`})},h=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=m,e[5]=h);let g;return e[6]!==p||e[7]!==m||e[8]!==h||e[9]!==l?(g=(0,c.jsx)(o,{layout:`page`,onClose:m,onTabChange:h,sg:p,tab:l}),e[6]=p,e[7]=m,e[8]=h,e[9]=l,e[10]=g):g=e[10],g}export{l as component}; \ No newline at end of file +import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{w as r}from"./ec2-DcwXjFvB.js";import{t as i}from"./_id-BD_vK45_.js";import{t as a}from"./back-link-B8ejy5Fm.js";import{t as o}from"./security-group-details-Dc-1r5cD.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{id:t}=i.useParams(),{tab:l}=i.useSearch(),u=i.useNavigate(),d;e[0]===t?d=e[1]:(d=r(t),e[0]=t,e[1]=d);let{data:f}=n(d),p=f.SecurityGroups?.[0];if(!p?.GroupId){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{to:`/ec2/describe-security-groups`,children:`Back to security groups`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Security group not found.`})]}),e[2]=t):t=e[2],t}let m,h;e[3]===u?(m=e[4],h=e[5]):(m=()=>{u({to:`/ec2/describe-security-groups`})},h=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=m,e[5]=h);let g;return e[6]!==p||e[7]!==m||e[8]!==h||e[9]!==l?(g=(0,c.jsx)(o,{layout:`page`,onClose:m,onTabChange:h,sg:p,tab:l}),e[6]=p,e[7]=m,e[8]=h,e[9]=l,e[10]=g):g=e[10],g}export{l as component}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-CPApFKIU.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-BQwLh8rf.js similarity index 87% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-CPApFKIU.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-BQwLh8rf.js index 1a09546b8..486503445 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-CPApFKIU.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-BQwLh8rf.js @@ -1 +1 @@ -import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{n as r}from"./instances-page-BPnRMywb.js";import{u as i}from"./ec2-DcwXjFvB.js";import{t as a}from"./describe-instances-oBl3gO4F.js";var o=t(),s=e(),c={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5};function l(){let e=(0,o.c)(8),{data:t}=n(i),c=a.useSearch(),l=a.useNavigate(),f;e[0]===t.Reservations?f=e[1]:(f=(t.Reservations?.flatMap(d)??[]).toSorted(u),e[0]=t.Reservations,e[1]=f);let p=f,m;e[2]===l?m=e[3]:(m=function(e){l({search:t=>({...t,...e}),replace:!(`selected`in e||`create`in e)})},e[2]=l,e[3]=m);let h=m,g;return e[4]!==p||e[5]!==h||e[6]!==c?(g=(0,s.jsx)(r,{instances:p,onSearchChange:h,search:c}),e[4]=p,e[5]=h,e[6]=c,e[7]=g):g=e[7],g}function u(e,t){let n=c[e.State?.Name??``]??6,r=c[t.State?.Name??``]??6;return n===r?(e.InstanceId??``).localeCompare(t.InstanceId??``):n-r}function d(e){return e.Instances??[]}export{l as component}; \ No newline at end of file +import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{n as r}from"./instances-page-Ol-kg3ZZ.js";import{u as i}from"./ec2-DcwXjFvB.js";import{t as a}from"./describe-instances-N1NU-Vrz.js";var o=t(),s=e(),c={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5};function l(){let e=(0,o.c)(8),{data:t}=n(i),c=a.useSearch(),l=a.useNavigate(),f;e[0]===t.Reservations?f=e[1]:(f=(t.Reservations?.flatMap(d)??[]).toSorted(u),e[0]=t.Reservations,e[1]=f);let p=f,m;e[2]===l?m=e[3]:(m=function(e){l({search:t=>({...t,...e}),replace:!(`selected`in e||`create`in e)})},e[2]=l,e[3]=m);let h=m,g;return e[4]!==p||e[5]!==h||e[6]!==c?(g=(0,s.jsx)(r,{instances:p,onSearchChange:h,search:c}),e[4]=p,e[5]=h,e[6]=c,e[7]=g):g=e[7],g}function u(e,t){let n=c[e.State?.Name??``]??6,r=c[t.State?.Name??``]??6;return n===r?(e.InstanceId??``).localeCompare(t.InstanceId??``):n-r}function d(e){return e.Instances??[]}export{l as component}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-oBl3gO4F.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-N1NU-Vrz.js similarity index 80% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-oBl3gO4F.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-N1NU-Vrz.js index 58eb92a2d..2d145fd38 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-oBl3gO4F.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-instances-N1NU-Vrz.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/describe-instances-CPApFKIU.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/instances-page-BPnRMywb.js","assets/select-UwOVJofC.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/useControlled-NIWPmeG5.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/useQuery-D6TojLgI.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/table-BLvCYTga.js","assets/useNavigate-cMdr_EJ0.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/eye-yi4wz0yh.js","assets/globe-D4RJ05Is.js","assets/maximize-2-BAlKoEj8.js","assets/button-group-CpOcyma9.js","assets/play-qJowxtRp.js","assets/plus-BK_7eO_G.js","assets/refresh-cw-Cb2whnur.js","assets/rotate-cw-DhHI5fTM.js","assets/server-D03m5B1l.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/radio-group-TE8lo9RG.js","assets/CompositeRoot-CmHoR-Tk.js","assets/CompositeItem-DqJfacHh.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/auth-BS4WytAe.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/dropdown-menu-BDPQio-M.js","assets/switch-CFqwHFZR.js","assets/textarea-BG1iGvVs.js","assets/create-panel-BF47ohJ2.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/filter-bar-DNltk5ao.js","assets/input-group-TEGNx6dm.js","assets/toggle-group-CED1FjZ4.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/state-badge-CQPRxt3J.js","assets/table-cells-Dh4yWZC8.js","assets/use-row-selection-DB6L9NiD.js","assets/console-output-B2nAhrwp.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/gpu-instance-type-select-DsB5oPSo.js","assets/metric-format-DCnx-pFz.js","assets/metric-format-CnsZ1jie.css","assets/instance-overview-I3DWLmM0.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/zod-nOHMBkds.js","assets/index.esm-C31mnnYl.js","assets/ec2-CM16SST3.js","assets/instance-type-size-DoyCeynC.js","assets/system-managed-Dk7ySh_E.js","assets/choice-tile-CEc-Vca5.js","assets/form-fields-CcTBfvl9.js","assets/security-group-picker-CRcCOtjC.js","assets/switch-list-X53OOONN.js"])))=>i.map(i=>d[i]); -import{l as e,s as t,t as n}from"./schemas-DCQXG11d.js";import{n as r,t as i}from"./lazyRouteComponent-PMetaA3O.js";import{t as a}from"./searchMiddleware-Clk50hy1.js";import{r as o,t as s}from"./instances-page-BPnRMywb.js";import{U as c}from"./fetch-http-handler-C0nfkUzI.js";import{u as l}from"./ec2-DcwXjFvB.js";import{r as u}from"./panel-search-LDLf8HCe.js";var d=()=>c(()=>import(`./describe-instances-CPApFKIU.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115])),f=t({q:e().default(``).catch(``),state:n(o).default(`all`).catch(`all`),sort:e().default(``).catch(``),template:e().default(``).catch(``),templateVersion:e().default(``).catch(``),...u}),p={q:``,state:`all`,sort:``,...s},m=r(`/_auth/ec2/(instances)/describe-instances/`)({validateSearch:f,search:{middlewares:[a(p)]},loader:async({context:e})=>{await e.queryClient.query({...l,staleTime:`static`})},head:()=>({meta:[{title:`Instances | EC2 | Mulga`}]}),component:i(d,`component`)});export{m as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/describe-instances-BQwLh8rf.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/instances-page-Ol-kg3ZZ.js","assets/select-UwOVJofC.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/useControlled-NIWPmeG5.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/useQuery-D6TojLgI.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/table-BLvCYTga.js","assets/useNavigate-cMdr_EJ0.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/eye-yi4wz0yh.js","assets/globe-D4RJ05Is.js","assets/maximize-2-BAlKoEj8.js","assets/button-group-CpOcyma9.js","assets/play-qJowxtRp.js","assets/plus-BK_7eO_G.js","assets/refresh-cw-Cb2whnur.js","assets/rotate-cw-DhHI5fTM.js","assets/server-D03m5B1l.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/radio-group-TE8lo9RG.js","assets/CompositeRoot-CmHoR-Tk.js","assets/CompositeItem-DqJfacHh.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/auth-BS4WytAe.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/dropdown-menu-BDPQio-M.js","assets/switch-CFqwHFZR.js","assets/textarea-BG1iGvVs.js","assets/create-panel-BF47ohJ2.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/filter-bar-DNltk5ao.js","assets/input-group-TEGNx6dm.js","assets/toggle-group-CED1FjZ4.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/state-badge-CQPRxt3J.js","assets/table-cells-Dh4yWZC8.js","assets/use-row-selection-DB6L9NiD.js","assets/console-output-B2nAhrwp.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/gpu-instance-type-select-DsB5oPSo.js","assets/metric-format-DCnx-pFz.js","assets/metric-format-CnsZ1jie.css","assets/instance-overview-DWnPG_Ut.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/zod-nOHMBkds.js","assets/index.esm-C31mnnYl.js","assets/ec2-CM16SST3.js","assets/instance-type-size-DoyCeynC.js","assets/system-managed-Dk7ySh_E.js","assets/choice-tile-CEc-Vca5.js","assets/form-fields-CcTBfvl9.js","assets/security-group-picker-CRcCOtjC.js","assets/switch-list-X53OOONN.js","assets/subnet-routing-CyGJGaO-.js"])))=>i.map(i=>d[i]); +import{l as e,s as t,t as n}from"./schemas-DCQXG11d.js";import{n as r,t as i}from"./lazyRouteComponent-PMetaA3O.js";import{t as a}from"./searchMiddleware-Clk50hy1.js";import{r as o,t as s}from"./instances-page-Ol-kg3ZZ.js";import{U as c}from"./fetch-http-handler-C0nfkUzI.js";import{u as l}from"./ec2-DcwXjFvB.js";import{r as u}from"./panel-search-LDLf8HCe.js";var d=()=>c(()=>import(`./describe-instances-BQwLh8rf.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116])),f=t({q:e().default(``).catch(``),state:n(o).default(`all`).catch(`all`),sort:e().default(``).catch(``),template:e().default(``).catch(``),templateVersion:e().default(``).catch(``),...u}),p={q:``,state:`all`,sort:``,...s},m=r(`/_auth/ec2/(instances)/describe-instances/`)({validateSearch:f,search:{middlewares:[a(p)]},loader:async({context:e})=>{await e.queryClient.query({...l,staleTime:`static`})},head:()=>({meta:[{title:`Instances | EC2 | Mulga`}]}),component:i(d,`component`)});export{m as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BSNUCY8N.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BSNUCY8N.js new file mode 100644 index 000000000..1d7ad9bd6 --- /dev/null +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BSNUCY8N.js @@ -0,0 +1,4 @@ +import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r,W as i}from"./schemas-DCQXG11d.js";import{c as a,i as o,n as s,s as c,t as l}from"./select-UwOVJofC.js";import{t as u}from"./useQuery-D6TojLgI.js";import{t as d}from"./useSuspenseQuery--dusmE-Q.js";import{t as f}from"./link-BX-1BPor.js";import{t as p}from"./data-table-9n7xOy9s.js";import{t as m}from"./plus-BK_7eO_G.js";import{a as h,i as g,r as _,t as v}from"./cli-command-panel-Do14gxB9.js";import{o as y}from"./useValueAsRef-uzS1fuI8.js";import{c as ee,f as b,r as x,t as S}from"./field-iLG94M00.js";import{M as te,v as ne}from"./ec2-mbMOQDVK.js";import{C,k as w,n as T,v as E}from"./ec2-DcwXjFvB.js";import{t as D}from"./panel-search-LDLf8HCe.js";import{t as O}from"./create-panel-BF47ohJ2.js";import{t as k}from"./page-heading-ZfrnK2wu.js";import{t as A}from"./resource-view-CPdFr_3k.js";import{t as j}from"./selection-bar-WnknBhRB.js";import{t as re}from"./state-badge-CQPRxt3J.js";import{t as ie}from"./use-row-selection-DB6L9NiD.js";import{n as ae,t as oe}from"./form-lock-D8Cu0Sfu.js";import{c as se,o as ce,t as le}from"./index.esm-C31mnnYl.js";import{t as ue}from"./zod-nOHMBkds.js";import{l as de}from"./ec2-CM16SST3.js";import{t as fe}from"./subnet-routing-CyGJGaO-.js";import{t as pe}from"./bulk-delete-CXIUB03J.js";import{t as M}from"./describe-nat-gateways-BSrgRFGh.js";import{t as N}from"./nat-gateway-details-B4rSOrtE.js";var P=e(n(),1),me=r(),F=t();function he(e){let t=(0,me.c)(70),{onClose:n}=e,{data:r}=d(w),{data:i}=u(C),{data:o}=d(T),p=ne(),m;t[0]===r.Subnets?m=t[1]:(m=r.Subnets??[],t[0]=r.Subnets,t[1]=m);let h=m,g;t[2]===i?.RouteTables?g=t[3]:(g=i?.RouteTables??[],t[2]=i?.RouteTables,t[3]=g);let _=g,y;if(t[4]!==_||t[5]!==h){let e;t[7]===_?e=t[8]:(e=e=>fe(e,_),t[7]=_,t[8]=e),y=h.filter(e),t[4]=_,t[5]=h,t[6]=y}else y=t[6];let te=y,E=te.length>0?te:h,D;t[9]===o.Addresses?D=t[10]:(D=o.Addresses??[],t[9]=o.Addresses,t[10]=D);let O;t[11]===D?O=t[12]:(O=D.filter(ve),t[11]=D,t[12]=O);let k=O,A;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(A={resolver:ue(de),defaultValues:{subnetId:``,allocationId:``,name:``}},t[13]=A):A=t[13];let{control:j,handleSubmit:re,register:ie,formState:pe}=ce(A),{errors:M,isSubmitting:N}=pe,P;t[14]===j?P=t[15]:(P={control:j},t[14]=j,t[15]=P);let he=se(P),I;t[16]!==p||t[17]!==n?(I=async e=>{let t;try{t=await p.mutateAsync({subnetId:e.subnetId,allocationId:e.allocationId,name:e.name?.trim()??void 0})}catch{return}n(t.NatGateway?.NatGatewayId)},t[16]=p,t[17]=n,t[18]=I):I=t[18];let L=I,R;t[19]!==re||t[20]!==L?(R=re(L),t[19]=re,t[20]=L,t[21]=R):R=t[21];let be=p.isPending||N,z;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,F.jsx)(ee,{children:(0,F.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),t[22]=z):z=t[22];let B;t[23]===ie?B=t[24]:(B=ie(`name`),t[23]=ie,t[24]=B);let V;t[25]===B?V=t[26]:(V=(0,F.jsxs)(S,{children:[z,(0,F.jsx)(b,{id:`name`,placeholder:`my-nat-gateway`,...B})]}),t[25]=B,t[26]=V);let xe;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,F.jsx)(ee,{children:(0,F.jsx)(`label`,{htmlFor:`subnetId`,children:`Public subnet`})}),t[27]=xe):xe=t[27];let H;t[28]!==M.subnetId||t[29]!==E?(H=e=>{let{field:t}=e;return(0,F.jsxs)(l,{onValueChange:t.onChange,value:t.value??``,children:[(0,F.jsx)(c,{"aria-invalid":!!M.subnetId,className:`w-full`,id:`subnetId`,children:(0,F.jsx)(a,{placeholder:`Select a public subnet`})}),(0,F.jsx)(s,{children:E.map(_e)})]})},t[28]=M.subnetId,t[29]=E,t[30]=H):H=t[30];let U;t[31]!==j||t[32]!==H?(U=(0,F.jsx)(le,{control:j,name:`subnetId`,render:H}),t[31]=j,t[32]=H,t[33]=U):U=t[33];let W;t[34]===M.subnetId?W=t[35]:(W=(0,F.jsx)(x,{errors:[M.subnetId]}),t[34]=M.subnetId,t[35]=W);let G;t[36]!==U||t[37]!==W?(G=(0,F.jsxs)(S,{children:[xe,U,W]}),t[36]=U,t[37]=W,t[38]=G):G=t[38];let Se;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,F.jsx)(ee,{children:(0,F.jsx)(`label`,{htmlFor:`allocationId`,children:`Elastic IP`})}),t[39]=Se):Se=t[39];let K;t[40]!==k||t[41]!==j||t[42]!==M.allocationId?(K=k.length>0?(0,F.jsx)(le,{control:j,name:`allocationId`,render:e=>{let{field:t}=e;return(0,F.jsxs)(l,{onValueChange:t.onChange,value:t.value??``,children:[(0,F.jsx)(c,{"aria-invalid":!!M.allocationId,className:`w-full`,id:`allocationId`,children:(0,F.jsx)(a,{placeholder:`Select an Elastic IP`})}),(0,F.jsx)(s,{children:k.map(ge)})]})}}):(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No available Elastic IPs.`,` `,(0,F.jsx)(f,{className:`text-primary hover:underline`,search:{create:!0},to:`/ec2/describe-addresses`,children:`Allocate one`}),` `,`first.`]}),t[40]=k,t[41]=j,t[42]=M.allocationId,t[43]=K):K=t[43];let q;t[44]===M.allocationId?q=t[45]:(q=(0,F.jsx)(x,{errors:[M.allocationId]}),t[44]=M.allocationId,t[45]=q);let J;t[46]!==K||t[47]!==q?(J=(0,F.jsxs)(S,{children:[Se,K,q]}),t[46]=K,t[47]=q,t[48]=J):J=t[48];let Y;t[49]===he?Y=t[50]:(Y=ye(he),t[49]=he,t[50]=Y);let X;t[51]===Y?X=t[52]:(X=(0,F.jsx)(v,{commands:Y}),t[51]=Y,t[52]=X);let Z;t[53]===n?Z=t[54]:(Z=()=>{n()},t[53]=n,t[54]=Z);let Q;t[55]!==p.error||t[56]!==p.isPending||t[57]!==N||t[58]!==Z?(Q=(0,F.jsx)(ae,{error:p.error,errorMsg:`Failed to create NAT Gateway`,isPending:p.isPending,isSubmitting:N,onCancel:Z,pendingLabel:`Creating…`,submitLabel:`Create NAT Gateway`}),t[55]=p.error,t[56]=p.isPending,t[57]=N,t[58]=Z,t[59]=Q):Q=t[59];let $;t[60]!==be||t[61]!==V||t[62]!==G||t[63]!==J||t[64]!==X||t[65]!==Q?($=(0,F.jsxs)(oe,{className:`space-y-6`,locked:be,children:[V,G,J,X,Q]}),t[60]=be,t[61]=V,t[62]=G,t[63]=J,t[64]=X,t[65]=Q,t[66]=$):$=t[66];let Ce;return t[67]!==R||t[68]!==$?(Ce=(0,F.jsx)(`form`,{onSubmit:R,children:$}),t[67]=R,t[68]=$,t[69]=Ce):Ce=t[69],Ce}function ge(e){return(0,F.jsx)(o,{value:e.AllocationId??``,children:`${e.AllocationId} (${e.PublicIp})`},e.AllocationId)}function _e(e){let t=i(e.Tags);return(0,F.jsx)(o,{value:e.SubnetId??``,children:t?`${e.SubnetId} (${t})`:`${e.SubnetId} (${e.CidrBlock})`},e.SubnetId)}function ve(e){return!e.AssociationId}function ye(e){let t=e.name?.trim();return[{label:`Create NAT Gateway`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-nat-gateway`},...g(`\\ + --subnet-id`,_(e.subnetId??``,`SubnetId`)),...g(`\\ + --allocation-id`,_(e.allocationId??``,`AllocationId`)),...h(`\\ + --tag-specifications`,t&&`'ResourceType=natgateway,Tags=[{Key=Name,Value=${t}}]'`)]}]}var I=[{id:`gateway`,header:`NAT gateway`,sortValue:e=>i(e.Tags)??e.NatGatewayId,cell:e=>{let t=i(e.Tags),n=e.NatGatewayId??``;return(0,F.jsxs)(f,{className:`group block max-w-72 min-w-0 rounded-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,from:`/ec2/describe-nat-gateways/`,search:e=>({...e,...D,selected:n}),to:`.`,children:[(0,F.jsx)(`span`,{className:`block truncate font-medium text-primary group-hover:underline`,children:t??n}),t&&(0,F.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:n})]})}},{id:`state`,header:`State`,sortValue:e=>e.State,cell:e=>(0,F.jsx)(re,{state:e.State})},{id:`publicIp`,header:`Public IP`,sortValue:e=>e.NatGatewayAddresses?.[0]?.PublicIp,hideBelow:`sm`,cell:e=>(0,F.jsx)(`span`,{className:`font-mono text-xs`,children:e.NatGatewayAddresses?.[0]?.PublicIp??`—`})},{id:`subnet`,header:`Subnet`,sortValue:e=>e.SubnetId,hideBelow:`md`,cell:e=>e.SubnetId?(0,F.jsx)(f,{className:`font-mono text-xs text-primary hover:underline`,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})},{id:`vpc`,header:`VPC`,sortValue:e=>e.VpcId,hideBelow:`lg`,cell:e=>e.VpcId?(0,F.jsx)(f,{className:`font-mono text-xs text-primary hover:underline`,params:{id:e.VpcId},to:`/ec2/describe-vpcs/$id`,children:e.VpcId}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}];function L(e){let t=(0,me.c)(47),{natGateways:n,search:r,onSearchChange:i}=e,[a,o]=(0,P.useState)(),s;if(t[0]!==n||t[1]!==r.selected){let e;t[3]===r.selected?e=t[4]:(e=e=>r.selected!==``&&e.NatGatewayId===r.selected,t[3]=r.selected,t[4]=e),s=n.find(e),t[0]=n,t[1]=r.selected,t[2]=s}else s=t[2];let c=s,l;t[5]===n?l=t[6]:(l=n.map(B),t[5]=n,t[6]=l);let u;t[7]===i?u=t[8]:(u=()=>{i(D)},t[7]=i,t[8]=u);let d=ie(l,c!==void 0,u),h=te(),g;t[9]===n?g=t[10]:(g=new Map(n.map(z)),t[9]=n,t[10]=g);let _=g,v=null;if(r.create){let e;t[11]===i?e=t[12]:(e=()=>{i(D)},t[11]=i,t[12]=e);let n;t[13]===i?n=t[14]:(n=(0,F.jsx)(he,{onClose:e=>{i({...D,selected:e??``})}}),t[13]=i,t[14]=n);let r;t[15]!==e||t[16]!==n?(r=(0,F.jsx)(O,{onClose:e,title:`Create NAT gateway`,children:n}),t[15]=e,t[16]=n,t[17]=r):r=t[17],v=r}else if(c?.NatGatewayId){let e,n;t[18]===i?(e=t[19],n=t[20]):(e=()=>{i(D)},n=e=>{i({tab:e})},t[18]=i,t[19]=e,t[20]=n);let a;t[21]!==c||t[22]!==r.tab||t[23]!==e||t[24]!==n?(a=(0,F.jsx)(N,{nat:c,onClose:e,onTabChange:n,tab:r.tab},c.NatGatewayId),t[21]=c,t[22]=r.tab,t[23]=e,t[24]=n,t[25]=a):a=t[25],v=a}let ee=v,b;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(b=y(),t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,F.jsx)(k,{actions:(0,F.jsxs)(f,{className:b,from:`/ec2/describe-nat-gateways/`,search:be,to:`.`,children:[(0,F.jsx)(m,{"data-icon":`inline-start`}),`Create NAT gateway`]}),subtitle:`Let private subnets reach out without being reached.`,title:`NAT Gateways`}),t[27]=x):x=t[27];let S;t[28]!==h||t[29]!==_||t[30]!==d.clear||t[31]!==d.drop||t[32]!==d.ids?(S=d.ids.length>0&&(0,F.jsx)(j,{count:d.ids.length,onClear:d.clear,children:(0,F.jsx)(pe,{deleteOne:h.mutateAsync,description:`This cannot be undone. Their Elastic IPs are not released.`,ids:d.ids,label:e=>{let t=_.get(e);return t?`${t} (${e})`:e},noun:[`NAT gateway`,`NAT gateways`],onDeleted:d.drop})}),t[28]=h,t[29]=_,t[30]=d.clear,t[31]=d.drop,t[32]=d.ids,t[33]=S):S=t[33];let ne=c?.NatGatewayId,C;t[34]===i?C=t[35]:(C=e=>{i({...D,selected:e})},t[34]=i,t[35]=C);let w;t[36]!==n||t[37]!==d.onSelectedChange||t[38]!==d.selected||t[39]!==a||t[40]!==C||t[41]!==ne?(w=(0,F.jsx)(p,{activeId:ne,caption:`NAT gateways`,columns:I,empty:`No NAT gateways yet.`,getRowId:R,onRowClick:C,onSelectedChange:d.onSelectedChange,onSortChange:o,rows:n,selected:d.selected,sort:a}),t[36]=n,t[37]=d.onSelectedChange,t[38]=d.selected,t[39]=a,t[40]=C,t[41]=ne,t[42]=w):w=t[42];let T;return t[43]!==v||t[44]!==w||t[45]!==S?(T=(0,F.jsxs)(A,{panel:ee,children:[x,S,w]}),t[43]=v,t[44]=w,t[45]=S,t[46]=T):T=t[46],T}function R(e){return e.NatGatewayId??``}function be(e){return{...e,...D,create:!0}}function z(e){return[e.NatGatewayId,i(e.Tags)]}function B(e){return e.NatGatewayId??``}function V(){let e=(0,me.c)(8),{data:t}=d(E),n=M.useSearch(),r=M.useNavigate(),i;e[0]===r?i=e[1]:(i=function(e){r({search:t=>({...t,...e}),replace:!(`selected`in e||`create`in e)})},e[0]=r,e[1]=i);let a=i,o;e[2]===t.NatGateways?o=e[3]:(o=t.NatGateways??[],e[2]=t.NatGateways,e[3]=o);let s;return e[4]!==a||e[5]!==n||e[6]!==o?(s=(0,F.jsx)(L,{onSearchChange:a,natGateways:o,search:n}),e[4]=a,e[5]=n,e[6]=o,e[7]=s):s=e[7],s}export{V as component}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BSrgRFGh.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BSrgRFGh.js new file mode 100644 index 000000000..f69e83a98 --- /dev/null +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BSrgRFGh.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/describe-nat-gateways-BSNUCY8N.js","assets/rolldown-runtime-XKyaHtl9.js","assets/schemas-DCQXG11d.js","assets/select-UwOVJofC.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/useControlled-NIWPmeG5.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/useQuery-D6TojLgI.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/useSuspenseQuery--dusmE-Q.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/table-BLvCYTga.js","assets/plus-BK_7eO_G.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/field-iLG94M00.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/panel-search-LDLf8HCe.js","assets/create-panel-BF47ohJ2.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/error-banner-Cahg3Ix2.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/state-badge-CQPRxt3J.js","assets/use-row-selection-DB6L9NiD.js","assets/form-lock-D8Cu0Sfu.js","assets/index.esm-C31mnnYl.js","assets/zod-nOHMBkds.js","assets/ec2-CM16SST3.js","assets/subnet-routing-CyGJGaO-.js","assets/bulk-delete-CXIUB03J.js","assets/circle-x-C6c0uvb-.js","assets/trash-BajuWzqn.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/nat-gateway-details-B4rSOrtE.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/sliders-horizontal-DsGbsnBU.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/resource-delete-dialog-D3NYuO-k.js","assets/delete-confirmation-dialog-O7cqOW0Y.js"])))=>i.map(i=>d[i]); +import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{v as a}from"./ec2-DcwXjFvB.js";import{r as o,t as s}from"./panel-search-LDLf8HCe.js";var c=()=>i(()=>import(`./describe-nat-gateways-BSNUCY8N.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84])),l=e(o),u=t(`/_auth/ec2/(nat-gateways)/describe-nat-gateways/`)({validateSearch:l,search:{middlewares:[r(s)]},loader:async({context:e})=>{await e.queryClient.query({...a,staleTime:`static`})},head:()=>({meta:[{title:`NAT Gateways | EC2 | Mulga`}]}),component:n(c,`component`)});export{u as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BkfId_R7.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BkfId_R7.js deleted file mode 100644 index ab8280cf2..000000000 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-BkfId_R7.js +++ /dev/null @@ -1,4 +0,0 @@ -import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r,W as i}from"./schemas-DCQXG11d.js";import{c as a,i as o,n as s,s as c,t as l}from"./select-UwOVJofC.js";import{t as u}from"./useSuspenseQuery--dusmE-Q.js";import{t as d}from"./link-BX-1BPor.js";import{t as f}from"./data-table-9n7xOy9s.js";import{t as p}from"./plus-BK_7eO_G.js";import{a as m,i as h,r as g,t as ee}from"./cli-command-panel-Do14gxB9.js";import{o as _}from"./useValueAsRef-uzS1fuI8.js";import{c as v,f as te,r as y,t as b}from"./field-iLG94M00.js";import{M as x,v as S}from"./ec2-mbMOQDVK.js";import{k as ne,n as C,v as w}from"./ec2-DcwXjFvB.js";import{t as T}from"./panel-search-LDLf8HCe.js";import{t as E}from"./create-panel-BF47ohJ2.js";import{t as D}from"./page-heading-ZfrnK2wu.js";import{t as O}from"./resource-view-CPdFr_3k.js";import{t as re}from"./selection-bar-WnknBhRB.js";import{t as k}from"./state-badge-CQPRxt3J.js";import{t as A}from"./use-row-selection-DB6L9NiD.js";import{n as ie,t as ae}from"./form-lock-D8Cu0Sfu.js";import{c as oe,o as se,t as ce}from"./index.esm-C31mnnYl.js";import{t as le}from"./zod-nOHMBkds.js";import{l as ue}from"./ec2-CM16SST3.js";import{t as j}from"./bulk-delete-CXIUB03J.js";import{t as M}from"./describe-nat-gateways-oarOwj4D.js";import{t as N}from"./nat-gateway-details-B4rSOrtE.js";var P=e(n(),1),de=r(),F=t();function I(e){let t=(0,de.c)(65),{onClose:n}=e,{data:r}=u(ne),{data:i}=u(C),o=S(),f;t[0]===r.Subnets?f=t[1]:(f=r.Subnets??[],t[0]=r.Subnets,t[1]=f);let p=f,m;t[2]===p?m=t[3]:(m=p.filter(he),t[2]=p,t[3]=m);let h=m,g=h.length>0?h:p,_;t[4]===i.Addresses?_=t[5]:(_=i.Addresses??[],t[4]=i.Addresses,t[5]=_);let x;t[6]===_?x=t[7]:(x=_.filter(me),t[6]=_,t[7]=x);let w=x,T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T={resolver:le(ue),defaultValues:{subnetId:``,allocationId:``,name:``}},t[8]=T):T=t[8];let{control:E,handleSubmit:D,register:O,formState:re}=se(T),{errors:k,isSubmitting:A}=re,j;t[9]===E?j=t[10]:(j={control:E},t[9]=E,t[10]=j);let M=oe(j),N;t[11]!==o||t[12]!==n?(N=async e=>{let t;try{t=await o.mutateAsync({subnetId:e.subnetId,allocationId:e.allocationId,name:e.name?.trim()??void 0})}catch{return}n(t.NatGateway?.NatGatewayId)},t[11]=o,t[12]=n,t[13]=N):N=t[13];let P=N,I;t[14]!==D||t[15]!==P?(I=D(P),t[14]=D,t[15]=P,t[16]=I):I=t[16];let L=o.isPending||A,R;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,F.jsx)(v,{children:(0,F.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),t[17]=R):R=t[17];let z;t[18]===O?z=t[19]:(z=O(`name`),t[18]=O,t[19]=z);let B;t[20]===z?B=t[21]:(B=(0,F.jsxs)(b,{children:[R,(0,F.jsx)(te,{id:`name`,placeholder:`my-nat-gateway`,...z})]}),t[20]=z,t[21]=B);let V;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,F.jsx)(v,{children:(0,F.jsx)(`label`,{htmlFor:`subnetId`,children:`Public subnet`})}),t[22]=V):V=t[22];let H;t[23]!==k.subnetId||t[24]!==g?(H=e=>{let{field:t}=e;return(0,F.jsxs)(l,{onValueChange:t.onChange,value:t.value??``,children:[(0,F.jsx)(c,{"aria-invalid":!!k.subnetId,className:`w-full`,id:`subnetId`,children:(0,F.jsx)(a,{placeholder:`Select a public subnet`})}),(0,F.jsx)(s,{children:g.map(pe)})]})},t[23]=k.subnetId,t[24]=g,t[25]=H):H=t[25];let U;t[26]!==E||t[27]!==H?(U=(0,F.jsx)(ce,{control:E,name:`subnetId`,render:H}),t[26]=E,t[27]=H,t[28]=U):U=t[28];let W;t[29]===k.subnetId?W=t[30]:(W=(0,F.jsx)(y,{errors:[k.subnetId]}),t[29]=k.subnetId,t[30]=W);let G;t[31]!==U||t[32]!==W?(G=(0,F.jsxs)(b,{children:[V,U,W]}),t[31]=U,t[32]=W,t[33]=G):G=t[33];let _e;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,F.jsx)(v,{children:(0,F.jsx)(`label`,{htmlFor:`allocationId`,children:`Elastic IP`})}),t[34]=_e):_e=t[34];let K;t[35]!==w||t[36]!==E||t[37]!==k.allocationId?(K=w.length>0?(0,F.jsx)(ce,{control:E,name:`allocationId`,render:e=>{let{field:t}=e;return(0,F.jsxs)(l,{onValueChange:t.onChange,value:t.value??``,children:[(0,F.jsx)(c,{"aria-invalid":!!k.allocationId,className:`w-full`,id:`allocationId`,children:(0,F.jsx)(a,{placeholder:`Select an Elastic IP`})}),(0,F.jsx)(s,{children:w.map(fe)})]})}}):(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No available Elastic IPs.`,` `,(0,F.jsx)(d,{className:`text-primary hover:underline`,search:{create:!0},to:`/ec2/describe-addresses`,children:`Allocate one`}),` `,`first.`]}),t[35]=w,t[36]=E,t[37]=k.allocationId,t[38]=K):K=t[38];let q;t[39]===k.allocationId?q=t[40]:(q=(0,F.jsx)(y,{errors:[k.allocationId]}),t[39]=k.allocationId,t[40]=q);let J;t[41]!==K||t[42]!==q?(J=(0,F.jsxs)(b,{children:[_e,K,q]}),t[41]=K,t[42]=q,t[43]=J):J=t[43];let Y;t[44]===M?Y=t[45]:(Y=ge(M),t[44]=M,t[45]=Y);let X;t[46]===Y?X=t[47]:(X=(0,F.jsx)(ee,{commands:Y}),t[46]=Y,t[47]=X);let Z;t[48]===n?Z=t[49]:(Z=()=>{n()},t[48]=n,t[49]=Z);let Q;t[50]!==o.error||t[51]!==o.isPending||t[52]!==A||t[53]!==Z?(Q=(0,F.jsx)(ie,{error:o.error,errorMsg:`Failed to create NAT Gateway`,isPending:o.isPending,isSubmitting:A,onCancel:Z,pendingLabel:`Creating…`,submitLabel:`Create NAT Gateway`}),t[50]=o.error,t[51]=o.isPending,t[52]=A,t[53]=Z,t[54]=Q):Q=t[54];let $;t[55]!==L||t[56]!==B||t[57]!==G||t[58]!==J||t[59]!==X||t[60]!==Q?($=(0,F.jsxs)(ae,{className:`space-y-6`,locked:L,children:[B,G,J,X,Q]}),t[55]=L,t[56]=B,t[57]=G,t[58]=J,t[59]=X,t[60]=Q,t[61]=$):$=t[61];let ve;return t[62]!==$||t[63]!==I?(ve=(0,F.jsx)(`form`,{onSubmit:I,children:$}),t[62]=$,t[63]=I,t[64]=ve):ve=t[64],ve}function fe(e){return(0,F.jsx)(o,{value:e.AllocationId??``,children:`${e.AllocationId} (${e.PublicIp})`},e.AllocationId)}function pe(e){let t=i(e.Tags);return(0,F.jsx)(o,{value:e.SubnetId??``,children:t?`${e.SubnetId} (${t})`:`${e.SubnetId} (${e.CidrBlock})`},e.SubnetId)}function me(e){return!e.AssociationId}function he(e){return e.MapPublicIpOnLaunch}function ge(e){let t=e.name?.trim();return[{label:`Create NAT Gateway`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-nat-gateway`},...h(`\\ - --subnet-id`,g(e.subnetId??``,`SubnetId`)),...h(`\\ - --allocation-id`,g(e.allocationId??``,`AllocationId`)),...m(`\\ - --tag-specifications`,t&&`'ResourceType=natgateway,Tags=[{Key=Name,Value=${t}}]'`)]}]}var L=[{id:`gateway`,header:`NAT gateway`,sortValue:e=>i(e.Tags)??e.NatGatewayId,cell:e=>{let t=i(e.Tags),n=e.NatGatewayId??``;return(0,F.jsxs)(d,{className:`group block max-w-72 min-w-0 rounded-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,from:`/ec2/describe-nat-gateways/`,search:e=>({...e,...T,selected:n}),to:`.`,children:[(0,F.jsx)(`span`,{className:`block truncate font-medium text-primary group-hover:underline`,children:t??n}),t&&(0,F.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:n})]})}},{id:`state`,header:`State`,sortValue:e=>e.State,cell:e=>(0,F.jsx)(k,{state:e.State})},{id:`publicIp`,header:`Public IP`,sortValue:e=>e.NatGatewayAddresses?.[0]?.PublicIp,hideBelow:`sm`,cell:e=>(0,F.jsx)(`span`,{className:`font-mono text-xs`,children:e.NatGatewayAddresses?.[0]?.PublicIp??`—`})},{id:`subnet`,header:`Subnet`,sortValue:e=>e.SubnetId,hideBelow:`md`,cell:e=>e.SubnetId?(0,F.jsx)(d,{className:`font-mono text-xs text-primary hover:underline`,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})},{id:`vpc`,header:`VPC`,sortValue:e=>e.VpcId,hideBelow:`lg`,cell:e=>e.VpcId?(0,F.jsx)(d,{className:`font-mono text-xs text-primary hover:underline`,params:{id:e.VpcId},to:`/ec2/describe-vpcs/$id`,children:e.VpcId}):(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}];function R(e){let t=(0,de.c)(47),{natGateways:n,search:r,onSearchChange:i}=e,[a,o]=(0,P.useState)(),s;if(t[0]!==n||t[1]!==r.selected){let e;t[3]===r.selected?e=t[4]:(e=e=>r.selected!==``&&e.NatGatewayId===r.selected,t[3]=r.selected,t[4]=e),s=n.find(e),t[0]=n,t[1]=r.selected,t[2]=s}else s=t[2];let c=s,l;t[5]===n?l=t[6]:(l=n.map(H),t[5]=n,t[6]=l);let u;t[7]===i?u=t[8]:(u=()=>{i(T)},t[7]=i,t[8]=u);let m=A(l,c!==void 0,u),h=x(),g;t[9]===n?g=t[10]:(g=new Map(n.map(V)),t[9]=n,t[10]=g);let ee=g,v=null;if(r.create){let e;t[11]===i?e=t[12]:(e=()=>{i(T)},t[11]=i,t[12]=e);let n;t[13]===i?n=t[14]:(n=(0,F.jsx)(I,{onClose:e=>{i({...T,selected:e??``})}}),t[13]=i,t[14]=n);let r;t[15]!==e||t[16]!==n?(r=(0,F.jsx)(E,{onClose:e,title:`Create NAT gateway`,children:n}),t[15]=e,t[16]=n,t[17]=r):r=t[17],v=r}else if(c?.NatGatewayId){let e,n;t[18]===i?(e=t[19],n=t[20]):(e=()=>{i(T)},n=e=>{i({tab:e})},t[18]=i,t[19]=e,t[20]=n);let a;t[21]!==c||t[22]!==r.tab||t[23]!==e||t[24]!==n?(a=(0,F.jsx)(N,{nat:c,onClose:e,onTabChange:n,tab:r.tab},c.NatGatewayId),t[21]=c,t[22]=r.tab,t[23]=e,t[24]=n,t[25]=a):a=t[25],v=a}let te=v,y;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(y=_(),t[26]=y):y=t[26];let b;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,F.jsx)(D,{actions:(0,F.jsxs)(d,{className:y,from:`/ec2/describe-nat-gateways/`,search:B,to:`.`,children:[(0,F.jsx)(p,{"data-icon":`inline-start`}),`Create NAT gateway`]}),subtitle:`Let private subnets reach out without being reached.`,title:`NAT Gateways`}),t[27]=b):b=t[27];let S;t[28]!==h||t[29]!==ee||t[30]!==m.clear||t[31]!==m.drop||t[32]!==m.ids?(S=m.ids.length>0&&(0,F.jsx)(re,{count:m.ids.length,onClear:m.clear,children:(0,F.jsx)(j,{deleteOne:h.mutateAsync,description:`This cannot be undone. Their Elastic IPs are not released.`,ids:m.ids,label:e=>{let t=ee.get(e);return t?`${t} (${e})`:e},noun:[`NAT gateway`,`NAT gateways`],onDeleted:m.drop})}),t[28]=h,t[29]=ee,t[30]=m.clear,t[31]=m.drop,t[32]=m.ids,t[33]=S):S=t[33];let ne=c?.NatGatewayId,C;t[34]===i?C=t[35]:(C=e=>{i({...T,selected:e})},t[34]=i,t[35]=C);let w;t[36]!==n||t[37]!==m.onSelectedChange||t[38]!==m.selected||t[39]!==a||t[40]!==C||t[41]!==ne?(w=(0,F.jsx)(f,{activeId:ne,caption:`NAT gateways`,columns:L,empty:`No NAT gateways yet.`,getRowId:z,onRowClick:C,onSelectedChange:m.onSelectedChange,onSortChange:o,rows:n,selected:m.selected,sort:a}),t[36]=n,t[37]=m.onSelectedChange,t[38]=m.selected,t[39]=a,t[40]=C,t[41]=ne,t[42]=w):w=t[42];let k;return t[43]!==v||t[44]!==w||t[45]!==S?(k=(0,F.jsxs)(O,{panel:te,children:[b,S,w]}),t[43]=v,t[44]=w,t[45]=S,t[46]=k):k=t[46],k}function z(e){return e.NatGatewayId??``}function B(e){return{...e,...T,create:!0}}function V(e){return[e.NatGatewayId,i(e.Tags)]}function H(e){return e.NatGatewayId??``}function U(){let e=(0,de.c)(8),{data:t}=u(w),n=M.useSearch(),r=M.useNavigate(),i;e[0]===r?i=e[1]:(i=function(e){r({search:t=>({...t,...e}),replace:!(`selected`in e||`create`in e)})},e[0]=r,e[1]=i);let a=i,o;e[2]===t.NatGateways?o=e[3]:(o=t.NatGateways??[],e[2]=t.NatGateways,e[3]=o);let s;return e[4]!==a||e[5]!==n||e[6]!==o?(s=(0,F.jsx)(R,{onSearchChange:a,natGateways:o,search:n}),e[4]=a,e[5]=n,e[6]=o,e[7]=s):s=e[7],s}export{U as component}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-oarOwj4D.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-oarOwj4D.js deleted file mode 100644 index d3693edf1..000000000 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-nat-gateways-oarOwj4D.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/describe-nat-gateways-BkfId_R7.js","assets/rolldown-runtime-XKyaHtl9.js","assets/schemas-DCQXG11d.js","assets/select-UwOVJofC.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/useControlled-NIWPmeG5.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/table-BLvCYTga.js","assets/plus-BK_7eO_G.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/field-iLG94M00.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/panel-search-LDLf8HCe.js","assets/create-panel-BF47ohJ2.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/error-banner-Cahg3Ix2.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/state-badge-CQPRxt3J.js","assets/use-row-selection-DB6L9NiD.js","assets/form-lock-D8Cu0Sfu.js","assets/index.esm-C31mnnYl.js","assets/zod-nOHMBkds.js","assets/ec2-CM16SST3.js","assets/bulk-delete-CXIUB03J.js","assets/circle-x-C6c0uvb-.js","assets/trash-BajuWzqn.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/nat-gateway-details-B4rSOrtE.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/sliders-horizontal-DsGbsnBU.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/resource-delete-dialog-D3NYuO-k.js","assets/delete-confirmation-dialog-O7cqOW0Y.js"])))=>i.map(i=>d[i]); -import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{v as a}from"./ec2-DcwXjFvB.js";import{r as o,t as s}from"./panel-search-LDLf8HCe.js";var c=()=>i(()=>import(`./describe-nat-gateways-BkfId_R7.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82])),l=e(o),u=t(`/_auth/ec2/(nat-gateways)/describe-nat-gateways/`)({validateSearch:l,search:{middlewares:[r(s)]},loader:async({context:e})=>{await e.queryClient.query({...a,staleTime:`static`})},head:()=>({meta:[{title:`NAT Gateways | EC2 | Mulga`}]}),component:n(c,`component`)});export{u as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-BUUHyKn_.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-89hPyNfr.js similarity index 93% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-BUUHyKn_.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-89hPyNfr.js index 3c8421931..f752cd32b 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-BUUHyKn_.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-89hPyNfr.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/describe-security-groups-DWDM1GeE.js","assets/rolldown-runtime-XKyaHtl9.js","assets/schemas-DCQXG11d.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/useRegisterFieldControl-DkI655of.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/useTransitionStatus-Dn-09Anc.js","assets/useValueChanged-wii0yYWk.js","assets/useControlled-NIWPmeG5.js","assets/table-BLvCYTga.js","assets/plus-BK_7eO_G.js","assets/cli-command-panel-Do14gxB9.js","assets/chevron-down-BgudX6bq.js","assets/copy-B9ICxw_u.js","assets/useValueAsRef-uzS1fuI8.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/panel-search-LDLf8HCe.js","assets/create-panel-BF47ohJ2.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/error-banner-Cahg3Ix2.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/use-row-selection-DB6L9NiD.js","assets/form-lock-D8Cu0Sfu.js","assets/index.esm-C31mnnYl.js","assets/zod-nOHMBkds.js","assets/ec2-CM16SST3.js","assets/form-fields-CcTBfvl9.js","assets/select-UwOVJofC.js","assets/clamp-D0kAXd-u.js","assets/field-iLG94M00.js","assets/bulk-delete-CXIUB03J.js","assets/circle-x-C6c0uvb-.js","assets/trash-BajuWzqn.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/vpc-select-field-C1Xb0z_c.js","assets/security-group-details-CdE6iD9s.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/sliders-horizontal-DsGbsnBU.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-panel-CtjudV7b.js","assets/instance-overview-I3DWLmM0.js","assets/useQuery-D6TojLgI.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/state-badge-CQPRxt3J.js","assets/instance-type-size-DoyCeynC.js","assets/resource-delete-dialog-D3NYuO-k.js"])))=>i.map(i=>d[i]); -import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{T as a}from"./ec2-DcwXjFvB.js";import{r as o,t as s}from"./panel-search-LDLf8HCe.js";var c=()=>i(()=>import(`./describe-security-groups-DWDM1GeE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95])),l=e(o),u=t(`/_auth/ec2/(security-groups)/describe-security-groups/`)({validateSearch:l,search:{middlewares:[r(s)]},loader:async({context:e})=>{await e.queryClient.query({...a,staleTime:`static`})},head:()=>({meta:[{title:`Security Groups | EC2 | Mulga`}]}),component:n(c,`component`)});export{u as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/describe-security-groups-BEpeMX96.js","assets/rolldown-runtime-XKyaHtl9.js","assets/schemas-DCQXG11d.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/useRegisterFieldControl-DkI655of.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/useTransitionStatus-Dn-09Anc.js","assets/useValueChanged-wii0yYWk.js","assets/useControlled-NIWPmeG5.js","assets/table-BLvCYTga.js","assets/plus-BK_7eO_G.js","assets/cli-command-panel-Do14gxB9.js","assets/chevron-down-BgudX6bq.js","assets/copy-B9ICxw_u.js","assets/useValueAsRef-uzS1fuI8.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/ec2-mbMOQDVK.js","assets/useMutation-lRi0DDcO.js","assets/aws-client-DrLAG3yq.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-M7C_FWzS.js","assets/ec2-DcwXjFvB.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/panel-search-LDLf8HCe.js","assets/create-panel-BF47ohJ2.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/error-banner-Cahg3Ix2.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/use-row-selection-DB6L9NiD.js","assets/form-lock-D8Cu0Sfu.js","assets/index.esm-C31mnnYl.js","assets/zod-nOHMBkds.js","assets/ec2-CM16SST3.js","assets/form-fields-CcTBfvl9.js","assets/select-UwOVJofC.js","assets/clamp-D0kAXd-u.js","assets/field-iLG94M00.js","assets/bulk-delete-CXIUB03J.js","assets/circle-x-C6c0uvb-.js","assets/trash-BajuWzqn.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/vpc-select-field-C1Xb0z_c.js","assets/security-group-details-Dc-1r5cD.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/sliders-horizontal-DsGbsnBU.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/resource-tags-DMnOITWf.js","assets/tags-CXDQrv7y.js","assets/commandBuilder-zZSrq900.js","assets/commandBuilder-CTdNRogs.js","assets/commandBuilder-lcvi73e2.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-panel-CtjudV7b.js","assets/instance-overview-DWnPG_Ut.js","assets/useQuery-D6TojLgI.js","assets/iam-CCgnxhTh.js","assets/json-DSPw_Fae.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/state-badge-CQPRxt3J.js","assets/instance-type-size-DoyCeynC.js","assets/resource-delete-dialog-D3NYuO-k.js"])))=>i.map(i=>d[i]); +import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-C0nfkUzI.js";import{T as a}from"./ec2-DcwXjFvB.js";import{r as o,t as s}from"./panel-search-LDLf8HCe.js";var c=()=>i(()=>import(`./describe-security-groups-BEpeMX96.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95])),l=e(o),u=t(`/_auth/ec2/(security-groups)/describe-security-groups/`)({validateSearch:l,search:{middlewares:[r(s)]},loader:async({context:e})=>{await e.queryClient.query({...a,staleTime:`static`})},head:()=>({meta:[{title:`Security Groups | EC2 | Mulga`}]}),component:n(c,`component`)});export{u as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-DWDM1GeE.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-BEpeMX96.js similarity index 98% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-DWDM1GeE.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-BEpeMX96.js index 3babd6920..78b867260 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-DWDM1GeE.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/describe-security-groups-BEpeMX96.js @@ -1,4 +1,4 @@ -import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r}from"./schemas-DCQXG11d.js";import{t as i}from"./useSuspenseQuery--dusmE-Q.js";import{t as a}from"./link-BX-1BPor.js";import{t as o}from"./data-table-9n7xOy9s.js";import{t as s}from"./plus-BK_7eO_G.js";import{a as c,i as l,r as u,t as d}from"./cli-command-panel-Do14gxB9.js";import{o as f}from"./useValueAsRef-uzS1fuI8.js";import{I as p,S as m}from"./ec2-mbMOQDVK.js";import{N as h,T as g}from"./ec2-DcwXjFvB.js";import{t as _}from"./panel-search-LDLf8HCe.js";import{t as v}from"./create-panel-BF47ohJ2.js";import{t as y}from"./page-heading-ZfrnK2wu.js";import{t as b}from"./resource-view-CPdFr_3k.js";import{t as x}from"./selection-bar-WnknBhRB.js";import{t as S}from"./use-row-selection-DB6L9NiD.js";import{n as C,t as w}from"./form-lock-D8Cu0Sfu.js";import{c as T,o as E}from"./index.esm-C31mnnYl.js";import{t as D}from"./zod-nOHMBkds.js";import{p as O}from"./ec2-CM16SST3.js";import{r as k}from"./form-fields-CcTBfvl9.js";import{t as A}from"./bulk-delete-CXIUB03J.js";import{t as j}from"./describe-security-groups-BUUHyKn_.js";import{t as M}from"./vpc-select-field-C1Xb0z_c.js";import{t as N}from"./security-group-details-CdE6iD9s.js";var P=e(n(),1),F=r(),I=t();function L(e){let t=(0,F.c)(47),{onClose:n}=e,{data:r}=i(h),a=m(),o;t[0]===r.Vpcs?o=t[1]:(o=r.Vpcs??[],t[0]=r.Vpcs,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=D(O),t[2]=c):c=t[2];let l=s[0]?.VpcId??``,u;t[3]===l?u=t[4]:(u={resolver:c,defaultValues:{groupName:``,description:``,vpcId:l}},t[3]=l,t[4]=u);let{control:f,handleSubmit:p,register:g,formState:_}=E(u),{errors:v,isSubmitting:y}=_,b;t[5]===f?b=t[6]:(b={control:f},t[5]=f,t[6]=b);let x=T(b),S;t[7]!==a||t[8]!==n?(S=async e=>{let t;try{t=await a.mutateAsync(e)}catch{return}n(t.GroupId)},t[7]=a,t[8]=n,t[9]=S):S=t[9];let A=S,j;t[10]!==p||t[11]!==A?(j=p(A),t[10]=p,t[11]=A,t[12]=j):j=t[12];let N=a.isPending||y,P=v.groupName,L;t[13]===g?L=t[14]:(L=g(`groupName`),t[13]=g,t[14]=L);let z;t[15]!==v.groupName||t[16]!==L?(z=(0,I.jsx)(k,{error:P,id:`groupName`,label:`Group Name`,placeholder:`my-security-group`,...L}),t[15]=v.groupName,t[16]=L,t[17]=z):z=t[17];let B=v.description,V;t[18]===g?V=t[19]:(V=g(`description`),t[18]=g,t[19]=V);let H;t[20]!==v.description||t[21]!==V?(H=(0,I.jsx)(k,{error:B,id:`description`,label:`Description`,placeholder:`My security group description`,...V}),t[20]=v.description,t[21]=V,t[22]=H):H=t[22];let U;t[23]!==f||t[24]!==s?(U=(0,I.jsx)(M,{control:f,id:`vpcId`,name:`vpcId`,vpcs:s}),t[23]=f,t[24]=s,t[25]=U):U=t[25];let W;t[26]===x?W=t[27]:(W=R(x),t[26]=x,t[27]=W);let G;t[28]===W?G=t[29]:(G=(0,I.jsx)(d,{commands:W}),t[28]=W,t[29]=G);let K;t[30]===n?K=t[31]:(K=()=>{n()},t[30]=n,t[31]=K);let q;t[32]!==a.error||t[33]!==a.isPending||t[34]!==y||t[35]!==K?(q=(0,I.jsx)(C,{error:a.error,errorMsg:`Failed to create security group`,isPending:a.isPending,isSubmitting:y,onCancel:K,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),t[32]=a.error,t[33]=a.isPending,t[34]=y,t[35]=K,t[36]=q):q=t[36];let J;t[37]!==z||t[38]!==H||t[39]!==U||t[40]!==G||t[41]!==q||t[42]!==N?(J=(0,I.jsxs)(w,{className:`space-y-6`,locked:N,children:[z,H,U,G,q]}),t[37]=z,t[38]=H,t[39]=U,t[40]=G,t[41]=q,t[42]=N,t[43]=J):J=t[43];let Y;return t[44]!==J||t[45]!==j?(Y=(0,I.jsx)(`form`,{onSubmit:j,children:J}),t[44]=J,t[45]=j,t[46]=Y):Y=t[46],Y}function R(e){let t=u(e.description??``,`Description`);return[{label:`Create Security Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},...l(`\\ +import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r}from"./schemas-DCQXG11d.js";import{t as i}from"./useSuspenseQuery--dusmE-Q.js";import{t as a}from"./link-BX-1BPor.js";import{t as o}from"./data-table-9n7xOy9s.js";import{t as s}from"./plus-BK_7eO_G.js";import{a as c,i as l,r as u,t as d}from"./cli-command-panel-Do14gxB9.js";import{o as f}from"./useValueAsRef-uzS1fuI8.js";import{I as p,S as m}from"./ec2-mbMOQDVK.js";import{N as h,T as g}from"./ec2-DcwXjFvB.js";import{t as _}from"./panel-search-LDLf8HCe.js";import{t as v}from"./create-panel-BF47ohJ2.js";import{t as y}from"./page-heading-ZfrnK2wu.js";import{t as b}from"./resource-view-CPdFr_3k.js";import{t as x}from"./selection-bar-WnknBhRB.js";import{t as S}from"./use-row-selection-DB6L9NiD.js";import{n as C,t as w}from"./form-lock-D8Cu0Sfu.js";import{c as T,o as E}from"./index.esm-C31mnnYl.js";import{t as D}from"./zod-nOHMBkds.js";import{p as O}from"./ec2-CM16SST3.js";import{r as k}from"./form-fields-CcTBfvl9.js";import{t as A}from"./bulk-delete-CXIUB03J.js";import{t as j}from"./describe-security-groups-89hPyNfr.js";import{t as M}from"./vpc-select-field-C1Xb0z_c.js";import{t as N}from"./security-group-details-Dc-1r5cD.js";var P=e(n(),1),F=r(),I=t();function L(e){let t=(0,F.c)(47),{onClose:n}=e,{data:r}=i(h),a=m(),o;t[0]===r.Vpcs?o=t[1]:(o=r.Vpcs??[],t[0]=r.Vpcs,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=D(O),t[2]=c):c=t[2];let l=s[0]?.VpcId??``,u;t[3]===l?u=t[4]:(u={resolver:c,defaultValues:{groupName:``,description:``,vpcId:l}},t[3]=l,t[4]=u);let{control:f,handleSubmit:p,register:g,formState:_}=E(u),{errors:v,isSubmitting:y}=_,b;t[5]===f?b=t[6]:(b={control:f},t[5]=f,t[6]=b);let x=T(b),S;t[7]!==a||t[8]!==n?(S=async e=>{let t;try{t=await a.mutateAsync(e)}catch{return}n(t.GroupId)},t[7]=a,t[8]=n,t[9]=S):S=t[9];let A=S,j;t[10]!==p||t[11]!==A?(j=p(A),t[10]=p,t[11]=A,t[12]=j):j=t[12];let N=a.isPending||y,P=v.groupName,L;t[13]===g?L=t[14]:(L=g(`groupName`),t[13]=g,t[14]=L);let z;t[15]!==v.groupName||t[16]!==L?(z=(0,I.jsx)(k,{error:P,id:`groupName`,label:`Group Name`,placeholder:`my-security-group`,...L}),t[15]=v.groupName,t[16]=L,t[17]=z):z=t[17];let B=v.description,V;t[18]===g?V=t[19]:(V=g(`description`),t[18]=g,t[19]=V);let H;t[20]!==v.description||t[21]!==V?(H=(0,I.jsx)(k,{error:B,id:`description`,label:`Description`,placeholder:`My security group description`,...V}),t[20]=v.description,t[21]=V,t[22]=H):H=t[22];let U;t[23]!==f||t[24]!==s?(U=(0,I.jsx)(M,{control:f,id:`vpcId`,name:`vpcId`,vpcs:s}),t[23]=f,t[24]=s,t[25]=U):U=t[25];let W;t[26]===x?W=t[27]:(W=R(x),t[26]=x,t[27]=W);let G;t[28]===W?G=t[29]:(G=(0,I.jsx)(d,{commands:W}),t[28]=W,t[29]=G);let K;t[30]===n?K=t[31]:(K=()=>{n()},t[30]=n,t[31]=K);let q;t[32]!==a.error||t[33]!==a.isPending||t[34]!==y||t[35]!==K?(q=(0,I.jsx)(C,{error:a.error,errorMsg:`Failed to create security group`,isPending:a.isPending,isSubmitting:y,onCancel:K,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),t[32]=a.error,t[33]=a.isPending,t[34]=y,t[35]=K,t[36]=q):q=t[36];let J;t[37]!==z||t[38]!==H||t[39]!==U||t[40]!==G||t[41]!==q||t[42]!==N?(J=(0,I.jsxs)(w,{className:`space-y-6`,locked:N,children:[z,H,U,G,q]}),t[37]=z,t[38]=H,t[39]=U,t[40]=G,t[41]=q,t[42]=N,t[43]=J):J=t[43];let Y;return t[44]!==J||t[45]!==j?(Y=(0,I.jsx)(`form`,{onSubmit:j,children:J}),t[44]=J,t[45]=j,t[46]=Y):Y=t[46],Y}function R(e){let t=u(e.description??``,`Description`);return[{label:`Create Security Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},...l(`\\ --group-name`,u(e.groupName??``,`GroupName`)),...l(`\\ --description`,`"${t}"`),...c(`\\ --vpc-id`,e.vpcId)]}]}function z(e){return(e??[]).reduce((e,t)=>e+(t.IpRanges?.length??0)+(t.Ipv6Ranges?.length??0)+(t.UserIdGroupPairs?.length??0)+(t.PrefixListIds?.length??0),0)}var B=[{id:`group`,header:`Security group`,sortValue:e=>e.GroupName??e.GroupId,cell:e=>{let t=e.GroupId??``;return(0,I.jsxs)(a,{className:`group block max-w-72 min-w-0 rounded-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,from:`/ec2/describe-security-groups/`,search:e=>({...e,..._,selected:t}),to:`.`,children:[(0,I.jsx)(`span`,{className:`block truncate font-medium text-primary group-hover:underline`,children:e.GroupName??t}),e.GroupName&&(0,I.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:t})]})}},{id:`vpc`,header:`VPC`,sortValue:e=>e.VpcId,hideBelow:`sm`,cell:e=>e.VpcId?(0,I.jsx)(a,{className:`font-mono text-xs text-primary hover:underline`,params:{id:e.VpcId},to:`/ec2/describe-vpcs/$id`,children:e.VpcId}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})},{id:`description`,header:`Description`,sortValue:e=>e.Description,hideBelow:`lg`,cell:e=>(0,I.jsx)(`span`,{className:`block max-w-80 truncate`,title:e.Description,children:e.Description})},{id:`inbound`,header:`Inbound`,sortValue:e=>z(e.IpPermissions),hideBelow:`md`,align:`end`,cell:e=>(0,I.jsx)(`span`,{className:`tabular-nums`,children:z(e.IpPermissions)})},{id:`outbound`,header:`Outbound`,sortValue:e=>z(e.IpPermissionsEgress),hideBelow:`md`,align:`end`,cell:e=>(0,I.jsx)(`span`,{className:`tabular-nums`,children:z(e.IpPermissionsEgress)})}];function V(e){let t=(0,F.c)(47),{securityGroups:n,search:r,onSearchChange:i}=e,[c,l]=(0,P.useState)(),u;if(t[0]!==r.selected||t[1]!==n){let e;t[3]===r.selected?e=t[4]:(e=e=>r.selected!==``&&e.GroupId===r.selected,t[3]=r.selected,t[4]=e),u=n.find(e),t[0]=r.selected,t[1]=n,t[2]=u}else u=t[2];let d=u,m;t[5]===n?m=t[6]:(m=n.map(G),t[5]=n,t[6]=m);let h;t[7]===i?h=t[8]:(h=()=>{i(_)},t[7]=i,t[8]=h);let g=S(m,d!==void 0,h),C=p(),w;t[9]===n?w=t[10]:(w=new Map(n.map(W)),t[9]=n,t[10]=w);let T=w,E=null;if(r.create){let e;t[11]===i?e=t[12]:(e=()=>{i(_)},t[11]=i,t[12]=e);let n;t[13]===i?n=t[14]:(n=(0,I.jsx)(L,{onClose:e=>{i({..._,selected:e??``})}}),t[13]=i,t[14]=n);let r;t[15]!==e||t[16]!==n?(r=(0,I.jsx)(v,{onClose:e,title:`Create security group`,children:n}),t[15]=e,t[16]=n,t[17]=r):r=t[17],E=r}else if(d?.GroupId){let e,n;t[18]===i?(e=t[19],n=t[20]):(e=()=>{i(_)},n=e=>{i({tab:e})},t[18]=i,t[19]=e,t[20]=n);let a;t[21]!==d||t[22]!==r.tab||t[23]!==e||t[24]!==n?(a=(0,I.jsx)(N,{onClose:e,onTabChange:n,sg:d,tab:r.tab},d.GroupId),t[21]=d,t[22]=r.tab,t[23]=e,t[24]=n,t[25]=a):a=t[25],E=a}let D=E,O;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(O=f(),t[26]=O):O=t[26];let k;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,I.jsx)(y,{actions:(0,I.jsxs)(a,{className:O,from:`/ec2/describe-security-groups/`,search:U,to:`.`,children:[(0,I.jsx)(s,{"data-icon":`inline-start`}),`Create security group`]}),subtitle:`Stateful firewalls for the instances in a VPC.`,title:`Security Groups`}),t[27]=k):k=t[27];let j;t[28]!==C||t[29]!==T||t[30]!==g.clear||t[31]!==g.drop||t[32]!==g.ids?(j=g.ids.length>0&&(0,I.jsx)(x,{count:g.ids.length,onClear:g.clear,children:(0,I.jsx)(A,{deleteOne:C.mutateAsync,description:`No instance or other group may still reference them. This cannot be undone.`,ids:g.ids,label:e=>{let t=T.get(e);return t?`${t} (${e})`:e},noun:[`security group`,`security groups`],onDeleted:g.drop})}),t[28]=C,t[29]=T,t[30]=g.clear,t[31]=g.drop,t[32]=g.ids,t[33]=j):j=t[33];let M=d?.GroupId,R;t[34]===i?R=t[35]:(R=e=>{i({..._,selected:e})},t[34]=i,t[35]=R);let z;t[36]!==n||t[37]!==g.onSelectedChange||t[38]!==g.selected||t[39]!==c||t[40]!==R||t[41]!==M?(z=(0,I.jsx)(o,{activeId:M,caption:`Security groups`,columns:B,empty:`No security groups yet.`,getRowId:H,onRowClick:R,onSelectedChange:g.onSelectedChange,onSortChange:l,rows:n,selected:g.selected,sort:c}),t[36]=n,t[37]=g.onSelectedChange,t[38]=g.selected,t[39]=c,t[40]=R,t[41]=M,t[42]=z):z=t[42];let V;return t[43]!==E||t[44]!==z||t[45]!==j?(V=(0,I.jsxs)(b,{panel:D,children:[k,j,z]}),t[43]=E,t[44]=z,t[45]=j,t[46]=V):V=t[46],V}function H(e){return e.GroupId??``}function U(e){return{...e,..._,create:!0}}function W(e){return[e.GroupId,e.GroupName]}function G(e){return e.GroupId??``}function K(){let e=(0,F.c)(8),{data:t}=i(g),n=j.useSearch(),r=j.useNavigate(),a;e[0]===r?a=e[1]:(a=function(e){r({search:t=>({...t,...e}),replace:!(`selected`in e||`create`in e)})},e[0]=r,e[1]=a);let o=a,s;e[2]===t.SecurityGroups?s=e[3]:(s=t.SecurityGroups??[],e[2]=t.SecurityGroups,e[3]=s);let c;return e[4]!==o||e[5]!==n||e[6]!==s?(c=(0,I.jsx)(V,{onSearchChange:o,search:n,securityGroups:s}),e[4]=o,e[5]=n,e[6]=s,e[7]=c):c=e[7],c}export{K as component}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/index-D4IPcr_s.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/index-DRn7Wf2u.js similarity index 99% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/index-D4IPcr_s.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/index-DRn7Wf2u.js index ec17993f7..d39fbdb76 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/index-D4IPcr_s.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/index-DRn7Wf2u.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-DOzLOF2O.js","assets/rolldown-runtime-XKyaHtl9.js","assets/schemas-DCQXG11d.js","assets/x-mlA6pp-8.js","assets/visuallyHidden-BHQz5bmH.js","assets/Match-DoMGE6F5.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/useSelector-CDb-n1FW.js","assets/circle-x-C6c0uvb-.js","assets/loader-circle-C7EgoGp_.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/dialog-cKmL-g1C.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/DialogTitle-nAIOTphJ.js","assets/store-BVhNJayb.js","assets/uploads-DWKB6oFv.js","assets/aws-client-DrLAG3yq.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-C0nfkUzI.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/progress-BKKUvnh8.js","assets/stringifyLocale-CkHjdQTJ.js","assets/clamp-D0kAXd-u.js","assets/_auth-B65uELJL.js","assets/useQuery-D6TojLgI.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/link-BX-1BPor.js","assets/useNavigate-cMdr_EJ0.js","assets/chevron-down-BgudX6bq.js","assets/chevron-right-DZULbaNT.js","assets/globe-D4RJ05Is.js","assets/shield-ueJ8o-9F.js","assets/network-HoxYWcnO.js","assets/server-D03m5B1l.js","assets/waypoints-DpY-cxow.js","assets/s3-PnGphw-P.js","assets/ec2-DcwXjFvB.js","assets/commandBuilder-M7C_FWzS.js","assets/admin-UXb5aZ2d.js","assets/signed-fetch-BqrfDScu.js","assets/use-admin-C98I-ai5.js","assets/sts-CE3ck8x_.js","assets/sts-B3Vm6ytn.js","assets/alert-dialog-D9jG-rkO.js","assets/panel-search-LDLf8HCe.js","assets/page-heading-ZfrnK2wu.js","assets/state-badge-CQPRxt3J.js","assets/badge-DmU0agld.js","assets/useRender-B8US0bW6.js","assets/card-CTe96Jxe.js","assets/nodes-table-B-w8id20.js","assets/data-table-9n7xOy9s.js","assets/check-DPoQ9cBn.js","assets/useRegisterFieldControl-DkI655of.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/useValueChanged-wii0yYWk.js","assets/useControlled-NIWPmeG5.js","assets/table-BLvCYTga.js","assets/node-topology-BvlVRsos.js","assets/nodes-BonJAxuB.js","assets/design-DZspP046.js","assets/select-UwOVJofC.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/info-tip-Cxa2GEOd.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/radio-group-TE8lo9RG.js","assets/CompositeRoot-CmHoR-Tk.js","assets/CompositeItem-DqJfacHh.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/error-banner-Cahg3Ix2.js","assets/command-DEKAblVz.js","assets/input-group-TEGNx6dm.js","assets/textarea-BG1iGvVs.js","assets/dropdown-menu-BDPQio-M.js","assets/switch-CFqwHFZR.js","assets/toggle-group-CED1FjZ4.js","assets/create-panel-BF47ohJ2.js","assets/confirm-phrase-C4Dux-0Y.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/filter-bar-DNltk5ao.js","assets/selection-bar-WnknBhRB.js","assets/table-cells-Dh4yWZC8.js","assets/console-output-B2nAhrwp.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/plus-BK_7eO_G.js","assets/trash-BajuWzqn.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/choice-tile-CEc-Vca5.js","assets/form-fields-CcTBfvl9.js","assets/index.esm-C31mnnYl.js","assets/switch-list-X53OOONN.js","assets/back-link-B8ejy5Fm.js","assets/tags-field-array-Drjjg7Rv.js","assets/device-art-DE6BwVxg.js","assets/speed-dial-68JSV0Fd.js","assets/wizard-failure-banner-BR3QnaTK.js","assets/topology-RT1jyrOt.js","assets/style-D6g7XXlp.js","assets/style-DLioOiRN.css","assets/service-metrics-DJkeW--G.js","assets/list-model-catalog-GXlDIUAQ.js","assets/list-model-access-B957cn4r.js","assets/useMutation-lRi0DDcO.js","assets/resource-delete-dialog-D3NYuO-k.js","assets/playground-NOAnET5k.js","assets/useSuspenseQuery--dusmE-Q.js","assets/bedrock-DaOk_4Nm.js","assets/commandBuilder-BGjY-6DN.js"])))=>i.map(i=>d[i]); -import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{It as n,Lt as r,Mt as i,Nt as a,jt as o,l as s,s as c,xt as l,z as u}from"./schemas-DCQXG11d.js";import{O as d}from"./select-UwOVJofC.js";import{n as f,t as p}from"./QueryClientProvider-BuG40HBe.js";import{C as m,_ as h,a as g,b as _,c as v,d as y,f as b,g as x,l as S,m as C,p as w,u as T,v as E,y as ee}from"./queryOptions-Cu2lvOFG.js";import{n as te}from"./useMutation-lRi0DDcO.js";import{a as ne,i as re,n as D,o as ie,r as ae,t as oe}from"./lazyRouteComponent-PMetaA3O.js";import{S as se,a as ce,f as le,g as ue,i as de,l as O,o as fe,u as pe,v as me,y as he}from"./matchContext-CUAcfcYw.js";import{t as ge}from"./link-BX-1BPor.js";import{n as _e}from"./x-mlA6pp-8.js";import{i as ve,n as ye,r as be,t as k}from"./Match-DoMGE6F5.js";import{n as A,t as xe}from"./useRouter-B_eSHXWd.js";import{i as Se,r as Ce}from"./data-table-9n7xOy9s.js";import{t as we}from"./useSelector-CDb-n1FW.js";import{t as Te}from"./useNavigate-cMdr_EJ0.js";import{n as j,t as Ee}from"./style-D6g7XXlp.js";import{t as De}from"./useRender-B8US0bW6.js";import{r as M}from"./visuallyHidden-BHQz5bmH.js";import{n as Oe,r as ke,t as Ae}from"./nodes-OW-WOv1L.js";import{t as je}from"./camera-1mvx7uSy.js";import{t as Me}from"./chevron-right-DZULbaNT.js";import{t as Ne}from"./database-BO8Y4D1H.js";import{t as Pe}from"./globe-D4RJ05Is.js";import{i as Fe,n as Ie,r as Le,t as Re}from"./shield-ueJ8o-9F.js";import{n as ze}from"./snapshot-details-DAaW4laK.js";import{t as Be}from"./key-round-CCs94qJj.js";import{t as Ve}from"./network-HoxYWcnO.js";import{t as He}from"./plus-BK_7eO_G.js";import{i as Ue}from"./input-group-TEGNx6dm.js";import{t as We}from"./server-D03m5B1l.js";import{t as Ge}from"./sliders-horizontal-DsGbsnBU.js";import{t as Ke}from"./waypoints-DpY-cxow.js";import{a as qe,o as Je}from"./useValueAsRef-uzS1fuI8.js";import{u as Ye}from"./field-iLG94M00.js";import{d as Xe,l as Ze,u as Qe}from"./detail-panel-DLM1ExsZ.js";import{_ as $e,a as et,b as tt,c as nt,d as rt,f as it,g as at,h as ot,i as st,l as ct,m as lt,n as ut,o as dt,p as ft,r as pt,s as mt,t as ht,u as gt,v as _t,y as vt}from"./command-DEKAblVz.js";import{i as yt,l as bt,n as xt,r as St,u as Ct}from"./auth-BS4WytAe.js";import{t as wt}from"./aws-client-DrLAG3yq.js";import{U as Tt}from"./fetch-http-handler-C0nfkUzI.js";import{t as Et}from"./uploads-DWKB6oFv.js";import{n as Dt}from"./s3-PnGphw-P.js";import{i as Ot,t as kt}from"./bedrock-DaOk_4Nm.js";import{N as At,T as jt,f as Mt,j as Nt,m as Pt,n as Ft,u as It,v as Lt}from"./ec2-DcwXjFvB.js";import{t as Rt}from"./use-admin-C98I-ai5.js";import{n as zt,r as Bt,t as Vt}from"./collapsible-DddM174D.js";import{u as Ht}from"./alert-dialog-D9jG-rkO.js";import{t as Ut}from"./login-CxRPXyw1.js";import{t as Wt}from"./task-definitions-4T85JnLY.js";import{t as Gt}from"./ls-WDEbec8A.js";import{t as Kt}from"./list-guardrails-BIUEeO-w.js";import{t as qt}from"./list-knowledge-bases-WZLojFWd.js";import{t as Jt}from"./_knowledgeBaseId-QWanYQuA.js";import{t as Yt}from"./describe-addresses-B6rjlSxy.js";import{t as Xt}from"./_id-mJ5xeUqe.js";import{t as N}from"./describe-images-BTgR9nNH.js";import{t as Zt}from"./_id-BsiXYrSu.js";import{t as Qt}from"./describe-instances-oBl3gO4F.js";import{t as $t}from"./_id-DVp0ns8g.js";import{t as en}from"./describe-internet-gateways-DGVdE4ao.js";import{t as tn}from"./_id-BImUwN-q.js";import{t as nn}from"./describe-key-pairs-DkJ57cPL.js";import{t as rn}from"./_id-CTPiGicO.js";import{t as an}from"./describe-launch-templates-Dm_Jqqa4.js";import{t as on}from"./_id-me2Zs0AS.js";import{t as sn}from"./describe-load-balancers-Rev_KV02.js";import{t as cn}from"./_id-BPFWujqp.js";import{t as ln}from"./describe-nat-gateways-oarOwj4D.js";import{t as un}from"./_id-BTSpHAWv.js";import{t as dn}from"./describe-placement-groups-CzAcMd0O.js";import{t as fn}from"./_id-CyQW19S-.js";import{t as pn}from"./describe-route-tables-b7ZQnWY7.js";import{t as mn}from"./_id-Cja38hIt.js";import{t as hn}from"./describe-security-groups-BUUHyKn_.js";import{t as gn}from"./_id-BzihuQgX.js";import{t as _n}from"./describe-snapshots-C08TJHbT.js";import{t as vn}from"./_id-D6QqOzEV.js";import{t as yn}from"./describe-subnets-QCNg3hA8.js";import{t as bn}from"./_id-J94S_B6e.js";import{t as xn}from"./describe-target-groups-PfIcQOgF.js";import{t as Sn}from"./_id-BsEp959L.js";import{t as Cn}from"./describe-volumes-BsD2s95-.js";import{t as wn}from"./_id-BrGGfbgb.js";import{t as Tn}from"./describe-vpcs-CoOUo2VJ.js";import{t as En}from"./_id-C4P0Mrzi.js";import{t as Dn}from"./list-repositories-CFQtM3Za.js";import{t as On}from"./_id-CAchV8yY.js";import{t as kn}from"./list-clusters-DPkge-uV.js";import{t as An}from"./_clusterName-ZSZ0iYUv.js";import{t as jn}from"./list-clusters-DLQ8XUVi.js";import{t as Mn}from"./_clusterName-BoraDYTI.js";import{t as Nn}from"./list-groups-w1_M2D0q.js";import{t as Pn}from"./_groupName-Cu1acPAK.js";import{t as Fn}from"./list-instance-profiles-BwX0pUQw.js";import{t as In}from"./_instanceProfileName-BMJLnNyw.js";import{t as Ln}from"./list-policies-DsbydxpV.js";import{t as Rn}from"./_policyArn-B7dS4-gS.js";import{t as zn}from"./list-roles-Dla1KegM.js";import{t as Bn}from"./_roleName-Onu0HgM_.js";import{t as Vn}from"./list-users-Cco38DUi.js";import{t as Hn}from"./_userName-jg4z-MoM.js";import{t as Un}from"./describe-db-instances-CXCbjVSB.js";import{t as Wn}from"./_id-C5hiXp-c.js";import{t as Gn}from"./describe-db-parameter-groups-DkYvdQdk.js";import{t as Kn}from"./_name-CiFyltf3.js";import{t as qn}from"./describe-db-snapshots-Cg0k6RKg.js";import{t as Jn}from"./_id-Bm_Q5cjN.js";import{t as Yn}from"./_id-BhWLqX_Y.js";import{t as Xn}from"./describe-db-subnet-groups-DidhiP0n.js";import{t as Zn}from"./_name-B2RsO8hn.js";import{t as Qn}from"./list-hosted-zones-ge_UH47C.js";import{t as $n}from"./_id-BpzmwVk1.js";import{t as er}from"./_bucket-D-1PqEUp.js";import{t as tr}from"./_-CRn6XnJv.js";import{t as nr}from"./_guardrailId.index-DoiGST_B.js";import{t as rr}from"./_guardrailId.edit-xP9dNDnv.js";import{t as ir}from"./_serviceName-DD2TOmis.js";import{t as ar}from"./_taskId-y57vUfE2.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var P=e(r(),1),F=n();function or(e){let{children:t,nonce:n,disableStyleElements:r}=e,i=P.useMemo(()=>({nonce:n,disableStyleElements:r}),[n,r]);return(0,F.jsx)(d.Provider,{value:i,children:t})}var sr=class extends y{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new te({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=cr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=cr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=cr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=cr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>x(t,e))}findAll(e={}){return this.getAll().filter(t=>x(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(E))))}};function cr(e){return e.options.scope?.id}var lr=class extends y{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??C(r,t),a=this.get(i);return a||(a=new g({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ur=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new lr,this.#t=e.mutationCache||new sr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=T.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=v.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=b(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(E).catch(E)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(E)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(E)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(_(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(_(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(E).catch(E)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return v.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(w(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ee(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(w(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ee(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=C(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===m&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function dr(e,t){if(e)return typeof e==`string`?e:e[t]}function fr(e){return e?.scriptFormat??`module`}function pr(e,t,n){let r=mr(t),i=dr(n,`script`)??r.crossOrigin;return{...fr(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,fetchPriority:`low`,...i?{crossOrigin:i}:{}}}function mr(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function hr(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function gr(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function _r(e,t){let n=e[1];e.length=0,n?.(t)}function vr({t:e}){let t=xe(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{_r(n,!1),n.push(i,a),e(t),P.startTransition(r)}),ie(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(ue(r.publicHref)!==ue(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...fe(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function yr(){let e=xe(),t=e.routesById[pe],n=be(e,t),r=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(vr,{t:P.useState()[1]}),e.ssr?(0,F.jsx)(br,{}):(0,F.jsx)(P.Suspense,{fallback:n,children:(0,F.jsx)(br,{})})]});return e.options.InnerWrap?(0,F.jsx)(e.options.InnerWrap,{children:r}):r}function br(){let e=xe(),t=e._rendered,n=we(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ie(()=>{t[0]===n&&_r(t,!0)},[t,n]);let a=i?(0,F.jsx)(k,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,F.jsx)(_e,{getResetKey:()=>r,onCatch:void 0,children:a})}var xr=e=>({createMutableStore:Se,createReadonlyStore:Se,batch:Ce}),Sr=e=>new Cr(e),Cr=class extends ce{constructor(e){super(e,xr)}};function wr({router:e,children:t,...n}){se(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,F.jsx)(A.Provider,{value:e,children:t});return e.options.Wrap?(0,F.jsx)(e.options.Wrap,{children:r}):r}function Tr({router:e,...t}){return(0,F.jsx)(wr,{router:e,...t,children:(0,F.jsx)(yr,{})})}function Er(e){let t=xe();return we(t.stores.location,ne(e,t))}function Dr(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function Or(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e,a=P.useMemo(()=>n===void 0?void 0:{__html:n},[n]);switch(e.tag){case`title`:return(0,F.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,F.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,F.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,F.jsx)(`style`,{...t,dangerouslySetInnerHTML:a,nonce:r});case`script`:return(0,F.jsx)(kr,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function kr({attrs:e,children:t,preventScriptHoist:n}){xe();let r=ve(),i=P.useMemo(()=>t===void 0?void 0:{__html:t},[t]),a=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(P.useEffect(()=>{if(!a){if(e?.src){let t=document.createElement(`a`);t.href=e.src;let n=t.href;for(let e of document.scripts)if(e.src===n)return;let r=document.createElement(`script`);return Dr(r,e),document.head.appendChild(r),()=>r.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.scripts){if(e.hasAttribute(`src`))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,Dr(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,a]),a&&typeof t==`string`)return(0,F.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:i});if(!r){if(e?.src)return(0,F.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,F.jsx)(`script`,{...e,dangerouslySetInnerHTML:i,suppressHydrationWarning:!0})}return null}function Ar(e,t,n,r){n=de(n);let i=n.map(e=>e.meta).filter(e=>e!==void 0),a=[],o={},s;for(let e=i.length-1;e>=0;e--){let n=i[e];for(let e=n.length-1;e>=0;e--){let r=n[e];if(r){if(r.title)s||={tag:`title`,children:r.title};else if(`script:ld+json`in r)try{let e=JSON.stringify(r[`script:ld+json`]);a.push({tag:`script`,attrs:{type:`application/ld+json`},children:he(e)})}catch{}else{let e=r.name??r.property;if(e){if(o[e])continue;o[e]=!0}a.push({tag:`meta`,attrs:{...r,nonce:t}})}}}}s&&a.push(s),t&&a.push({tag:`meta`,attrs:{property:`csp-nonce`,content:t}}),a.reverse();let c=n.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:t}})),l=e.ssr?.manifest,u=[];l&&(n.forEach(e=>{(l.routes[e.routeId]?.css)?.forEach(e=>{let n=gr(e);u.push({tag:`link`,attrs:{rel:`stylesheet`,...n,crossOrigin:dr(r,`stylesheet`)??n.crossOrigin,suppressHydrationWarning:!0,nonce:t}})})}),l.inlineStyle&&u.push({tag:`style`,attrs:{...l.inlineStyle.attrs,nonce:t},children:l.inlineStyle.children,inlineCss:!0}));let d=[];l&&n.forEach(e=>{l.routes[e.routeId]?.preloads?.forEach(e=>{d.push({tag:`link`,attrs:{...pr(l,e,r),nonce:t}})})});let f=n.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...n})=>({tag:`style`,attrs:{...n,nonce:t},children:e})),p=n.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...n})=>({tag:`script`,attrs:{...n,nonce:t},children:e})),m=[];return hr(m,a),m.push(...d),hr(m,c),m.push(...u),hr(m,f),hr(m,p),m}var jr=e=>{let t=xe(),n=t.options.ssr?.nonce,r=P.useCallback(r=>Ar(t,n,r,e),[e,n,t]);return we(t.stores.matches,r,{compare:me})};function Mr(e){let t=jr(e.assetCrossOrigin),n=xe().options.ssr?.nonce;return(0,F.jsx)(F.Fragment,{children:t.map(e=>(0,P.createElement)(Or,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var Nr=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&D(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&D(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function D(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,D(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Pr=t(((e,t)=>{t.exports=Nr()})),Fr=t((e=>{var t=Pr(),n=r(),i=a();function o(e){var t=`https://react.dev/errors/`+e;if(1Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function j(e,t){Ce++,Se[Ce]=e.current,e.current=t}var Ee=we(null),De=we(null),M=we(null),Oe=we(null);function ke(e,t){switch(j(M,t),j(De,e),j(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(Ee),j(Ee,e)}function Ae(){Te(Ee),Te(De),Te(M)}function je(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,j(Oe,e)),t=Ee.current;var n=dp(t,e.type);t!==n&&(j(De,e),j(Ee,n))}function Me(e){De.current===e&&(Te(Ee),Te(De)),Oe.current===e&&(Te(Oe),sh._currentValue=xe)}var Ne,Pe;function Fe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,Pe=-1{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var P=e(r(),1),F=n();function or(e){let{children:t,nonce:n,disableStyleElements:r}=e,i=P.useMemo(()=>({nonce:n,disableStyleElements:r}),[n,r]);return(0,F.jsx)(d.Provider,{value:i,children:t})}var sr=class extends y{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new te({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=cr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=cr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=cr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=cr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>x(t,e))}findAll(e={}){return this.getAll().filter(t=>x(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(E))))}};function cr(e){return e.options.scope?.id}var lr=class extends y{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??C(r,t),a=this.get(i);return a||(a=new g({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ur=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new lr,this.#t=e.mutationCache||new sr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=T.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=v.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=b(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(E).catch(E)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(E)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(E)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(_(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(_(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(E).catch(E)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return v.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(w(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ee(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(w(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ee(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=C(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===m&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function dr(e,t){if(e)return typeof e==`string`?e:e[t]}function fr(e){return e?.scriptFormat??`module`}function pr(e,t,n){let r=mr(t),i=dr(n,`script`)??r.crossOrigin;return{...fr(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,fetchPriority:`low`,...i?{crossOrigin:i}:{}}}function mr(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function hr(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function gr(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function _r(e,t){let n=e[1];e.length=0,n?.(t)}function vr({t:e}){let t=xe(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{_r(n,!1),n.push(i,a),e(t),P.startTransition(r)}),ie(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(ue(r.publicHref)!==ue(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...fe(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function yr(){let e=xe(),t=e.routesById[pe],n=be(e,t),r=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(vr,{t:P.useState()[1]}),e.ssr?(0,F.jsx)(br,{}):(0,F.jsx)(P.Suspense,{fallback:n,children:(0,F.jsx)(br,{})})]});return e.options.InnerWrap?(0,F.jsx)(e.options.InnerWrap,{children:r}):r}function br(){let e=xe(),t=e._rendered,n=we(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ie(()=>{t[0]===n&&_r(t,!0)},[t,n]);let a=i?(0,F.jsx)(k,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,F.jsx)(_e,{getResetKey:()=>r,onCatch:void 0,children:a})}var xr=e=>({createMutableStore:Se,createReadonlyStore:Se,batch:Ce}),Sr=e=>new Cr(e),Cr=class extends ce{constructor(e){super(e,xr)}};function wr({router:e,children:t,...n}){se(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,F.jsx)(A.Provider,{value:e,children:t});return e.options.Wrap?(0,F.jsx)(e.options.Wrap,{children:r}):r}function Tr({router:e,...t}){return(0,F.jsx)(wr,{router:e,...t,children:(0,F.jsx)(yr,{})})}function Er(e){let t=xe();return we(t.stores.location,ne(e,t))}function Dr(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function Or(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e,a=P.useMemo(()=>n===void 0?void 0:{__html:n},[n]);switch(e.tag){case`title`:return(0,F.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,F.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,F.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,F.jsx)(`style`,{...t,dangerouslySetInnerHTML:a,nonce:r});case`script`:return(0,F.jsx)(kr,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function kr({attrs:e,children:t,preventScriptHoist:n}){xe();let r=ve(),i=P.useMemo(()=>t===void 0?void 0:{__html:t},[t]),a=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(P.useEffect(()=>{if(!a){if(e?.src){let t=document.createElement(`a`);t.href=e.src;let n=t.href;for(let e of document.scripts)if(e.src===n)return;let r=document.createElement(`script`);return Dr(r,e),document.head.appendChild(r),()=>r.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.scripts){if(e.hasAttribute(`src`))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,Dr(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,a]),a&&typeof t==`string`)return(0,F.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:i});if(!r){if(e?.src)return(0,F.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,F.jsx)(`script`,{...e,dangerouslySetInnerHTML:i,suppressHydrationWarning:!0})}return null}function Ar(e,t,n,r){n=de(n);let i=n.map(e=>e.meta).filter(e=>e!==void 0),a=[],o={},s;for(let e=i.length-1;e>=0;e--){let n=i[e];for(let e=n.length-1;e>=0;e--){let r=n[e];if(r){if(r.title)s||={tag:`title`,children:r.title};else if(`script:ld+json`in r)try{let e=JSON.stringify(r[`script:ld+json`]);a.push({tag:`script`,attrs:{type:`application/ld+json`},children:he(e)})}catch{}else{let e=r.name??r.property;if(e){if(o[e])continue;o[e]=!0}a.push({tag:`meta`,attrs:{...r,nonce:t}})}}}}s&&a.push(s),t&&a.push({tag:`meta`,attrs:{property:`csp-nonce`,content:t}}),a.reverse();let c=n.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:t}})),l=e.ssr?.manifest,u=[];l&&(n.forEach(e=>{(l.routes[e.routeId]?.css)?.forEach(e=>{let n=gr(e);u.push({tag:`link`,attrs:{rel:`stylesheet`,...n,crossOrigin:dr(r,`stylesheet`)??n.crossOrigin,suppressHydrationWarning:!0,nonce:t}})})}),l.inlineStyle&&u.push({tag:`style`,attrs:{...l.inlineStyle.attrs,nonce:t},children:l.inlineStyle.children,inlineCss:!0}));let d=[];l&&n.forEach(e=>{l.routes[e.routeId]?.preloads?.forEach(e=>{d.push({tag:`link`,attrs:{...pr(l,e,r),nonce:t}})})});let f=n.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...n})=>({tag:`style`,attrs:{...n,nonce:t},children:e})),p=n.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...n})=>({tag:`script`,attrs:{...n,nonce:t},children:e})),m=[];return hr(m,a),m.push(...d),hr(m,c),m.push(...u),hr(m,f),hr(m,p),m}var jr=e=>{let t=xe(),n=t.options.ssr?.nonce,r=P.useCallback(r=>Ar(t,n,r,e),[e,n,t]);return we(t.stores.matches,r,{compare:me})};function Mr(e){let t=jr(e.assetCrossOrigin),n=xe().options.ssr?.nonce;return(0,F.jsx)(F.Fragment,{children:t.map(e=>(0,P.createElement)(Or,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var Nr=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&D(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&D(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function D(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,D(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Pr=t(((e,t)=>{t.exports=Nr()})),Fr=t((e=>{var t=Pr(),n=r(),i=a();function o(e){var t=`https://react.dev/errors/`+e;if(1Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function j(e,t){Ce++,Se[Ce]=e.current,e.current=t}var Ee=we(null),De=we(null),M=we(null),Oe=we(null);function ke(e,t){switch(j(M,t),j(De,e),j(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(Ee),j(Ee,e)}function Ae(){Te(Ee),Te(De),Te(M)}function je(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,j(Oe,e)),t=Ee.current;var n=dp(t,e.type);t!==n&&(j(De,e),j(Ee,n))}function Me(e){De.current===e&&(Te(Ee),Te(De)),Oe.current===e&&(Te(Oe),sh._currentValue=xe)}var Ne,Pe;function Fe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,Pe=-1)`:-1(0,P.jsxs)(`div`,{className:`not-first:mt-3`,children:[n.length>1&&(0,P.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`GPU `,t+1]}),(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{label:`Model`,children:e.model}),(0,P.jsx)(_,{label:`VRAM`,children:i(e.vram_mib)}),(0,P.jsx)(_,{label:`Attachment`,children:e.profile?`MIG slice`:`PCIe passthrough`}),e.profile&&(0,P.jsx)(_,{label:`Profile`,mono:!0,children:e.profile}),e.mdev_path&&(0,P.jsx)(_,{label:`Mdev path`,mono:!0,children:e.mdev_path}),e.pci_address&&(0,P.jsx)(_,{label:`PCI address`,mono:!0,children:e.pci_address})]})]},e.mdev_path??e.pci_address??`${e.model}-${t}`),t[2]=n.length,t[3]=e),a=n.map(e),t[0]=n,t[1]=a}else a=t[1];let o;return t[4]!==r||t[5]!==a?(o=(0,P.jsx)(h,{title:r,children:a}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}var te=e(n(),1);function I(e){let t=(0,N.c)(30),{instanceId:n}=e,r;t[0]===n?r=t[1]:(r=x(n),t[0]=n,t[1]=r);let{data:i}=d(r),{data:a}=d(T),s=y(),p=v(),[b,S]=(0,te.useState)(``),C;t[2]===i?.IamInstanceProfileAssociations?C=t[3]:(C=i?.IamInstanceProfileAssociations?.find(re),t[2]=i?.IamInstanceProfileAssociations,t[3]=C);let w=C,E;t[4]===a?.InstanceProfiles?E=t[5]:(E=a?.InstanceProfiles??[],t[4]=a?.InstanceProfiles,t[5]=E);let D=E,k;t[6]!==s||t[7]!==n||t[8]!==b?(k=async()=>{if(b){try{await s.mutateAsync({instanceId:n,instanceProfileName:b})}catch{return}S(``)}},t[6]=s,t[7]=n,t[8]=b,t[9]=k):k=t[9];let A=k,j;t[10]!==w||t[11]!==p||t[12]!==n?(j=async()=>{if(w?.AssociationId)try{await p.mutateAsync({associationId:w.AssociationId,instanceId:n})}catch{}},t[10]=w,t[11]=p,t[12]=n,t[13]=j):j=t[13];let M=j,F;t[14]===s.error?F=t[15]:(F=s.error&&(0,P.jsx)(O,{error:s.error,msg:`Failed to associate instance profile`}),t[14]=s.error,t[15]=F);let I;t[16]===p.error?I=t[17]:(I=p.error&&(0,P.jsx)(O,{error:p.error,msg:`Failed to disassociate instance profile`}),t[16]=p.error,t[17]=I);let L;t[18]!==s.isPending||t[19]!==w||t[20]!==p.isPending||t[21]!==A||t[22]!==M||t[23]!==D||t[24]!==b?(L=w?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{copy:w.IamInstanceProfile?.Arn,label:`Instance profile`,mono:!0,children:w.IamInstanceProfile?.Arn}),(0,P.jsx)(_,{label:`State`,children:(0,P.jsx)(ee,{state:w.State})})]}),(0,P.jsx)(m,{className:`self-start`,disabled:p.isPending,onClick:M,size:`sm`,variant:`destructive`,children:p.isPending?`Detaching…`:`Detach`})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No instance profile is associated. Associate one to flow role credentials to this instance via IMDS.`}),D.length>0?(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(u,{onValueChange:e=>{S(e??``)},value:b,children:[(0,P.jsx)(l,{"aria-label":`Instance profile`,className:`w-full`,children:(0,P.jsx)(o,{placeholder:`Select an instance profile`})}),(0,P.jsx)(c,{children:D.map(ne)})]}),(0,P.jsx)(m,{disabled:!b||s.isPending,onClick:A,size:`sm`,children:s.isPending?`Associating…`:`Associate`})]}):(0,P.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No instance profiles exist.`,` `,(0,P.jsx)(f,{className:`text-primary hover:underline`,search:{create:!0},to:`/iam/list-instance-profiles`,children:`Create one`}),` `,`first.`]})]}),t[18]=s.isPending,t[19]=w,t[20]=p.isPending,t[21]=A,t[22]=M,t[23]=D,t[24]=b,t[25]=L):L=t[25];let R;return t[26]!==F||t[27]!==I||t[28]!==L?(R=(0,P.jsx)(h,{title:`IAM role`,children:(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[F,I,L]})}),t[26]=F,t[27]=I,t[28]=L,t[29]=R):R=t[29],R}function ne(e){return(0,P.jsx)(s,{value:e.InstanceProfileName??``,children:e.InstanceProfileName},e.InstanceProfileName)}function re(e){return e.State===`associating`||e.State===`associated`}var L=[[`amazonlinux`,`ec2-user`],[`almalinux`,`almalinux`],[`oracle`,`cloud-user`],[`ubuntu`,`ubuntu`],[`debian`,`debian`],[`fedora`,`fedora`],[`centos`,`cloud-user`],[`alpine`,`alpine`],[`rocky`,`rocky`],[`amzn`,`ec2-user`],[`rhel`,`cloud-user`]];function R(e){let t=new Set(`${e?.Name??``} ${e?.Description??``}`.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)),n=L.find(([e])=>t.has(e));return n?{user:n[1],distro:n[0]}:{user:``}}function z(e){return e?.PublicIpAddress?{address:e.PublicIpAddress,reachability:`public`}:e?.PrivateIpAddress?{address:e.PrivateIpAddress,reachability:`private`}:{address:``,reachability:`none`}}var ie=`path/to/key.pem`;function ae(e){return`ssh -i ${e.keyName?`path/to/${e.keyName}.pem`:ie} ${e.user||``}@${e.address}`}function B(e){let t=(0,N.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,P.jsx)(`div`,{className:`py-1.5`,children:(0,P.jsx)(`dd`,{className:`text-xs text-warning-foreground`,children:n})}),t[0]=n,t[1]=r),r}function oe(e){let t=(0,N.c)(37),{instance:n,image:r}=e,i,a,o,s,c,l;if(t[0]!==r||t[1]!==n){c=Symbol.for(`react.early_return_sentinel`);bb0:{if({address:i,reachability:o}=z(n),{user:l,distro:a}=R(r),o===`none`){c=null;break bb0}s=ae({keyName:n.KeyName,user:l,address:i})}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(c!==Symbol.for(`react.early_return_sentinel`))return c;let u=s,d;t[8]===u?d=t[9]:(d=(0,P.jsx)(`span`,{title:u,children:u}),t[8]=u,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,P.jsx)(_,{copy:u,label:`SSH`,mono:!0,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,P.jsx)(`p`,{children:`The account cloud-init creates in the guest. It comes from the image, not from Spinifex.`}),t[13]=m):m=t[13];let h=r?.Name,g;t[14]===h?g=t[15]:(g=[`Image`,h],t[14]=h,t[15]=g);let v;t[16]===a?v=t[17]:(v=[`Distribution`,a],t[16]=a,t[17]=v);let y=l||`Unknown`,b;t[18]===y?b=t[19]:(b=[`User`,y],t[18]=y,t[19]=b);let x;t[20]!==b||t[21]!==g||t[22]!==v?(x=(0,P.jsxs)(P.Fragment,{children:[m,(0,P.jsx)(p,{items:[g,v,b]})]}),t[20]=b,t[21]=g,t[22]=v,t[23]=x):x=t[23];let S=l||void 0,C;t[24]!==x||t[25]!==S?(C=(0,P.jsx)(_,{info:x,label:`Login user`,mono:!0,children:S}),t[24]=x,t[25]=S,t[26]=C):C=t[26];let w;t[27]!==i||t[28]!==o?(w=o===`private`&&(0,P.jsxs)(B,{children:[`No public IP, so `,i,` is reachable only from inside the VPC.`]}),t[27]=i,t[28]=o,t[29]=w):w=t[29];let T;t[30]===l?T=t[31]:(T=!l&&(0,P.jsx)(B,{children:`The login user could not be determined from this AMI; check the image's documentation.`}),t[30]=l,t[31]=T);let E;return t[32]!==C||t[33]!==w||t[34]!==T||t[35]!==f?(E=(0,P.jsxs)(P.Fragment,{children:[f,C,w,T]}),t[32]=C,t[33]=w,t[34]=T,t[35]=f,t[36]=E):E=t[36],E}var se=/^(?:ami-)?(?[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)*)-(?\d+(?:\.\d+)*)-(?x86_64|amd64|arm64|aarch64)$/iu,ce=new Map([[`x86_64`,`x86_64`],[`amd64`,`x86_64`],[`arm64`,`arm64`],[`aarch64`,`arm64`]]);function V(e){return e?ce.get(e.toLowerCase()):void 0}function H(e){let t=se.exec(e??``)?.groups;if(!t?.distro||!t.version||!t.arch)return;let n=V(t.arch);if(n)return{distro:t.distro.toLowerCase(),version:t.version,arch:n}}function le(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e({distro:e,versions:t.toSorted((e,t)=>le(t.version,e.version))})).toSorted((e,t)=>e.distro.localeCompare(t.distro)),other:r}}function ue(e){let t=new Set;for(let n of e){let e=U(n);e&&t.add(e)}return[`x86_64`,`arm64`].filter(e=>t.has(e))}function G(e,t){let n=e.ProcessorInfo?.SupportedArchitectures??[];return!t||n.length===0||n.some(e=>V(e)===t)}var de=new Map([[`almalinux`,`AlmaLinux`],[`alpine`,`Alpine`],[`amazon`,`Amazon Linux`],[`centos`,`CentOS`],[`debian`,`Debian`],[`fedora`,`Fedora`],[`freebsd`,`FreeBSD`],[`opensuse`,`openSUSE`],[`oracle`,`Oracle Linux`],[`rhel`,`Red Hat`],[`rocky`,`Rocky Linux`],[`ubuntu`,`Ubuntu`]]);function fe(e){return de.get(e)??e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function K(e,t=`ubuntu`){return(e.distros.find(e=>e.distro===t)??e.distros[0])?.versions[0]?.image??e.other[0]}function pe(e,t){return e.distros.find(e=>e.distro===t)?.versions[0]?.image}var me=`/dev/sda1`;function he(e,t){return e.filter(e=>G(e,t))}function ge(e){return[...new Set(e.flatMap(e=>e.InstanceType??[]))].toSorted()}function q(e){return e.find(e=>e.endsWith(`.nano`))??e[0]}function _e(e,t){return e.find(e=>t.some(t=>G(t,e)))??e[0]}function ve(e){return e.Tags?.find(e=>e.Key===`Name`)?.Value}function ye(e){let t=ve(e);return t?`${t} (${e.SubnetId})`:e.SubnetId??``}function be(e){return e===void 0?`internet gateway route unknown`:e?`public: routes to an internet gateway`:`private: no internet gateway route`}function xe(e,t){return[e.CidrBlock,e.AvailabilityZone,e.VpcId,be(t),e.MapPublicIpOnLaunch?`public IP assigned on launch`:`no public IP on launch`].filter(Boolean).join(` · `)}function Se(e,t,n){return t?e.find(e=>e.SubnetId===t):n}function J(e){let t=e?.RootDeviceName??`/dev/sda1`,n=e?.BlockDeviceMappings??[];return{deviceName:t,snapshotSize:(n.find(e=>e.DeviceName===t)??n[0])?.Ebs?.VolumeSize}}function Y(e,t){return J(e.find(e=>e.ImageId===t))}function Ce(e,t){if(e.length===0)return;if(!t||t===`$Default`)return e.find(e=>e.DefaultVersion)??e[0];if(t===`$Latest`)return e.toSorted((e,t)=>(t.VersionNumber??0)-(e.VersionNumber??0))[0];let n=Number(t);return e.find(e=>e.VersionNumber===n)}function we({images:e,arch:t,archTypeNames:n,keyPairs:r,securityGroups:i,launchTemplateId:a,launchTemplateVersion:o}){let s=K(W(e,t))?.ImageId;return{count:1,name:``,imageId:s??``,keyName:r[0]?.KeyName??``,instanceType:q(n)??``,launchTemplateId:a,launchTemplateVersion:o??`$Default`,rootDeviceName:Y(e,s).deviceName,securityGroupMode:`create`,securityGroupIds:[],newSgName:A(i.map(e=>e.GroupName??``)),newSgDescription:`Created by launch wizard`,allowPing:!0,allowSsh:!0,allowHttp:!1,allowHttps:!1,ruleSource:`anywhere`,customCidr:``}}function Te(e,t,n){return k(j.refine(e=>{let t=e.instanceType?n[e.instanceType]:void 0;return t===void 0||e.count<=t},{message:`Cannot exceed available capacity`,path:[`count`]}).superRefine((n,r)=>{let i=e.find(e=>e.ImageId===n.imageId),a=J(i).snapshotSize;n.rootVolumeSize!==void 0&&a!==void 0&&n.rootVolumeSizee.InstanceType===n.instanceType);!n.launchTemplateId&&s&&o&&!G(s,o)&&r.addIssue({code:`custom`,message:`${n.instanceType} cannot run a ${o} image`,path:[`instanceType`]})}))}var X=`text-primary hover:underline`;function Z(e){let t=e.IpProtocol??``;if(t===`-1`)return`All traffic`;let n={6:`TCP`,17:`UDP`,1:`ICMP`}[t]??t.toUpperCase();return e.FromPort===void 0||e.FromPort===-1?n:e.FromPort===e.ToPort?`${n} ${e.FromPort}`:`${n} ${e.FromPort}–${e.ToPort}`}function Ee(e){let t=[...(e.IpRanges??[]).map(e=>e.CidrIp),...(e.Ipv6Ranges??[]).map(e=>e.CidrIpv6),...(e.UserIdGroupPairs??[]).map(e=>e.GroupId),...(e.PrefixListIds??[]).map(e=>e.PrefixListId)].filter(Boolean);return t.length?t.join(`, `):`—`}function Q(e){let t=(0,N.c)(8),{direction:n,rules:r}=e;if(!r?.length){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:`No rules`}),t[0]=e):e=t[0];let r;return t[1]===n?r=t[2]:(r=(0,P.jsx)(_,{label:n,children:e}),t[1]=n,t[2]=r),r}let i;if(t[3]!==n||t[4]!==r){let e;t[6]===n?e=t[7]:(e=e=>{let t=Z(e),r=Ee(e);return(0,P.jsx)(_,{label:n,mono:!0,children:(0,P.jsxs)(`span`,{title:r,children:[t,` · `,r]})},`${n}${t}${r}`)},t[6]=n,t[7]=e),i=r.map(e),t[3]=n,t[4]=r,t[5]=i}else i=t[5];return i}function De(e){let t=(0,N.c)(13),{instance:n}=e,{data:r}=d(b),i;t[0]===n.SecurityGroups?i=t[1]:(i=new Set(n.SecurityGroups?.map(Oe)),t[0]=n.SecurityGroups,t[1]=i);let a=i,o;t[2]!==r?.SecurityGroups||t[3]!==a||t[4]!==n.SecurityGroups?(o=r?.SecurityGroups?.filter(e=>a.has(e.GroupId))??n.SecurityGroups??[],t[2]=r?.SecurityGroups,t[3]=a,t[4]=n.SecurityGroups,t[5]=o):o=t[5];let s=o;if(!s.length)return null;let c;if(t[6]!==r||t[7]!==s){let e;t[9]===r?e=t[10]:(e=e=>(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{label:`Group`,children:e.GroupId&&(0,P.jsx)(f,{className:X,params:{id:e.GroupId},title:e.GroupId,to:`/ec2/describe-security-groups/$id`,children:e.GroupName??e.GroupId})}),r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Q,{direction:`Inbound`,rules:e.IpPermissions}),(0,P.jsx)(Q,{direction:`Outbound`,rules:e.IpPermissionsEgress})]})]},e.GroupId),t[9]=r,t[10]=e),c=s.map(e),t[6]=r,t[7]=s,t[8]=c}else c=t[8];let l;return t[11]===c?l=t[12]:(l=(0,P.jsx)(h,{title:`Security groups`,children:(0,P.jsx)(`div`,{className:`flex flex-col gap-3`,children:c})}),t[11]=c,t[12]=l),l}function Oe(e){return e.GroupId}function ke(e){let t=(0,N.c)(6),{instance:n}=e,r;t[0]===n.NetworkInterfaces?r=t[1]:(r=n.NetworkInterfaces??[],t[0]=n.NetworkInterfaces,t[1]=r);let i=r;if(!i.length)return null;let a;t[2]===i?a=t[3]:(a=i.map(Ae),t[2]=i,t[3]=a);let o;return t[4]===a?o=t[5]:(o=(0,P.jsx)(h,{defaultOpen:!1,title:`Network interfaces`,children:(0,P.jsx)(`div`,{className:`flex flex-col gap-3`,children:a})}),t[4]=a,t[5]=o),o}function Ae(e){return(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{copy:e.NetworkInterfaceId,label:`Interface`,mono:!0,children:e.NetworkInterfaceId}),(0,P.jsx)(_,{label:`Device index`,mono:!0,children:e.Attachment?.DeviceIndex?.toString()}),(0,P.jsx)(_,{label:`Private IP`,mono:!0,children:e.PrivateIpAddress}),(0,P.jsx)(_,{label:`Public IP`,mono:!0,children:e.Association?.PublicIp}),(0,P.jsx)(_,{label:`MAC address`,mono:!0,children:e.MacAddress}),(0,P.jsx)(_,{label:`Subnet`,mono:!0,children:e.SubnetId&&(0,P.jsx)(f,{className:X,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId})}),(0,P.jsx)(_,{label:`Status`,children:e.Status})]},e.NetworkInterfaceId)}function $(e){let t=(0,N.c)(8),{image:n,instance:r}=e,i;t[0]===n?i=t[1]:(i=n&&(0,P.jsx)(p,{items:[[`AMI`,n.ImageId],[`Name`,n.Name],[`Description`,n.Description],[`Architecture`,n.Architecture],[`Boot mode`,n.BootMode],[`Platform`,n.PlatformDetails],[`Created`,n.CreationDate&&a(n.CreationDate)]]}),t[0]=n,t[1]=i);let o;t[2]!==n?.Name||t[3]!==r.ImageId?(o=r.ImageId&&(0,P.jsx)(f,{className:X,params:{id:r.ImageId},title:n?.Name,to:`/ec2/describe-images/$id`,children:n?.Name??r.ImageId}),t[2]=n?.Name,t[3]=r.ImageId,t[4]=o):o=t[4];let s;return t[5]!==i||t[6]!==o?(s=(0,P.jsx)(_,{info:i,label:`Image`,mono:!0,children:o}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function je(e){let t=(0,N.c)(8),{instance:n}=e,{data:r}=d(S),i,a;if(t[0]!==r?.InstanceTypes||t[1]!==n.InstanceType){let e=r?.InstanceTypes?.find(e=>e.InstanceType===n.InstanceType);i=_,a=e&&M(e),t[0]=r?.InstanceTypes,t[1]=n.InstanceType,t[2]=i,t[3]=a}else i=t[2],a=t[3];let o;return t[4]!==i||t[5]!==n.InstanceType||t[6]!==a?(o=(0,P.jsx)(i,{info:a,label:`Type`,mono:!0,children:n.InstanceType}),t[4]=i,t[5]=n.InstanceType,t[6]=a,t[7]=o):o=t[7],o}function Me(e){let t=(0,N.c)(36),{image:n,instance:r}=e,i;t[0]===r.Tags?i=t[1]:(i=r.Tags?.find(Ne)?.Value,t[0]=r.Tags,t[1]=i);let o=i,s;t[2]===r.InstanceId?s=t[3]:(s=(0,P.jsx)(_,{copy:r.InstanceId,label:`Instance ID`,mono:!0,children:r.InstanceId}),t[2]=r.InstanceId,t[3]=s);let c;t[4]===o?c=t[5]:(c=(0,P.jsx)(_,{label:`Name`,children:o}),t[4]=o,t[5]=c);let l;t[6]===r?l=t[7]:(l=(0,P.jsx)(je,{instance:r}),t[6]=r,t[7]=l);let u=r.Placement?.AvailabilityZone,d;t[8]===u?d=t[9]:(d=(0,P.jsx)(_,{label:`Zone`,children:u}),t[8]=u,t[9]=d);let p;t[10]===r.Placement?p=t[11]:(p=r.Placement?.GroupName&&(0,P.jsx)(f,{className:X,to:`/ec2/describe-placement-groups`,children:r.Placement.GroupName}),t[10]=r.Placement,t[11]=p);let m;t[12]===p?m=t[13]:(m=(0,P.jsx)(_,{label:`Placement group`,children:p}),t[12]=p,t[13]=m);let v;t[14]!==n||t[15]!==r?(v=(0,P.jsx)($,{image:n,instance:r}),t[14]=n,t[15]=r,t[16]=v):v=t[16];let y;t[17]===r.KeyName?y=t[18]:(y=(0,P.jsx)(_,{label:`Key pair`,children:r.KeyName}),t[17]=r.KeyName,t[18]=y);let b;t[19]===r.LaunchTime?b=t[20]:(b=r.LaunchTime&&a(r.LaunchTime),t[19]=r.LaunchTime,t[20]=b);let x;t[21]===b?x=t[22]:(x=(0,P.jsx)(_,{label:`Launched`,children:b}),t[21]=b,t[22]=x);let S;t[23]!==n||t[24]!==r?(S=r.State?.Name===`running`&&(0,P.jsx)(oe,{image:n,instance:r}),t[23]=n,t[24]=r,t[25]=S):S=t[25];let C;return t[26]!==y||t[27]!==x||t[28]!==S||t[29]!==s||t[30]!==c||t[31]!==l||t[32]!==d||t[33]!==m||t[34]!==v?(C=(0,P.jsx)(h,{title:`Instance information`,children:(0,P.jsxs)(g,{children:[s,c,l,d,m,v,y,x,S]})}),t[26]=y,t[27]=x,t[28]=S,t[29]=s,t[30]=c,t[31]=l,t[32]=d,t[33]=m,t[34]=v,t[35]=C):C=t[35],C}function Ne(e){return e.Key===`Name`}function Pe(e){let t=(0,N.c)(28),{elasticIp:n,instance:r}=e,i;t[0]===r.PrivateIpAddress?i=t[1]:(i=(0,P.jsx)(_,{copy:r.PrivateIpAddress,label:`Private IP`,mono:!0,children:r.PrivateIpAddress}),t[0]=r.PrivateIpAddress,t[1]=i);let a;t[2]===r.PublicIpAddress?a=t[3]:(a=(0,P.jsx)(_,{copy:r.PublicIpAddress,label:`Public IP`,mono:!0,children:r.PublicIpAddress}),t[2]=r.PublicIpAddress,t[3]=a);let o;t[4]===n?o=t[5]:(o=n?.AllocationId&&(0,P.jsx)(f,{className:X,params:{id:n.AllocationId},title:n.AllocationId,to:`/ec2/describe-addresses/$id`,children:n.PublicIp}),t[4]=n,t[5]=o);let s;t[6]===o?s=t[7]:(s=(0,P.jsx)(_,{info:`A static public address the account owns. It stays with the account when the instance stops or is terminated.`,label:`Elastic IP`,mono:!0,children:o}),t[6]=o,t[7]=s);let c;t[8]===r.PrivateDnsName?c=t[9]:(c=(0,P.jsx)(_,{copy:r.PrivateDnsName,label:`Private DNS`,mono:!0,children:r.PrivateDnsName}),t[8]=r.PrivateDnsName,t[9]=c);let l;t[10]===r.PublicDnsName?l=t[11]:(l=(0,P.jsx)(_,{copy:r.PublicDnsName,label:`Public DNS`,mono:!0,children:r.PublicDnsName}),t[10]=r.PublicDnsName,t[11]=l);let u;t[12]===r.VpcId?u=t[13]:(u=r.VpcId&&(0,P.jsx)(f,{className:X,params:{id:r.VpcId},to:`/ec2/describe-vpcs/$id`,children:r.VpcId}),t[12]=r.VpcId,t[13]=u);let d;t[14]===u?d=t[15]:(d=(0,P.jsx)(_,{label:`VPC`,mono:!0,children:u}),t[14]=u,t[15]=d);let p;t[16]===r.SubnetId?p=t[17]:(p=r.SubnetId&&(0,P.jsx)(f,{className:X,params:{id:r.SubnetId},to:`/ec2/describe-subnets/$id`,children:r.SubnetId}),t[16]=r.SubnetId,t[17]=p);let m;t[18]===p?m=t[19]:(m=(0,P.jsx)(_,{label:`Subnet`,mono:!0,children:p}),t[18]=p,t[19]=m);let v;return t[20]!==i||t[21]!==m||t[22]!==a||t[23]!==s||t[24]!==c||t[25]!==l||t[26]!==d?(v=(0,P.jsx)(h,{title:`Networking`,children:(0,P.jsxs)(g,{children:[i,a,s,c,l,d,m]})}),t[20]=i,t[21]=m,t[22]=a,t[23]=s,t[24]=c,t[25]=l,t[26]=d,t[27]=v):v=t[27],v}function Fe(e){let t=(0,N.c)(4),{instance:n}=e;if((n.BlockDeviceMappings?.length??0)===0)return null;let r;t[0]===n.BlockDeviceMappings?r=t[1]:(r=n.BlockDeviceMappings?.map(Ie),t[0]=n.BlockDeviceMappings,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,P.jsx)(h,{title:`Storage`,children:(0,P.jsx)(g,{children:r})}),t[2]=r,t[3]=i),i}function Ie(e){return(0,P.jsx)(_,{label:e.DeviceName??`—`,mono:!0,children:e.Ebs?.VolumeId&&(0,P.jsx)(f,{className:X,params:{id:e.Ebs.VolumeId},to:`/ec2/describe-volumes/$id`,children:e.Ebs.VolumeId})},e.DeviceName)}function Le(e){let t=(0,N.c)(33),{instance:n}=e,{isAdmin:r}=D(),i;t[0]===n.ImageId?i=t[1]:(i=w(n.ImageId),t[0]=n.ImageId,t[1]=i);let{data:a}=d(i),{data:o}=d(C),s;t[2]===r?s=t[3]:(s={...E,enabled:r},t[2]=r,t[3]=s);let{data:c}=d(s),l=a?.Images?.[0],u;t[4]!==o?.Addresses||t[5]!==n.InstanceId?(u=o?.Addresses?.find(e=>e.InstanceId===n.InstanceId),t[4]=o?.Addresses,t[5]=n.InstanceId,t[6]=u):u=t[6];let f=u,p;t[7]!==n.InstanceId||t[8]!==c?.vms?(p=c?.vms?.find(e=>e.instance_id===n.InstanceId)?.gpus,t[7]=n.InstanceId,t[8]=c?.vms,t[9]=p):p=t[9];let m=p,h;t[10]!==l||t[11]!==n?(h=(0,P.jsx)(Me,{image:l,instance:n}),t[10]=l,t[11]=n,t[12]=h):h=t[12];let g;t[13]!==f||t[14]!==n?(g=(0,P.jsx)(Pe,{elasticIp:f,instance:n}),t[13]=f,t[14]=n,t[15]=g):g=t[15];let _,v,y;t[16]===n?(_=t[17],v=t[18],y=t[19]):(_=(0,P.jsx)(De,{instance:n}),v=(0,P.jsx)(ke,{instance:n}),y=(0,P.jsx)(Fe,{instance:n}),t[16]=n,t[17]=_,t[18]=v,t[19]=y);let b;t[20]===n.InstanceId?b=t[21]:(b=n.InstanceId&&(0,P.jsx)(I,{instanceId:n.InstanceId}),t[20]=n.InstanceId,t[21]=b);let x;t[22]!==m||t[23]!==r?(x=r&&(0,P.jsx)(F,{gpus:m}),t[22]=m,t[23]=r,t[24]=x):x=t[24];let S;return t[25]!==b||t[26]!==x||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==y?(S=(0,P.jsxs)(P.Fragment,{children:[h,g,_,v,y,b,x]}),t[25]=b,t[26]=x,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=y,t[32]=S):S=t[32],S}export{K as S,U as _,Y as a,pe as b,Ce as c,ye as d,xe as f,fe as g,W as h,q as i,we as l,ge as m,Z as n,_e as o,he as p,me as r,Se as s,Le as t,Te as u,ue as v,H as x,G as y}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instance-overview-I3DWLmM0.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instance-overview-I3DWLmM0.js deleted file mode 100644 index 45b4a4cc5..000000000 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instance-overview-I3DWLmM0.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r,U as i,V as a}from"./schemas-DCQXG11d.js";import{c as o,i as s,n as c,s as l,t as u}from"./select-UwOVJofC.js";import{t as d}from"./useQuery-D6TojLgI.js";import{t as f}from"./link-BX-1BPor.js";import{t as p}from"./info-tip-Cxa2GEOd.js";import{a as m}from"./useValueAsRef-uzS1fuI8.js";import{a as h,i as g,r as _}from"./detail-panel-DLM1ExsZ.js";import{G as v,a as y}from"./ec2-mbMOQDVK.js";import{T as b,a as x,l as S,n as C,o as w}from"./ec2-DcwXjFvB.js";import{f as T}from"./iam-CCgnxhTh.js";import{o as E}from"./admin-UXb5aZ2d.js";import{t as D}from"./use-admin-C98I-ai5.js";import{t as O}from"./error-banner-Cahg3Ix2.js";import{t as ee}from"./state-badge-CQPRxt3J.js";import{t as k}from"./zod-nOHMBkds.js";import{b as A,i as j}from"./ec2-CM16SST3.js";import{n as M}from"./instance-type-size-DoyCeynC.js";var N=r(),P=t();function F(e){let t=(0,N.c)(7),{gpus:n}=e;if(!n?.length)return null;let r=n.length===1?`GPU`:`GPUs (${n.length})`,a;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>(0,P.jsxs)(`div`,{className:`not-first:mt-3`,children:[n.length>1&&(0,P.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`GPU `,t+1]}),(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{label:`Model`,children:e.model}),(0,P.jsx)(_,{label:`VRAM`,children:i(e.vram_mib)}),(0,P.jsx)(_,{label:`Attachment`,children:e.profile?`MIG slice`:`PCIe passthrough`}),e.profile&&(0,P.jsx)(_,{label:`Profile`,mono:!0,children:e.profile}),e.mdev_path&&(0,P.jsx)(_,{label:`Mdev path`,mono:!0,children:e.mdev_path}),e.pci_address&&(0,P.jsx)(_,{label:`PCI address`,mono:!0,children:e.pci_address})]})]},e.mdev_path??e.pci_address??`${e.model}-${t}`),t[2]=n.length,t[3]=e),a=n.map(e),t[0]=n,t[1]=a}else a=t[1];let o;return t[4]!==r||t[5]!==a?(o=(0,P.jsx)(h,{title:r,children:a}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}var te=e(n(),1);function I(e){let t=(0,N.c)(30),{instanceId:n}=e,r;t[0]===n?r=t[1]:(r=x(n),t[0]=n,t[1]=r);let{data:i}=d(r),{data:a}=d(T),s=y(),p=v(),[b,S]=(0,te.useState)(``),C;t[2]===i?.IamInstanceProfileAssociations?C=t[3]:(C=i?.IamInstanceProfileAssociations?.find(re),t[2]=i?.IamInstanceProfileAssociations,t[3]=C);let w=C,E;t[4]===a?.InstanceProfiles?E=t[5]:(E=a?.InstanceProfiles??[],t[4]=a?.InstanceProfiles,t[5]=E);let D=E,k;t[6]!==s||t[7]!==n||t[8]!==b?(k=async()=>{if(b){try{await s.mutateAsync({instanceId:n,instanceProfileName:b})}catch{return}S(``)}},t[6]=s,t[7]=n,t[8]=b,t[9]=k):k=t[9];let A=k,j;t[10]!==w||t[11]!==p||t[12]!==n?(j=async()=>{if(w?.AssociationId)try{await p.mutateAsync({associationId:w.AssociationId,instanceId:n})}catch{}},t[10]=w,t[11]=p,t[12]=n,t[13]=j):j=t[13];let M=j,F;t[14]===s.error?F=t[15]:(F=s.error&&(0,P.jsx)(O,{error:s.error,msg:`Failed to associate instance profile`}),t[14]=s.error,t[15]=F);let I;t[16]===p.error?I=t[17]:(I=p.error&&(0,P.jsx)(O,{error:p.error,msg:`Failed to disassociate instance profile`}),t[16]=p.error,t[17]=I);let L;t[18]!==s.isPending||t[19]!==w||t[20]!==p.isPending||t[21]!==A||t[22]!==M||t[23]!==D||t[24]!==b?(L=w?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{copy:w.IamInstanceProfile?.Arn,label:`Instance profile`,mono:!0,children:w.IamInstanceProfile?.Arn}),(0,P.jsx)(_,{label:`State`,children:(0,P.jsx)(ee,{state:w.State})})]}),(0,P.jsx)(m,{className:`self-start`,disabled:p.isPending,onClick:M,size:`sm`,variant:`destructive`,children:p.isPending?`Detaching…`:`Detach`})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No instance profile is associated. Associate one to flow role credentials to this instance via IMDS.`}),D.length>0?(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(u,{onValueChange:e=>{S(e??``)},value:b,children:[(0,P.jsx)(l,{"aria-label":`Instance profile`,className:`w-full`,children:(0,P.jsx)(o,{placeholder:`Select an instance profile`})}),(0,P.jsx)(c,{children:D.map(ne)})]}),(0,P.jsx)(m,{disabled:!b||s.isPending,onClick:A,size:`sm`,children:s.isPending?`Associating…`:`Associate`})]}):(0,P.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No instance profiles exist.`,` `,(0,P.jsx)(f,{className:`text-primary hover:underline`,search:{create:!0},to:`/iam/list-instance-profiles`,children:`Create one`}),` `,`first.`]})]}),t[18]=s.isPending,t[19]=w,t[20]=p.isPending,t[21]=A,t[22]=M,t[23]=D,t[24]=b,t[25]=L):L=t[25];let R;return t[26]!==F||t[27]!==I||t[28]!==L?(R=(0,P.jsx)(h,{title:`IAM role`,children:(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[F,I,L]})}),t[26]=F,t[27]=I,t[28]=L,t[29]=R):R=t[29],R}function ne(e){return(0,P.jsx)(s,{value:e.InstanceProfileName??``,children:e.InstanceProfileName},e.InstanceProfileName)}function re(e){return e.State===`associating`||e.State===`associated`}var L=[[`amazonlinux`,`ec2-user`],[`almalinux`,`almalinux`],[`oracle`,`cloud-user`],[`ubuntu`,`ubuntu`],[`debian`,`debian`],[`fedora`,`fedora`],[`centos`,`cloud-user`],[`alpine`,`alpine`],[`rocky`,`rocky`],[`amzn`,`ec2-user`],[`rhel`,`cloud-user`]];function R(e){let t=new Set(`${e?.Name??``} ${e?.Description??``}`.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)),n=L.find(([e])=>t.has(e));return n?{user:n[1],distro:n[0]}:{user:``}}function z(e){return e?.PublicIpAddress?{address:e.PublicIpAddress,reachability:`public`}:e?.PrivateIpAddress?{address:e.PrivateIpAddress,reachability:`private`}:{address:``,reachability:`none`}}var ie=`path/to/key.pem`;function ae(e){return`ssh -i ${e.keyName?`path/to/${e.keyName}.pem`:ie} ${e.user||``}@${e.address}`}function B(e){let t=(0,N.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,P.jsx)(`div`,{className:`py-1.5`,children:(0,P.jsx)(`dd`,{className:`text-xs text-warning-foreground`,children:n})}),t[0]=n,t[1]=r),r}function oe(e){let t=(0,N.c)(37),{instance:n,image:r}=e,i,a,o,s,c,l;if(t[0]!==r||t[1]!==n){c=Symbol.for(`react.early_return_sentinel`);bb0:{if({address:i,reachability:o}=z(n),{user:l,distro:a}=R(r),o===`none`){c=null;break bb0}s=ae({keyName:n.KeyName,user:l,address:i})}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(c!==Symbol.for(`react.early_return_sentinel`))return c;let u=s,d;t[8]===u?d=t[9]:(d=(0,P.jsx)(`span`,{title:u,children:u}),t[8]=u,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,P.jsx)(_,{copy:u,label:`SSH`,mono:!0,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,P.jsx)(`p`,{children:`The account cloud-init creates in the guest. It comes from the image, not from Spinifex.`}),t[13]=m):m=t[13];let h=r?.Name,g;t[14]===h?g=t[15]:(g=[`Image`,h],t[14]=h,t[15]=g);let v;t[16]===a?v=t[17]:(v=[`Distribution`,a],t[16]=a,t[17]=v);let y=l||`Unknown`,b;t[18]===y?b=t[19]:(b=[`User`,y],t[18]=y,t[19]=b);let x;t[20]!==b||t[21]!==g||t[22]!==v?(x=(0,P.jsxs)(P.Fragment,{children:[m,(0,P.jsx)(p,{items:[g,v,b]})]}),t[20]=b,t[21]=g,t[22]=v,t[23]=x):x=t[23];let S=l||void 0,C;t[24]!==x||t[25]!==S?(C=(0,P.jsx)(_,{info:x,label:`Login user`,mono:!0,children:S}),t[24]=x,t[25]=S,t[26]=C):C=t[26];let w;t[27]!==i||t[28]!==o?(w=o===`private`&&(0,P.jsxs)(B,{children:[`No public IP, so `,i,` is reachable only from inside the VPC.`]}),t[27]=i,t[28]=o,t[29]=w):w=t[29];let T;t[30]===l?T=t[31]:(T=!l&&(0,P.jsx)(B,{children:`The login user could not be determined from this AMI; check the image's documentation.`}),t[30]=l,t[31]=T);let E;return t[32]!==C||t[33]!==w||t[34]!==T||t[35]!==f?(E=(0,P.jsxs)(P.Fragment,{children:[f,C,w,T]}),t[32]=C,t[33]=w,t[34]=T,t[35]=f,t[36]=E):E=t[36],E}var se=/^(?:ami-)?(?[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)*)-(?\d+(?:\.\d+)*)-(?x86_64|amd64|arm64|aarch64)$/iu,ce=new Map([[`x86_64`,`x86_64`],[`amd64`,`x86_64`],[`arm64`,`arm64`],[`aarch64`,`arm64`]]);function V(e){return e?ce.get(e.toLowerCase()):void 0}function H(e){let t=se.exec(e??``)?.groups;if(!t?.distro||!t.version||!t.arch)return;let n=V(t.arch);if(n)return{distro:t.distro.toLowerCase(),version:t.version,arch:n}}function le(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e({distro:e,versions:t.toSorted((e,t)=>le(t.version,e.version))})).toSorted((e,t)=>e.distro.localeCompare(t.distro)),other:r}}function ue(e){let t=new Set;for(let n of e){let e=U(n);e&&t.add(e)}return[`x86_64`,`arm64`].filter(e=>t.has(e))}function G(e,t){let n=e.ProcessorInfo?.SupportedArchitectures??[];return!t||n.length===0||n.some(e=>V(e)===t)}var de=new Map([[`almalinux`,`AlmaLinux`],[`alpine`,`Alpine`],[`amazon`,`Amazon Linux`],[`centos`,`CentOS`],[`debian`,`Debian`],[`fedora`,`Fedora`],[`freebsd`,`FreeBSD`],[`opensuse`,`openSUSE`],[`oracle`,`Oracle Linux`],[`rhel`,`Red Hat`],[`rocky`,`Rocky Linux`],[`ubuntu`,`Ubuntu`]]);function fe(e){return de.get(e)??e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function K(e,t=`ubuntu`){return(e.distros.find(e=>e.distro===t)??e.distros[0])?.versions[0]?.image??e.other[0]}function pe(e,t){return e.distros.find(e=>e.distro===t)?.versions[0]?.image}var me=`/dev/sda1`;function he(e,t){return e.filter(e=>G(e,t))}function ge(e){return[...new Set(e.flatMap(e=>e.InstanceType??[]))].toSorted()}function q(e){return e.find(e=>e.endsWith(`.nano`))??e[0]}function _e(e,t){return e.find(e=>t.some(t=>G(t,e)))??e[0]}function ve(e){return e.Tags?.find(e=>e.Key===`Name`)?.Value}function ye(e){let t=ve(e);return t?`${t} (${e.SubnetId})`:e.SubnetId??``}function be(e){return[e.CidrBlock,e.AvailabilityZone,e.VpcId,e.MapPublicIpOnLaunch?`public IP assigned on launch`:`private address only`].filter(Boolean).join(` · `)}function xe(e,t,n){return t?e.find(e=>e.SubnetId===t):n}function J(e){let t=e?.RootDeviceName??`/dev/sda1`,n=e?.BlockDeviceMappings??[];return{deviceName:t,snapshotSize:(n.find(e=>e.DeviceName===t)??n[0])?.Ebs?.VolumeSize}}function Y(e,t){return J(e.find(e=>e.ImageId===t))}function Se(e,t){if(e.length===0)return;if(!t||t===`$Default`)return e.find(e=>e.DefaultVersion)??e[0];if(t===`$Latest`)return e.toSorted((e,t)=>(t.VersionNumber??0)-(e.VersionNumber??0))[0];let n=Number(t);return e.find(e=>e.VersionNumber===n)}function Ce({images:e,arch:t,archTypeNames:n,keyPairs:r,securityGroups:i,launchTemplateId:a,launchTemplateVersion:o}){let s=K(W(e,t))?.ImageId;return{count:1,name:``,imageId:s??``,keyName:r[0]?.KeyName??``,instanceType:q(n)??``,launchTemplateId:a,launchTemplateVersion:o??`$Default`,rootDeviceName:Y(e,s).deviceName,securityGroupMode:`create`,securityGroupIds:[],newSgName:A(i.map(e=>e.GroupName??``)),newSgDescription:`Created by launch wizard`,allowPing:!0,allowSsh:!0,allowHttp:!1,allowHttps:!1,ruleSource:`anywhere`,customCidr:``}}function we(e,t,n){return k(j.refine(e=>{let t=e.instanceType?n[e.instanceType]:void 0;return t===void 0||e.count<=t},{message:`Cannot exceed available capacity`,path:[`count`]}).superRefine((n,r)=>{let i=e.find(e=>e.ImageId===n.imageId),a=J(i).snapshotSize;n.rootVolumeSize!==void 0&&a!==void 0&&n.rootVolumeSizee.InstanceType===n.instanceType);!n.launchTemplateId&&s&&o&&!G(s,o)&&r.addIssue({code:`custom`,message:`${n.instanceType} cannot run a ${o} image`,path:[`instanceType`]})}))}var X=`text-primary hover:underline`;function Z(e){let t=e.IpProtocol??``;if(t===`-1`)return`All traffic`;let n={6:`TCP`,17:`UDP`,1:`ICMP`}[t]??t.toUpperCase();return e.FromPort===void 0||e.FromPort===-1?n:e.FromPort===e.ToPort?`${n} ${e.FromPort}`:`${n} ${e.FromPort}–${e.ToPort}`}function Te(e){let t=[...(e.IpRanges??[]).map(e=>e.CidrIp),...(e.Ipv6Ranges??[]).map(e=>e.CidrIpv6),...(e.UserIdGroupPairs??[]).map(e=>e.GroupId),...(e.PrefixListIds??[]).map(e=>e.PrefixListId)].filter(Boolean);return t.length?t.join(`, `):`—`}function Q(e){let t=(0,N.c)(8),{direction:n,rules:r}=e;if(!r?.length){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:`No rules`}),t[0]=e):e=t[0];let r;return t[1]===n?r=t[2]:(r=(0,P.jsx)(_,{label:n,children:e}),t[1]=n,t[2]=r),r}let i;if(t[3]!==n||t[4]!==r){let e;t[6]===n?e=t[7]:(e=e=>{let t=Z(e),r=Te(e);return(0,P.jsx)(_,{label:n,mono:!0,children:(0,P.jsxs)(`span`,{title:r,children:[t,` · `,r]})},`${n}${t}${r}`)},t[6]=n,t[7]=e),i=r.map(e),t[3]=n,t[4]=r,t[5]=i}else i=t[5];return i}function Ee(e){let t=(0,N.c)(13),{instance:n}=e,{data:r}=d(b),i;t[0]===n.SecurityGroups?i=t[1]:(i=new Set(n.SecurityGroups?.map(De)),t[0]=n.SecurityGroups,t[1]=i);let a=i,o;t[2]!==r?.SecurityGroups||t[3]!==a||t[4]!==n.SecurityGroups?(o=r?.SecurityGroups?.filter(e=>a.has(e.GroupId))??n.SecurityGroups??[],t[2]=r?.SecurityGroups,t[3]=a,t[4]=n.SecurityGroups,t[5]=o):o=t[5];let s=o;if(!s.length)return null;let c;if(t[6]!==r||t[7]!==s){let e;t[9]===r?e=t[10]:(e=e=>(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{label:`Group`,children:e.GroupId&&(0,P.jsx)(f,{className:X,params:{id:e.GroupId},title:e.GroupId,to:`/ec2/describe-security-groups/$id`,children:e.GroupName??e.GroupId})}),r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Q,{direction:`Inbound`,rules:e.IpPermissions}),(0,P.jsx)(Q,{direction:`Outbound`,rules:e.IpPermissionsEgress})]})]},e.GroupId),t[9]=r,t[10]=e),c=s.map(e),t[6]=r,t[7]=s,t[8]=c}else c=t[8];let l;return t[11]===c?l=t[12]:(l=(0,P.jsx)(h,{title:`Security groups`,children:(0,P.jsx)(`div`,{className:`flex flex-col gap-3`,children:c})}),t[11]=c,t[12]=l),l}function De(e){return e.GroupId}function $(e){let t=(0,N.c)(6),{instance:n}=e,r;t[0]===n.NetworkInterfaces?r=t[1]:(r=n.NetworkInterfaces??[],t[0]=n.NetworkInterfaces,t[1]=r);let i=r;if(!i.length)return null;let a;t[2]===i?a=t[3]:(a=i.map(Oe),t[2]=i,t[3]=a);let o;return t[4]===a?o=t[5]:(o=(0,P.jsx)(h,{defaultOpen:!1,title:`Network interfaces`,children:(0,P.jsx)(`div`,{className:`flex flex-col gap-3`,children:a})}),t[4]=a,t[5]=o),o}function Oe(e){return(0,P.jsxs)(g,{children:[(0,P.jsx)(_,{copy:e.NetworkInterfaceId,label:`Interface`,mono:!0,children:e.NetworkInterfaceId}),(0,P.jsx)(_,{label:`Device index`,mono:!0,children:e.Attachment?.DeviceIndex?.toString()}),(0,P.jsx)(_,{label:`Private IP`,mono:!0,children:e.PrivateIpAddress}),(0,P.jsx)(_,{label:`Public IP`,mono:!0,children:e.Association?.PublicIp}),(0,P.jsx)(_,{label:`MAC address`,mono:!0,children:e.MacAddress}),(0,P.jsx)(_,{label:`Subnet`,mono:!0,children:e.SubnetId&&(0,P.jsx)(f,{className:X,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId})}),(0,P.jsx)(_,{label:`Status`,children:e.Status})]},e.NetworkInterfaceId)}function ke(e){let t=(0,N.c)(8),{image:n,instance:r}=e,i;t[0]===n?i=t[1]:(i=n&&(0,P.jsx)(p,{items:[[`AMI`,n.ImageId],[`Name`,n.Name],[`Description`,n.Description],[`Architecture`,n.Architecture],[`Boot mode`,n.BootMode],[`Platform`,n.PlatformDetails],[`Created`,n.CreationDate&&a(n.CreationDate)]]}),t[0]=n,t[1]=i);let o;t[2]!==n?.Name||t[3]!==r.ImageId?(o=r.ImageId&&(0,P.jsx)(f,{className:X,params:{id:r.ImageId},title:n?.Name,to:`/ec2/describe-images/$id`,children:n?.Name??r.ImageId}),t[2]=n?.Name,t[3]=r.ImageId,t[4]=o):o=t[4];let s;return t[5]!==i||t[6]!==o?(s=(0,P.jsx)(_,{info:i,label:`Image`,mono:!0,children:o}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function Ae(e){let t=(0,N.c)(8),{instance:n}=e,{data:r}=d(S),i,a;if(t[0]!==r?.InstanceTypes||t[1]!==n.InstanceType){let e=r?.InstanceTypes?.find(e=>e.InstanceType===n.InstanceType);i=_,a=e&&M(e),t[0]=r?.InstanceTypes,t[1]=n.InstanceType,t[2]=i,t[3]=a}else i=t[2],a=t[3];let o;return t[4]!==i||t[5]!==n.InstanceType||t[6]!==a?(o=(0,P.jsx)(i,{info:a,label:`Type`,mono:!0,children:n.InstanceType}),t[4]=i,t[5]=n.InstanceType,t[6]=a,t[7]=o):o=t[7],o}function je(e){let t=(0,N.c)(36),{image:n,instance:r}=e,i;t[0]===r.Tags?i=t[1]:(i=r.Tags?.find(Me)?.Value,t[0]=r.Tags,t[1]=i);let o=i,s;t[2]===r.InstanceId?s=t[3]:(s=(0,P.jsx)(_,{copy:r.InstanceId,label:`Instance ID`,mono:!0,children:r.InstanceId}),t[2]=r.InstanceId,t[3]=s);let c;t[4]===o?c=t[5]:(c=(0,P.jsx)(_,{label:`Name`,children:o}),t[4]=o,t[5]=c);let l;t[6]===r?l=t[7]:(l=(0,P.jsx)(Ae,{instance:r}),t[6]=r,t[7]=l);let u=r.Placement?.AvailabilityZone,d;t[8]===u?d=t[9]:(d=(0,P.jsx)(_,{label:`Zone`,children:u}),t[8]=u,t[9]=d);let p;t[10]===r.Placement?p=t[11]:(p=r.Placement?.GroupName&&(0,P.jsx)(f,{className:X,to:`/ec2/describe-placement-groups`,children:r.Placement.GroupName}),t[10]=r.Placement,t[11]=p);let m;t[12]===p?m=t[13]:(m=(0,P.jsx)(_,{label:`Placement group`,children:p}),t[12]=p,t[13]=m);let v;t[14]!==n||t[15]!==r?(v=(0,P.jsx)(ke,{image:n,instance:r}),t[14]=n,t[15]=r,t[16]=v):v=t[16];let y;t[17]===r.KeyName?y=t[18]:(y=(0,P.jsx)(_,{label:`Key pair`,children:r.KeyName}),t[17]=r.KeyName,t[18]=y);let b;t[19]===r.LaunchTime?b=t[20]:(b=r.LaunchTime&&a(r.LaunchTime),t[19]=r.LaunchTime,t[20]=b);let x;t[21]===b?x=t[22]:(x=(0,P.jsx)(_,{label:`Launched`,children:b}),t[21]=b,t[22]=x);let S;t[23]!==n||t[24]!==r?(S=r.State?.Name===`running`&&(0,P.jsx)(oe,{image:n,instance:r}),t[23]=n,t[24]=r,t[25]=S):S=t[25];let C;return t[26]!==y||t[27]!==x||t[28]!==S||t[29]!==s||t[30]!==c||t[31]!==l||t[32]!==d||t[33]!==m||t[34]!==v?(C=(0,P.jsx)(h,{title:`Instance information`,children:(0,P.jsxs)(g,{children:[s,c,l,d,m,v,y,x,S]})}),t[26]=y,t[27]=x,t[28]=S,t[29]=s,t[30]=c,t[31]=l,t[32]=d,t[33]=m,t[34]=v,t[35]=C):C=t[35],C}function Me(e){return e.Key===`Name`}function Ne(e){let t=(0,N.c)(28),{elasticIp:n,instance:r}=e,i;t[0]===r.PrivateIpAddress?i=t[1]:(i=(0,P.jsx)(_,{copy:r.PrivateIpAddress,label:`Private IP`,mono:!0,children:r.PrivateIpAddress}),t[0]=r.PrivateIpAddress,t[1]=i);let a;t[2]===r.PublicIpAddress?a=t[3]:(a=(0,P.jsx)(_,{copy:r.PublicIpAddress,label:`Public IP`,mono:!0,children:r.PublicIpAddress}),t[2]=r.PublicIpAddress,t[3]=a);let o;t[4]===n?o=t[5]:(o=n?.AllocationId&&(0,P.jsx)(f,{className:X,params:{id:n.AllocationId},title:n.AllocationId,to:`/ec2/describe-addresses/$id`,children:n.PublicIp}),t[4]=n,t[5]=o);let s;t[6]===o?s=t[7]:(s=(0,P.jsx)(_,{info:`A static public address the account owns. It stays with the account when the instance stops or is terminated.`,label:`Elastic IP`,mono:!0,children:o}),t[6]=o,t[7]=s);let c;t[8]===r.PrivateDnsName?c=t[9]:(c=(0,P.jsx)(_,{copy:r.PrivateDnsName,label:`Private DNS`,mono:!0,children:r.PrivateDnsName}),t[8]=r.PrivateDnsName,t[9]=c);let l;t[10]===r.PublicDnsName?l=t[11]:(l=(0,P.jsx)(_,{copy:r.PublicDnsName,label:`Public DNS`,mono:!0,children:r.PublicDnsName}),t[10]=r.PublicDnsName,t[11]=l);let u;t[12]===r.VpcId?u=t[13]:(u=r.VpcId&&(0,P.jsx)(f,{className:X,params:{id:r.VpcId},to:`/ec2/describe-vpcs/$id`,children:r.VpcId}),t[12]=r.VpcId,t[13]=u);let d;t[14]===u?d=t[15]:(d=(0,P.jsx)(_,{label:`VPC`,mono:!0,children:u}),t[14]=u,t[15]=d);let p;t[16]===r.SubnetId?p=t[17]:(p=r.SubnetId&&(0,P.jsx)(f,{className:X,params:{id:r.SubnetId},to:`/ec2/describe-subnets/$id`,children:r.SubnetId}),t[16]=r.SubnetId,t[17]=p);let m;t[18]===p?m=t[19]:(m=(0,P.jsx)(_,{label:`Subnet`,mono:!0,children:p}),t[18]=p,t[19]=m);let v;return t[20]!==i||t[21]!==m||t[22]!==a||t[23]!==s||t[24]!==c||t[25]!==l||t[26]!==d?(v=(0,P.jsx)(h,{title:`Networking`,children:(0,P.jsxs)(g,{children:[i,a,s,c,l,d,m]})}),t[20]=i,t[21]=m,t[22]=a,t[23]=s,t[24]=c,t[25]=l,t[26]=d,t[27]=v):v=t[27],v}function Pe(e){let t=(0,N.c)(4),{instance:n}=e;if((n.BlockDeviceMappings?.length??0)===0)return null;let r;t[0]===n.BlockDeviceMappings?r=t[1]:(r=n.BlockDeviceMappings?.map(Fe),t[0]=n.BlockDeviceMappings,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,P.jsx)(h,{title:`Storage`,children:(0,P.jsx)(g,{children:r})}),t[2]=r,t[3]=i),i}function Fe(e){return(0,P.jsx)(_,{label:e.DeviceName??`—`,mono:!0,children:e.Ebs?.VolumeId&&(0,P.jsx)(f,{className:X,params:{id:e.Ebs.VolumeId},to:`/ec2/describe-volumes/$id`,children:e.Ebs.VolumeId})},e.DeviceName)}function Ie(e){let t=(0,N.c)(33),{instance:n}=e,{isAdmin:r}=D(),i;t[0]===n.ImageId?i=t[1]:(i=w(n.ImageId),t[0]=n.ImageId,t[1]=i);let{data:a}=d(i),{data:o}=d(C),s;t[2]===r?s=t[3]:(s={...E,enabled:r},t[2]=r,t[3]=s);let{data:c}=d(s),l=a?.Images?.[0],u;t[4]!==o?.Addresses||t[5]!==n.InstanceId?(u=o?.Addresses?.find(e=>e.InstanceId===n.InstanceId),t[4]=o?.Addresses,t[5]=n.InstanceId,t[6]=u):u=t[6];let f=u,p;t[7]!==n.InstanceId||t[8]!==c?.vms?(p=c?.vms?.find(e=>e.instance_id===n.InstanceId)?.gpus,t[7]=n.InstanceId,t[8]=c?.vms,t[9]=p):p=t[9];let m=p,h;t[10]!==l||t[11]!==n?(h=(0,P.jsx)(je,{image:l,instance:n}),t[10]=l,t[11]=n,t[12]=h):h=t[12];let g;t[13]!==f||t[14]!==n?(g=(0,P.jsx)(Ne,{elasticIp:f,instance:n}),t[13]=f,t[14]=n,t[15]=g):g=t[15];let _,v,y;t[16]===n?(_=t[17],v=t[18],y=t[19]):(_=(0,P.jsx)(Ee,{instance:n}),v=(0,P.jsx)($,{instance:n}),y=(0,P.jsx)(Pe,{instance:n}),t[16]=n,t[17]=_,t[18]=v,t[19]=y);let b;t[20]===n.InstanceId?b=t[21]:(b=n.InstanceId&&(0,P.jsx)(I,{instanceId:n.InstanceId}),t[20]=n.InstanceId,t[21]=b);let x;t[22]!==m||t[23]!==r?(x=r&&(0,P.jsx)(F,{gpus:m}),t[22]=m,t[23]=r,t[24]=x):x=t[24];let S;return t[25]!==b||t[26]!==x||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==y?(S=(0,P.jsxs)(P.Fragment,{children:[h,g,_,v,y,b,x]}),t[25]=b,t[26]=x,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=y,t[32]=S):S=t[32],S}export{K as S,U as _,Y as a,pe as b,Se as c,ye as d,be as f,fe as g,W as h,q as i,Ce as l,ge as m,Z as n,_e as o,he as p,me as r,xe as s,Ie as t,we as u,ue as v,H as x,G as y}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instances-page-BPnRMywb.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instances-page-BPnRMywb.js deleted file mode 100644 index 6961448cd..000000000 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instances-page-BPnRMywb.js +++ /dev/null @@ -1,22 +0,0 @@ -import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r,U as i}from"./schemas-DCQXG11d.js";import{c as a,i as o,n as s,s as c,t as l}from"./select-UwOVJofC.js";import{n as u}from"./QueryClientProvider-BuG40HBe.js";import{t as d}from"./useQuery-D6TojLgI.js";import{t as f}from"./useSuspenseQuery--dusmE-Q.js";import{t as p}from"./link-BX-1BPor.js";import{t as m}from"./data-table-9n7xOy9s.js";import{t as h}from"./useNavigate-cMdr_EJ0.js";import{r as g}from"./visuallyHidden-BHQz5bmH.js";import{n as _}from"./info-tip-Cxa2GEOd.js";import{t as v}from"./chevron-down-BgudX6bq.js";import{t as y}from"./eye-yi4wz0yh.js";import{t as b}from"./globe-D4RJ05Is.js";import{t as x}from"./maximize-2-BAlKoEj8.js";import{n as S,t as C}from"./button-group-CpOcyma9.js";import{t as w}from"./play-qJowxtRp.js";import{t as T}from"./plus-BK_7eO_G.js";import{t as E}from"./refresh-cw-Cb2whnur.js";import{t as D}from"./rotate-cw-DhHI5fTM.js";import{t as O}from"./server-D03m5B1l.js";import{t as k}from"./sliders-horizontal-DsGbsnBU.js";import{a as A,i as j,n as M,o as N,r as P,t as F}from"./cli-command-panel-Do14gxB9.js";import{t as I}from"./trash-BajuWzqn.js";import{a as L,o as R}from"./useValueAsRef-uzS1fuI8.js";import{n as z,t as B}from"./radio-group-TE8lo9RG.js";import{c as V,f as H,l as U,n as W,r as G,t as K}from"./field-iLG94M00.js";import{a as q,t as ee}from"./detail-panel-DLM1ExsZ.js";import{c as te}from"./auth-BS4WytAe.js";import{J as ne,Z as re,f as ie,it as ae,n as oe,nt as se,p as ce,rt as le}from"./ec2-mbMOQDVK.js";import{N as ue,T as de,b as fe,g as J,h as pe,i as me,k as he,l as Y,m as ge,s as X}from"./ec2-DcwXjFvB.js";import{l as _e}from"./admin-UXb5aZ2d.js";import{a as ve,i as ye,n as be,r as xe,t as Se}from"./dropdown-menu-BDPQio-M.js";import{t as Ce}from"./switch-CFqwHFZR.js";import{t as we}from"./textarea-BG1iGvVs.js";import{t as Te}from"./panel-search-LDLf8HCe.js";import{t as Ee}from"./error-banner-Cahg3Ix2.js";import{t as De}from"./create-panel-BF47ohJ2.js";import{t as Oe}from"./delete-confirmation-dialog-O7cqOW0Y.js";import{t as ke}from"./filter-bar-DNltk5ao.js";import{t as Ae}from"./page-heading-ZfrnK2wu.js";import{t as je}from"./resource-view-CPdFr_3k.js";import{t as Me}from"./selection-bar-WnknBhRB.js";import{t as Ne}from"./state-badge-CQPRxt3J.js";import{n as Pe,r as Fe,t as Ie}from"./table-cells-Dh4yWZC8.js";import{t as Le}from"./use-row-selection-DB6L9NiD.js";import{t as Re}from"./console-output-B2nAhrwp.js";import{t as ze}from"./resource-tags-DMnOITWf.js";import{n as Be,t as Ve}from"./form-lock-D8Cu0Sfu.js";import{t as He}from"./form-panel-CtjudV7b.js";import{t as Ue}from"./gpu-instance-type-select-DsB5oPSo.js";import{a as We,i as Ge,l as Ke,n as qe,r as Je,s as Ye,t as Xe,u as Ze}from"./metric-format-DCnx-pFz.js";import{S as Qe,_ as $e,a as et,b as tt,c as nt,d as rt,f as it,g as at,h as ot,i as st,l as ct,m as lt,o as ut,p as dt,s as ft,t as pt,u as mt,v as ht,x as gt,y as _t}from"./instance-overview-I3DWLmM0.js";import{c as vt,o as yt,t as bt}from"./index.esm-C31mnnYl.js";import{t as xt}from"./ec2-CM16SST3.js";import{n as St}from"./instance-type-size-DoyCeynC.js";import{i as Ct}from"./system-managed-Dk7ySh_E.js";import{n as wt,t as Tt}from"./choice-tile-CEc-Vca5.js";import{r as Et}from"./form-fields-CcTBfvl9.js";import{t as Dt}from"./security-group-picker-CRcCOtjC.js";var Ot={name:`chart-area`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z`,key:`q0gr47`}]],aliases:[`area-chart`]};Ot.node;var kt=g(Ot),At={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};At.node;var jt=g(At),Mt={name:`disc-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]};Mt.node;var Nt=g(Mt),Pt={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};Pt.node;var Ft=g(Pt),It={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};It.node;var Lt=g(It),Rt={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Rt.node;var zt=g(Rt),Z=r(),Bt=e(n(),1),Q=t();function Vt(e,t,n){return[{label:`Create Image`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-image`},...j(`\\ - --instance-id`,e),...j(`\\ - --name`,t?N(t):P(``,`Name`)),...A(`\\ - --description`,n&&N(n))]}]}function Ht(e){let t=(0,Z.c)(43),{instanceId:n,onClose:r}=e,i=ie(),a=h(),[o,s]=(0,Bt.useState)(``),[c,l]=(0,Bt.useState)(``),u;t[0]!==i||t[1]!==c||t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==r?(u=async function(){let e;try{e=await i.mutateAsync({instanceId:n,name:o,description:c||void 0})}catch{return}r(),e.ImageId&&a({to:`/ec2/describe-images`,search:{selected:e.ImageId}})},t[0]=i,t[1]=c,t[2]=n,t[3]=o,t[4]=a,t[5]=r,t[6]=u):u=t[6];let d=u,f;t[7]===d?f=t[8]:(f=e=>{e.preventDefault(),d()},t[7]=d,t[8]=f);let p=i.isPending,m;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageName`,children:`Name`})}),t[9]=m):m=t[9];let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{s(e.target.value)},t[10]=g):g=t[10];let _;t[11]===o?_=t[12]:(_=(0,Q.jsxs)(K,{children:[m,(0,Q.jsx)(H,{id:`imageName`,onChange:g,placeholder:`my-image`,value:o})]}),t[11]=o,t[12]=_);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageDescription`,children:`Description`})}),t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{l(e.target.value)},t[14]=y):y=t[14];let b;t[15]===c?b=t[16]:(b=(0,Q.jsxs)(K,{children:[v,(0,Q.jsx)(we,{id:`imageDescription`,onChange:y,placeholder:`Optional description`,rows:2,value:c})]}),t[15]=c,t[16]=b);let x;t[17]!==c||t[18]!==n||t[19]!==o?(x=Vt(n,o,c),t[17]=c,t[18]=n,t[19]=o,t[20]=x):x=t[20];let S;t[21]===x?S=t[22]:(S=(0,Q.jsx)(F,{commands:x}),t[21]=x,t[22]=S);let C=i.error,w=i.isPending,T;t[23]===o?T=t[24]:(T=o.trim(),t[23]=o,t[24]=T);let E=!T,D;t[25]!==i.error||t[26]!==i.isPending||t[27]!==r||t[28]!==E?(D=(0,Q.jsx)(Be,{error:C,errorMsg:`Failed to create image`,isPending:w,isSubmitting:!1,onCancel:r,pendingLabel:`Creating…`,submitDisabled:E,submitLabel:`Create image`}),t[25]=i.error,t[26]=i.isPending,t[27]=r,t[28]=E,t[29]=D):D=t[29];let O;t[30]!==i.isPending||t[31]!==S||t[32]!==D||t[33]!==_||t[34]!==b?(O=(0,Q.jsxs)(Ve,{className:`space-y-6`,locked:p,children:[_,b,S,D]}),t[30]=i.isPending,t[31]=S,t[32]=D,t[33]=_,t[34]=b,t[35]=O):O=t[35];let k;t[36]!==O||t[37]!==f?(k=(0,Q.jsx)(`form`,{onSubmit:f,children:O}),t[36]=O,t[37]=f,t[38]=k):k=t[38];let A;return t[39]!==n||t[40]!==r||t[41]!==k?(A=(0,Q.jsx)(He,{onClose:r,subtitle:n,title:`Create image (AMI)`,children:k}),t[39]=n,t[40]=r,t[41]=k,t[42]=A):A=t[42],A}function Ut(e,t){return[{label:`Modify Instance Attribute`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 modify-instance-attribute`},...j(`\\ - --instance-id`,e),...j(`\\ - --instance-type`,`Value=${P(t,`InstanceType`)}`)]}]}function Wt(e){let t=(0,Z.c)(38),{instance:n,onClose:r}=e,{data:i}=d(Y),a=ne(),[o,s]=(0,Bt.useState)(n.InstanceType??``),c=n.InstanceId??``,l;t[0]!==c||t[1]!==a||t[2]!==r||t[3]!==o?(l=async function(){try{await a.mutateAsync({instanceId:c,instanceType:o})}catch{return}r()},t[0]=c,t[1]=a,t[2]=r,t[3]=o,t[4]=l):l=t[4];let u=l,f;t[5]===u?f=t[6]:(f=e=>{e.preventDefault(),u()},t[5]=u,t[6]=f);let p=a.isPending,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance type`})}),t[7]=m):m=t[7];let h;t[8]===i?.InstanceTypes?h=t[9]:(h=i?.InstanceTypes??[],t[8]=i?.InstanceTypes,t[9]=h);let g;t[10]!==o||t[11]!==h?(g=(0,Q.jsx)(Ue,{className:`w-full`,id:`instanceType`,instanceTypes:h,onValueChange:s,value:o}),t[10]=o,t[11]=h,t[12]=g):g=t[12];let _;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(W,{children:`The instance must be stopped.`}),t[13]=_):_=t[13];let v;t[14]===g?v=t[15]:(v=(0,Q.jsxs)(K,{children:[m,g,_]}),t[14]=g,t[15]=v);let y;t[16]!==c||t[17]!==o?(y=Ut(c,o),t[16]=c,t[17]=o,t[18]=y):y=t[18];let b;t[19]===y?b=t[20]:(b=(0,Q.jsx)(F,{commands:y}),t[19]=y,t[20]=b);let x=!o||o===n.InstanceType,S;t[21]!==a.error||t[22]!==a.isPending||t[23]!==r||t[24]!==x?(S=(0,Q.jsx)(Be,{error:a.error,errorMsg:`Failed to change the instance type`,isPending:a.isPending,isSubmitting:!1,onCancel:r,pendingLabel:`Saving…`,submitDisabled:x,submitLabel:`Save`}),t[21]=a.error,t[22]=a.isPending,t[23]=r,t[24]=x,t[25]=S):S=t[25];let C;t[26]!==a.isPending||t[27]!==b||t[28]!==S||t[29]!==v?(C=(0,Q.jsxs)(Ve,{className:`space-y-6`,locked:p,children:[v,b,S]}),t[26]=a.isPending,t[27]=b,t[28]=S,t[29]=v,t[30]=C):C=t[30];let w;t[31]!==C||t[32]!==f?(w=(0,Q.jsx)(`form`,{onSubmit:f,children:C}),t[31]=C,t[32]=f,t[33]=w):w=t[33];let T;return t[34]!==c||t[35]!==r||t[36]!==w?(T=(0,Q.jsx)(He,{onClose:r,subtitle:c,title:`Change instance type`,children:w}),t[34]=c,t[35]=r,t[36]=w,t[37]=T):T=t[37],T}function Gt(e){let t=(0,Z.c)(101),{instance:n,layout:r,tab:i,onTabChange:a,onTerminated:o}=e,s=n.InstanceId??``,c=n.State?.Name??``,l=h(),d=u(),f=se(),p=le(),m=re(),g=ae(),[_,y]=(0,Bt.useState)(``),b=f.error??p.error??m.error??g.error,T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){e||y(``)},t[0]=T):T=t[0];let E=T,O=c!==`stopped`||f.isPending,k;t[1]!==s||t[2]!==f?(k=()=>{f.mutate(s)},t[1]=s,t[2]=f,t[3]=k):k=t[3];let A;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(w,{"data-icon":`inline-start`}),t[4]=A):A=t[4];let j;t[5]!==O||t[6]!==k?(j=(0,Q.jsxs)(L,{disabled:O,onClick:k,size:`sm`,variant:`outline`,children:[A,`Start`]}),t[5]=O,t[6]=k,t[7]=j):j=t[7];let M=c!==`running`||p.isPending,N;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{y(`stop`)},t[8]=N):N=t[8];let P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(S,{"data-icon":`inline-start`}),t[9]=P):P=t[9];let F;t[10]===M?F=t[11]:(F=(0,Q.jsxs)(L,{disabled:M,onClick:N,size:`sm`,variant:`outline`,children:[P,`Stop`]}),t[10]=M,t[11]=F);let R=c!==`running`||m.isPending,z;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>{y(`reboot`)},t[12]=z):z=t[12];let B;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(D,{"data-icon":`inline-start`}),t[13]=B):B=t[13];let V;t[14]===R?V=t[15]:(V=(0,Q.jsxs)(L,{disabled:R,onClick:z,size:`sm`,variant:`outline`,children:[B,`Reboot`]}),t[14]=R,t[15]=V);let H;t[16]!==V||t[17]!==j||t[18]!==F?(H=(0,Q.jsxs)(C,{"aria-label":`Power`,children:[j,F,V]}),t[16]=V,t[17]=j,t[18]=F,t[19]=H):H=t[19];let U;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(L,{size:`sm`,variant:`outline`}),t[20]=U):U=t[20];let W;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsxs)(ve,{render:U,children:[`Actions`,(0,Q.jsx)(v,{"data-icon":`inline-end`})]}),t[21]=W):W=t[21];let G;t[22]!==s||t[23]!==r||t[24]!==l||t[25]!==i?(G=r===`auto`&&(0,Q.jsxs)(xe,{onClick:()=>{l({to:`/ec2/describe-instances/$id`,params:{id:s},search:{tab:i}})},children:[(0,Q.jsx)(x,{}),`Open instance page`]}),t[22]=s,t[23]=r,t[24]=l,t[25]=i,t[26]=G):G=t[26];let K=c!==`running`,q;t[27]!==s||t[28]!==a||t[29]!==d?(q=()=>{a(`settings`),d.query({...me(s),staleTime:0})},t[27]=s,t[28]=a,t[29]=d,t[30]=q):q=t[30];let ee;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(zt,{}),t[31]=ee):ee=t[31];let te;t[32]!==K||t[33]!==q?(te=(0,Q.jsxs)(xe,{disabled:K,onClick:q,children:[ee,`View console output`]}),t[32]=K,t[33]=q,t[34]=te):te=t[34];let ne=c!==`stopped`,ie,oe;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{y(`type`)},oe=(0,Q.jsx)(Lt,{}),t[35]=ie,t[36]=oe):(ie=t[35],oe=t[36]);let ce;t[37]===ne?ce=t[38]:(ce=(0,Q.jsxs)(xe,{disabled:ne,onClick:ie,children:[oe,`Change instance type`]}),t[37]=ne,t[38]=ce);let ue=c!==`running`&&c!==`stopped`,de,fe;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>{y(`image`)},fe=(0,Q.jsx)(Ft,{}),t[39]=de,t[40]=fe):(de=t[39],fe=t[40]);let J;t[41]===ue?J=t[42]:(J=(0,Q.jsxs)(xe,{disabled:ue,onClick:de,children:[fe,`Create image`]}),t[41]=ue,t[42]=J);let pe;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(ye,{}),t[43]=pe):pe=t[43];let he;t[44]!==c||t[45]!==g.isPending?(he=[`terminated`,`shutting-down`].includes(c)||g.isPending,t[44]=c,t[45]=g.isPending,t[46]=he):he=t[46];let Y;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>{y(`terminate`)},t[47]=Y):Y=t[47];let ge;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Q.jsx)(I,{}),t[48]=ge):ge=t[48];let X;t[49]===he?X=t[50]:(X=(0,Q.jsxs)(xe,{disabled:he,onClick:Y,variant:`destructive`,children:[ge,`Terminate`]}),t[49]=he,t[50]=X);let _e;t[51]!==G||t[52]!==te||t[53]!==ce||t[54]!==J||t[55]!==X?(_e=(0,Q.jsxs)(Se,{children:[W,(0,Q.jsxs)(be,{align:`end`,className:`min-w-48`,children:[G,te,ce,J,pe,X]})]}),t[51]=G,t[52]=te,t[53]=ce,t[54]=J,t[55]=X,t[56]=_e):_e=t[56];let Ce;t[57]!==H||t[58]!==_e?(Ce=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[H,_e]}),t[57]=H,t[58]=_e,t[59]=Ce):Ce=t[59];let we;t[60]===b?we=t[61]:(we=b&&(0,Q.jsx)(Ee,{error:b}),t[60]=b,t[61]=we);let Te=`Stopping ${s} shuts its guest down. Its volumes are kept, and Start brings it back.`,De;t[62]!==s||t[63]!==p?(De=()=>{p.mutate(s,{onSettled:()=>{y(``)}})},t[62]=s,t[63]=p,t[64]=De):De=t[64];let ke=_===`stop`,Ae;t[65]!==p.isPending||t[66]!==Te||t[67]!==De||t[68]!==ke?(Ae=(0,Q.jsx)(Oe,{confirmLabel:`Stop`,description:Te,isPending:p.isPending,onConfirm:De,onOpenChange:E,open:ke,pendingLabel:`Stopping…`,title:`Stop instance?`}),t[65]=p.isPending,t[66]=Te,t[67]=De,t[68]=ke,t[69]=Ae):Ae=t[69];let je=`Rebooting ${s} restarts its guest. Anything not written to disk is lost.`,Me;t[70]!==s||t[71]!==m?(Me=()=>{m.mutate(s,{onSettled:()=>{y(``)}})},t[70]=s,t[71]=m,t[72]=Me):Me=t[72];let Ne=_===`reboot`,Pe;t[73]!==m.isPending||t[74]!==je||t[75]!==Me||t[76]!==Ne?(Pe=(0,Q.jsx)(Oe,{confirmLabel:`Reboot`,description:je,isPending:m.isPending,onConfirm:Me,onOpenChange:E,open:Ne,pendingLabel:`Rebooting…`,title:`Reboot instance?`}),t[73]=m.isPending,t[74]=je,t[75]=Me,t[76]=Ne,t[77]=Pe):Pe=t[77];let Fe;t[78]!==_||t[79]!==n?(Fe=_===`type`&&(0,Q.jsx)(Wt,{instance:n,onClose:()=>{y(``)}}),t[78]=_,t[79]=n,t[80]=Fe):Fe=t[80];let Ie;t[81]!==_||t[82]!==s?(Ie=_===`image`&&(0,Q.jsx)(Ht,{instanceId:s,onClose:()=>{y(``)}}),t[81]=_,t[82]=s,t[83]=Ie):Ie=t[83];let Le=`Terminating ${s} deletes it and any volume set to delete on termination. This cannot be undone.`,Re;t[84]!==s||t[85]!==o||t[86]!==g?(Re=()=>{g.mutate(s,{onSettled:()=>{y(``)},onSuccess:o})},t[84]=s,t[85]=o,t[86]=g,t[87]=Re):Re=t[87];let ze=_===`terminate`,Be;t[88]!==Le||t[89]!==Re||t[90]!==ze||t[91]!==g.isPending?(Be=(0,Q.jsx)(Oe,{confirmLabel:`Terminate`,description:Le,isPending:g.isPending,onConfirm:Re,onOpenChange:E,open:ze,confirmPhrase:`terminate`,pendingLabel:`Terminating…`,title:`Terminate instance?`}),t[88]=Le,t[89]=Re,t[90]=ze,t[91]=g.isPending,t[92]=Be):Be=t[92];let Ve;return t[93]!==Ce||t[94]!==we||t[95]!==Ae||t[96]!==Pe||t[97]!==Fe||t[98]!==Ie||t[99]!==Be?(Ve=(0,Q.jsxs)(Q.Fragment,{children:[Ce,we,Ae,Pe,Fe,Ie,Be]}),t[93]=Ce,t[94]=we,t[95]=Ae,t[96]=Pe,t[97]=Fe,t[98]=Ie,t[99]=Be,t[100]=Ve):Ve=t[100],Ve}var Kt={connecting:`Connecting…`,unavailable:`No live statistics for this instance yet. Retrying.`,unsupported:`This cluster's gateway does not serve live statistics.`,error:`Live statistics are unavailable. Retrying.`};function qt(e){return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}}function Jt(){return document.visibilityState===`visible`}var Yt=new Ye().series();function Xt(e,t,n,r){let i=new Ye,a=new Ge;t.current=a,We(e,0,{onSamples:t=>{let r=Date.now();for(let e of t)a.observe(e.t,r);i.add(t);let o=i.series();n(t=>({...t,instanceId:e,series:o}))},onStatus:t=>{n(n=>({...n,instanceId:e,status:t}))}},r)}function Zt(e,t){let n=(0,Z.c)(12),r=(0,Bt.useSyncExternalStore)(qt,Jt),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=new Ge,n[0]=i):i=n[0];let a=(0,Bt.useRef)(i),o;n[1]===e?o=n[2]:(o={instanceId:e,series:Yt,status:`connecting`},n[1]=e,n[2]=o);let[s,c]=(0,Bt.useState)(o),l,u;n[3]!==e||n[4]!==t||n[5]!==r?(l=()=>{let n=new AbortController;return t&&r&&Xt(e,a,c,n.signal),()=>{n.abort()}},u=[e,t,r],n[3]=e,n[4]=t,n[5]=r,n[6]=l,n[7]=u):(l=n[6],u=n[7]),(0,Bt.useEffect)(l,u);let d;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(d={now:()=>a.current.now(Date.now())/1e3,span:Ke/1e3},n[8]=d):d=n[8];let f=d,p=s.instanceId===e,m=p?s.series:Yt,h=p?s.status:`connecting`,g;return n[9]!==m||n[10]!==h?(g={series:m,status:h,live:f},n[9]=m,n[10]=h,n[11]=g):g=n[11],g}function Qt(e){let t=(0,Z.c)(32),{instanceId:n,running:r}=e,{series:i,status:a,live:o}=Zt(n,r),s;t[0]===i.cpu?s=t[1]:(s={title:`CPU utilization (%)`,format:Je,max:100,series:[{label:`CPU`,color:`chart-1`,values:i.cpu}]},t[0]=i.cpu,t[1]=s);let c;t[2]===i.networkIn?c=t[3]:(c={label:`In`,color:`chart-2`,values:i.networkIn},t[2]=i.networkIn,t[3]=c);let l;t[4]===i.networkOut?l=t[5]:(l={label:`Out`,color:`chart-3`,values:i.networkOut},t[4]=i.networkOut,t[5]=l);let u;t[6]!==c||t[7]!==l?(u={title:`Network`,format:Xe,series:[c,l]},t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===i.packetsIn?d=t[10]:(d={label:`In`,color:`chart-2`,values:i.packetsIn},t[9]=i.packetsIn,t[10]=d);let f;t[11]===i.packetsOut?f=t[12]:(f={label:`Out`,color:`chart-5`,values:i.packetsOut},t[11]=i.packetsOut,t[12]=f);let p;t[13]!==d||t[14]!==f?(p={title:`Network packets`,format:qe,series:[d,f]},t[13]=d,t[14]=f,t[15]=p):p=t[15];let m;t[16]!==s||t[17]!==u||t[18]!==p?(m=[s,u,p],t[16]=s,t[17]=u,t[18]=p,t[19]=m):m=t[19];let h=m,g;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Live statistics need a running instance.`}),t[20]=g):g=t[20];let _=g;if(r){let e;t[21]===a?e=t[22]:(e=a===`live`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-2 animate-pulse rounded-full bg-success motion-reduce:animate-none`}),`Live`]}):(0,Q.jsx)(`output`,{className:`text-xs text-muted-foreground`,children:Kt[a]}),t[21]=a,t[22]=e),_=e}let v;t[23]===_?v=t[24]:(v=(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:_}),t[23]=_,t[24]=v);let y;t[25]!==o||t[26]!==i.times||t[27]!==h?(y=h.map(e=>(0,Q.jsx)(Ze,{format:e.format,live:o,max:e.max,series:e.series,since:`-5 min`,times:i.times,title:e.title},e.title)),t[25]=o,t[26]=i.times,t[27]=h,t[28]=y):y=t[28];let b;return t[29]!==v||t[30]!==y?(b=(0,Q.jsx)(q,{title:`Instance statistics`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[v,y]})}),t[29]=v,t[30]=y,t[31]=b):b=t[31],b}function $t(e){let t=(0,Z.c)(18),{instance:n}=e,r=n.InstanceId??``,i=n.State?.Name===`running`,a;t[0]===r?a=t[1]:(a=me(r),t[0]=r,t[1]=a);let{data:o,error:s,isFetching:c,refetch:l}=d(a),u=!i||c,f;t[2]===l?f=t[3]:(f=()=>{l()},t[2]=l,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(E,{"data-icon":`inline-start`}),t[4]=p):p=t[4];let m=c&&`Fetching…`,h=!c&&(o===void 0?`Fetch output`:`Refresh`),g;t[5]!==u||t[6]!==f||t[7]!==m||t[8]!==h?(g=(0,Q.jsxs)(L,{disabled:u,onClick:f,size:`sm`,variant:`outline`,children:[p,m,h]}),t[5]=u,t[6]=f,t[7]=m,t[8]=h,t[9]=g):g=t[9];let _;t[10]===s?_=t[11]:(_=s&&(0,Q.jsx)(Ee,{error:s}),t[10]=s,t[11]=_);let v;t[12]===o?v=t[13]:(v=o!==void 0&&(0,Q.jsx)(`div`,{className:`w-full`,children:(0,Q.jsx)(Re,{output:o||`(no output)`})}),t[12]=o,t[13]=v);let y;return t[14]!==g||t[15]!==_||t[16]!==v?(y=(0,Q.jsx)(q,{title:`Console output`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[g,_,v]})}),t[14]=g,t[15]=_,t[16]=v,t[17]=y):y=t[17],y}function en(e){let t=(0,Z.c)(44),{instance:n,name:r,tab:i,onTabChange:a,onClose:o,layout:s}=e,c=s===void 0?`auto`:s,l=n.InstanceId??``,u=c===`page`?`Back to instances`:`Close instance details`,d;t[0]!==l||t[1]!==c||t[2]!==i?(d=c===`auto`&&(0,Q.jsx)(p,{"aria-label":`Open instance page`,className:R({size:`icon-sm`,variant:`ghost`}),params:{id:l},search:{tab:i},to:`/ec2/describe-instances/$id`,children:(0,Q.jsx)(x,{})}),t[0]=l,t[1]=c,t[2]=i,t[3]=d):d=t[3];let f=r?l:void 0,m=n.State?.Name,h;t[4]===m?h=t[5]:(h=(0,Q.jsx)(Ne,{state:m}),t[4]=m,t[5]=h);let g;t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==a||t[10]!==i?(g=(0,Q.jsx)(Gt,{instance:n,layout:c,onTabChange:a,onTerminated:o,tab:i}),t[6]=n,t[7]=c,t[8]=o,t[9]=a,t[10]=i,t[11]=g):g=t[11];let _;t[12]!==h||t[13]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[h,g]}),t[12]=h,t[13]=g,t[14]=_):_=t[14];let v;t[15]===n?v=t[16]:(v={id:`overview`,label:`Overview`,icon:y,content:(0,Q.jsx)(pt,{instance:n})},t[15]=n,t[16]=v);let b=n.State?.Name===`running`,S;t[17]!==l||t[18]!==b?(S={id:`monitoring`,label:`Monitoring`,icon:kt,content:(0,Q.jsx)(Qt,{instanceId:l,running:b})},t[17]=l,t[18]=b,t[19]=S):S=t[19];let C;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(C=[`ec2`,`instances`],t[20]=C):C=t[20];let w;t[21]!==n.InstanceId||t[22]!==n.Tags?(w=(0,Q.jsx)(ze,{id:n.InstanceId,invalidate:C,tags:n.Tags}),t[21]=n.InstanceId,t[22]=n.Tags,t[23]=w):w=t[23];let T;t[24]===n?T=t[25]:(T=(0,Q.jsx)($t,{instance:n}),t[24]=n,t[25]=T);let E;t[26]!==w||t[27]!==T?(E={id:`settings`,label:`Settings`,icon:k,content:(0,Q.jsxs)(Q.Fragment,{children:[w,T]})},t[26]=w,t[27]=T,t[28]=E):E=t[28];let D;t[29]!==S||t[30]!==E||t[31]!==v?(D=[v,S,E],t[29]=S,t[30]=E,t[31]=v,t[32]=D):D=t[32];let O=r??l,A;return t[33]!==c||t[34]!==o||t[35]!==a||t[36]!==D||t[37]!==O||t[38]!==u||t[39]!==d||t[40]!==f||t[41]!==_||t[42]!==i?(A=(0,Q.jsx)(ee,{closeLabel:u,fullPage:d,label:`Instance details`,layout:c,onClose:o,onTabChange:a,subtitle:f,summary:_,tab:i,tabs:D,title:O}),t[33]=c,t[34]=o,t[35]=a,t[36]=D,t[37]=O,t[38]=u,t[39]=d,t[40]=f,t[41]=_,t[42]=i,t[43]=A):A=t[43],A}function tn(){return{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 run-instances`}}function nn(e){return j(`\\ - --count`,(e.count??0)||1)}function rn(e){return`'${e.replaceAll(`'`,String.raw`'\''`)}'`}function an(e){let t=e.name?.trim();return t?j(`\\ - --tag-specifications`,rn(JSON.stringify([{ResourceType:`instance`,Tags:[{Key:`Name`,Value:t}]}]))):[]}function on(e){let t=e.launchTemplateVersion||`$Default`;return{label:`Run Instances`,parts:[tn(),...j(`\\ - --launch-template`,`LaunchTemplateId=${e.launchTemplateId},Version=${t}`),...nn(e),...an(e)]}}function sn(e){return[tn(),...j(`\\ - --image-id`,P(e.imageId??``,`ImageId`)),...j(`\\ - --instance-type`,P(e.instanceType??``,`InstanceType`)),...j(`\\ - --key-name`,P(e.keyName??``,`KeyName`)),...A(`\\ - --subnet-id`,e.subnetId),...A(`\\ - --placement`,e.placementGroupName&&`GroupName=${e.placementGroupName}`),...nn(e),...an(e)]}function cn(e,t){return{label:`Create security group`,parts:M(`SG_ID`,`AWS_PROFILE=spinifex aws ec2 create-security-group`,[...j(`\\ - --group-name`,P(e.newSgName??``,`name`)),...j(`\\ - --description`,`'${e.newSgDescription||`Created by launch wizard`}'`),...j(`\\ - --vpc-id`,t??``)],`GroupId`)}}function ln(e){let t=oe(e);if(t.length===0)return;let n=JSON.stringify(t);return{label:`Authorize inbound rules`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 authorize-security-group-ingress`},...j(`\\ - --group-id`,`$SG_ID`),...j(`\\ - --ip-permissions`,`'${n}'`)]}}function un(e,t){if((e.securityGroupMode||`create`)!==`create`)return{commands:[],parts:A(`\\ - --security-group-ids`,e.securityGroupIds?.join(` `))};let n=ln(e);return{commands:[cn(e,t),...n?[n]:[]],parts:j(`\\ - --security-group-ids`,`$SG_ID`)}}function dn(e){let{rootDeleteOnTermination:t,rootVolumeSize:n,rootVolumeType:r}=e;if(n===void 0&&r===void 0&&t===void 0)return[];let i={VolumeSize:n,VolumeType:r||void 0,DeleteOnTermination:t},a=JSON.stringify([{DeviceName:e.rootDeviceName||`/dev/sda1`,Ebs:i}]);return j(`\\ - --block-device-mappings`,`'${a}'`)}function fn(e,t){if(e.launchTemplateId)return[on(e)];let n=un(e,t),r=[...sn(e),...n.parts,...dn(e)];return[...n.commands,{label:`Run Instances`,parts:r}]}var pn=new Map([[`alpine`,`/assets/alpine-Bcmoufgu.svg`],[`centos`,`/assets/centos-BBbnm4JZ.svg`],[`debian`,`/assets/debian-B_qSwqdF.svg`],[`rocky`,`/assets/rocky-DkVCjoIs.svg`],[`ubuntu`,`/assets/ubuntu-6CTPzEln.svg`]]);function mn(e){let t=(0,Z.c)(11),{distro:n,size:r}=e,i=(r===void 0?`md`:r)===`md`?`size-8`:`size-5`;if(!n){let e=`${i} text-muted-foreground`,n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(Nt,{"aria-hidden":!0,className:e}),t[0]=e,t[1]=n),n}let a;t[2]===n?a=t[3]:(a=pn.get(n),t[2]=n,t[3]=a);let o=a;if(!o){let e=`${i} text-muted-foreground`,r;return t[4]!==n||t[5]!==e?(r=(0,Q.jsx)(O,{"aria-hidden":!0,className:e,"data-distro":n}),t[4]=n,t[5]=e,t[6]=r):r=t[6],r}let s=`${i} object-contain`,c;return t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,Q.jsx)(`img`,{alt:``,className:s,"data-distro":n,src:o}),t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}var hn=`other`;function gn(e){let t=(0,Z.c)(28),{images:n,arch:r,value:i,onChange:u,invalid:d}=e,f,p,m,h,g,_,v;if(t[0]!==r||t[1]!==n||t[2]!==d||t[3]!==u||t[4]!==i){v=Symbol.for(`react.early_return_sentinel`);bb0:{f=ot(n,r);let e;t[12]===i?e=t[13]:(e=e=>e.ImageId===i,t[12]=i,t[13]=e),p=n.find(e);let y=gt(p?.Name);y&&f.distros.some(e=>e.distro===y.distro)?m=y.distro:p&&f.other.includes(p)&&(m=hn);let b=f.distros.find(e=>e.distro===m);if(f.distros.length===0&&f.other.length===0){let e=r?` for ${r}`:``,n;t[14]===e?n=t[15]:(n=(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No images are available`,e,`.`]}),t[14]=e,t[15]=n),v=n;break bb0}h=`flex flex-col gap-3`,g=(0,Q.jsxs)(wt,{label:`Operating system`,children:[f.distros.map(e=>(0,Q.jsx)(Tt,{checked:e.distro===m,icon:(0,Q.jsx)(mn,{distro:e.distro}),label:at(e.distro),onSelect:()=>{let t=e.versions[0]?.image.ImageId;t&&u(t)}},e.distro)),f.other.length>0&&(0,Q.jsx)(Tt,{checked:m===hn,icon:(0,Q.jsx)(mn,{}),label:`Other images`,onSelect:()=>{let e=f.other[0]?.ImageId;e&&u(e)}})]}),_=b&&(0,Q.jsxs)(K,{children:[(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageVersion`,children:`Version`})}),(0,Q.jsxs)(l,{onValueChange:e=>{u(e??``)},value:i,children:[(0,Q.jsx)(c,{"aria-invalid":d,className:`w-full`,id:`imageVersion`,children:(0,Q.jsx)(a,{children:y&&`${at(y.distro)} ${y.version}`})}),(0,Q.jsx)(s,{children:b.versions.map((e,t)=>{let{image:n,version:r}=e;return(0,Q.jsxs)(o,{value:n.ImageId??``,children:[at(b.distro),` `,r,t===0?` (latest)`:``]},n.ImageId)})})]}),(0,Q.jsx)(vn,{image:p})]})}t[0]=r,t[1]=n,t[2]=d,t[3]=u,t[4]=i,t[5]=f,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_,t[11]=v}else f=t[5],p=t[6],m=t[7],h=t[8],g=t[9],_=t[10],v=t[11];if(v!==Symbol.for(`react.early_return_sentinel`))return v;let y;t[16]!==f||t[17]!==d||t[18]!==u||t[19]!==p||t[20]!==m||t[21]!==i?(y=m===hn&&(0,Q.jsxs)(K,{children:[(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageId`,children:`Image`})}),(0,Q.jsxs)(l,{onValueChange:e=>{u(e??``)},value:i,children:[(0,Q.jsx)(c,{"aria-invalid":d,className:`w-full`,id:`imageId`,children:(0,Q.jsx)(a,{children:p?.Name??p?.ImageId})}),(0,Q.jsx)(s,{children:f.other.map(_n)})]}),(0,Q.jsx)(vn,{image:p})]}),t[16]=f,t[17]=d,t[18]=u,t[19]=p,t[20]=m,t[21]=i,t[22]=y):y=t[22];let b;return t[23]!==h||t[24]!==g||t[25]!==_||t[26]!==y?(b=(0,Q.jsxs)(`div`,{className:h,children:[g,_,y]}),t[23]=h,t[24]=g,t[25]=_,t[26]=y,t[27]=b):b=t[27],b}function _n(e){return(0,Q.jsx)(o,{value:e.ImageId??``,children:e.Name??e.ImageId},e.ImageId)}function vn(e){let t=(0,Z.c)(6),{image:n}=e;if(!n)return null;let r;t[0]===n.ImageId?r=t[1]:(r=(0,Q.jsx)(`span`,{className:`font-mono`,children:n.ImageId}),t[0]=n.ImageId,t[1]=r);let i=n.Architecture&&` · ${n.Architecture}`,a=n.BootMode&&` · ${n.BootMode}`,o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,Q.jsxs)(W,{children:[r,i,a]}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}var yn=new Map([[`af-south-1`,{country:`ZA`,city:`Cape Town`}],[`ap-east-1`,{country:`HK`,city:`Hong Kong`}],[`ap-east-2`,{country:`TW`,city:`Taipei`}],[`ap-northeast-1`,{country:`JP`,city:`Tokyo`}],[`ap-northeast-2`,{country:`KR`,city:`Seoul`}],[`ap-northeast-3`,{country:`JP`,city:`Osaka`}],[`ap-south-1`,{country:`IN`,city:`Mumbai`}],[`ap-south-2`,{country:`IN`,city:`Hyderabad`}],[`ap-southeast-1`,{country:`SG`,city:`Singapore`}],[`ap-southeast-2`,{country:`AU`,city:`Sydney`}],[`ap-southeast-3`,{country:`ID`,city:`Jakarta`}],[`ap-southeast-4`,{country:`AU`,city:`Melbourne`}],[`ap-southeast-5`,{country:`MY`,city:`Malaysia`}],[`ap-southeast-6`,{country:`NZ`,city:`New Zealand`}],[`ap-southeast-7`,{country:`TH`,city:`Thailand`}],[`ca-central-1`,{country:`CA`,city:`Central`}],[`ca-west-1`,{country:`CA`,city:`Calgary`}],[`cn-north-1`,{country:`CN`,city:`Beijing`}],[`cn-northwest-1`,{country:`CN`,city:`Ningxia`}],[`eu-central-1`,{country:`DE`,city:`Frankfurt`}],[`eu-central-2`,{country:`CH`,city:`Zurich`}],[`eu-north-1`,{country:`SE`,city:`Stockholm`}],[`eu-south-1`,{country:`IT`,city:`Milan`}],[`eu-south-2`,{country:`ES`,city:`Spain`}],[`eu-west-1`,{country:`IE`,city:`Ireland`}],[`eu-west-2`,{country:`GB`,city:`London`}],[`eu-west-3`,{country:`FR`,city:`Paris`}],[`il-central-1`,{country:`IL`,city:`Tel Aviv`}],[`me-central-1`,{country:`AE`,city:`UAE`}],[`me-south-1`,{country:`BH`,city:`Bahrain`}],[`mx-central-1`,{country:`MX`,city:`Mexico`}],[`sa-east-1`,{country:`BR`,city:`São Paulo`}],[`us-east-1`,{country:`US`,city:`N. Virginia`}],[`us-east-2`,{country:`US`,city:`Ohio`}],[`us-gov-east-1`,{country:`US`,city:`GovCloud (US-East)`}],[`us-gov-west-1`,{country:`US`,city:`GovCloud (US-West)`}],[`us-west-1`,{country:`US`,city:`N. California`}],[`us-west-2`,{country:`US`,city:`Oregon`}]]);function bn(e){return e?yn.get(e.toLowerCase()):void 0}function $(e,t,n,r=5){let i=n*.45,a=[];for(let o=0;o(0,Q.jsx)(`rect`,{fill:e,height:t,width:30,y:n*t},`${e}-${n}`))}function Sn(...e){let t=30/e.length;return e.map((e,n)=>(0,Q.jsx)(`rect`,{fill:e,height:20,width:t,x:n*t},`${e}-${n}`))}function Cn(e,t){return(0,Q.jsxs)(`g`,{children:[(0,Q.jsx)(`rect`,{fill:`#012169`,height:t,width:e}),(0,Q.jsx)(`path`,{d:`M0,0 L${e},${t} M${e},0 L0,${t}`,stroke:`#fff`,strokeWidth:t/5}),(0,Q.jsx)(`path`,{d:`M0,0 L${e},${t} M${e},0 L0,${t}`,stroke:`#C8102E`,strokeWidth:t/15}),(0,Q.jsx)(`path`,{d:`M${e/2},0 V${t} M0,${t/2} H${e}`,stroke:`#fff`,strokeWidth:t/3}),(0,Q.jsx)(`path`,{d:`M${e/2},0 V${t} M0,${t/2} H${e}`,stroke:`#C8102E`,strokeWidth:t/5})]})}var wn={AE:()=>(0,Q.jsxs)(Q.Fragment,{children:[xn(`#00732F`,`#fff`,`#000`),(0,Q.jsx)(`rect`,{fill:`#FF0000`,height:20,width:8})]}),AU:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#012169`,height:20,width:30}),Cn(15,10),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(7.5,15,2.6,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(22.5,4,1.2,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(19,9,1.2,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(26,8,1.2,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(22.5,16,1.4,7)})]}),BH:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#CE1126`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:`0,0 8,0 11,2 8,4 11,6 8,8 11,10 8,12 11,14 8,16 11,18 8,20 0,20`})]}),BR:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#009C3B`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#FFDF00`,points:`15,2.5 27,10 15,17.5 3,10`}),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`#002776`,r:4.5})]}),CA:()=>(0,Q.jsxs)(Q.Fragment,{children:[Sn(`#D80621`,`#fff`,`#fff`,`#D80621`),(0,Q.jsx)(`polygon`,{fill:`#D80621`,points:$(15,10,5,5)})]}),CH:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#DA291C`,height:20,width:30}),(0,Q.jsx)(`path`,{d:`M15,4 V16 M9,10 H21`,stroke:`#fff`,strokeWidth:3.5})]}),CN:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#EE1C25`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(6,6,3.5)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(11,2.5,1)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(13,5,1)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(13,8.5,1)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(11,11,1)})]}),DE:()=>(0,Q.jsx)(Q.Fragment,{children:xn(`#000`,`#DD0000`,`#FFCE00`)}),ES:()=>(0,Q.jsx)(Q.Fragment,{children:xn(`#AA151B`,`#F1BF00`,`#F1BF00`,`#AA151B`)}),FR:()=>(0,Q.jsx)(Q.Fragment,{children:Sn(`#002395`,`#fff`,`#ED2939`)}),GB:()=>(0,Q.jsx)(Q.Fragment,{children:Cn(30,20)}),HK:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#DE2910`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(15,10,6,5)})]}),ID:()=>(0,Q.jsx)(Q.Fragment,{children:xn(`#CE1126`,`#fff`)}),IE:()=>(0,Q.jsx)(Q.Fragment,{children:Sn(`#169B62`,`#fff`,`#FF883E`)}),IL:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#fff`,height:20,width:30}),(0,Q.jsx)(`rect`,{fill:`#0038B8`,height:2.5,width:30,y:2}),(0,Q.jsx)(`rect`,{fill:`#0038B8`,height:2.5,width:30,y:15.5}),(0,Q.jsx)(`polygon`,{fill:`none`,points:`15,5.5 19,12.5 11,12.5`,stroke:`#0038B8`,strokeWidth:1}),(0,Q.jsx)(`polygon`,{fill:`none`,points:`15,14.5 19,7.5 11,7.5`,stroke:`#0038B8`,strokeWidth:1})]}),IN:()=>(0,Q.jsxs)(Q.Fragment,{children:[xn(`#FF9933`,`#fff`,`#138808`),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`none`,r:2.6,stroke:`#000080`,strokeWidth:.8})]}),IT:()=>(0,Q.jsx)(Q.Fragment,{children:Sn(`#009246`,`#fff`,`#CE2B37`)}),JP:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#fff`,height:20,width:30}),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`#BC002D`,r:6})]}),KR:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#fff`,height:20,width:30}),(0,Q.jsx)(`path`,{d:`M10,10 A5,5 0 0 1 20,10 Z`,fill:`#CD2E3A`}),(0,Q.jsx)(`path`,{d:`M10,10 A5,5 0 0 0 20,10 Z`,fill:`#0047A0`})]}),MX:()=>(0,Q.jsxs)(Q.Fragment,{children:[Sn(`#006847`,`#fff`,`#CE1126`),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`#8C5A2B`,r:2.6})]}),MY:()=>(0,Q.jsxs)(Q.Fragment,{children:[xn(`#CC0001`,`#fff`,`#CC0001`,`#fff`,`#CC0001`,`#fff`,`#CC0001`),(0,Q.jsx)(`rect`,{fill:`#010066`,height:11.4,width:15}),(0,Q.jsx)(`circle`,{cx:6,cy:5.7,fill:`#FFCC00`,r:3.6}),(0,Q.jsx)(`circle`,{cx:7.4,cy:5.7,fill:`#010066`,r:3}),(0,Q.jsx)(`polygon`,{fill:`#FFCC00`,points:$(11.5,5.7,2.4,7)})]}),NZ:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#012169`,height:20,width:30}),Cn(15,10),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(22.5,4,1.4)}),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(19.5,9.5,1.4)}),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(25.5,8.5,1.4)}),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(22.5,16,1.6)})]}),SE:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#006AA7`,height:20,width:30}),(0,Q.jsx)(`path`,{d:`M11,0 V20 M0,10 H30`,stroke:`#FECC00`,strokeWidth:4})]}),SG:()=>(0,Q.jsxs)(Q.Fragment,{children:[xn(`#EF3340`,`#fff`),(0,Q.jsx)(`circle`,{cx:6.5,cy:5,fill:`#fff`,r:3.4}),(0,Q.jsx)(`circle`,{cx:8,cy:5,fill:`#EF3340`,r:3.2})]}),TH:()=>(0,Q.jsx)(Q.Fragment,{children:xn(`#A51931`,`#F4F5F8`,`#2D2A4A`,`#2D2A4A`,`#F4F5F8`,`#A51931`)}),TW:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#FE0000`,height:20,width:30}),(0,Q.jsx)(`rect`,{fill:`#000095`,height:10,width:15}),(0,Q.jsx)(`circle`,{cx:7.5,cy:5,fill:`#fff`,r:2.8})]}),US:()=>(0,Q.jsxs)(Q.Fragment,{children:[xn(`#B22234`,`#fff`,`#B22234`,`#fff`,`#B22234`,`#fff`,`#B22234`),(0,Q.jsx)(`rect`,{fill:`#3C3B6E`,height:11.4,width:13})]}),ZA:()=>(0,Q.jsxs)(Q.Fragment,{children:[xn(`#E03C31`,`#001489`),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:`0,0 4,0 14,8 30,8 30,12 14,12 4,20 0,20`}),(0,Q.jsx)(`polygon`,{fill:`#007749`,points:`0,1.5 2,0 4,0 13,7 30,7 30,13 13,13 4,20 2,20 0,18.5`}),(0,Q.jsx)(`polygon`,{fill:`#FFB81C`,points:`0,3.5 9,10 0,16.5`}),(0,Q.jsx)(`polygon`,{fill:`#000`,points:`0,5 7,10 0,15`})]})};function Tn(e){let t=(0,Z.c)(6),{country:n}=e;if(!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(b,{"aria-hidden":!0,className:`size-5 text-muted-foreground`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=wn[n](),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,Q.jsx)(`svg`,{"aria-hidden":!0,className:`h-4 w-6 shrink-0 overflow-hidden rounded-xs ring-1 ring-border`,"data-country":n,viewBox:`0 0 30 20`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function En(e){let t=(0,Z.c)(11),{region:n,availabilityZone:r}=e,i;t[0]===n?i=t[1]:(i=bn(n),t[0]=n,t[1]=i);let a=i,o=a?.city,s=r??`zone set by subnet`,c;t[2]!==o||t[3]!==s?(c=[o,s].filter(Boolean),t[2]=o,t[3]=s,t[4]=c):c=t[4];let l=c.join(` · `),u=a?.country,d;t[5]===u?d=t[6]:(d=(0,Q.jsx)(Tn,{country:u}),t[5]=u,t[6]=d);let f;return t[7]!==n||t[8]!==l||t[9]!==d?(f=(0,Q.jsx)(wt,{columns:2,label:`Location`,children:(0,Q.jsx)(Tt,{checked:!0,description:l,icon:d,label:n,layout:`inline`})}),t[7]=n,t[8]=l,t[9]=d,t[10]=f):f=t[10],f}var Dn=`gp3`,On=1,kn=16384,An=`default`,jn=[{name:`allowPing`,label:`Allow ping`,text:`Ping (ICMP echo request)`},{name:`allowSsh`,label:`Allow SSH`,text:`SSH (tcp/22)`},{name:`allowHttp`,label:`Allow HTTP`,text:`HTTP (tcp/80)`},{name:`allowHttps`,label:`Allow HTTPS`,text:`HTTPS (tcp/443)`}];function Mn(e){let t=(0,Z.c)(16),{control:n,errors:r,instanceTypeCapacity:i,register:a}=e,o;t[0]===n?o=t[1]:(o={control:n,name:`instanceType`},t[0]=n,t[1]=o);let s=vt(o),c=s?i[s]:void 0,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`count`,children:`Number of Instances`})}),t[2]=l):l=t[2];let u=!!r.count,d;t[3]===a?d=t[4]:(d=a(`count`,{valueAsNumber:!0}),t[3]=a,t[4]=d);let f;t[5]!==u||t[6]!==d?(f=(0,Q.jsx)(H,{"aria-describedby":`count-description`,"aria-invalid":u,id:`count`,type:`number`,...d}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p=s&&c!==void 0&&`Available capacity for ${s}: ${c}`,m;t[8]===p?m=t[9]:(m=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,id:`count-description`,children:p}),t[8]=p,t[9]=m);let h;t[10]===r.count?h=t[11]:(h=(0,Q.jsx)(G,{errors:[r.count]}),t[10]=r.count,t[11]=h);let g;return t[12]!==f||t[13]!==m||t[14]!==h?(g=(0,Q.jsxs)(K,{children:[l,f,m,h]}),t[12]=f,t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function Nn(e){let t=(0,Z.c)(13),{control:n,countField:r,launchTemplates:i,selectedTemplateId:u}=e,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`launchTemplateId`,children:`Launch Template`}),(0,Q.jsx)(_,{label:`Launch template`,children:`A template supplies the image, instance type, key pair and network settings, so those fields are hidden while one is chosen.`})]}),t[0]=d):d=t[0];let f;t[1]===i?f=t[2]:(f=e=>{let{field:t}=e;return(0,Q.jsxs)(l,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,Q.jsx)(c,{className:`w-full`,id:`launchTemplateId`,children:(0,Q.jsx)(a,{})}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(o,{value:`none`,children:`none`}),i.map(Pn)]})]})},t[1]=i,t[2]=f);let p;t[3]!==n||t[4]!==f?(p=(0,Q.jsxs)(K,{children:[d,(0,Q.jsx)(bt,{control:n,name:`launchTemplateId`,render:f})]}),t[3]=n,t[4]=f,t[5]=p):p=t[5];let m;t[6]!==n||t[7]!==u?(m=u&&(0,Q.jsx)(Fn,{control:n,templateId:u}),t[6]=n,t[7]=u,t[8]=m):m=t[8];let h=u&&r,g;return t[9]!==p||t[10]!==m||t[11]!==h?(g=(0,Q.jsx)(q,{title:`Launch template`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p,m,h]})}),t[9]=p,t[10]=m,t[11]=h,t[12]=g):g=t[12],g}function Pn(e){return(0,Q.jsx)(o,{value:e.LaunchTemplateId??``,children:e.LaunchTemplateName??e.LaunchTemplateId},e.LaunchTemplateId)}function Fn(e){let t=(0,Z.c)(23),{control:n,templateId:r}=e,i;t[0]===n?i=t[1]:(i={control:n,name:`launchTemplateVersion`},t[0]=n,t[1]=i);let u=vt(i),f;t[2]===r?f=t[3]:(f=pe(r),t[2]=r,t[3]=f);let p=!!r,m;t[4]!==f||t[5]!==p?(m={...f,enabled:p},t[4]=f,t[5]=p,t[6]=m):m=t[6];let h=d(m),g;t[7]===h.data?.LaunchTemplateVersions?g=t[8]:(g=h.data?.LaunchTemplateVersions??[],t[7]=h.data?.LaunchTemplateVersions,t[8]=g);let _=g,v;t[9]!==u||t[10]!==_?(v=nt(_,u)?.LaunchTemplateData,t[9]=u,t[10]=_,t[11]=v):v=t[11];let y=v,b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`launchTemplateVersion`,children:`Version`})}),t[12]=b):b=t[12];let x;t[13]===_?x=t[14]:(x=e=>{let{field:t}=e;return(0,Q.jsxs)(l,{onValueChange:t.onChange,value:t.value??`$Default`,children:[(0,Q.jsx)(c,{className:`w-full`,id:`launchTemplateVersion`,children:(0,Q.jsx)(a,{})}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(o,{value:`$Default`,children:`$Default`}),(0,Q.jsx)(o,{value:`$Latest`,children:`$Latest`}),_.map(In)]})]})},t[13]=_,t[14]=x);let S;t[15]!==n||t[16]!==x?(S=(0,Q.jsx)(bt,{control:n,name:`launchTemplateVersion`,render:x}),t[15]=n,t[16]=x,t[17]=S):S=t[17];let C;t[18]===y?C=t[19]:(C=y&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-1 rounded-md border border-border p-3 text-xs`,children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`Configuration from this version:`}),(0,Q.jsxs)(`p`,{children:[`Image:`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:y.ImageId??`—`})]}),(0,Q.jsxs)(`p`,{children:[`Instance type:`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:y.InstanceType??`—`})]}),(0,Q.jsxs)(`p`,{children:[`Key pair:`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:y.KeyName??`—`})]})]}),t[18]=y,t[19]=C);let w;return t[20]!==C||t[21]!==S?(w=(0,Q.jsxs)(K,{children:[b,S,C]}),t[20]=C,t[21]=S,t[22]=w):w=t[22],w}function In(e){return(0,Q.jsxs)(o,{value:String(e.VersionNumber),children:[`v`,e.VersionNumber]},e.VersionNumber)}function Ln(e){let t=(0,Z.c)(21),{arch:n,architectures:r,control:i,errors:a,images:o,onSelectArchitecture:s,onSelectImage:c}=e,l;t[0]===i?l=t[1]:(l={control:i,name:`imageId`},t[0]=i,t[1]=l);let u=vt(l),d;t[2]!==n||t[3]!==r||t[4]!==s?(d=r.length>1&&(0,Q.jsxs)(K,{children:[(0,Q.jsxs)(V,{children:[`Architecture`,(0,Q.jsx)(_,{label:`Architecture`,children:`An instance type runs one architecture, so choosing one narrows both the images and the instance types to those that can run together.`})]}),(0,Q.jsx)(wt,{columns:2,label:`Architecture`,children:r.map(e=>(0,Q.jsx)(Tt,{checked:n===e,description:e===`arm64`?`64-bit Arm`:`64-bit x86`,icon:(0,Q.jsx)(jt,{"aria-hidden":!0,className:`size-5 text-muted-foreground`}),label:e,layout:`inline`,onSelect:()=>{s(e)}},e))})]}),t[2]=n,t[3]=r,t[4]=s,t[5]=d):d=t[5];let f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(V,{children:`Operating system`}),t[6]=f):f=t[6];let p=!!a.imageId,m=u??``,h;t[7]!==n||t[8]!==o||t[9]!==c||t[10]!==p||t[11]!==m?(h=(0,Q.jsx)(gn,{arch:n,images:o,invalid:p,onChange:c,value:m}),t[7]=n,t[8]=o,t[9]=c,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]===a.imageId?g=t[14]:(g=(0,Q.jsx)(G,{errors:[a.imageId]}),t[13]=a.imageId,t[14]=g);let v;t[15]!==h||t[16]!==g?(v=(0,Q.jsxs)(K,{children:[f,h,g]}),t[15]=h,t[16]=g,t[17]=v):v=t[17];let y;return t[18]!==d||t[19]!==v?(y=(0,Q.jsx)(q,{title:`Image`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[d,v]})}),t[18]=d,t[19]=v,t[20]=y):y=t[20],y}function Rn(e){let t=(0,Z.c)(27),{allInstanceTypes:n,arch:r,archTypeNames:i,archTypes:a,control:o,countField:s,errors:c,hasCompute:l,instanceTypeCapacity:u,keyPairs:d,placementGroups:f,register:p}=e,m=c.name,h;t[0]===p?h=t[1]:(h=p(`name`),t[0]=p,t[1]=h);let g;t[2]!==c.name||t[3]!==h?(g=(0,Q.jsx)(Et,{autoComplete:`off`,error:m,id:`instance-name`,info:`A Name tag, to tell instances apart in lists and search.`,label:`Name (optional)`,placeholder:`web-1`,...h}),t[2]=c.name,t[3]=h,t[4]=g):g=t[4];let _;t[5]!==n||t[6]!==r||t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u?(_=(0,Q.jsx)(zn,{allInstanceTypes:n,arch:r,archTypeNames:i,archTypes:a,control:o,errors:c,hasCompute:l,instanceTypeCapacity:u}),t[5]=n,t[6]=r,t[7]=i,t[8]=a,t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=_):_=t[13];let v;t[14]!==o||t[15]!==c||t[16]!==d?(v=(0,Q.jsx)(Vn,{control:o,errors:c,keyPairs:d}),t[14]=o,t[15]=c,t[16]=d,t[17]=v):v=t[17];let y;t[18]!==o||t[19]!==f?(y=(0,Q.jsx)(Un,{control:o,placementGroups:f}),t[18]=o,t[19]=f,t[20]=y):y=t[20];let b;return t[21]!==s||t[22]!==g||t[23]!==_||t[24]!==v||t[25]!==y?(b=(0,Q.jsx)(q,{title:`Instance`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[g,_,s,v,y]})}),t[21]=s,t[22]=g,t[23]=_,t[24]=v,t[25]=y,t[26]=b):b=t[26],b}function zn(e){let t=(0,Z.c)(43),{allInstanceTypes:n,arch:r,archTypeNames:i,archTypes:a,control:o,errors:s,hasCompute:c,instanceTypeCapacity:l}=e,u;t[0]===o?u=t[1]:(u={control:o,name:`instanceType`},t[0]=o,t[1]=u);let d=vt(u),f,p,m,h,g,v;if(t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a||t[6]!==o||t[7]!==s.instanceType||t[8]!==c||t[9]!==l||t[10]!==d){let e;t[17]===d?e=t[18]:(e=e=>e.InstanceType===d,t[17]=d,t[18]=e);let u=n.find(e);p=u?.GpuInfo?.Gpus?.[0],f=K,t[19]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`}),(0,Q.jsx)(_,{label:`Instance type`,children:`vCPUs and memory for the instance, with the free capacity for each type. Only types that can run the chosen image's architecture are listed.`})]}),t[19]=m):m=t[19];let y;t[20]!==a||t[21]!==s.instanceType||t[22]!==l?(y=e=>{let{field:t}=e;return(0,Q.jsx)(Ue,{"aria-invalid":!!s.instanceType,availabilityByType:l,className:`w-full`,id:`instanceType`,instanceTypes:a,onValueChange:t.onChange,value:t.value??``})},t[20]=a,t[21]=s.instanceType,t[22]=l,t[23]=y):y=t[23],t[24]!==o||t[25]!==y?(h=(0,Q.jsx)(bt,{control:o,name:`instanceType`,render:y}),t[24]=o,t[25]=y,t[26]=h):h=t[26],t[27]!==r||t[28]!==i||t[29]!==c?(g=c&&i.length===0&&r&&(0,Q.jsxs)(W,{children:[`No instance types on this cluster run `,r,`.`]}),t[27]=r,t[28]=i,t[29]=c,t[30]=g):g=t[30],v=u&&(0,Q.jsx)(W,{"data-testid":`instance-type-size`,children:St(u)}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o,t[7]=s.instanceType,t[8]=c,t[9]=l,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h,t[15]=g,t[16]=v}else f=t[11],p=t[12],m=t[13],h=t[14],g=t[15],v=t[16];let y;t[31]===p?y=t[32]:(y=p&&(0,Q.jsx)(Bn,{device:p}),t[31]=p,t[32]=y);let b;t[33]===s.instanceType?b=t[34]:(b=(0,Q.jsx)(G,{errors:[s.instanceType]}),t[33]=s.instanceType,t[34]=b);let x;return t[35]!==f||t[36]!==m||t[37]!==h||t[38]!==g||t[39]!==v||t[40]!==y||t[41]!==b?(x=(0,Q.jsxs)(f,{children:[m,h,g,v,y,b]}),t[35]=f,t[36]=m,t[37]=h,t[38]=g,t[39]=v,t[40]=y,t[41]=b,t[42]=x):x=t[42],x}function Bn(e){let t=(0,Z.c)(8),{device:n}=e,r;t[0]===n.Name?r=t[1]:(r=n.Name?.startsWith(`MIG `)?n.Name.slice(4):void 0,t[0]=n.Name,t[1]=r);let a=r,o;t[2]===n.MemoryInfo?o=t[3]:(o=n.MemoryInfo?.SizeInMiB!==void 0&&` · ${i(n.MemoryInfo.SizeInMiB)} VRAM`,t[2]=n.MemoryInfo,t[3]=o);let s=a&&` · MIG ${a} slice`,c;return t[4]!==n.Name||t[5]!==o||t[6]!==s?(c=(0,Q.jsxs)(W,{children:[`GPU: `,n.Name,o,s]}),t[4]=n.Name,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Vn(e){let t=(0,Z.c)(12),{control:n,errors:r,keyPairs:i}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair`})}),t[0]=o):o=t[0];let u;t[1]!==r.keyName||t[2]!==i?(u=e=>{let{field:t}=e;return(0,Q.jsxs)(l,{onValueChange:t.onChange,value:t.value??``,children:[(0,Q.jsx)(c,{"aria-invalid":!!r.keyName,className:`w-full`,id:`keyName`,children:(0,Q.jsx)(a,{})}),(0,Q.jsx)(s,{children:i.map(Hn)})]})},t[1]=r.keyName,t[2]=i,t[3]=u):u=t[3];let d;t[4]!==n||t[5]!==u?(d=(0,Q.jsx)(bt,{control:n,name:`keyName`,render:u}),t[4]=n,t[5]=u,t[6]=d):d=t[6];let f;t[7]===r.keyName?f=t[8]:(f=(0,Q.jsx)(G,{errors:[r.keyName]}),t[7]=r.keyName,t[8]=f);let p;return t[9]!==d||t[10]!==f?(p=(0,Q.jsxs)(K,{children:[o,d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11],p}function Hn(e){return(0,Q.jsx)(o,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function Un(e){let t=(0,Z.c)(8),{control:n,placementGroups:r}=e,i;t[0]===r?i=t[1]:(i=r.filter(Gn),t[0]=r,t[1]=i);let u=i;if(u.length===0)return null;let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`placementGroupName`,children:`Placement Group`})}),t[2]=d):d=t[2];let f;t[3]===u?f=t[4]:(f=e=>{let{field:t}=e;return(0,Q.jsxs)(l,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,Q.jsx)(c,{className:`w-full`,id:`placementGroupName`,children:(0,Q.jsx)(a,{})}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(o,{value:`none`,children:`none`}),u.map(Wn)]})]})},t[3]=u,t[4]=f);let p;return t[5]!==n||t[6]!==f?(p=(0,Q.jsxs)(K,{children:[d,(0,Q.jsx)(bt,{control:n,name:`placementGroupName`,render:f})]}),t[5]=n,t[6]=f,t[7]=p):p=t[7],p}function Wn(e){return(0,Q.jsxs)(o,{value:e.GroupName??``,children:[e.GroupName,` (`,e.Strategy,`)`]},e.GroupId)}function Gn(e){return e.State===void 0||e.State===`available`}function Kn(e){let t=(0,Z.c)(21),{control:n,defaultSubnet:r,effectiveSubnet:i,effectiveVpcId:a,errors:o,otherSubnets:s,register:c,securityGroups:l,selectedSubnetId:u,setValue:d}=e,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsxs)(V,{children:[`Location`,(0,Q.jsx)(_,{label:`Location`,children:`The region this cluster serves. The availability zone comes from the subnet the instance launches into.`})]}),t[0]=f):f=t[0];let p=i?.AvailabilityZone,m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=te(),t[1]=m):m=t[1];let h;t[2]===p?h=t[3]:(h=(0,Q.jsxs)(K,{children:[f,(0,Q.jsx)(En,{availabilityZone:p,region:m})]}),t[2]=p,t[3]=h);let g;t[4]!==n||t[5]!==r||t[6]!==i||t[7]!==s||t[8]!==u?(g=(0,Q.jsx)(qn,{control:n,defaultSubnet:r,effectiveSubnet:i,otherSubnets:s,selectedSubnetId:u}),t[4]=n,t[5]=r,t[6]=i,t[7]=s,t[8]=u,t[9]=g):g=t[9];let v;t[10]!==n||t[11]!==a||t[12]!==o||t[13]!==c||t[14]!==l||t[15]!==d?(v=(0,Q.jsx)(Yn,{control:n,effectiveVpcId:a,errors:o,register:c,securityGroups:l,setValue:d}),t[10]=n,t[11]=a,t[12]=o,t[13]=c,t[14]=l,t[15]=d,t[16]=v):v=t[16];let y;return t[17]!==h||t[18]!==g||t[19]!==v?(y=(0,Q.jsx)(q,{title:`Network`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[h,g,v]})}),t[17]=h,t[18]=g,t[19]=v,t[20]=y):y=t[20],y}function qn(e){let t=(0,Z.c)(16),{control:n,defaultSubnet:r,effectiveSubnet:i,otherSubnets:u,selectedSubnetId:d}=e,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`subnetId`,children:`Subnet`}),(0,Q.jsx)(_,{label:`Subnet`,children:`With no subnet chosen, EC2 places the instance in the default VPC's default subnet. It gets a private address there, and other instances in the VPC can reach it as its security groups allow. It gets a public address only if the subnet assigns one on launch.`})]}),t[0]=f):f=t[0];let p;t[1]!==r||t[2]!==i||t[3]!==u||t[4]!==d?(p=e=>{let{field:t}=e;return(0,Q.jsxs)(l,{onValueChange:e=>{t.onChange(e===An?void 0:e)},value:t.value??An,children:[(0,Q.jsx)(c,{className:`w-full`,id:`subnetId`,children:(0,Q.jsx)(a,{children:i?`${d?``:`Default: `}${rt(i)}`:`No subnet`})}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(o,{value:An,children:r?`Default: ${rt(r)}`:`No subnet`}),u.map(Jn)]})]})},t[1]=r,t[2]=i,t[3]=u,t[4]=d,t[5]=p):p=t[5];let m;t[6]!==n||t[7]!==p?(m=(0,Q.jsx)(bt,{control:n,name:`subnetId`,render:p}),t[6]=n,t[7]=p,t[8]=m):m=t[8];let h;t[9]===i?h=t[10]:(h=i?it(i):`This account has no default subnet, so an instance launched without one gets no VPC network interface. Choose a subnet.`,t[9]=i,t[10]=h);let g;t[11]===h?g=t[12]:(g=(0,Q.jsx)(W,{children:h}),t[11]=h,t[12]=g);let v;return t[13]!==m||t[14]!==g?(v=(0,Q.jsxs)(K,{children:[f,m,g]}),t[13]=m,t[14]=g,t[15]=v):v=t[15],v}function Jn(e){return(0,Q.jsx)(o,{value:e.SubnetId??``,children:rt(e)},e.SubnetId)}function Yn(e){let t=(0,Z.c)(22),{control:n,effectiveVpcId:r,errors:i,register:a,securityGroups:o,setValue:s}=e,c;t[0]===n?c=t[1]:(c={control:n,name:`securityGroupMode`},t[0]=n,t[1]=c);let l=vt(c),u=vt({control:n,name:`securityGroupIds`})??[],d;t[2]!==r||t[3]!==o?(d=r?o.filter(e=>e.VpcId===r):o,t[2]=r,t[3]=o,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(V,{children:[`Security Group`,(0,Q.jsx)(_,{label:`Security group`,children:`A new group allows only the inbound ports switched on below. Outbound traffic is allowed either way.`})]}),t[5]=p):p=t[5];let m=r?`Applies to VPC ${r}`:`No VPC resolved — select a subnet`,h;t[6]===m?h=t[7]:(h=(0,Q.jsx)(W,{children:m}),t[6]=m,t[7]=h);let g;t[8]===n?g=t[9]:(g=(0,Q.jsx)(bt,{control:n,name:`securityGroupMode`,render:Xn}),t[8]=n,t[9]=g);let v;t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==u||t[14]!==s||t[15]!==l||t[16]!==f?(v=l===`create`?(0,Q.jsx)(Zn,{control:n,errors:i,register:a}):(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsx)(Dt,{emptyText:`No security groups in the resolved VPC.`,groups:f,onChange:e=>{s(`securityGroupIds`,e,{shouldValidate:!0})},selected:u}),(0,Q.jsx)(G,{errors:[i.securityGroupIds]})]}),t[10]=n,t[11]=i,t[12]=a,t[13]=u,t[14]=s,t[15]=l,t[16]=f,t[17]=v):v=t[17];let y;return t[18]!==h||t[19]!==g||t[20]!==v?(y=(0,Q.jsxs)(K,{children:[p,h,g,v]}),t[18]=h,t[19]=g,t[20]=v,t[21]=y):y=t[21],y}function Xn(e){let{field:t}=e;return(0,Q.jsxs)(B,{"aria-label":`Security group`,className:`flex w-auto`,onValueChange:t.onChange,value:t.value,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Create new security group`,value:`create`}),`Create new`]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Select existing security group`,value:`existing`}),`Select existing`]})]})}function Zn(e){let t=(0,Z.c)(38),{control:n,errors:r,register:i}=e,a;t[0]===n?a=t[1]:(a={control:n,name:`ruleSource`},t[0]=n,t[1]=a);let o=vt(a),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`newSgName`,children:`Name`})}),t[2]=s):s=t[2];let c=!!r.newSgName,l;t[3]===i?l=t[4]:(l=i(`newSgName`),t[3]=i,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,Q.jsx)(H,{"aria-invalid":c,id:`newSgName`,type:`text`,...l}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===r.newSgName?d=t[9]:(d=(0,Q.jsx)(G,{errors:[r.newSgName]}),t[8]=r.newSgName,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,Q.jsxs)(K,{children:[s,u,d]}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`newSgDescription`,children:`Description`})}),t[13]=p):p=t[13];let m;t[14]===i?m=t[15]:(m=i(`newSgDescription`),t[14]=i,t[15]=m);let h;t[16]===m?h=t[17]:(h=(0,Q.jsxs)(K,{children:[p,(0,Q.jsx)(H,{id:`newSgDescription`,type:`text`,...m})]}),t[16]=m,t[17]=h);let g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(V,{children:`Inbound rules`}),t[18]=g):g=t[18];let _;t[19]===n?_=t[20]:(_=jn.map(e=>{let{name:t,label:r,text:i}=e;return(0,Q.jsx)(bt,{control:n,name:t,render:e=>{let{field:n}=e;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ce,{"aria-label":r,checked:n.value??!1,id:t,onCheckedChange:n.onChange}),(0,Q.jsx)(U,{htmlFor:t,children:i})]})}},t)}),t[19]=n,t[20]=_);let v;t[21]===_?v=t[22]:(v=(0,Q.jsxs)(K,{children:[g,(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:_})]}),t[21]=_,t[22]=v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(V,{children:`Source`}),t[23]=y):y=t[23];let b;t[24]===n?b=t[25]:(b=(0,Q.jsx)(bt,{control:n,name:`ruleSource`,render:Qn}),t[24]=n,t[25]=b);let x;t[26]!==r.customCidr||t[27]!==i||t[28]!==o?(x=o===`custom`&&(0,Q.jsxs)(`div`,{className:`mt-2`,children:[(0,Q.jsx)(H,{"aria-invalid":!!r.customCidr,placeholder:`203.0.113.0/24`,type:`text`,...i(`customCidr`)}),(0,Q.jsx)(G,{errors:[r.customCidr]})]}),t[26]=r.customCidr,t[27]=i,t[28]=o,t[29]=x):x=t[29];let S;t[30]!==b||t[31]!==x?(S=(0,Q.jsxs)(K,{children:[y,b,x]}),t[30]=b,t[31]=x,t[32]=S):S=t[32];let C;return t[33]!==h||t[34]!==v||t[35]!==S||t[36]!==f?(C=(0,Q.jsxs)(`div`,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[f,h,v,S]}),t[33]=h,t[34]=v,t[35]=S,t[36]=f,t[37]=C):C=t[37],C}function Qn(e){let{field:t}=e;return(0,Q.jsxs)(B,{"aria-label":`Source`,className:`flex w-auto`,onValueChange:t.onChange,value:t.value,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Source anywhere`,value:`anywhere`}),`Anywhere (0.0.0.0/0)`]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Source custom CIDR`,value:`custom`}),`Custom CIDR`]})]})}function $n(e){let t=(0,Z.c)(52),{control:n,errors:r,images:i,register:o}=e,u;t[0]===n?u=t[1]:(u={control:n,name:`imageId`},t[0]=n,t[1]=u);let d=vt(u),f;t[2]!==i||t[3]!==d?(f=et(i,d),t[2]=i,t[3]=d,t[4]=f):f=t[4];let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`rootVolumeSize`,children:`Size (GiB)`}),(0,Q.jsx)(_,{label:`Root volume size`,children:`Leave blank to use the image's own size. A larger size grows the root volume; it cannot be smaller than the image's snapshot.`})]}),t[5]=m):m=t[5];let h=!!r.rootVolumeSize,g=p.snapshotSize??On,v=p.snapshotSize?String(p.snapshotSize):`Image default`,y;t[6]===o?y=t[7]:(y=o(`rootVolumeSize`,{setValueAs:nr}),t[6]=o,t[7]=y);let b;t[8]!==h||t[9]!==g||t[10]!==v||t[11]!==y?(b=(0,Q.jsx)(H,{"aria-invalid":h,id:`rootVolumeSize`,max:kn,min:g,placeholder:v,type:`number`,...y}),t[8]=h,t[9]=g,t[10]=v,t[11]=y,t[12]=b):b=t[12];let x=p.snapshotSize===void 0?`The image does not report a size.`:`Minimum ${p.snapshotSize} GiB, the image's snapshot size.`,S;t[13]===x?S=t[14]:(S=(0,Q.jsx)(W,{children:x}),t[13]=x,t[14]=S);let C;t[15]===r.rootVolumeSize?C=t[16]:(C=(0,Q.jsx)(G,{errors:[r.rootVolumeSize]}),t[15]=r.rootVolumeSize,t[16]=C);let w;t[17]!==S||t[18]!==C||t[19]!==b?(w=(0,Q.jsxs)(K,{children:[m,b,S,C]}),t[17]=S,t[18]=C,t[19]=b,t[20]=w):w=t[20];let T;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`rootVolumeType`,children:`Volume Type`})}),t[21]=T):T=t[21];let E;t[22]===r.rootVolumeType?E=t[23]:(E=e=>{let{field:t}=e;return(0,Q.jsxs)(l,{onValueChange:t.onChange,value:t.value??Dn,children:[(0,Q.jsx)(c,{"aria-invalid":!!r.rootVolumeType,className:`w-full`,id:`rootVolumeType`,children:(0,Q.jsx)(a,{})}),(0,Q.jsx)(s,{children:xt.map(tr)})]})},t[22]=r.rootVolumeType,t[23]=E);let D;t[24]!==n||t[25]!==E?(D=(0,Q.jsx)(bt,{control:n,name:`rootVolumeType`,render:E}),t[24]=n,t[25]=E,t[26]=D):D=t[26];let O;t[27]===r.rootVolumeType?O=t[28]:(O=(0,Q.jsx)(G,{errors:[r.rootVolumeType]}),t[27]=r.rootVolumeType,t[28]=O);let k;t[29]!==D||t[30]!==O?(k=(0,Q.jsxs)(K,{children:[T,D,O]}),t[29]=D,t[30]=O,t[31]=k):k=t[31];let A;t[32]!==w||t[33]!==k?(A=(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[w,k]}),t[32]=w,t[33]=k,t[34]=A):A=t[34];let j;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`rootDeviceName`,children:`Device Name`})}),t[35]=j):j=t[35];let M=!!r.rootDeviceName,N;t[36]===o?N=t[37]:(N=o(`rootDeviceName`),t[36]=o,t[37]=N);let P;t[38]!==M||t[39]!==N?(P=(0,Q.jsx)(H,{"aria-invalid":M,id:`rootDeviceName`,type:`text`,variant:`code`,...N}),t[38]=M,t[39]=N,t[40]=P):P=t[40];let F;t[41]===r.rootDeviceName?F=t[42]:(F=(0,Q.jsx)(G,{errors:[r.rootDeviceName]}),t[41]=r.rootDeviceName,t[42]=F);let I;t[43]!==P||t[44]!==F?(I=(0,Q.jsxs)(K,{children:[j,P,F]}),t[43]=P,t[44]=F,t[45]=I):I=t[45];let L;t[46]===n?L=t[47]:(L=(0,Q.jsx)(bt,{control:n,name:`rootDeleteOnTermination`,render:er}),t[46]=n,t[47]=L);let R;return t[48]!==A||t[49]!==I||t[50]!==L?(R=(0,Q.jsx)(q,{title:`Root volume`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[A,I,L]})}),t[48]=A,t[49]=I,t[50]=L,t[51]=R):R=t[51],R}function er(e){let{field:t}=e;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ce,{"aria-label":`Delete on termination`,checked:t.value??!0,id:`rootDeleteOnTermination`,onCheckedChange:t.onChange}),(0,Q.jsx)(U,{htmlFor:`rootDeleteOnTermination`,children:`Delete on termination`}),(0,Q.jsx)(_,{label:`Delete on termination`,children:`When on, the root volume is deleted with the instance. Turn it off to keep the volume after termination.`})]})}function tr(e){return(0,Q.jsx)(o,{value:e,children:e},e)}function nr(e){return e===``||e==null?void 0:Number(e)}function rr(){let e=(0,Z.c)(41),{data:t}=f(X),{data:n}=f(ge),{data:r}=f(Y),{data:i}=d(_e),{data:a}=f(he),{data:o}=f(fe),{data:s}=f(ue),{data:c}=f(de),{data:l}=f(J),u;e[0]===t.Images?u=e[1]:(u=t.Images??[],e[0]=t.Images,e[1]=u);let p;e[2]===u?p=e[3]:(p=u.filter(or),e[2]=u,e[3]=p);let m=p,h;e[4]===a.Subnets?h=e[5]:(h=a.Subnets??[],e[4]=a.Subnets,e[5]=h);let g=h,_;e[6]===s.Vpcs?_=e[7]:(_=s.Vpcs??[],e[6]=s.Vpcs,e[7]=_);let v=_,y;e[8]===g?y=e[9]:(y=g.find(ar),e[8]=g,e[9]=y);let b=y,x;e[10]===r.InstanceTypes?x=e[11]:(x=r.InstanceTypes??[],e[10]=r.InstanceTypes,e[11]=x);let S;e[12]===i?.available?S=e[13]:(S=i?.available??{},e[12]=i?.available,e[13]=S);let C;e[14]===n.KeyPairs?C=e[15]:(C=n.KeyPairs??[],e[14]=n.KeyPairs,e[15]=C);let w;e[16]===o.PlacementGroups?w=e[17]:(w=o.PlacementGroups??[],e[16]=o.PlacementGroups,e[17]=w);let T;e[18]===c.SecurityGroups?T=e[19]:(T=c.SecurityGroups??[],e[18]=c.SecurityGroups,e[19]=T);let E;e[20]===l.LaunchTemplates?E=e[21]:(E=l.LaunchTemplates??[],e[20]=l.LaunchTemplates,e[21]=E);let D;e[22]===v?D=e[23]:(D=(v.find(ir)??v[0])?.VpcId,e[22]=v,e[23]=D);let O;if(e[24]!==b||e[25]!==g){let t;e[27]===b?t=e[28]:(t=e=>e!==b,e[27]=b,e[28]=t),O=g.filter(t),e[24]=b,e[25]=g,e[26]=O}else O=e[26];let k;return e[29]!==b||e[30]!==m||e[31]!==g||e[32]!==E||e[33]!==D||e[34]!==O||e[35]!==x||e[36]!==S||e[37]!==C||e[38]!==w||e[39]!==T?(k={images:m,allInstanceTypes:x,instanceTypeCapacity:S,keyPairs:C,subnets:g,placementGroups:w,securityGroups:T,launchTemplates:E,defaultVpcId:D,defaultSubnet:b,otherSubnets:O},e[29]=b,e[30]=m,e[31]=g,e[32]=E,e[33]=D,e[34]=O,e[35]=x,e[36]=S,e[37]=C,e[38]=w,e[39]=T,e[40]=k):k=e[40],k}function ir(e){return e.IsDefault}function ar(e){return e.DefaultForAz}function or(e){return!Ct(e)}function sr(e){let t=(0,Z.c)(116),{launchTemplateId:n,launchTemplateVersion:r,onClose:i}=e,{images:a,allInstanceTypes:o,instanceTypeCapacity:s,keyPairs:c,subnets:l,placementGroups:u,securityGroups:d,launchTemplates:f,defaultVpcId:p,defaultSubnet:m,otherSubnets:h}=rr(),g=ce(),_=o.length>0,v,y;t[0]!==o||t[1]!==a?(v=ht(a),y=ut(v,o),t[0]=o,t[1]=a,t[2]=v,t[3]=y):(v=t[2],y=t[3]);let[b,x]=(0,Bt.useState)(y),S,C,w,T,E;t[4]!==o||t[5]!==b||t[6]!==a||t[7]!==s||t[8]!==c||t[9]!==n||t[10]!==r||t[11]!==d?(C=dt(o,b),S=lt(C),E=yt,t[17]!==o||t[18]!==a||t[19]!==s?(w=mt(a,o,s),t[17]=o,t[18]=a,t[19]=s,t[20]=w):w=t[20],T=ct({images:a,arch:b,archTypeNames:S,keyPairs:c,securityGroups:d,launchTemplateId:n,launchTemplateVersion:r}),t[4]=o,t[5]=b,t[6]=a,t[7]=s,t[8]=c,t[9]=n,t[10]=r,t[11]=d,t[12]=S,t[13]=C,t[14]=w,t[15]=T,t[16]=E):(S=t[12],C=t[13],w=t[14],T=t[15],E=t[16]);let D;t[21]!==w||t[22]!==T?(D={resolver:w,defaultValues:T},t[21]=w,t[22]=T,t[23]=D):D=t[23];let{control:O,handleSubmit:k,register:A,setValue:j,getValues:M,formState:N}=E(D),{errors:P,isSubmitting:I}=N,L;t[24]===O?L=t[25]:(L={control:O},t[24]=O,t[25]=L);let R=vt(L),z;t[26]===O?z=t[27]:(z={control:O,name:`subnetId`},t[26]=O,t[27]=z);let B=vt(z),V;t[28]===O?V=t[29]:(V={control:O,name:`launchTemplateId`},t[28]=O,t[29]=V);let H=vt(V),U;t[30]!==m||t[31]!==B||t[32]!==l?(U=ft(l,B,m),t[30]=m,t[31]=B,t[32]=l,t[33]=U):U=t[33];let W=U,G=W?.VpcId??p,K;t[34]!==P.imageId||t[35]!==a||t[36]!==j?(K=function(e){j(`imageId`,e,{shouldValidate:!!P.imageId}),j(`rootDeviceName`,et(a,e).deviceName)},t[34]=P.imageId,t[35]=a,t[36]=j,t[37]=K):K=t[37];let q=K,ee;t[38]!==o||t[39]!==M||t[40]!==a||t[41]!==q||t[42]!==j?(ee=function(e){x(e);let t=ot(a,e),n=a.find(e=>e.ImageId===M(`imageId`)),r=n&&$e(n);if(!n||r&&r!==e){let e=tt(t,gt(n?.Name)?.distro)??Qe(t);q(e?.ImageId??``)}let i=o.find(e=>e.InstanceType===M(`instanceType`));i&&_t(i,e)||j(`instanceType`,st(lt(dt(o,e)))??``)},t[38]=o,t[39]=M,t[40]=a,t[41]=q,t[42]=j,t[43]=ee):ee=t[43];let te=ee,ne;t[44]!==g||t[45]!==G||t[46]!==_||t[47]!==i?(ne=async e=>{if(!e.launchTemplateId&&!_)return;let t=e.launchTemplateId?{count:e.count,launchTemplateId:e.launchTemplateId,launchTemplateVersion:e.launchTemplateVersion,resolvedVpcId:G}:{...e,resolvedVpcId:G},n;try{n=await g.mutateAsync(t)}catch{return}let r=n.Instances??[];i(r.length===1?r[0]?.InstanceId:void 0)},t[44]=g,t[45]=G,t[46]=_,t[47]=i,t[48]=ne):ne=t[48];let re=ne,ie=f.length>0||!!n,ae;t[49]!==O||t[50]!==P||t[51]!==s||t[52]!==A?(ae=(0,Q.jsx)(Mn,{control:O,errors:P,instanceTypeCapacity:s,register:A}),t[49]=O,t[50]=P,t[51]=s,t[52]=A,t[53]=ae):ae=t[53];let oe=ae,se;t[54]!==_||t[55]!==H?(se=!_&&!H&&(0,Q.jsx)(Ee,{msg:`No compute available. No new instances can be created until compute is available.`}),t[54]=_,t[55]=H,t[56]=se):se=t[56];let le;t[57]!==k||t[58]!==re?(le=k(re),t[57]=k,t[58]=re,t[59]=le):le=t[59];let ue=I||g.isPending,de;t[60]!==O||t[61]!==oe||t[62]!==f||t[63]!==H||t[64]!==ie?(de=ie&&(0,Q.jsx)(Nn,{control:O,countField:oe,launchTemplates:f,selectedTemplateId:H}),t[60]=O,t[61]=oe,t[62]=f,t[63]=H,t[64]=ie,t[65]=de):de=t[65];let fe;t[66]!==o||t[67]!==b||t[68]!==S||t[69]!==C||t[70]!==v||t[71]!==O||t[72]!==oe||t[73]!==m||t[74]!==W||t[75]!==G||t[76]!==P||t[77]!==_||t[78]!==a||t[79]!==s||t[80]!==c||t[81]!==h||t[82]!==u||t[83]!==A||t[84]!==d||t[85]!==te||t[86]!==q||t[87]!==B||t[88]!==H||t[89]!==j?(fe=!H&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ln,{arch:b,architectures:v,control:O,errors:P,images:a,onSelectArchitecture:te,onSelectImage:q}),(0,Q.jsx)(Rn,{allInstanceTypes:o,arch:b,archTypeNames:S,archTypes:C,control:O,countField:oe,errors:P,hasCompute:_,instanceTypeCapacity:s,keyPairs:c,placementGroups:u,register:A}),(0,Q.jsx)(Kn,{control:O,defaultSubnet:m,effectiveSubnet:W,effectiveVpcId:G,errors:P,otherSubnets:h,register:A,securityGroups:d,selectedSubnetId:B,setValue:j}),(0,Q.jsx)($n,{control:O,errors:P,images:a,register:A})]}),t[66]=o,t[67]=b,t[68]=S,t[69]=C,t[70]=v,t[71]=O,t[72]=oe,t[73]=m,t[74]=W,t[75]=G,t[76]=P,t[77]=_,t[78]=a,t[79]=s,t[80]=c,t[81]=h,t[82]=u,t[83]=A,t[84]=d,t[85]=te,t[86]=q,t[87]=B,t[88]=H,t[89]=j,t[90]=fe):fe=t[90];let J;t[91]!==G||t[92]!==R?(J=fn(R,G),t[91]=G,t[92]=R,t[93]=J):J=t[93];let pe;t[94]===J?pe=t[95]:(pe=(0,Q.jsx)(F,{commands:J}),t[94]=J,t[95]=pe);let me;t[96]===i?me=t[97]:(me=()=>{i()},t[96]=i,t[97]=me);let he=!_&&!H,Y;t[98]!==g.error||t[99]!==g.isPending||t[100]!==I||t[101]!==me||t[102]!==he?(Y=(0,Q.jsx)(Be,{error:g.error,errorMsg:`Failed to create instance`,isPending:g.isPending,isSubmitting:I,onCancel:me,pendingLabel:`Creating…`,submitDisabled:he,submitLabel:`Create Instance`}),t[98]=g.error,t[99]=g.isPending,t[100]=I,t[101]=me,t[102]=he,t[103]=Y):Y=t[103];let ge;t[104]!==ue||t[105]!==de||t[106]!==fe||t[107]!==pe||t[108]!==Y?(ge=(0,Q.jsxs)(Ve,{className:`flex flex-col gap-4`,locked:ue,children:[de,fe,pe,Y]}),t[104]=ue,t[105]=de,t[106]=fe,t[107]=pe,t[108]=Y,t[109]=ge):ge=t[109];let X;t[110]!==le||t[111]!==ge?(X=(0,Q.jsx)(`form`,{onSubmit:le,children:ge}),t[110]=le,t[111]=ge,t[112]=X):X=t[112];let _e;return t[113]!==se||t[114]!==X?(_e=(0,Q.jsxs)(Q.Fragment,{children:[se,X]}),t[113]=se,t[114]=X,t[115]=_e):_e=t[115],_e}var cr=[`all`,`running`,`stopped`,`other`],lr={...Te,template:``,templateVersion:``};function ur(e){return e.Tags?.find(e=>e.Key===`Name`)?.Value}function dr(e){return e.State?.Name??`unknown`}function fr(e,t){let n=dr(e);return t===`all`?!0:t===`other`?n!==`running`&&n!==`stopped`:n===t}function pr(e,t){if(!t)return!0;let n=t.toLowerCase();return[e.InstanceId,ur(e),e.InstanceType,e.PrivateIpAddress,e.PublicIpAddress,e.ImageId].some(e=>e?.toLowerCase().includes(n))}function mr(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=n?(0,Q.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,children:n}):(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t[0]=n,t[1]=r),r}var hr=[`Name`],gr=[{id:`instance`,header:`Instance ID`,sortValue:e=>e.InstanceId,cell:e=>{let t=e.InstanceId??``;return(0,Q.jsx)(p,{className:`rounded-sm font-mono text-xs font-medium whitespace-nowrap text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,from:`/ec2/describe-instances/`,search:e=>({...e,...lr,selected:t}),to:`.`,children:t})}},{id:`name`,header:`Name`,sortValue:ur,cell:e=>(0,Q.jsx)(Fe,{text:ur(e)})},{id:`state`,header:`State`,sortValue:dr,cell:e=>(0,Q.jsx)(Ne,{state:e.State?.Name})},{id:`type`,header:`Type`,sortValue:e=>e.InstanceType,hideBelow:`md`,cell:e=>(0,Q.jsx)(mr,{children:e.InstanceType})},{id:`private-ip`,header:`Private IP`,sortValue:e=>e.PrivateIpAddress,hideBelow:`md`,cell:e=>(0,Q.jsx)(mr,{children:e.PrivateIpAddress})},{id:`public-ip`,header:`Public IP`,sortValue:e=>e.PublicIpAddress,hideBelow:`md`,cell:e=>(0,Q.jsx)(mr,{children:e.PublicIpAddress})},{id:`launched`,header:`Launched`,sortValue:e=>e.LaunchTime?new Date(e.LaunchTime).getTime():void 0,hideBelow:`lg`,cell:e=>(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:(0,Q.jsx)(Ie,{date:e.LaunchTime})})},{id:`tags`,header:`Tags`,hideBelow:`lg`,cell:e=>(0,Q.jsx)(Pe,{omit:hr,tags:e.Tags})}];function _r(e){let t=e.startsWith(`-`),n=t?e.slice(1):e;return gr.some(e=>e.id===n)?{column:n,desc:t}:void 0}var vr=[`start`,`stop`,`reboot`],yr={start:{label:`Start`,icon:w,from:`stopped`},stop:{label:`Stop`,icon:S,from:`running`},reboot:{label:`Reboot`,icon:D,from:`running`}};function br(e){let t=(0,Z.c)(30),{instances:n,onDone:r}=e,i={start:se(),stop:le(),reboot:re()},a=ae(),[o,s]=(0,Bt.useState)(!1),c=n.flatMap(Sr),l=[...Object.values(i),a].find(xr)?.error,u=Me,d=n.length,f=l&&(0,Q.jsx)(Ee,{error:l}),p=vr.map(e=>{let t=yr[e],a=i[e],o=n.flatMap(e=>e.InstanceId&&dr(e)===t.from?[e.InstanceId]:[]);return(0,Q.jsxs)(L,{disabled:o.length===0||a.isPending,onClick:()=>{a.mutate(o,{onSuccess:r})},size:`sm`,variant:`outline`,children:[(0,Q.jsx)(t.icon,{"data-icon":`inline-start`}),t.label,o.length>0&&o.length{s(!0)},t[0]=s,t[1]=h);let g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(I,{"data-icon":`inline-start`}),t[2]=g):g=t[2];let _;t[3]!==m||t[4]!==h?(_=(0,Q.jsxs)(L,{disabled:m,onClick:h,size:`sm`,variant:`destructive`,children:[g,`Terminate`]}),t[3]=m,t[4]=h,t[5]=_):_=t[5];let v=Oe,y=`Terminate ${c.length}`,b=c.join(`, `),x;t[6]===b?x=t[7]:(x=(0,Q.jsxs)(Q.Fragment,{children:[`Terminating deletes the instance and any volume set to delete on termination. This cannot be undone.`,(0,Q.jsx)(`span`,{className:`mt-2 block font-mono text-xs break-all`,children:b})]}),t[6]=b,t[7]=x);let S;t[8]!==r||t[9]!==s||t[10]!==c||t[11]!==a?(S=()=>{a.mutate(c,{onSettled:()=>{s(!1)},onSuccess:r})},t[8]=r,t[9]=s,t[10]=c,t[11]=a,t[12]=S):S=t[12];let C=`Terminate ${c.length} ${c.length===1?`instance`:`instances`}?`,w;t[13]!==v||t[14]!==o||t[15]!==s||t[16]!==x||t[17]!==S||t[18]!==C||t[19]!==y||t[20]!==a.isPending?(w=(0,Q.jsx)(v,{confirmLabel:y,description:x,isPending:a.isPending,onConfirm:S,onOpenChange:s,open:o,confirmPhrase:`terminate`,pendingLabel:`Terminating…`,title:C}),t[13]=v,t[14]=o,t[15]=s,t[16]=x,t[17]=S,t[18]=C,t[19]=y,t[20]=a.isPending,t[21]=w):w=t[21];let T;return t[22]!==u||t[23]!==n.length||t[24]!==r||t[25]!==w||t[26]!==f||t[27]!==p||t[28]!==_?(T=(0,Q.jsxs)(u,{count:d,footer:f,onClear:r,children:[p,_,w]}),t[22]=u,t[23]=n.length,t[24]=r,t[25]=w,t[26]=f,t[27]=p,t[28]=_,t[29]=T):T=t[29],T}function xr(e){return e.error}function Sr(e){return e.InstanceId&&![`terminated`,`shutting-down`].includes(dr(e))?[e.InstanceId]:[]}function Cr(e){let t=(0,Z.c)(73),{instances:n,search:r,onSearchChange:i}=e,a;t[0]===r.sort?a=t[1]:(a=_r(r.sort),t[0]=r.sort,t[1]=a);let o=a,s;t[2]===n?s=t[3]:(s=e=>[e,n.filter(t=>fr(t,e)).length],t[2]=n,t[3]=s);let c=Object.fromEntries(cr.map(s)),l;t[4]!==r.q||t[5]!==r.state?(l=e=>fr(e,r.state)&&pr(e,r.q),t[4]=r.q,t[5]=r.state,t[6]=l):l=t[6];let u=n.filter(l),d=r.q!==``||r.state!==`all`,f;t[7]===r.selected?f=t[8]:(f=e=>r.selected!==``&&e.InstanceId===r.selected,t[7]=r.selected,t[8]=f);let h=n.find(f),g;t[9]===i?g=t[10]:(g=function(){i(lr)},t[9]=i,t[10]=g);let _=g,v=Le(u.map(Dr),r.selected!==``,_),y;t[11]===v.selected?y=t[12]:(y=e=>e.InstanceId&&v.selected.has(e.InstanceId),t[11]=v.selected,t[12]=y);let b=u.filter(y),x;t[13]===i?x=t[14]:(x=function(e){i({...lr,selected:e})},t[13]=i,t[14]=x);let S=x,C=null;if(r.create){let e=r.template||void 0,n=r.templateVersion||void 0,i;t[15]!==_||t[16]!==S?(i=e=>{e?S(e):_()},t[15]=_,t[16]=S,t[17]=i):i=t[17];let a;t[18]!==i||t[19]!==e||t[20]!==n?(a=(0,Q.jsx)(sr,{launchTemplateId:e,launchTemplateVersion:n,onClose:i}),t[18]=i,t[19]=e,t[20]=n,t[21]=a):a=t[21];let o;t[22]!==_||t[23]!==a?(o=(0,Q.jsx)(De,{onClose:_,title:`Launch instance`,children:a}),t[22]=_,t[23]=a,t[24]=o):o=t[24],C=o}else if(h){let e;t[25]===i?e=t[26]:(e=e=>{i({tab:e})},t[25]=i,t[26]=e),C=(0,Q.jsx)(en,{instance:h,name:ur(h),onClose:_,onTabChange:e,tab:r.tab},h.InstanceId)}let w=je,E=C,D;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(D=R(),t[27]=D):D=t[27];let O;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(Ae,{actions:(0,Q.jsxs)(p,{className:D,from:`/ec2/describe-instances/`,search:Er,to:`.`,children:[(0,Q.jsx)(T,{"data-icon":`inline-start`}),`Launch instance`]}),subtitle:`Virtual machines running on this cluster.`,title:`Instances`}),t[28]=O):O=t[28];let k=ke,A=r.state,j=cr.map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),count:c[e]})),M,N,P;t[29]===i?(M=t[30],N=t[31],P=t[32]):(M=e=>{i({state:e})},N=()=>{i({q:``,state:`all`})},P=e=>{i({q:e})},t[29]=i,t[30]=M,t[31]=N,t[32]=P);let F;t[33]!==k||t[34]!==r.q||t[35]!==r.state||t[36]!==j||t[37]!==M||t[38]!==N||t[39]!==P?(F=(0,Q.jsx)(k,{choice:A,choices:j,choicesLabel:`Instance state`,onChoiceChange:M,onClear:N,onQueryChange:P,placeholder:`Filter by name, ID, type or IP`,query:r.q,searchLabel:`Filter instances`}),t[33]=k,t[34]=r.q,t[35]=r.state,t[36]=j,t[37]=M,t[38]=N,t[39]=P,t[40]=F):F=t[40];let I;t[41]!==b||t[42]!==v.clear?(I=b.length>0&&(0,Q.jsx)(br,{instances:b,onDone:v.clear}),t[41]=b,t[42]=v.clear,t[43]=I):I=t[43];let L;t[44]===d?L=t[45]:(L=d?`No instances match these filters.`:(0,Q.jsxs)(`span`,{className:`flex flex-col items-center gap-3`,children:[`No instances yet.`,(0,Q.jsx)(p,{className:R({size:`sm`,variant:`outline`}),from:`/ec2/describe-instances/`,search:Tr,to:`.`,children:`Launch your first instance`})]}),t[44]=d,t[45]=L);let z=h?.InstanceId,B;t[46]===S?B=t[47]:(B=e=>{S(e)},t[46]=S,t[47]=B);let V;t[48]===i?V=t[49]:(V=e=>{i({sort:`${e.desc?`-`:``}${e.column}`})},t[48]=i,t[49]=V);let H;t[50]!==v.onSelectedChange||t[51]!==v.selected||t[52]!==o||t[53]!==L||t[54]!==z||t[55]!==B||t[56]!==V||t[57]!==u?(H=(0,Q.jsx)(m,{caption:`Instances`,columns:gr,empty:L,activeId:z,getRowId:wr,onRowClick:B,onSelectedChange:v.onSelectedChange,onSortChange:V,rows:u,selected:v.selected,sort:o}),t[50]=v.onSelectedChange,t[51]=v.selected,t[52]=o,t[53]=L,t[54]=z,t[55]=B,t[56]=V,t[57]=u,t[58]=H):H=t[58];let U;t[59]!==I||t[60]!==H?(U=(0,Q.jsxs)(`div`,{children:[I,H]}),t[59]=I,t[60]=H,t[61]=U):U=t[61];let W=d?`${u.length} of ${n.length} instances`:`${n.length} ${n.length===1?`instance`:`instances`}`,G;t[62]===W?G=t[63]:(G=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground tabular-nums`,children:W}),t[62]=W,t[63]=G);let K;t[64]!==F||t[65]!==U||t[66]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[F,U,G]}),t[64]=F,t[65]=U,t[66]=G,t[67]=K):K=t[67];let q;return t[68]!==w||t[69]!==C||t[70]!==O||t[71]!==K?(q=(0,Q.jsxs)(w,{panel:E,children:[O,K]}),t[68]=w,t[69]=C,t[70]=O,t[71]=K,t[72]=q):q=t[72],q}function wr(e){return e.InstanceId??``}function Tr(e){return{...e,...lr,create:!0}}function Er(e){return{...e,...lr,create:!0}}function Dr(e){return e.InstanceId??``}export{en as a,ur as i,Cr as n,cr as r,lr as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instances-page-Ol-kg3ZZ.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instances-page-Ol-kg3ZZ.js new file mode 100644 index 000000000..e739df535 --- /dev/null +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/instances-page-Ol-kg3ZZ.js @@ -0,0 +1,22 @@ +import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r,U as i}from"./schemas-DCQXG11d.js";import{a,c as o,i as s,n as c,r as l,s as u,t as d}from"./select-UwOVJofC.js";import{n as f}from"./QueryClientProvider-BuG40HBe.js";import{t as p}from"./useQuery-D6TojLgI.js";import{t as m}from"./useSuspenseQuery--dusmE-Q.js";import{t as h}from"./link-BX-1BPor.js";import{t as g}from"./data-table-9n7xOy9s.js";import{t as _}from"./useNavigate-cMdr_EJ0.js";import{r as v}from"./visuallyHidden-BHQz5bmH.js";import{n as y}from"./info-tip-Cxa2GEOd.js";import{t as b}from"./chevron-down-BgudX6bq.js";import{t as x}from"./eye-yi4wz0yh.js";import{t as S}from"./globe-D4RJ05Is.js";import{t as C}from"./maximize-2-BAlKoEj8.js";import{n as w,t as T}from"./button-group-CpOcyma9.js";import{t as E}from"./play-qJowxtRp.js";import{t as D}from"./plus-BK_7eO_G.js";import{t as O}from"./refresh-cw-Cb2whnur.js";import{t as k}from"./rotate-cw-DhHI5fTM.js";import{t as A}from"./server-D03m5B1l.js";import{t as j}from"./sliders-horizontal-DsGbsnBU.js";import{a as M,i as N,n as P,o as F,r as I,t as L}from"./cli-command-panel-Do14gxB9.js";import{t as ee}from"./trash-BajuWzqn.js";import{a as R,o as te}from"./useValueAsRef-uzS1fuI8.js";import{n as z,t as B}from"./radio-group-TE8lo9RG.js";import{c as V,f as H,l as U,n as W,r as G,t as K}from"./field-iLG94M00.js";import{a as q,t as ne}from"./detail-panel-DLM1ExsZ.js";import{c as re}from"./auth-BS4WytAe.js";import{J as ie,Z as ae,f as oe,it as se,n as ce,nt as le,p as ue,rt as de}from"./ec2-mbMOQDVK.js";import{C as fe,N as J,T as pe,b as Y,g as me,h as he,i as ge,k as _e,l as X,m as ve,s as ye}from"./ec2-DcwXjFvB.js";import{l as be}from"./admin-UXb5aZ2d.js";import{a as xe,i as Se,n as Ce,r as we,t as Te}from"./dropdown-menu-BDPQio-M.js";import{t as Ee}from"./switch-CFqwHFZR.js";import{t as De}from"./textarea-BG1iGvVs.js";import{t as Oe}from"./panel-search-LDLf8HCe.js";import{t as ke}from"./error-banner-Cahg3Ix2.js";import{t as Ae}from"./create-panel-BF47ohJ2.js";import{t as je}from"./delete-confirmation-dialog-O7cqOW0Y.js";import{t as Me}from"./filter-bar-DNltk5ao.js";import{t as Ne}from"./page-heading-ZfrnK2wu.js";import{t as Pe}from"./resource-view-CPdFr_3k.js";import{t as Fe}from"./selection-bar-WnknBhRB.js";import{t as Ie}from"./state-badge-CQPRxt3J.js";import{n as Le,r as Re,t as ze}from"./table-cells-Dh4yWZC8.js";import{t as Be}from"./use-row-selection-DB6L9NiD.js";import{t as Ve}from"./console-output-B2nAhrwp.js";import{t as He}from"./resource-tags-DMnOITWf.js";import{n as Ue,t as We}from"./form-lock-D8Cu0Sfu.js";import{t as Ge}from"./form-panel-CtjudV7b.js";import{t as Ke}from"./gpu-instance-type-select-DsB5oPSo.js";import{a as qe,i as Je,l as Ye,n as Xe,r as Ze,s as Qe,t as $e,u as et}from"./metric-format-DCnx-pFz.js";import{S as tt,_ as nt,a as rt,b as it,c as at,d as ot,f as st,g as ct,h as lt,i as ut,l as dt,m as ft,o as pt,p as mt,s as ht,t as gt,u as _t,v as vt,x as yt,y as bt}from"./instance-overview-DWnPG_Ut.js";import{c as xt,o as St,t as Ct}from"./index.esm-C31mnnYl.js";import{t as wt}from"./ec2-CM16SST3.js";import{n as Tt}from"./instance-type-size-DoyCeynC.js";import{i as Et}from"./system-managed-Dk7ySh_E.js";import{n as Dt,t as Ot}from"./choice-tile-CEc-Vca5.js";import{r as kt}from"./form-fields-CcTBfvl9.js";import{t as At}from"./security-group-picker-CRcCOtjC.js";import{t as jt}from"./subnet-routing-CyGJGaO-.js";var Mt={name:`chart-area`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z`,key:`q0gr47`}]],aliases:[`area-chart`]};Mt.node;var Nt=v(Mt),Pt={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Pt.node;var Ft=v(Pt),It={name:`disc-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]};It.node;var Lt=v(It),Rt={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};Rt.node;var zt=v(Rt),Bt={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Bt.node;var Vt=v(Bt),Ht={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Ht.node;var Ut=v(Ht),Z=r(),Wt=e(n(),1),Q=t();function Gt(e,t,n){return[{label:`Create Image`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-image`},...N(`\\ + --instance-id`,e),...N(`\\ + --name`,t?F(t):I(``,`Name`)),...M(`\\ + --description`,n&&F(n))]}]}function Kt(e){let t=(0,Z.c)(43),{instanceId:n,onClose:r}=e,i=oe(),a=_(),[o,s]=(0,Wt.useState)(``),[c,l]=(0,Wt.useState)(``),u;t[0]!==i||t[1]!==c||t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==r?(u=async function(){let e;try{e=await i.mutateAsync({instanceId:n,name:o,description:c||void 0})}catch{return}r(),e.ImageId&&a({to:`/ec2/describe-images`,search:{selected:e.ImageId}})},t[0]=i,t[1]=c,t[2]=n,t[3]=o,t[4]=a,t[5]=r,t[6]=u):u=t[6];let d=u,f;t[7]===d?f=t[8]:(f=e=>{e.preventDefault(),d()},t[7]=d,t[8]=f);let p=i.isPending,m;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageName`,children:`Name`})}),t[9]=m):m=t[9];let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{s(e.target.value)},t[10]=h):h=t[10];let g;t[11]===o?g=t[12]:(g=(0,Q.jsxs)(K,{children:[m,(0,Q.jsx)(H,{id:`imageName`,onChange:h,placeholder:`my-image`,value:o})]}),t[11]=o,t[12]=g);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageDescription`,children:`Description`})}),t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{l(e.target.value)},t[14]=y):y=t[14];let b;t[15]===c?b=t[16]:(b=(0,Q.jsxs)(K,{children:[v,(0,Q.jsx)(De,{id:`imageDescription`,onChange:y,placeholder:`Optional description`,rows:2,value:c})]}),t[15]=c,t[16]=b);let x;t[17]!==c||t[18]!==n||t[19]!==o?(x=Gt(n,o,c),t[17]=c,t[18]=n,t[19]=o,t[20]=x):x=t[20];let S;t[21]===x?S=t[22]:(S=(0,Q.jsx)(L,{commands:x}),t[21]=x,t[22]=S);let C=i.error,w=i.isPending,T;t[23]===o?T=t[24]:(T=o.trim(),t[23]=o,t[24]=T);let E=!T,D;t[25]!==i.error||t[26]!==i.isPending||t[27]!==r||t[28]!==E?(D=(0,Q.jsx)(Ue,{error:C,errorMsg:`Failed to create image`,isPending:w,isSubmitting:!1,onCancel:r,pendingLabel:`Creating…`,submitDisabled:E,submitLabel:`Create image`}),t[25]=i.error,t[26]=i.isPending,t[27]=r,t[28]=E,t[29]=D):D=t[29];let O;t[30]!==i.isPending||t[31]!==S||t[32]!==D||t[33]!==g||t[34]!==b?(O=(0,Q.jsxs)(We,{className:`space-y-6`,locked:p,children:[g,b,S,D]}),t[30]=i.isPending,t[31]=S,t[32]=D,t[33]=g,t[34]=b,t[35]=O):O=t[35];let k;t[36]!==O||t[37]!==f?(k=(0,Q.jsx)(`form`,{onSubmit:f,children:O}),t[36]=O,t[37]=f,t[38]=k):k=t[38];let A;return t[39]!==n||t[40]!==r||t[41]!==k?(A=(0,Q.jsx)(Ge,{onClose:r,subtitle:n,title:`Create image (AMI)`,children:k}),t[39]=n,t[40]=r,t[41]=k,t[42]=A):A=t[42],A}function qt(e,t){return[{label:`Modify Instance Attribute`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 modify-instance-attribute`},...N(`\\ + --instance-id`,e),...N(`\\ + --instance-type`,`Value=${I(t,`InstanceType`)}`)]}]}function Jt(e){let t=(0,Z.c)(38),{instance:n,onClose:r}=e,{data:i}=p(X),a=ie(),[o,s]=(0,Wt.useState)(n.InstanceType??``),c=n.InstanceId??``,l;t[0]!==c||t[1]!==a||t[2]!==r||t[3]!==o?(l=async function(){try{await a.mutateAsync({instanceId:c,instanceType:o})}catch{return}r()},t[0]=c,t[1]=a,t[2]=r,t[3]=o,t[4]=l):l=t[4];let u=l,d;t[5]===u?d=t[6]:(d=e=>{e.preventDefault(),u()},t[5]=u,t[6]=d);let f=a.isPending,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance type`})}),t[7]=m):m=t[7];let h;t[8]===i?.InstanceTypes?h=t[9]:(h=i?.InstanceTypes??[],t[8]=i?.InstanceTypes,t[9]=h);let g;t[10]!==o||t[11]!==h?(g=(0,Q.jsx)(Ke,{className:`w-full`,id:`instanceType`,instanceTypes:h,onValueChange:s,value:o}),t[10]=o,t[11]=h,t[12]=g):g=t[12];let _;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(W,{children:`The instance must be stopped.`}),t[13]=_):_=t[13];let v;t[14]===g?v=t[15]:(v=(0,Q.jsxs)(K,{children:[m,g,_]}),t[14]=g,t[15]=v);let y;t[16]!==c||t[17]!==o?(y=qt(c,o),t[16]=c,t[17]=o,t[18]=y):y=t[18];let b;t[19]===y?b=t[20]:(b=(0,Q.jsx)(L,{commands:y}),t[19]=y,t[20]=b);let x=!o||o===n.InstanceType,S;t[21]!==a.error||t[22]!==a.isPending||t[23]!==r||t[24]!==x?(S=(0,Q.jsx)(Ue,{error:a.error,errorMsg:`Failed to change the instance type`,isPending:a.isPending,isSubmitting:!1,onCancel:r,pendingLabel:`Saving…`,submitDisabled:x,submitLabel:`Save`}),t[21]=a.error,t[22]=a.isPending,t[23]=r,t[24]=x,t[25]=S):S=t[25];let C;t[26]!==a.isPending||t[27]!==b||t[28]!==S||t[29]!==v?(C=(0,Q.jsxs)(We,{className:`space-y-6`,locked:f,children:[v,b,S]}),t[26]=a.isPending,t[27]=b,t[28]=S,t[29]=v,t[30]=C):C=t[30];let w;t[31]!==C||t[32]!==d?(w=(0,Q.jsx)(`form`,{onSubmit:d,children:C}),t[31]=C,t[32]=d,t[33]=w):w=t[33];let T;return t[34]!==c||t[35]!==r||t[36]!==w?(T=(0,Q.jsx)(Ge,{onClose:r,subtitle:c,title:`Change instance type`,children:w}),t[34]=c,t[35]=r,t[36]=w,t[37]=T):T=t[37],T}function Yt(e){let t=(0,Z.c)(101),{instance:n,layout:r,tab:i,onTabChange:a,onTerminated:o}=e,s=n.InstanceId??``,c=n.State?.Name??``,l=_(),u=f(),d=le(),p=de(),m=ae(),h=se(),[g,v]=(0,Wt.useState)(``),y=d.error??p.error??m.error??h.error,x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(e){e||v(``)},t[0]=x):x=t[0];let S=x,D=c!==`stopped`||d.isPending,O;t[1]!==s||t[2]!==d?(O=()=>{d.mutate(s)},t[1]=s,t[2]=d,t[3]=O):O=t[3];let A;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(E,{"data-icon":`inline-start`}),t[4]=A):A=t[4];let j;t[5]!==D||t[6]!==O?(j=(0,Q.jsxs)(R,{disabled:D,onClick:O,size:`sm`,variant:`outline`,children:[A,`Start`]}),t[5]=D,t[6]=O,t[7]=j):j=t[7];let M=c!==`running`||p.isPending,N;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{v(`stop`)},t[8]=N):N=t[8];let P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(w,{"data-icon":`inline-start`}),t[9]=P):P=t[9];let F;t[10]===M?F=t[11]:(F=(0,Q.jsxs)(R,{disabled:M,onClick:N,size:`sm`,variant:`outline`,children:[P,`Stop`]}),t[10]=M,t[11]=F);let I=c!==`running`||m.isPending,L;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{v(`reboot`)},t[12]=L):L=t[12];let te;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(k,{"data-icon":`inline-start`}),t[13]=te):te=t[13];let z;t[14]===I?z=t[15]:(z=(0,Q.jsxs)(R,{disabled:I,onClick:L,size:`sm`,variant:`outline`,children:[te,`Reboot`]}),t[14]=I,t[15]=z);let B;t[16]!==z||t[17]!==j||t[18]!==F?(B=(0,Q.jsxs)(T,{"aria-label":`Power`,children:[j,F,z]}),t[16]=z,t[17]=j,t[18]=F,t[19]=B):B=t[19];let V;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Q.jsx)(R,{size:`sm`,variant:`outline`}),t[20]=V):V=t[20];let H;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Q.jsxs)(xe,{render:V,children:[`Actions`,(0,Q.jsx)(b,{"data-icon":`inline-end`})]}),t[21]=H):H=t[21];let U;t[22]!==s||t[23]!==r||t[24]!==l||t[25]!==i?(U=r===`auto`&&(0,Q.jsxs)(we,{onClick:()=>{l({to:`/ec2/describe-instances/$id`,params:{id:s},search:{tab:i}})},children:[(0,Q.jsx)(C,{}),`Open instance page`]}),t[22]=s,t[23]=r,t[24]=l,t[25]=i,t[26]=U):U=t[26];let W=c!==`running`,G;t[27]!==s||t[28]!==a||t[29]!==u?(G=()=>{a(`settings`),u.query({...ge(s),staleTime:0})},t[27]=s,t[28]=a,t[29]=u,t[30]=G):G=t[30];let K;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(Ut,{}),t[31]=K):K=t[31];let q;t[32]!==W||t[33]!==G?(q=(0,Q.jsxs)(we,{disabled:W,onClick:G,children:[K,`View console output`]}),t[32]=W,t[33]=G,t[34]=q):q=t[34];let ne=c!==`stopped`,re,ie;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(re=()=>{v(`type`)},ie=(0,Q.jsx)(Vt,{}),t[35]=re,t[36]=ie):(re=t[35],ie=t[36]);let oe;t[37]===ne?oe=t[38]:(oe=(0,Q.jsxs)(we,{disabled:ne,onClick:re,children:[ie,`Change instance type`]}),t[37]=ne,t[38]=oe);let ce=c!==`running`&&c!==`stopped`,ue,fe;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>{v(`image`)},fe=(0,Q.jsx)(zt,{}),t[39]=ue,t[40]=fe):(ue=t[39],fe=t[40]);let J;t[41]===ce?J=t[42]:(J=(0,Q.jsxs)(we,{disabled:ce,onClick:ue,children:[fe,`Create image`]}),t[41]=ce,t[42]=J);let pe;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(Se,{}),t[43]=pe):pe=t[43];let Y;t[44]!==c||t[45]!==h.isPending?(Y=[`terminated`,`shutting-down`].includes(c)||h.isPending,t[44]=c,t[45]=h.isPending,t[46]=Y):Y=t[46];let me;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(me=()=>{v(`terminate`)},t[47]=me):me=t[47];let he;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Q.jsx)(ee,{}),t[48]=he):he=t[48];let _e;t[49]===Y?_e=t[50]:(_e=(0,Q.jsxs)(we,{disabled:Y,onClick:me,variant:`destructive`,children:[he,`Terminate`]}),t[49]=Y,t[50]=_e);let X;t[51]!==U||t[52]!==q||t[53]!==oe||t[54]!==J||t[55]!==_e?(X=(0,Q.jsxs)(Te,{children:[H,(0,Q.jsxs)(Ce,{align:`end`,className:`min-w-48`,children:[U,q,oe,J,pe,_e]})]}),t[51]=U,t[52]=q,t[53]=oe,t[54]=J,t[55]=_e,t[56]=X):X=t[56];let ve;t[57]!==B||t[58]!==X?(ve=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[B,X]}),t[57]=B,t[58]=X,t[59]=ve):ve=t[59];let ye;t[60]===y?ye=t[61]:(ye=y&&(0,Q.jsx)(ke,{error:y}),t[60]=y,t[61]=ye);let be=`Stopping ${s} shuts its guest down. Its volumes are kept, and Start brings it back.`,Ee;t[62]!==s||t[63]!==p?(Ee=()=>{p.mutate(s,{onSettled:()=>{v(``)}})},t[62]=s,t[63]=p,t[64]=Ee):Ee=t[64];let De=g===`stop`,Oe;t[65]!==p.isPending||t[66]!==be||t[67]!==Ee||t[68]!==De?(Oe=(0,Q.jsx)(je,{confirmLabel:`Stop`,description:be,isPending:p.isPending,onConfirm:Ee,onOpenChange:S,open:De,pendingLabel:`Stopping…`,title:`Stop instance?`}),t[65]=p.isPending,t[66]=be,t[67]=Ee,t[68]=De,t[69]=Oe):Oe=t[69];let Ae=`Rebooting ${s} restarts its guest. Anything not written to disk is lost.`,Me;t[70]!==s||t[71]!==m?(Me=()=>{m.mutate(s,{onSettled:()=>{v(``)}})},t[70]=s,t[71]=m,t[72]=Me):Me=t[72];let Ne=g===`reboot`,Pe;t[73]!==m.isPending||t[74]!==Ae||t[75]!==Me||t[76]!==Ne?(Pe=(0,Q.jsx)(je,{confirmLabel:`Reboot`,description:Ae,isPending:m.isPending,onConfirm:Me,onOpenChange:S,open:Ne,pendingLabel:`Rebooting…`,title:`Reboot instance?`}),t[73]=m.isPending,t[74]=Ae,t[75]=Me,t[76]=Ne,t[77]=Pe):Pe=t[77];let Fe;t[78]!==g||t[79]!==n?(Fe=g===`type`&&(0,Q.jsx)(Jt,{instance:n,onClose:()=>{v(``)}}),t[78]=g,t[79]=n,t[80]=Fe):Fe=t[80];let Ie;t[81]!==g||t[82]!==s?(Ie=g===`image`&&(0,Q.jsx)(Kt,{instanceId:s,onClose:()=>{v(``)}}),t[81]=g,t[82]=s,t[83]=Ie):Ie=t[83];let Le=`Terminating ${s} deletes it and any volume set to delete on termination. This cannot be undone.`,Re;t[84]!==s||t[85]!==o||t[86]!==h?(Re=()=>{h.mutate(s,{onSettled:()=>{v(``)},onSuccess:o})},t[84]=s,t[85]=o,t[86]=h,t[87]=Re):Re=t[87];let ze=g===`terminate`,Be;t[88]!==Le||t[89]!==Re||t[90]!==ze||t[91]!==h.isPending?(Be=(0,Q.jsx)(je,{confirmLabel:`Terminate`,description:Le,isPending:h.isPending,onConfirm:Re,onOpenChange:S,open:ze,confirmPhrase:`terminate`,pendingLabel:`Terminating…`,title:`Terminate instance?`}),t[88]=Le,t[89]=Re,t[90]=ze,t[91]=h.isPending,t[92]=Be):Be=t[92];let Ve;return t[93]!==ve||t[94]!==ye||t[95]!==Oe||t[96]!==Pe||t[97]!==Fe||t[98]!==Ie||t[99]!==Be?(Ve=(0,Q.jsxs)(Q.Fragment,{children:[ve,ye,Oe,Pe,Fe,Ie,Be]}),t[93]=ve,t[94]=ye,t[95]=Oe,t[96]=Pe,t[97]=Fe,t[98]=Ie,t[99]=Be,t[100]=Ve):Ve=t[100],Ve}var Xt={connecting:`Connecting…`,unavailable:`No live statistics for this instance yet. Retrying.`,unsupported:`This cluster's gateway does not serve live statistics.`,error:`Live statistics are unavailable. Retrying.`};function Zt(e){return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}}function Qt(){return document.visibilityState===`visible`}var $t=new Qe().series();function en(e,t,n,r){let i=new Qe,a=new Je;t.current=a,qe(e,0,{onSamples:t=>{let r=Date.now();for(let e of t)a.observe(e.t,r);i.add(t);let o=i.series();n(t=>({...t,instanceId:e,series:o}))},onStatus:t=>{n(n=>({...n,instanceId:e,status:t}))}},r)}function tn(e,t){let n=(0,Z.c)(12),r=(0,Wt.useSyncExternalStore)(Zt,Qt),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=new Je,n[0]=i):i=n[0];let a=(0,Wt.useRef)(i),o;n[1]===e?o=n[2]:(o={instanceId:e,series:$t,status:`connecting`},n[1]=e,n[2]=o);let[s,c]=(0,Wt.useState)(o),l,u;n[3]!==e||n[4]!==t||n[5]!==r?(l=()=>{let n=new AbortController;return t&&r&&en(e,a,c,n.signal),()=>{n.abort()}},u=[e,t,r],n[3]=e,n[4]=t,n[5]=r,n[6]=l,n[7]=u):(l=n[6],u=n[7]),(0,Wt.useEffect)(l,u);let d;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(d={now:()=>a.current.now(Date.now())/1e3,span:Ye/1e3},n[8]=d):d=n[8];let f=d,p=s.instanceId===e,m=p?s.series:$t,h=p?s.status:`connecting`,g;return n[9]!==m||n[10]!==h?(g={series:m,status:h,live:f},n[9]=m,n[10]=h,n[11]=g):g=n[11],g}function nn(e){let t=(0,Z.c)(32),{instanceId:n,running:r}=e,{series:i,status:a,live:o}=tn(n,r),s;t[0]===i.cpu?s=t[1]:(s={title:`CPU utilization (%)`,format:Ze,max:100,series:[{label:`CPU`,color:`chart-1`,values:i.cpu}]},t[0]=i.cpu,t[1]=s);let c;t[2]===i.networkIn?c=t[3]:(c={label:`In`,color:`chart-2`,values:i.networkIn},t[2]=i.networkIn,t[3]=c);let l;t[4]===i.networkOut?l=t[5]:(l={label:`Out`,color:`chart-3`,values:i.networkOut},t[4]=i.networkOut,t[5]=l);let u;t[6]!==c||t[7]!==l?(u={title:`Network`,format:$e,series:[c,l]},t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===i.packetsIn?d=t[10]:(d={label:`In`,color:`chart-2`,values:i.packetsIn},t[9]=i.packetsIn,t[10]=d);let f;t[11]===i.packetsOut?f=t[12]:(f={label:`Out`,color:`chart-5`,values:i.packetsOut},t[11]=i.packetsOut,t[12]=f);let p;t[13]!==d||t[14]!==f?(p={title:`Network packets`,format:Xe,series:[d,f]},t[13]=d,t[14]=f,t[15]=p):p=t[15];let m;t[16]!==s||t[17]!==u||t[18]!==p?(m=[s,u,p],t[16]=s,t[17]=u,t[18]=p,t[19]=m):m=t[19];let h=m,g;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Live statistics need a running instance.`}),t[20]=g):g=t[20];let _=g;if(r){let e;t[21]===a?e=t[22]:(e=a===`live`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-2 animate-pulse rounded-full bg-success motion-reduce:animate-none`}),`Live`]}):(0,Q.jsx)(`output`,{className:`text-xs text-muted-foreground`,children:Xt[a]}),t[21]=a,t[22]=e),_=e}let v;t[23]===_?v=t[24]:(v=(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:_}),t[23]=_,t[24]=v);let y;t[25]!==o||t[26]!==i.times||t[27]!==h?(y=h.map(e=>(0,Q.jsx)(et,{format:e.format,live:o,max:e.max,series:e.series,since:`-5 min`,times:i.times,title:e.title},e.title)),t[25]=o,t[26]=i.times,t[27]=h,t[28]=y):y=t[28];let b;return t[29]!==v||t[30]!==y?(b=(0,Q.jsx)(q,{title:`Instance statistics`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[v,y]})}),t[29]=v,t[30]=y,t[31]=b):b=t[31],b}function rn(e){let t=(0,Z.c)(18),{instance:n}=e,r=n.InstanceId??``,i=n.State?.Name===`running`,a;t[0]===r?a=t[1]:(a=ge(r),t[0]=r,t[1]=a);let{data:o,error:s,isFetching:c,refetch:l}=p(a),u=!i||c,d;t[2]===l?d=t[3]:(d=()=>{l()},t[2]=l,t[3]=d);let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(O,{"data-icon":`inline-start`}),t[4]=f):f=t[4];let m=c&&`Fetching…`,h=!c&&(o===void 0?`Fetch output`:`Refresh`),g;t[5]!==u||t[6]!==d||t[7]!==m||t[8]!==h?(g=(0,Q.jsxs)(R,{disabled:u,onClick:d,size:`sm`,variant:`outline`,children:[f,m,h]}),t[5]=u,t[6]=d,t[7]=m,t[8]=h,t[9]=g):g=t[9];let _;t[10]===s?_=t[11]:(_=s&&(0,Q.jsx)(ke,{error:s}),t[10]=s,t[11]=_);let v;t[12]===o?v=t[13]:(v=o!==void 0&&(0,Q.jsx)(`div`,{className:`w-full`,children:(0,Q.jsx)(Ve,{output:o||`(no output)`})}),t[12]=o,t[13]=v);let y;return t[14]!==g||t[15]!==_||t[16]!==v?(y=(0,Q.jsx)(q,{title:`Console output`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[g,_,v]})}),t[14]=g,t[15]=_,t[16]=v,t[17]=y):y=t[17],y}function an(e){let t=(0,Z.c)(44),{instance:n,name:r,tab:i,onTabChange:a,onClose:o,layout:s}=e,c=s===void 0?`auto`:s,l=n.InstanceId??``,u=c===`page`?`Back to instances`:`Close instance details`,d;t[0]!==l||t[1]!==c||t[2]!==i?(d=c===`auto`&&(0,Q.jsx)(h,{"aria-label":`Open instance page`,className:te({size:`icon-sm`,variant:`ghost`}),params:{id:l},search:{tab:i},to:`/ec2/describe-instances/$id`,children:(0,Q.jsx)(C,{})}),t[0]=l,t[1]=c,t[2]=i,t[3]=d):d=t[3];let f=r?l:void 0,p=n.State?.Name,m;t[4]===p?m=t[5]:(m=(0,Q.jsx)(Ie,{state:p}),t[4]=p,t[5]=m);let g;t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==a||t[10]!==i?(g=(0,Q.jsx)(Yt,{instance:n,layout:c,onTabChange:a,onTerminated:o,tab:i}),t[6]=n,t[7]=c,t[8]=o,t[9]=a,t[10]=i,t[11]=g):g=t[11];let _;t[12]!==m||t[13]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[m,g]}),t[12]=m,t[13]=g,t[14]=_):_=t[14];let v;t[15]===n?v=t[16]:(v={id:`overview`,label:`Overview`,icon:x,content:(0,Q.jsx)(gt,{instance:n})},t[15]=n,t[16]=v);let y=n.State?.Name===`running`,b;t[17]!==l||t[18]!==y?(b={id:`monitoring`,label:`Monitoring`,icon:Nt,content:(0,Q.jsx)(nn,{instanceId:l,running:y})},t[17]=l,t[18]=y,t[19]=b):b=t[19];let S;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=[`ec2`,`instances`],t[20]=S):S=t[20];let w;t[21]!==n.InstanceId||t[22]!==n.Tags?(w=(0,Q.jsx)(He,{id:n.InstanceId,invalidate:S,tags:n.Tags}),t[21]=n.InstanceId,t[22]=n.Tags,t[23]=w):w=t[23];let T;t[24]===n?T=t[25]:(T=(0,Q.jsx)(rn,{instance:n}),t[24]=n,t[25]=T);let E;t[26]!==w||t[27]!==T?(E={id:`settings`,label:`Settings`,icon:j,content:(0,Q.jsxs)(Q.Fragment,{children:[w,T]})},t[26]=w,t[27]=T,t[28]=E):E=t[28];let D;t[29]!==b||t[30]!==E||t[31]!==v?(D=[v,b,E],t[29]=b,t[30]=E,t[31]=v,t[32]=D):D=t[32];let O=r??l,k;return t[33]!==c||t[34]!==o||t[35]!==a||t[36]!==D||t[37]!==O||t[38]!==u||t[39]!==d||t[40]!==f||t[41]!==_||t[42]!==i?(k=(0,Q.jsx)(ne,{closeLabel:u,fullPage:d,label:`Instance details`,layout:c,onClose:o,onTabChange:a,subtitle:f,summary:_,tab:i,tabs:D,title:O}),t[33]=c,t[34]=o,t[35]=a,t[36]=D,t[37]=O,t[38]=u,t[39]=d,t[40]=f,t[41]=_,t[42]=i,t[43]=k):k=t[43],k}function on(){return{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 run-instances`}}function sn(e){return N(`\\ + --count`,(e.count??0)||1)}function cn(e){return`'${e.replaceAll(`'`,String.raw`'\''`)}'`}function ln(e){let t=e.name?.trim();return t?N(`\\ + --tag-specifications`,cn(JSON.stringify([{ResourceType:`instance`,Tags:[{Key:`Name`,Value:t}]}]))):[]}function un(e){let t=e.launchTemplateVersion||`$Default`;return{label:`Run Instances`,parts:[on(),...N(`\\ + --launch-template`,`LaunchTemplateId=${e.launchTemplateId},Version=${t}`),...sn(e),...ln(e)]}}function dn(e){return[on(),...N(`\\ + --image-id`,I(e.imageId??``,`ImageId`)),...N(`\\ + --instance-type`,I(e.instanceType??``,`InstanceType`)),...N(`\\ + --key-name`,I(e.keyName??``,`KeyName`)),...M(`\\ + --subnet-id`,e.subnetId),...M(`\\ + --placement`,e.placementGroupName&&`GroupName=${e.placementGroupName}`),...sn(e),...ln(e)]}function fn(e,t){return{label:`Create security group`,parts:P(`SG_ID`,`AWS_PROFILE=spinifex aws ec2 create-security-group`,[...N(`\\ + --group-name`,I(e.newSgName??``,`name`)),...N(`\\ + --description`,`'${e.newSgDescription||`Created by launch wizard`}'`),...N(`\\ + --vpc-id`,t??``)],`GroupId`)}}function pn(e){let t=ce(e);if(t.length===0)return;let n=JSON.stringify(t);return{label:`Authorize inbound rules`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 authorize-security-group-ingress`},...N(`\\ + --group-id`,`$SG_ID`),...N(`\\ + --ip-permissions`,`'${n}'`)]}}function mn(e,t){if((e.securityGroupMode||`create`)!==`create`)return{commands:[],parts:M(`\\ + --security-group-ids`,e.securityGroupIds?.join(` `))};let n=pn(e);return{commands:[fn(e,t),...n?[n]:[]],parts:N(`\\ + --security-group-ids`,`$SG_ID`)}}function hn(e){let{rootDeleteOnTermination:t,rootVolumeSize:n,rootVolumeType:r}=e;if(n===void 0&&r===void 0&&t===void 0)return[];let i={VolumeSize:n,VolumeType:r||void 0,DeleteOnTermination:t},a=JSON.stringify([{DeviceName:e.rootDeviceName||`/dev/sda1`,Ebs:i}]);return N(`\\ + --block-device-mappings`,`'${a}'`)}function gn(e,t){if(e.launchTemplateId)return[un(e)];let n=mn(e,t),r=[...dn(e),...n.parts,...hn(e)];return[...n.commands,{label:`Run Instances`,parts:r}]}var _n=new Map([[`alpine`,`/assets/alpine-Bcmoufgu.svg`],[`centos`,`/assets/centos-BBbnm4JZ.svg`],[`debian`,`/assets/debian-B_qSwqdF.svg`],[`rocky`,`/assets/rocky-DkVCjoIs.svg`],[`ubuntu`,`/assets/ubuntu-6CTPzEln.svg`]]);function vn(e){let t=(0,Z.c)(11),{distro:n,size:r}=e,i=(r===void 0?`md`:r)===`md`?`size-8`:`size-5`;if(!n){let e=`${i} text-muted-foreground`,n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(Lt,{"aria-hidden":!0,className:e}),t[0]=e,t[1]=n),n}let a;t[2]===n?a=t[3]:(a=_n.get(n),t[2]=n,t[3]=a);let o=a;if(!o){let e=`${i} text-muted-foreground`,r;return t[4]!==n||t[5]!==e?(r=(0,Q.jsx)(A,{"aria-hidden":!0,className:e,"data-distro":n}),t[4]=n,t[5]=e,t[6]=r):r=t[6],r}let s=`${i} object-contain`,c;return t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,Q.jsx)(`img`,{alt:``,className:s,"data-distro":n,src:o}),t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}var yn=`other`;function bn(e){let t=(0,Z.c)(28),{images:n,arch:r,value:i,onChange:a,invalid:l}=e,f,p,m,h,g,_,v;if(t[0]!==r||t[1]!==n||t[2]!==l||t[3]!==a||t[4]!==i){v=Symbol.for(`react.early_return_sentinel`);bb0:{f=lt(n,r);let e;t[12]===i?e=t[13]:(e=e=>e.ImageId===i,t[12]=i,t[13]=e),p=n.find(e);let y=yt(p?.Name);y&&f.distros.some(e=>e.distro===y.distro)?m=y.distro:p&&f.other.includes(p)&&(m=yn);let b=f.distros.find(e=>e.distro===m);if(f.distros.length===0&&f.other.length===0){let e=r?` for ${r}`:``,n;t[14]===e?n=t[15]:(n=(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No images are available`,e,`.`]}),t[14]=e,t[15]=n),v=n;break bb0}h=`flex flex-col gap-3`,g=(0,Q.jsxs)(Dt,{label:`Operating system`,children:[f.distros.map(e=>(0,Q.jsx)(Ot,{checked:e.distro===m,icon:(0,Q.jsx)(vn,{distro:e.distro}),label:ct(e.distro),onSelect:()=>{let t=e.versions[0]?.image.ImageId;t&&a(t)}},e.distro)),f.other.length>0&&(0,Q.jsx)(Ot,{checked:m===yn,icon:(0,Q.jsx)(vn,{}),label:`Other images`,onSelect:()=>{let e=f.other[0]?.ImageId;e&&a(e)}})]}),_=b&&(0,Q.jsxs)(K,{children:[(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageVersion`,children:`Version`})}),(0,Q.jsxs)(d,{onValueChange:e=>{a(e??``)},value:i,children:[(0,Q.jsx)(u,{"aria-invalid":l,className:`w-full`,id:`imageVersion`,children:(0,Q.jsx)(o,{children:y&&`${ct(y.distro)} ${y.version}`})}),(0,Q.jsx)(c,{children:b.versions.map((e,t)=>{let{image:n,version:r}=e;return(0,Q.jsxs)(s,{value:n.ImageId??``,children:[ct(b.distro),` `,r,t===0?` (latest)`:``]},n.ImageId)})})]}),(0,Q.jsx)(Sn,{image:p})]})}t[0]=r,t[1]=n,t[2]=l,t[3]=a,t[4]=i,t[5]=f,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_,t[11]=v}else f=t[5],p=t[6],m=t[7],h=t[8],g=t[9],_=t[10],v=t[11];if(v!==Symbol.for(`react.early_return_sentinel`))return v;let y;t[16]!==f||t[17]!==l||t[18]!==a||t[19]!==p||t[20]!==m||t[21]!==i?(y=m===yn&&(0,Q.jsxs)(K,{children:[(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`imageId`,children:`Image`})}),(0,Q.jsxs)(d,{onValueChange:e=>{a(e??``)},value:i,children:[(0,Q.jsx)(u,{"aria-invalid":l,className:`w-full`,id:`imageId`,children:(0,Q.jsx)(o,{children:p?.Name??p?.ImageId})}),(0,Q.jsx)(c,{children:f.other.map(xn)})]}),(0,Q.jsx)(Sn,{image:p})]}),t[16]=f,t[17]=l,t[18]=a,t[19]=p,t[20]=m,t[21]=i,t[22]=y):y=t[22];let b;return t[23]!==h||t[24]!==g||t[25]!==_||t[26]!==y?(b=(0,Q.jsxs)(`div`,{className:h,children:[g,_,y]}),t[23]=h,t[24]=g,t[25]=_,t[26]=y,t[27]=b):b=t[27],b}function xn(e){return(0,Q.jsx)(s,{value:e.ImageId??``,children:e.Name??e.ImageId},e.ImageId)}function Sn(e){let t=(0,Z.c)(6),{image:n}=e;if(!n)return null;let r;t[0]===n.ImageId?r=t[1]:(r=(0,Q.jsx)(`span`,{className:`font-mono`,children:n.ImageId}),t[0]=n.ImageId,t[1]=r);let i=n.Architecture&&` · ${n.Architecture}`,a=n.BootMode&&` · ${n.BootMode}`,o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,Q.jsxs)(W,{children:[r,i,a]}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}var Cn=new Map([[`af-south-1`,{country:`ZA`,city:`Cape Town`}],[`ap-east-1`,{country:`HK`,city:`Hong Kong`}],[`ap-east-2`,{country:`TW`,city:`Taipei`}],[`ap-northeast-1`,{country:`JP`,city:`Tokyo`}],[`ap-northeast-2`,{country:`KR`,city:`Seoul`}],[`ap-northeast-3`,{country:`JP`,city:`Osaka`}],[`ap-south-1`,{country:`IN`,city:`Mumbai`}],[`ap-south-2`,{country:`IN`,city:`Hyderabad`}],[`ap-southeast-1`,{country:`SG`,city:`Singapore`}],[`ap-southeast-2`,{country:`AU`,city:`Sydney`}],[`ap-southeast-3`,{country:`ID`,city:`Jakarta`}],[`ap-southeast-4`,{country:`AU`,city:`Melbourne`}],[`ap-southeast-5`,{country:`MY`,city:`Malaysia`}],[`ap-southeast-6`,{country:`NZ`,city:`New Zealand`}],[`ap-southeast-7`,{country:`TH`,city:`Thailand`}],[`ca-central-1`,{country:`CA`,city:`Central`}],[`ca-west-1`,{country:`CA`,city:`Calgary`}],[`cn-north-1`,{country:`CN`,city:`Beijing`}],[`cn-northwest-1`,{country:`CN`,city:`Ningxia`}],[`eu-central-1`,{country:`DE`,city:`Frankfurt`}],[`eu-central-2`,{country:`CH`,city:`Zurich`}],[`eu-north-1`,{country:`SE`,city:`Stockholm`}],[`eu-south-1`,{country:`IT`,city:`Milan`}],[`eu-south-2`,{country:`ES`,city:`Spain`}],[`eu-west-1`,{country:`IE`,city:`Ireland`}],[`eu-west-2`,{country:`GB`,city:`London`}],[`eu-west-3`,{country:`FR`,city:`Paris`}],[`il-central-1`,{country:`IL`,city:`Tel Aviv`}],[`me-central-1`,{country:`AE`,city:`UAE`}],[`me-south-1`,{country:`BH`,city:`Bahrain`}],[`mx-central-1`,{country:`MX`,city:`Mexico`}],[`sa-east-1`,{country:`BR`,city:`São Paulo`}],[`us-east-1`,{country:`US`,city:`N. Virginia`}],[`us-east-2`,{country:`US`,city:`Ohio`}],[`us-gov-east-1`,{country:`US`,city:`GovCloud (US-East)`}],[`us-gov-west-1`,{country:`US`,city:`GovCloud (US-West)`}],[`us-west-1`,{country:`US`,city:`N. California`}],[`us-west-2`,{country:`US`,city:`Oregon`}]]);function wn(e){return e?Cn.get(e.toLowerCase()):void 0}function $(e,t,n,r=5){let i=n*.45,a=[];for(let o=0;o(0,Q.jsx)(`rect`,{fill:e,height:t,width:30,y:n*t},`${e}-${n}`))}function En(...e){let t=30/e.length;return e.map((e,n)=>(0,Q.jsx)(`rect`,{fill:e,height:20,width:t,x:n*t},`${e}-${n}`))}function Dn(e,t){return(0,Q.jsxs)(`g`,{children:[(0,Q.jsx)(`rect`,{fill:`#012169`,height:t,width:e}),(0,Q.jsx)(`path`,{d:`M0,0 L${e},${t} M${e},0 L0,${t}`,stroke:`#fff`,strokeWidth:t/5}),(0,Q.jsx)(`path`,{d:`M0,0 L${e},${t} M${e},0 L0,${t}`,stroke:`#C8102E`,strokeWidth:t/15}),(0,Q.jsx)(`path`,{d:`M${e/2},0 V${t} M0,${t/2} H${e}`,stroke:`#fff`,strokeWidth:t/3}),(0,Q.jsx)(`path`,{d:`M${e/2},0 V${t} M0,${t/2} H${e}`,stroke:`#C8102E`,strokeWidth:t/5})]})}var On={AE:()=>(0,Q.jsxs)(Q.Fragment,{children:[Tn(`#00732F`,`#fff`,`#000`),(0,Q.jsx)(`rect`,{fill:`#FF0000`,height:20,width:8})]}),AU:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#012169`,height:20,width:30}),Dn(15,10),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(7.5,15,2.6,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(22.5,4,1.2,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(19,9,1.2,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(26,8,1.2,7)}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(22.5,16,1.4,7)})]}),BH:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#CE1126`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:`0,0 8,0 11,2 8,4 11,6 8,8 11,10 8,12 11,14 8,16 11,18 8,20 0,20`})]}),BR:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#009C3B`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#FFDF00`,points:`15,2.5 27,10 15,17.5 3,10`}),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`#002776`,r:4.5})]}),CA:()=>(0,Q.jsxs)(Q.Fragment,{children:[En(`#D80621`,`#fff`,`#fff`,`#D80621`),(0,Q.jsx)(`polygon`,{fill:`#D80621`,points:$(15,10,5,5)})]}),CH:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#DA291C`,height:20,width:30}),(0,Q.jsx)(`path`,{d:`M15,4 V16 M9,10 H21`,stroke:`#fff`,strokeWidth:3.5})]}),CN:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#EE1C25`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(6,6,3.5)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(11,2.5,1)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(13,5,1)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(13,8.5,1)}),(0,Q.jsx)(`polygon`,{fill:`#FFFF00`,points:$(11,11,1)})]}),DE:()=>(0,Q.jsx)(Q.Fragment,{children:Tn(`#000`,`#DD0000`,`#FFCE00`)}),ES:()=>(0,Q.jsx)(Q.Fragment,{children:Tn(`#AA151B`,`#F1BF00`,`#F1BF00`,`#AA151B`)}),FR:()=>(0,Q.jsx)(Q.Fragment,{children:En(`#002395`,`#fff`,`#ED2939`)}),GB:()=>(0,Q.jsx)(Q.Fragment,{children:Dn(30,20)}),HK:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#DE2910`,height:20,width:30}),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:$(15,10,6,5)})]}),ID:()=>(0,Q.jsx)(Q.Fragment,{children:Tn(`#CE1126`,`#fff`)}),IE:()=>(0,Q.jsx)(Q.Fragment,{children:En(`#169B62`,`#fff`,`#FF883E`)}),IL:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#fff`,height:20,width:30}),(0,Q.jsx)(`rect`,{fill:`#0038B8`,height:2.5,width:30,y:2}),(0,Q.jsx)(`rect`,{fill:`#0038B8`,height:2.5,width:30,y:15.5}),(0,Q.jsx)(`polygon`,{fill:`none`,points:`15,5.5 19,12.5 11,12.5`,stroke:`#0038B8`,strokeWidth:1}),(0,Q.jsx)(`polygon`,{fill:`none`,points:`15,14.5 19,7.5 11,7.5`,stroke:`#0038B8`,strokeWidth:1})]}),IN:()=>(0,Q.jsxs)(Q.Fragment,{children:[Tn(`#FF9933`,`#fff`,`#138808`),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`none`,r:2.6,stroke:`#000080`,strokeWidth:.8})]}),IT:()=>(0,Q.jsx)(Q.Fragment,{children:En(`#009246`,`#fff`,`#CE2B37`)}),JP:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#fff`,height:20,width:30}),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`#BC002D`,r:6})]}),KR:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#fff`,height:20,width:30}),(0,Q.jsx)(`path`,{d:`M10,10 A5,5 0 0 1 20,10 Z`,fill:`#CD2E3A`}),(0,Q.jsx)(`path`,{d:`M10,10 A5,5 0 0 0 20,10 Z`,fill:`#0047A0`})]}),MX:()=>(0,Q.jsxs)(Q.Fragment,{children:[En(`#006847`,`#fff`,`#CE1126`),(0,Q.jsx)(`circle`,{cx:15,cy:10,fill:`#8C5A2B`,r:2.6})]}),MY:()=>(0,Q.jsxs)(Q.Fragment,{children:[Tn(`#CC0001`,`#fff`,`#CC0001`,`#fff`,`#CC0001`,`#fff`,`#CC0001`),(0,Q.jsx)(`rect`,{fill:`#010066`,height:11.4,width:15}),(0,Q.jsx)(`circle`,{cx:6,cy:5.7,fill:`#FFCC00`,r:3.6}),(0,Q.jsx)(`circle`,{cx:7.4,cy:5.7,fill:`#010066`,r:3}),(0,Q.jsx)(`polygon`,{fill:`#FFCC00`,points:$(11.5,5.7,2.4,7)})]}),NZ:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#012169`,height:20,width:30}),Dn(15,10),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(22.5,4,1.4)}),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(19.5,9.5,1.4)}),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(25.5,8.5,1.4)}),(0,Q.jsx)(`polygon`,{fill:`#C8102E`,points:$(22.5,16,1.6)})]}),SE:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#006AA7`,height:20,width:30}),(0,Q.jsx)(`path`,{d:`M11,0 V20 M0,10 H30`,stroke:`#FECC00`,strokeWidth:4})]}),SG:()=>(0,Q.jsxs)(Q.Fragment,{children:[Tn(`#EF3340`,`#fff`),(0,Q.jsx)(`circle`,{cx:6.5,cy:5,fill:`#fff`,r:3.4}),(0,Q.jsx)(`circle`,{cx:8,cy:5,fill:`#EF3340`,r:3.2})]}),TH:()=>(0,Q.jsx)(Q.Fragment,{children:Tn(`#A51931`,`#F4F5F8`,`#2D2A4A`,`#2D2A4A`,`#F4F5F8`,`#A51931`)}),TW:()=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`rect`,{fill:`#FE0000`,height:20,width:30}),(0,Q.jsx)(`rect`,{fill:`#000095`,height:10,width:15}),(0,Q.jsx)(`circle`,{cx:7.5,cy:5,fill:`#fff`,r:2.8})]}),US:()=>(0,Q.jsxs)(Q.Fragment,{children:[Tn(`#B22234`,`#fff`,`#B22234`,`#fff`,`#B22234`,`#fff`,`#B22234`),(0,Q.jsx)(`rect`,{fill:`#3C3B6E`,height:11.4,width:13})]}),ZA:()=>(0,Q.jsxs)(Q.Fragment,{children:[Tn(`#E03C31`,`#001489`),(0,Q.jsx)(`polygon`,{fill:`#fff`,points:`0,0 4,0 14,8 30,8 30,12 14,12 4,20 0,20`}),(0,Q.jsx)(`polygon`,{fill:`#007749`,points:`0,1.5 2,0 4,0 13,7 30,7 30,13 13,13 4,20 2,20 0,18.5`}),(0,Q.jsx)(`polygon`,{fill:`#FFB81C`,points:`0,3.5 9,10 0,16.5`}),(0,Q.jsx)(`polygon`,{fill:`#000`,points:`0,5 7,10 0,15`})]})};function kn(e){let t=(0,Z.c)(6),{country:n}=e;if(!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(S,{"aria-hidden":!0,className:`size-5 text-muted-foreground`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=On[n](),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,Q.jsx)(`svg`,{"aria-hidden":!0,className:`h-4 w-6 shrink-0 overflow-hidden rounded-xs ring-1 ring-border`,"data-country":n,viewBox:`0 0 30 20`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function An(e){let t=(0,Z.c)(11),{region:n,availabilityZone:r}=e,i;t[0]===n?i=t[1]:(i=wn(n),t[0]=n,t[1]=i);let a=i,o=a?.city,s=r??`zone set by subnet`,c;t[2]!==o||t[3]!==s?(c=[o,s].filter(Boolean),t[2]=o,t[3]=s,t[4]=c):c=t[4];let l=c.join(` · `),u=a?.country,d;t[5]===u?d=t[6]:(d=(0,Q.jsx)(kn,{country:u}),t[5]=u,t[6]=d);let f;return t[7]!==n||t[8]!==l||t[9]!==d?(f=(0,Q.jsx)(Dt,{columns:2,label:`Location`,children:(0,Q.jsx)(Ot,{checked:!0,description:l,icon:d,label:n,layout:`inline`})}),t[7]=n,t[8]=l,t[9]=d,t[10]=f):f=t[10],f}var jn=`gp3`,Mn=1,Nn=16384,Pn=`default`,Fn=[{name:`allowPing`,label:`Allow ping`,text:`Ping (ICMP echo request)`},{name:`allowSsh`,label:`Allow SSH`,text:`SSH (tcp/22)`},{name:`allowHttp`,label:`Allow HTTP`,text:`HTTP (tcp/80)`},{name:`allowHttps`,label:`Allow HTTPS`,text:`HTTPS (tcp/443)`}];function In(e){let t=(0,Z.c)(16),{control:n,errors:r,instanceTypeCapacity:i,register:a}=e,o;t[0]===n?o=t[1]:(o={control:n,name:`instanceType`},t[0]=n,t[1]=o);let s=xt(o),c=s?i[s]:void 0,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`count`,children:`Number of Instances`})}),t[2]=l):l=t[2];let u=!!r.count,d;t[3]===a?d=t[4]:(d=a(`count`,{valueAsNumber:!0}),t[3]=a,t[4]=d);let f;t[5]!==u||t[6]!==d?(f=(0,Q.jsx)(H,{"aria-describedby":`count-description`,"aria-invalid":u,id:`count`,type:`number`,...d}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p=s&&c!==void 0&&`Available capacity for ${s}: ${c}`,m;t[8]===p?m=t[9]:(m=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,id:`count-description`,children:p}),t[8]=p,t[9]=m);let h;t[10]===r.count?h=t[11]:(h=(0,Q.jsx)(G,{errors:[r.count]}),t[10]=r.count,t[11]=h);let g;return t[12]!==f||t[13]!==m||t[14]!==h?(g=(0,Q.jsxs)(K,{children:[l,f,m,h]}),t[12]=f,t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function Ln(e){let t=(0,Z.c)(13),{control:n,countField:r,launchTemplates:i,selectedTemplateId:a}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`launchTemplateId`,children:`Launch Template`}),(0,Q.jsx)(y,{label:`Launch template`,children:`A template supplies the image, instance type, key pair and network settings, so those fields are hidden while one is chosen.`})]}),t[0]=l):l=t[0];let f;t[1]===i?f=t[2]:(f=e=>{let{field:t}=e;return(0,Q.jsxs)(d,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,Q.jsx)(u,{className:`w-full`,id:`launchTemplateId`,children:(0,Q.jsx)(o,{})}),(0,Q.jsxs)(c,{children:[(0,Q.jsx)(s,{value:`none`,children:`none`}),i.map(Rn)]})]})},t[1]=i,t[2]=f);let p;t[3]!==n||t[4]!==f?(p=(0,Q.jsxs)(K,{children:[l,(0,Q.jsx)(Ct,{control:n,name:`launchTemplateId`,render:f})]}),t[3]=n,t[4]=f,t[5]=p):p=t[5];let m;t[6]!==n||t[7]!==a?(m=a&&(0,Q.jsx)(zn,{control:n,templateId:a}),t[6]=n,t[7]=a,t[8]=m):m=t[8];let h=a&&r,g;return t[9]!==p||t[10]!==m||t[11]!==h?(g=(0,Q.jsx)(q,{title:`Launch template`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p,m,h]})}),t[9]=p,t[10]=m,t[11]=h,t[12]=g):g=t[12],g}function Rn(e){return(0,Q.jsx)(s,{value:e.LaunchTemplateId??``,children:e.LaunchTemplateName??e.LaunchTemplateId},e.LaunchTemplateId)}function zn(e){let t=(0,Z.c)(23),{control:n,templateId:r}=e,i;t[0]===n?i=t[1]:(i={control:n,name:`launchTemplateVersion`},t[0]=n,t[1]=i);let a=xt(i),l;t[2]===r?l=t[3]:(l=he(r),t[2]=r,t[3]=l);let f=!!r,m;t[4]!==l||t[5]!==f?(m={...l,enabled:f},t[4]=l,t[5]=f,t[6]=m):m=t[6];let h=p(m),g;t[7]===h.data?.LaunchTemplateVersions?g=t[8]:(g=h.data?.LaunchTemplateVersions??[],t[7]=h.data?.LaunchTemplateVersions,t[8]=g);let _=g,v;t[9]!==a||t[10]!==_?(v=at(_,a)?.LaunchTemplateData,t[9]=a,t[10]=_,t[11]=v):v=t[11];let y=v,b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`launchTemplateVersion`,children:`Version`})}),t[12]=b):b=t[12];let x;t[13]===_?x=t[14]:(x=e=>{let{field:t}=e;return(0,Q.jsxs)(d,{onValueChange:t.onChange,value:t.value??`$Default`,children:[(0,Q.jsx)(u,{className:`w-full`,id:`launchTemplateVersion`,children:(0,Q.jsx)(o,{})}),(0,Q.jsxs)(c,{children:[(0,Q.jsx)(s,{value:`$Default`,children:`$Default`}),(0,Q.jsx)(s,{value:`$Latest`,children:`$Latest`}),_.map(Bn)]})]})},t[13]=_,t[14]=x);let S;t[15]!==n||t[16]!==x?(S=(0,Q.jsx)(Ct,{control:n,name:`launchTemplateVersion`,render:x}),t[15]=n,t[16]=x,t[17]=S):S=t[17];let C;t[18]===y?C=t[19]:(C=y&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-1 rounded-md border border-border p-3 text-xs`,children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`Configuration from this version:`}),(0,Q.jsxs)(`p`,{children:[`Image:`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:y.ImageId??`—`})]}),(0,Q.jsxs)(`p`,{children:[`Instance type:`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:y.InstanceType??`—`})]}),(0,Q.jsxs)(`p`,{children:[`Key pair:`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:y.KeyName??`—`})]})]}),t[18]=y,t[19]=C);let w;return t[20]!==C||t[21]!==S?(w=(0,Q.jsxs)(K,{children:[b,S,C]}),t[20]=C,t[21]=S,t[22]=w):w=t[22],w}function Bn(e){return(0,Q.jsxs)(s,{value:String(e.VersionNumber),children:[`v`,e.VersionNumber]},e.VersionNumber)}function Vn(e){let t=(0,Z.c)(21),{arch:n,architectures:r,control:i,errors:a,images:o,onSelectArchitecture:s,onSelectImage:c}=e,l;t[0]===i?l=t[1]:(l={control:i,name:`imageId`},t[0]=i,t[1]=l);let u=xt(l),d;t[2]!==n||t[3]!==r||t[4]!==s?(d=r.length>1&&(0,Q.jsxs)(K,{children:[(0,Q.jsxs)(V,{children:[`Architecture`,(0,Q.jsx)(y,{label:`Architecture`,children:`An instance type runs one architecture, so choosing one narrows both the images and the instance types to those that can run together.`})]}),(0,Q.jsx)(Dt,{columns:2,label:`Architecture`,children:r.map(e=>(0,Q.jsx)(Ot,{checked:n===e,description:e===`arm64`?`64-bit Arm`:`64-bit x86`,icon:(0,Q.jsx)(Ft,{"aria-hidden":!0,className:`size-5 text-muted-foreground`}),label:e,layout:`inline`,onSelect:()=>{s(e)}},e))})]}),t[2]=n,t[3]=r,t[4]=s,t[5]=d):d=t[5];let f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(V,{children:`Operating system`}),t[6]=f):f=t[6];let p=!!a.imageId,m=u??``,h;t[7]!==n||t[8]!==o||t[9]!==c||t[10]!==p||t[11]!==m?(h=(0,Q.jsx)(bn,{arch:n,images:o,invalid:p,onChange:c,value:m}),t[7]=n,t[8]=o,t[9]=c,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]===a.imageId?g=t[14]:(g=(0,Q.jsx)(G,{errors:[a.imageId]}),t[13]=a.imageId,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,Q.jsxs)(K,{children:[f,h,g]}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==d||t[19]!==_?(v=(0,Q.jsx)(q,{title:`Image`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[d,_]})}),t[18]=d,t[19]=_,t[20]=v):v=t[20],v}function Hn(e){let t=(0,Z.c)(27),{allInstanceTypes:n,arch:r,archTypeNames:i,archTypes:a,control:o,countField:s,errors:c,hasCompute:l,instanceTypeCapacity:u,keyPairs:d,placementGroups:f,register:p}=e,m=c.name,h;t[0]===p?h=t[1]:(h=p(`name`),t[0]=p,t[1]=h);let g;t[2]!==c.name||t[3]!==h?(g=(0,Q.jsx)(kt,{autoComplete:`off`,error:m,id:`instance-name`,info:`A Name tag, to tell instances apart in lists and search.`,label:`Name (optional)`,placeholder:`web-1`,...h}),t[2]=c.name,t[3]=h,t[4]=g):g=t[4];let _;t[5]!==n||t[6]!==r||t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u?(_=(0,Q.jsx)(Un,{allInstanceTypes:n,arch:r,archTypeNames:i,archTypes:a,control:o,errors:c,hasCompute:l,instanceTypeCapacity:u}),t[5]=n,t[6]=r,t[7]=i,t[8]=a,t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=_):_=t[13];let v;t[14]!==o||t[15]!==c||t[16]!==d?(v=(0,Q.jsx)(Gn,{control:o,errors:c,keyPairs:d}),t[14]=o,t[15]=c,t[16]=d,t[17]=v):v=t[17];let y;t[18]!==o||t[19]!==f?(y=(0,Q.jsx)(qn,{control:o,placementGroups:f}),t[18]=o,t[19]=f,t[20]=y):y=t[20];let b;return t[21]!==s||t[22]!==g||t[23]!==_||t[24]!==v||t[25]!==y?(b=(0,Q.jsx)(q,{title:`Instance`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[g,_,s,v,y]})}),t[21]=s,t[22]=g,t[23]=_,t[24]=v,t[25]=y,t[26]=b):b=t[26],b}function Un(e){let t=(0,Z.c)(43),{allInstanceTypes:n,arch:r,archTypeNames:i,archTypes:a,control:o,errors:s,hasCompute:c,instanceTypeCapacity:l}=e,u;t[0]===o?u=t[1]:(u={control:o,name:`instanceType`},t[0]=o,t[1]=u);let d=xt(u),f,p,m,h,g,_;if(t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a||t[6]!==o||t[7]!==s.instanceType||t[8]!==c||t[9]!==l||t[10]!==d){let e;t[17]===d?e=t[18]:(e=e=>e.InstanceType===d,t[17]=d,t[18]=e);let u=n.find(e);p=u?.GpuInfo?.Gpus?.[0],f=K,t[19]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`}),(0,Q.jsx)(y,{label:`Instance type`,children:`vCPUs and memory for the instance, with the free capacity for each type. Only types that can run the chosen image's architecture are listed.`})]}),t[19]=m):m=t[19];let v;t[20]!==a||t[21]!==s.instanceType||t[22]!==l?(v=e=>{let{field:t}=e;return(0,Q.jsx)(Ke,{"aria-invalid":!!s.instanceType,availabilityByType:l,className:`w-full`,id:`instanceType`,instanceTypes:a,onValueChange:t.onChange,value:t.value??``})},t[20]=a,t[21]=s.instanceType,t[22]=l,t[23]=v):v=t[23],t[24]!==o||t[25]!==v?(h=(0,Q.jsx)(Ct,{control:o,name:`instanceType`,render:v}),t[24]=o,t[25]=v,t[26]=h):h=t[26],t[27]!==r||t[28]!==i||t[29]!==c?(g=c&&i.length===0&&r&&(0,Q.jsxs)(W,{children:[`No instance types on this cluster run `,r,`.`]}),t[27]=r,t[28]=i,t[29]=c,t[30]=g):g=t[30],_=u&&(0,Q.jsx)(W,{"data-testid":`instance-type-size`,children:Tt(u)}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o,t[7]=s.instanceType,t[8]=c,t[9]=l,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h,t[15]=g,t[16]=_}else f=t[11],p=t[12],m=t[13],h=t[14],g=t[15],_=t[16];let v;t[31]===p?v=t[32]:(v=p&&(0,Q.jsx)(Wn,{device:p}),t[31]=p,t[32]=v);let b;t[33]===s.instanceType?b=t[34]:(b=(0,Q.jsx)(G,{errors:[s.instanceType]}),t[33]=s.instanceType,t[34]=b);let x;return t[35]!==f||t[36]!==m||t[37]!==h||t[38]!==g||t[39]!==_||t[40]!==v||t[41]!==b?(x=(0,Q.jsxs)(f,{children:[m,h,g,_,v,b]}),t[35]=f,t[36]=m,t[37]=h,t[38]=g,t[39]=_,t[40]=v,t[41]=b,t[42]=x):x=t[42],x}function Wn(e){let t=(0,Z.c)(8),{device:n}=e,r;t[0]===n.Name?r=t[1]:(r=n.Name?.startsWith(`MIG `)?n.Name.slice(4):void 0,t[0]=n.Name,t[1]=r);let a=r,o;t[2]===n.MemoryInfo?o=t[3]:(o=n.MemoryInfo?.SizeInMiB!==void 0&&` · ${i(n.MemoryInfo.SizeInMiB)} VRAM`,t[2]=n.MemoryInfo,t[3]=o);let s=a&&` · MIG ${a} slice`,c;return t[4]!==n.Name||t[5]!==o||t[6]!==s?(c=(0,Q.jsxs)(W,{children:[`GPU: `,n.Name,o,s]}),t[4]=n.Name,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Gn(e){let t=(0,Z.c)(12),{control:n,errors:r,keyPairs:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair`})}),t[0]=a):a=t[0];let s;t[1]!==r.keyName||t[2]!==i?(s=e=>{let{field:t}=e;return(0,Q.jsxs)(d,{onValueChange:t.onChange,value:t.value??``,children:[(0,Q.jsx)(u,{"aria-invalid":!!r.keyName,className:`w-full`,id:`keyName`,children:(0,Q.jsx)(o,{})}),(0,Q.jsx)(c,{children:i.map(Kn)})]})},t[1]=r.keyName,t[2]=i,t[3]=s):s=t[3];let l;t[4]!==n||t[5]!==s?(l=(0,Q.jsx)(Ct,{control:n,name:`keyName`,render:s}),t[4]=n,t[5]=s,t[6]=l):l=t[6];let f;t[7]===r.keyName?f=t[8]:(f=(0,Q.jsx)(G,{errors:[r.keyName]}),t[7]=r.keyName,t[8]=f);let p;return t[9]!==l||t[10]!==f?(p=(0,Q.jsxs)(K,{children:[a,l,f]}),t[9]=l,t[10]=f,t[11]=p):p=t[11],p}function Kn(e){return(0,Q.jsx)(s,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function qn(e){let t=(0,Z.c)(8),{control:n,placementGroups:r}=e,i;t[0]===r?i=t[1]:(i=r.filter(Yn),t[0]=r,t[1]=i);let a=i;if(a.length===0)return null;let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`placementGroupName`,children:`Placement Group`})}),t[2]=l):l=t[2];let f;t[3]===a?f=t[4]:(f=e=>{let{field:t}=e;return(0,Q.jsxs)(d,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,Q.jsx)(u,{className:`w-full`,id:`placementGroupName`,children:(0,Q.jsx)(o,{})}),(0,Q.jsxs)(c,{children:[(0,Q.jsx)(s,{value:`none`,children:`none`}),a.map(Jn)]})]})},t[3]=a,t[4]=f);let p;return t[5]!==n||t[6]!==f?(p=(0,Q.jsxs)(K,{children:[l,(0,Q.jsx)(Ct,{control:n,name:`placementGroupName`,render:f})]}),t[5]=n,t[6]=f,t[7]=p):p=t[7],p}function Jn(e){return(0,Q.jsxs)(s,{value:e.GroupName??``,children:[e.GroupName,` (`,e.Strategy,`)`]},e.GroupId)}function Yn(e){return e.State===void 0||e.State===`available`}function Xn(e){let t=(0,Z.c)(22),{control:n,defaultSubnet:r,effectiveSubnet:i,effectiveVpcId:a,errors:o,otherSubnets:s,register:c,routeTables:l,securityGroups:u,selectedSubnetId:d,setValue:f}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(V,{children:[`Location`,(0,Q.jsx)(y,{label:`Location`,children:`The region this cluster serves. The availability zone comes from the subnet the instance launches into.`})]}),t[0]=p):p=t[0];let m=i?.AvailabilityZone,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=re(),t[1]=h):h=t[1];let g;t[2]===m?g=t[3]:(g=(0,Q.jsxs)(K,{children:[p,(0,Q.jsx)(An,{availabilityZone:m,region:h})]}),t[2]=m,t[3]=g);let _;t[4]!==n||t[5]!==r||t[6]!==i||t[7]!==s||t[8]!==l||t[9]!==d?(_=(0,Q.jsx)(Qn,{control:n,defaultSubnet:r,effectiveSubnet:i,otherSubnets:s,routeTables:l,selectedSubnetId:d}),t[4]=n,t[5]=r,t[6]=i,t[7]=s,t[8]=l,t[9]=d,t[10]=_):_=t[10];let v;t[11]!==n||t[12]!==a||t[13]!==o||t[14]!==c||t[15]!==u||t[16]!==f?(v=(0,Q.jsx)(tr,{control:n,effectiveVpcId:a,errors:o,register:c,securityGroups:u,setValue:f}),t[11]=n,t[12]=a,t[13]=o,t[14]=c,t[15]=u,t[16]=f,t[17]=v):v=t[17];let b;return t[18]!==g||t[19]!==_||t[20]!==v?(b=(0,Q.jsx)(q,{title:`Network`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[g,_,v]})}),t[18]=g,t[19]=_,t[20]=v,t[21]=b):b=t[21],b}function Zn(e,t){let n=e.toSorted((e,t)=>ot(e).localeCompare(ot(t)));return t?[{label:`Public subnets`,subnets:n.filter(e=>jt(e,t))},{label:`Private subnets`,subnets:n.filter(e=>!jt(e,t))}].filter(e=>e.subnets.length>0):[{subnets:n}].filter(e=>e.subnets.length>0)}function Qn(e){let t=(0,Z.c)(18),{control:n,defaultSubnet:r,effectiveSubnet:i,otherSubnets:a,routeTables:l,selectedSubnetId:f}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`subnetId`,children:`Subnet`}),(0,Q.jsx)(y,{label:`Subnet`,children:`With no subnet chosen, EC2 places the instance in the default VPC's default subnet. It gets a private address there, and other instances in the VPC can reach it as its security groups allow. It gets a public address only if the subnet assigns one on launch.`})]}),t[0]=p):p=t[0];let m;t[1]!==r||t[2]!==i||t[3]!==a||t[4]!==l||t[5]!==f?(m=e=>{let{field:t}=e;return(0,Q.jsxs)(d,{onValueChange:e=>{t.onChange(e===Pn?void 0:e)},value:t.value??Pn,children:[(0,Q.jsx)(u,{className:`w-full`,id:`subnetId`,children:(0,Q.jsx)(o,{children:i?`${f?``:`Default: `}${ot(i)}`:`No subnet`})}),(0,Q.jsxs)(c,{children:[(0,Q.jsx)(s,{value:Pn,children:r?`Default: ${ot(r)}`:`No subnet`}),Zn(a,l).map($n)]})]})},t[1]=r,t[2]=i,t[3]=a,t[4]=l,t[5]=f,t[6]=m):m=t[6];let h;t[7]!==n||t[8]!==m?(h=(0,Q.jsx)(Ct,{control:n,name:`subnetId`,render:m}),t[7]=n,t[8]=m,t[9]=h):h=t[9];let g;t[10]!==i||t[11]!==l?(g=i?st(i,l&&jt(i,l)):`This account has no default subnet, so an instance launched without one gets no VPC network interface. Choose a subnet.`,t[10]=i,t[11]=l,t[12]=g):g=t[12];let _;t[13]===g?_=t[14]:(_=(0,Q.jsx)(W,{children:g}),t[13]=g,t[14]=_);let v;return t[15]!==h||t[16]!==_?(v=(0,Q.jsxs)(K,{children:[p,h,_]}),t[15]=h,t[16]=_,t[17]=v):v=t[17],v}function $n(e){return(0,Q.jsxs)(l,{children:[e.label&&(0,Q.jsx)(a,{children:e.label}),e.subnets.map(er)]},e.label??`subnets`)}function er(e){return(0,Q.jsx)(s,{value:e.SubnetId??``,children:ot(e)},e.SubnetId)}function tr(e){let t=(0,Z.c)(22),{control:n,effectiveVpcId:r,errors:i,register:a,securityGroups:o,setValue:s}=e,c;t[0]===n?c=t[1]:(c={control:n,name:`securityGroupMode`},t[0]=n,t[1]=c);let l=xt(c),u=xt({control:n,name:`securityGroupIds`})??[],d;t[2]!==r||t[3]!==o?(d=r?o.filter(e=>e.VpcId===r):o,t[2]=r,t[3]=o,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(V,{children:[`Security Group`,(0,Q.jsx)(y,{label:`Security group`,children:`A new group allows only the inbound ports switched on below. Outbound traffic is allowed either way.`})]}),t[5]=p):p=t[5];let m=r?`Applies to VPC ${r}`:`No VPC resolved — select a subnet`,h;t[6]===m?h=t[7]:(h=(0,Q.jsx)(W,{children:m}),t[6]=m,t[7]=h);let g;t[8]===n?g=t[9]:(g=(0,Q.jsx)(Ct,{control:n,name:`securityGroupMode`,render:nr}),t[8]=n,t[9]=g);let _;t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==u||t[14]!==s||t[15]!==l||t[16]!==f?(_=l===`create`?(0,Q.jsx)(rr,{control:n,errors:i,register:a}):(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsx)(At,{emptyText:`No security groups in the resolved VPC.`,groups:f,onChange:e=>{s(`securityGroupIds`,e,{shouldValidate:!0})},selected:u}),(0,Q.jsx)(G,{errors:[i.securityGroupIds]})]}),t[10]=n,t[11]=i,t[12]=a,t[13]=u,t[14]=s,t[15]=l,t[16]=f,t[17]=_):_=t[17];let v;return t[18]!==h||t[19]!==g||t[20]!==_?(v=(0,Q.jsxs)(K,{children:[p,h,g,_]}),t[18]=h,t[19]=g,t[20]=_,t[21]=v):v=t[21],v}function nr(e){let{field:t}=e;return(0,Q.jsxs)(B,{"aria-label":`Security group`,className:`flex w-auto`,onValueChange:t.onChange,value:t.value,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Create new security group`,value:`create`}),`Create new`]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Select existing security group`,value:`existing`}),`Select existing`]})]})}function rr(e){let t=(0,Z.c)(38),{control:n,errors:r,register:i}=e,a;t[0]===n?a=t[1]:(a={control:n,name:`ruleSource`},t[0]=n,t[1]=a);let o=xt(a),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`newSgName`,children:`Name`})}),t[2]=s):s=t[2];let c=!!r.newSgName,l;t[3]===i?l=t[4]:(l=i(`newSgName`),t[3]=i,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,Q.jsx)(H,{"aria-invalid":c,id:`newSgName`,type:`text`,...l}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===r.newSgName?d=t[9]:(d=(0,Q.jsx)(G,{errors:[r.newSgName]}),t[8]=r.newSgName,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,Q.jsxs)(K,{children:[s,u,d]}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`newSgDescription`,children:`Description`})}),t[13]=p):p=t[13];let m;t[14]===i?m=t[15]:(m=i(`newSgDescription`),t[14]=i,t[15]=m);let h;t[16]===m?h=t[17]:(h=(0,Q.jsxs)(K,{children:[p,(0,Q.jsx)(H,{id:`newSgDescription`,type:`text`,...m})]}),t[16]=m,t[17]=h);let g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(V,{children:`Inbound rules`}),t[18]=g):g=t[18];let _;t[19]===n?_=t[20]:(_=Fn.map(e=>{let{name:t,label:r,text:i}=e;return(0,Q.jsx)(Ct,{control:n,name:t,render:e=>{let{field:n}=e;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ee,{"aria-label":r,checked:n.value??!1,id:t,onCheckedChange:n.onChange}),(0,Q.jsx)(U,{htmlFor:t,children:i})]})}},t)}),t[19]=n,t[20]=_);let v;t[21]===_?v=t[22]:(v=(0,Q.jsxs)(K,{children:[g,(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:_})]}),t[21]=_,t[22]=v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(V,{children:`Source`}),t[23]=y):y=t[23];let b;t[24]===n?b=t[25]:(b=(0,Q.jsx)(Ct,{control:n,name:`ruleSource`,render:ir}),t[24]=n,t[25]=b);let x;t[26]!==r.customCidr||t[27]!==i||t[28]!==o?(x=o===`custom`&&(0,Q.jsxs)(`div`,{className:`mt-2`,children:[(0,Q.jsx)(H,{"aria-invalid":!!r.customCidr,placeholder:`203.0.113.0/24`,type:`text`,...i(`customCidr`)}),(0,Q.jsx)(G,{errors:[r.customCidr]})]}),t[26]=r.customCidr,t[27]=i,t[28]=o,t[29]=x):x=t[29];let S;t[30]!==b||t[31]!==x?(S=(0,Q.jsxs)(K,{children:[y,b,x]}),t[30]=b,t[31]=x,t[32]=S):S=t[32];let C;return t[33]!==h||t[34]!==v||t[35]!==S||t[36]!==f?(C=(0,Q.jsxs)(`div`,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[f,h,v,S]}),t[33]=h,t[34]=v,t[35]=S,t[36]=f,t[37]=C):C=t[37],C}function ir(e){let{field:t}=e;return(0,Q.jsxs)(B,{"aria-label":`Source`,className:`flex w-auto`,onValueChange:t.onChange,value:t.value,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Source anywhere`,value:`anywhere`}),`Anywhere (0.0.0.0/0)`]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(z,{"aria-label":`Source custom CIDR`,value:`custom`}),`Custom CIDR`]})]})}function ar(e){let t=(0,Z.c)(52),{control:n,errors:r,images:i,register:a}=e,s;t[0]===n?s=t[1]:(s={control:n,name:`imageId`},t[0]=n,t[1]=s);let l=xt(s),f;t[2]!==i||t[3]!==l?(f=rt(i,l),t[2]=i,t[3]=l,t[4]=f):f=t[4];let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(V,{children:[(0,Q.jsx)(`label`,{htmlFor:`rootVolumeSize`,children:`Size (GiB)`}),(0,Q.jsx)(y,{label:`Root volume size`,children:`Leave blank to use the image's own size. A larger size grows the root volume; it cannot be smaller than the image's snapshot.`})]}),t[5]=m):m=t[5];let h=!!r.rootVolumeSize,g=p.snapshotSize??Mn,_=p.snapshotSize?String(p.snapshotSize):`Image default`,v;t[6]===a?v=t[7]:(v=a(`rootVolumeSize`,{setValueAs:cr}),t[6]=a,t[7]=v);let b;t[8]!==h||t[9]!==g||t[10]!==_||t[11]!==v?(b=(0,Q.jsx)(H,{"aria-invalid":h,id:`rootVolumeSize`,max:Nn,min:g,placeholder:_,type:`number`,...v}),t[8]=h,t[9]=g,t[10]=_,t[11]=v,t[12]=b):b=t[12];let x=p.snapshotSize===void 0?`The image does not report a size.`:`Minimum ${p.snapshotSize} GiB, the image's snapshot size.`,S;t[13]===x?S=t[14]:(S=(0,Q.jsx)(W,{children:x}),t[13]=x,t[14]=S);let C;t[15]===r.rootVolumeSize?C=t[16]:(C=(0,Q.jsx)(G,{errors:[r.rootVolumeSize]}),t[15]=r.rootVolumeSize,t[16]=C);let w;t[17]!==S||t[18]!==C||t[19]!==b?(w=(0,Q.jsxs)(K,{children:[m,b,S,C]}),t[17]=S,t[18]=C,t[19]=b,t[20]=w):w=t[20];let T;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`rootVolumeType`,children:`Volume Type`})}),t[21]=T):T=t[21];let E;t[22]===r.rootVolumeType?E=t[23]:(E=e=>{let{field:t}=e;return(0,Q.jsxs)(d,{onValueChange:t.onChange,value:t.value??jn,children:[(0,Q.jsx)(u,{"aria-invalid":!!r.rootVolumeType,className:`w-full`,id:`rootVolumeType`,children:(0,Q.jsx)(o,{})}),(0,Q.jsx)(c,{children:wt.map(sr)})]})},t[22]=r.rootVolumeType,t[23]=E);let D;t[24]!==n||t[25]!==E?(D=(0,Q.jsx)(Ct,{control:n,name:`rootVolumeType`,render:E}),t[24]=n,t[25]=E,t[26]=D):D=t[26];let O;t[27]===r.rootVolumeType?O=t[28]:(O=(0,Q.jsx)(G,{errors:[r.rootVolumeType]}),t[27]=r.rootVolumeType,t[28]=O);let k;t[29]!==D||t[30]!==O?(k=(0,Q.jsxs)(K,{children:[T,D,O]}),t[29]=D,t[30]=O,t[31]=k):k=t[31];let A;t[32]!==w||t[33]!==k?(A=(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[w,k]}),t[32]=w,t[33]=k,t[34]=A):A=t[34];let j;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(V,{children:(0,Q.jsx)(`label`,{htmlFor:`rootDeviceName`,children:`Device Name`})}),t[35]=j):j=t[35];let M=!!r.rootDeviceName,N;t[36]===a?N=t[37]:(N=a(`rootDeviceName`),t[36]=a,t[37]=N);let P;t[38]!==M||t[39]!==N?(P=(0,Q.jsx)(H,{"aria-invalid":M,id:`rootDeviceName`,type:`text`,variant:`code`,...N}),t[38]=M,t[39]=N,t[40]=P):P=t[40];let F;t[41]===r.rootDeviceName?F=t[42]:(F=(0,Q.jsx)(G,{errors:[r.rootDeviceName]}),t[41]=r.rootDeviceName,t[42]=F);let I;t[43]!==P||t[44]!==F?(I=(0,Q.jsxs)(K,{children:[j,P,F]}),t[43]=P,t[44]=F,t[45]=I):I=t[45];let L;t[46]===n?L=t[47]:(L=(0,Q.jsx)(Ct,{control:n,name:`rootDeleteOnTermination`,render:or}),t[46]=n,t[47]=L);let ee;return t[48]!==A||t[49]!==I||t[50]!==L?(ee=(0,Q.jsx)(q,{title:`Root volume`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[A,I,L]})}),t[48]=A,t[49]=I,t[50]=L,t[51]=ee):ee=t[51],ee}function or(e){let{field:t}=e;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ee,{"aria-label":`Delete on termination`,checked:t.value??!0,id:`rootDeleteOnTermination`,onCheckedChange:t.onChange}),(0,Q.jsx)(U,{htmlFor:`rootDeleteOnTermination`,children:`Delete on termination`}),(0,Q.jsx)(y,{label:`Delete on termination`,children:`When on, the root volume is deleted with the instance. Turn it off to keep the volume after termination.`})]})}function sr(e){return(0,Q.jsx)(s,{value:e,children:e},e)}function cr(e){return e===``||e==null?void 0:Number(e)}function lr(){let e=(0,Z.c)(42),{data:t}=m(ye),{data:n}=m(ve),{data:r}=m(X),{data:i}=p(be),{data:a}=p(fe),{data:o}=m(_e),{data:s}=m(Y),{data:c}=m(J),{data:l}=m(pe),{data:u}=m(me),d;e[0]===t.Images?d=e[1]:(d=t.Images??[],e[0]=t.Images,e[1]=d);let f;e[2]===d?f=e[3]:(f=d.filter(fr),e[2]=d,e[3]=f);let h=f,g;e[4]===o.Subnets?g=e[5]:(g=o.Subnets??[],e[4]=o.Subnets,e[5]=g);let _=g,v;e[6]===c.Vpcs?v=e[7]:(v=c.Vpcs??[],e[6]=c.Vpcs,e[7]=v);let y=v,b;e[8]===_?b=e[9]:(b=_.find(dr),e[8]=_,e[9]=b);let x=b,S;e[10]===r.InstanceTypes?S=e[11]:(S=r.InstanceTypes??[],e[10]=r.InstanceTypes,e[11]=S);let C;e[12]===i?.available?C=e[13]:(C=i?.available??{},e[12]=i?.available,e[13]=C);let w;e[14]===n.KeyPairs?w=e[15]:(w=n.KeyPairs??[],e[14]=n.KeyPairs,e[15]=w);let T=a?.RouteTables,E;e[16]===s.PlacementGroups?E=e[17]:(E=s.PlacementGroups??[],e[16]=s.PlacementGroups,e[17]=E);let D;e[18]===l.SecurityGroups?D=e[19]:(D=l.SecurityGroups??[],e[18]=l.SecurityGroups,e[19]=D);let O;e[20]===u.LaunchTemplates?O=e[21]:(O=u.LaunchTemplates??[],e[20]=u.LaunchTemplates,e[21]=O);let k;e[22]===y?k=e[23]:(k=(y.find(ur)??y[0])?.VpcId,e[22]=y,e[23]=k);let A;if(e[24]!==x||e[25]!==_){let t;e[27]===x?t=e[28]:(t=e=>e!==x,e[27]=x,e[28]=t),A=_.filter(t),e[24]=x,e[25]=_,e[26]=A}else A=e[26];let j;return e[29]!==x||e[30]!==h||e[31]!==_||e[32]!==D||e[33]!==O||e[34]!==k||e[35]!==A||e[36]!==S||e[37]!==C||e[38]!==w||e[39]!==T||e[40]!==E?(j={images:h,allInstanceTypes:S,instanceTypeCapacity:C,keyPairs:w,subnets:_,routeTables:T,placementGroups:E,securityGroups:D,launchTemplates:O,defaultVpcId:k,defaultSubnet:x,otherSubnets:A},e[29]=x,e[30]=h,e[31]=_,e[32]=D,e[33]=O,e[34]=k,e[35]=A,e[36]=S,e[37]=C,e[38]=w,e[39]=T,e[40]=E,e[41]=j):j=e[41],j}function ur(e){return e.IsDefault}function dr(e){return e.DefaultForAz}function fr(e){return!Et(e)}function pr(e){let t=(0,Z.c)(117),{launchTemplateId:n,launchTemplateVersion:r,onClose:i}=e,{images:a,allInstanceTypes:o,instanceTypeCapacity:s,keyPairs:c,subnets:l,routeTables:u,placementGroups:d,securityGroups:f,launchTemplates:p,defaultVpcId:m,defaultSubnet:h,otherSubnets:g}=lr(),_=ue(),v=o.length>0,y,b;t[0]!==o||t[1]!==a?(y=vt(a),b=pt(y,o),t[0]=o,t[1]=a,t[2]=y,t[3]=b):(y=t[2],b=t[3]);let[x,S]=(0,Wt.useState)(b),C,w,T,E,D;t[4]!==o||t[5]!==x||t[6]!==a||t[7]!==s||t[8]!==c||t[9]!==n||t[10]!==r||t[11]!==f?(w=mt(o,x),C=ft(w),D=St,t[17]!==o||t[18]!==a||t[19]!==s?(T=_t(a,o,s),t[17]=o,t[18]=a,t[19]=s,t[20]=T):T=t[20],E=dt({images:a,arch:x,archTypeNames:C,keyPairs:c,securityGroups:f,launchTemplateId:n,launchTemplateVersion:r}),t[4]=o,t[5]=x,t[6]=a,t[7]=s,t[8]=c,t[9]=n,t[10]=r,t[11]=f,t[12]=C,t[13]=w,t[14]=T,t[15]=E,t[16]=D):(C=t[12],w=t[13],T=t[14],E=t[15],D=t[16]);let O;t[21]!==T||t[22]!==E?(O={resolver:T,defaultValues:E},t[21]=T,t[22]=E,t[23]=O):O=t[23];let{control:k,handleSubmit:A,register:j,setValue:M,getValues:N,formState:P}=D(O),{errors:F,isSubmitting:I}=P,ee;t[24]===k?ee=t[25]:(ee={control:k},t[24]=k,t[25]=ee);let R=xt(ee),te;t[26]===k?te=t[27]:(te={control:k,name:`subnetId`},t[26]=k,t[27]=te);let z=xt(te),B;t[28]===k?B=t[29]:(B={control:k,name:`launchTemplateId`},t[28]=k,t[29]=B);let V=xt(B),H;t[30]!==h||t[31]!==z||t[32]!==l?(H=ht(l,z,h),t[30]=h,t[31]=z,t[32]=l,t[33]=H):H=t[33];let U=H,W=U?.VpcId??m,G;t[34]!==F.imageId||t[35]!==a||t[36]!==M?(G=function(e){M(`imageId`,e,{shouldValidate:!!F.imageId}),M(`rootDeviceName`,rt(a,e).deviceName)},t[34]=F.imageId,t[35]=a,t[36]=M,t[37]=G):G=t[37];let K=G,q;t[38]!==o||t[39]!==N||t[40]!==a||t[41]!==K||t[42]!==M?(q=function(e){S(e);let t=lt(a,e),n=a.find(e=>e.ImageId===N(`imageId`)),r=n&&nt(n);if(!n||r&&r!==e){let e=it(t,yt(n?.Name)?.distro)??tt(t);K(e?.ImageId??``)}let i=o.find(e=>e.InstanceType===N(`instanceType`));i&&bt(i,e)||M(`instanceType`,ut(ft(mt(o,e)))??``)},t[38]=o,t[39]=N,t[40]=a,t[41]=K,t[42]=M,t[43]=q):q=t[43];let ne=q,re;t[44]!==_||t[45]!==W||t[46]!==v||t[47]!==i?(re=async e=>{if(!e.launchTemplateId&&!v)return;let t=e.launchTemplateId?{count:e.count,launchTemplateId:e.launchTemplateId,launchTemplateVersion:e.launchTemplateVersion,resolvedVpcId:W}:{...e,resolvedVpcId:W},n;try{n=await _.mutateAsync(t)}catch{return}let r=n.Instances??[];i(r.length===1?r[0]?.InstanceId:void 0)},t[44]=_,t[45]=W,t[46]=v,t[47]=i,t[48]=re):re=t[48];let ie=re,ae=p.length>0||!!n,oe;t[49]!==k||t[50]!==F||t[51]!==s||t[52]!==j?(oe=(0,Q.jsx)(In,{control:k,errors:F,instanceTypeCapacity:s,register:j}),t[49]=k,t[50]=F,t[51]=s,t[52]=j,t[53]=oe):oe=t[53];let se=oe,ce;t[54]!==v||t[55]!==V?(ce=!v&&!V&&(0,Q.jsx)(ke,{msg:`No compute available. No new instances can be created until compute is available.`}),t[54]=v,t[55]=V,t[56]=ce):ce=t[56];let le;t[57]!==A||t[58]!==ie?(le=A(ie),t[57]=A,t[58]=ie,t[59]=le):le=t[59];let de=I||_.isPending,fe;t[60]!==k||t[61]!==se||t[62]!==p||t[63]!==V||t[64]!==ae?(fe=ae&&(0,Q.jsx)(Ln,{control:k,countField:se,launchTemplates:p,selectedTemplateId:V}),t[60]=k,t[61]=se,t[62]=p,t[63]=V,t[64]=ae,t[65]=fe):fe=t[65];let J;t[66]!==o||t[67]!==x||t[68]!==C||t[69]!==w||t[70]!==y||t[71]!==k||t[72]!==se||t[73]!==h||t[74]!==U||t[75]!==W||t[76]!==F||t[77]!==v||t[78]!==a||t[79]!==s||t[80]!==c||t[81]!==g||t[82]!==d||t[83]!==j||t[84]!==u||t[85]!==f||t[86]!==ne||t[87]!==K||t[88]!==z||t[89]!==V||t[90]!==M?(J=!V&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Vn,{arch:x,architectures:y,control:k,errors:F,images:a,onSelectArchitecture:ne,onSelectImage:K}),(0,Q.jsx)(Hn,{allInstanceTypes:o,arch:x,archTypeNames:C,archTypes:w,control:k,countField:se,errors:F,hasCompute:v,instanceTypeCapacity:s,keyPairs:c,placementGroups:d,register:j}),(0,Q.jsx)(Xn,{control:k,defaultSubnet:h,effectiveSubnet:U,effectiveVpcId:W,errors:F,otherSubnets:g,routeTables:u,register:j,securityGroups:f,selectedSubnetId:z,setValue:M}),(0,Q.jsx)(ar,{control:k,errors:F,images:a,register:j})]}),t[66]=o,t[67]=x,t[68]=C,t[69]=w,t[70]=y,t[71]=k,t[72]=se,t[73]=h,t[74]=U,t[75]=W,t[76]=F,t[77]=v,t[78]=a,t[79]=s,t[80]=c,t[81]=g,t[82]=d,t[83]=j,t[84]=u,t[85]=f,t[86]=ne,t[87]=K,t[88]=z,t[89]=V,t[90]=M,t[91]=J):J=t[91];let pe;t[92]!==W||t[93]!==R?(pe=gn(R,W),t[92]=W,t[93]=R,t[94]=pe):pe=t[94];let Y;t[95]===pe?Y=t[96]:(Y=(0,Q.jsx)(L,{commands:pe}),t[95]=pe,t[96]=Y);let me;t[97]===i?me=t[98]:(me=()=>{i()},t[97]=i,t[98]=me);let he=!v&&!V,ge;t[99]!==_.error||t[100]!==_.isPending||t[101]!==I||t[102]!==me||t[103]!==he?(ge=(0,Q.jsx)(Ue,{error:_.error,errorMsg:`Failed to create instance`,isPending:_.isPending,isSubmitting:I,onCancel:me,pendingLabel:`Creating…`,submitDisabled:he,submitLabel:`Create Instance`}),t[99]=_.error,t[100]=_.isPending,t[101]=I,t[102]=me,t[103]=he,t[104]=ge):ge=t[104];let _e;t[105]!==de||t[106]!==fe||t[107]!==J||t[108]!==Y||t[109]!==ge?(_e=(0,Q.jsxs)(We,{className:`flex flex-col gap-4`,locked:de,children:[fe,J,Y,ge]}),t[105]=de,t[106]=fe,t[107]=J,t[108]=Y,t[109]=ge,t[110]=_e):_e=t[110];let X;t[111]!==le||t[112]!==_e?(X=(0,Q.jsx)(`form`,{onSubmit:le,children:_e}),t[111]=le,t[112]=_e,t[113]=X):X=t[113];let ve;return t[114]!==ce||t[115]!==X?(ve=(0,Q.jsxs)(Q.Fragment,{children:[ce,X]}),t[114]=ce,t[115]=X,t[116]=ve):ve=t[116],ve}var mr=[`all`,`running`,`stopped`,`other`],hr={...Oe,template:``,templateVersion:``};function gr(e){return e.Tags?.find(e=>e.Key===`Name`)?.Value}function _r(e){return e.State?.Name??`unknown`}function vr(e,t){let n=_r(e);return t===`all`?!0:t===`other`?n!==`running`&&n!==`stopped`:n===t}function yr(e,t){if(!t)return!0;let n=t.toLowerCase();return[e.InstanceId,gr(e),e.InstanceType,e.PrivateIpAddress,e.PublicIpAddress,e.ImageId].some(e=>e?.toLowerCase().includes(n))}function br(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=n?(0,Q.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,children:n}):(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t[0]=n,t[1]=r),r}var xr=[`Name`],Sr=[{id:`instance`,header:`Instance ID`,sortValue:e=>e.InstanceId,cell:e=>{let t=e.InstanceId??``;return(0,Q.jsx)(h,{className:`rounded-sm font-mono text-xs font-medium whitespace-nowrap text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,from:`/ec2/describe-instances/`,search:e=>({...e,...hr,selected:t}),to:`.`,children:t})}},{id:`name`,header:`Name`,sortValue:gr,cell:e=>(0,Q.jsx)(Re,{text:gr(e)})},{id:`state`,header:`State`,sortValue:_r,cell:e=>(0,Q.jsx)(Ie,{state:e.State?.Name})},{id:`type`,header:`Type`,sortValue:e=>e.InstanceType,hideBelow:`md`,cell:e=>(0,Q.jsx)(br,{children:e.InstanceType})},{id:`private-ip`,header:`Private IP`,sortValue:e=>e.PrivateIpAddress,hideBelow:`md`,cell:e=>(0,Q.jsx)(br,{children:e.PrivateIpAddress})},{id:`public-ip`,header:`Public IP`,sortValue:e=>e.PublicIpAddress,hideBelow:`md`,cell:e=>(0,Q.jsx)(br,{children:e.PublicIpAddress})},{id:`launched`,header:`Launched`,sortValue:e=>e.LaunchTime?new Date(e.LaunchTime).getTime():void 0,hideBelow:`lg`,cell:e=>(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:(0,Q.jsx)(ze,{date:e.LaunchTime})})},{id:`tags`,header:`Tags`,hideBelow:`lg`,cell:e=>(0,Q.jsx)(Le,{omit:xr,tags:e.Tags})}];function Cr(e){let t=e.startsWith(`-`),n=t?e.slice(1):e;return Sr.some(e=>e.id===n)?{column:n,desc:t}:void 0}var wr=[`start`,`stop`,`reboot`],Tr={start:{label:`Start`,icon:E,from:`stopped`},stop:{label:`Stop`,icon:w,from:`running`},reboot:{label:`Reboot`,icon:k,from:`running`}};function Er(e){let t=(0,Z.c)(30),{instances:n,onDone:r}=e,i={start:le(),stop:de(),reboot:ae()},a=se(),[o,s]=(0,Wt.useState)(!1),c=n.flatMap(Or),l=[...Object.values(i),a].find(Dr)?.error,u=Fe,d=n.length,f=l&&(0,Q.jsx)(ke,{error:l}),p=wr.map(e=>{let t=Tr[e],a=i[e],o=n.flatMap(e=>e.InstanceId&&_r(e)===t.from?[e.InstanceId]:[]);return(0,Q.jsxs)(R,{disabled:o.length===0||a.isPending,onClick:()=>{a.mutate(o,{onSuccess:r})},size:`sm`,variant:`outline`,children:[(0,Q.jsx)(t.icon,{"data-icon":`inline-start`}),t.label,o.length>0&&o.length{s(!0)},t[0]=s,t[1]=h);let g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(ee,{"data-icon":`inline-start`}),t[2]=g):g=t[2];let _;t[3]!==m||t[4]!==h?(_=(0,Q.jsxs)(R,{disabled:m,onClick:h,size:`sm`,variant:`destructive`,children:[g,`Terminate`]}),t[3]=m,t[4]=h,t[5]=_):_=t[5];let v=je,y=`Terminate ${c.length}`,b=c.join(`, `),x;t[6]===b?x=t[7]:(x=(0,Q.jsxs)(Q.Fragment,{children:[`Terminating deletes the instance and any volume set to delete on termination. This cannot be undone.`,(0,Q.jsx)(`span`,{className:`mt-2 block font-mono text-xs break-all`,children:b})]}),t[6]=b,t[7]=x);let S;t[8]!==r||t[9]!==s||t[10]!==c||t[11]!==a?(S=()=>{a.mutate(c,{onSettled:()=>{s(!1)},onSuccess:r})},t[8]=r,t[9]=s,t[10]=c,t[11]=a,t[12]=S):S=t[12];let C=`Terminate ${c.length} ${c.length===1?`instance`:`instances`}?`,w;t[13]!==v||t[14]!==o||t[15]!==s||t[16]!==x||t[17]!==S||t[18]!==C||t[19]!==y||t[20]!==a.isPending?(w=(0,Q.jsx)(v,{confirmLabel:y,description:x,isPending:a.isPending,onConfirm:S,onOpenChange:s,open:o,confirmPhrase:`terminate`,pendingLabel:`Terminating…`,title:C}),t[13]=v,t[14]=o,t[15]=s,t[16]=x,t[17]=S,t[18]=C,t[19]=y,t[20]=a.isPending,t[21]=w):w=t[21];let T;return t[22]!==u||t[23]!==n.length||t[24]!==r||t[25]!==w||t[26]!==f||t[27]!==p||t[28]!==_?(T=(0,Q.jsxs)(u,{count:d,footer:f,onClear:r,children:[p,_,w]}),t[22]=u,t[23]=n.length,t[24]=r,t[25]=w,t[26]=f,t[27]=p,t[28]=_,t[29]=T):T=t[29],T}function Dr(e){return e.error}function Or(e){return e.InstanceId&&![`terminated`,`shutting-down`].includes(_r(e))?[e.InstanceId]:[]}function kr(e){let t=(0,Z.c)(73),{instances:n,search:r,onSearchChange:i}=e,a;t[0]===r.sort?a=t[1]:(a=Cr(r.sort),t[0]=r.sort,t[1]=a);let o=a,s;t[2]===n?s=t[3]:(s=e=>[e,n.filter(t=>vr(t,e)).length],t[2]=n,t[3]=s);let c=Object.fromEntries(mr.map(s)),l;t[4]!==r.q||t[5]!==r.state?(l=e=>vr(e,r.state)&&yr(e,r.q),t[4]=r.q,t[5]=r.state,t[6]=l):l=t[6];let u=n.filter(l),d=r.q!==``||r.state!==`all`,f;t[7]===r.selected?f=t[8]:(f=e=>r.selected!==``&&e.InstanceId===r.selected,t[7]=r.selected,t[8]=f);let p=n.find(f),m;t[9]===i?m=t[10]:(m=function(){i(hr)},t[9]=i,t[10]=m);let _=m,v=Be(u.map(Nr),r.selected!==``,_),y;t[11]===v.selected?y=t[12]:(y=e=>e.InstanceId&&v.selected.has(e.InstanceId),t[11]=v.selected,t[12]=y);let b=u.filter(y),x;t[13]===i?x=t[14]:(x=function(e){i({...hr,selected:e})},t[13]=i,t[14]=x);let S=x,C=null;if(r.create){let e=r.template||void 0,n=r.templateVersion||void 0,i;t[15]!==_||t[16]!==S?(i=e=>{e?S(e):_()},t[15]=_,t[16]=S,t[17]=i):i=t[17];let a;t[18]!==i||t[19]!==e||t[20]!==n?(a=(0,Q.jsx)(pr,{launchTemplateId:e,launchTemplateVersion:n,onClose:i}),t[18]=i,t[19]=e,t[20]=n,t[21]=a):a=t[21];let o;t[22]!==_||t[23]!==a?(o=(0,Q.jsx)(Ae,{onClose:_,title:`Launch instance`,children:a}),t[22]=_,t[23]=a,t[24]=o):o=t[24],C=o}else if(p){let e;t[25]===i?e=t[26]:(e=e=>{i({tab:e})},t[25]=i,t[26]=e),C=(0,Q.jsx)(an,{instance:p,name:gr(p),onClose:_,onTabChange:e,tab:r.tab},p.InstanceId)}let w=Pe,T=C,E;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(E=te(),t[27]=E):E=t[27];let O;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(Ne,{actions:(0,Q.jsxs)(h,{className:E,from:`/ec2/describe-instances/`,search:Mr,to:`.`,children:[(0,Q.jsx)(D,{"data-icon":`inline-start`}),`Launch instance`]}),subtitle:`Virtual machines running on this cluster.`,title:`Instances`}),t[28]=O):O=t[28];let k=Me,A=r.state,j=mr.map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),count:c[e]})),M,N,P;t[29]===i?(M=t[30],N=t[31],P=t[32]):(M=e=>{i({state:e})},N=()=>{i({q:``,state:`all`})},P=e=>{i({q:e})},t[29]=i,t[30]=M,t[31]=N,t[32]=P);let F;t[33]!==k||t[34]!==r.q||t[35]!==r.state||t[36]!==j||t[37]!==M||t[38]!==N||t[39]!==P?(F=(0,Q.jsx)(k,{choice:A,choices:j,choicesLabel:`Instance state`,onChoiceChange:M,onClear:N,onQueryChange:P,placeholder:`Filter by name, ID, type or IP`,query:r.q,searchLabel:`Filter instances`}),t[33]=k,t[34]=r.q,t[35]=r.state,t[36]=j,t[37]=M,t[38]=N,t[39]=P,t[40]=F):F=t[40];let I;t[41]!==b||t[42]!==v.clear?(I=b.length>0&&(0,Q.jsx)(Er,{instances:b,onDone:v.clear}),t[41]=b,t[42]=v.clear,t[43]=I):I=t[43];let L;t[44]===d?L=t[45]:(L=d?`No instances match these filters.`:(0,Q.jsxs)(`span`,{className:`flex flex-col items-center gap-3`,children:[`No instances yet.`,(0,Q.jsx)(h,{className:te({size:`sm`,variant:`outline`}),from:`/ec2/describe-instances/`,search:jr,to:`.`,children:`Launch your first instance`})]}),t[44]=d,t[45]=L);let ee=p?.InstanceId,R;t[46]===S?R=t[47]:(R=e=>{S(e)},t[46]=S,t[47]=R);let z;t[48]===i?z=t[49]:(z=e=>{i({sort:`${e.desc?`-`:``}${e.column}`})},t[48]=i,t[49]=z);let B;t[50]!==v.onSelectedChange||t[51]!==v.selected||t[52]!==o||t[53]!==L||t[54]!==ee||t[55]!==R||t[56]!==z||t[57]!==u?(B=(0,Q.jsx)(g,{caption:`Instances`,columns:Sr,empty:L,activeId:ee,getRowId:Ar,onRowClick:R,onSelectedChange:v.onSelectedChange,onSortChange:z,rows:u,selected:v.selected,sort:o}),t[50]=v.onSelectedChange,t[51]=v.selected,t[52]=o,t[53]=L,t[54]=ee,t[55]=R,t[56]=z,t[57]=u,t[58]=B):B=t[58];let V;t[59]!==I||t[60]!==B?(V=(0,Q.jsxs)(`div`,{children:[I,B]}),t[59]=I,t[60]=B,t[61]=V):V=t[61];let H=d?`${u.length} of ${n.length} instances`:`${n.length} ${n.length===1?`instance`:`instances`}`,U;t[62]===H?U=t[63]:(U=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground tabular-nums`,children:H}),t[62]=H,t[63]=U);let W;t[64]!==F||t[65]!==V||t[66]!==U?(W=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[F,V,U]}),t[64]=F,t[65]=V,t[66]=U,t[67]=W):W=t[67];let G;return t[68]!==w||t[69]!==C||t[70]!==O||t[71]!==W?(G=(0,Q.jsxs)(w,{panel:T,children:[O,W]}),t[68]=w,t[69]=C,t[70]=O,t[71]=W,t[72]=G):G=t[72],G}function Ar(e){return e.InstanceId??``}function jr(e){return{...e,...hr,create:!0}}function Mr(e){return{...e,...hr,create:!0}}function Nr(e){return e.InstanceId??``}export{an as a,gr as i,kr as n,mr as r,hr as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/security-group-details-CdE6iD9s.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/security-group-details-Dc-1r5cD.js similarity index 99% rename from spinifex/runtime/roles/spinifexui/frontend/dist/assets/security-group-details-CdE6iD9s.js rename to spinifex/runtime/roles/spinifexui/frontend/dist/assets/security-group-details-Dc-1r5cD.js index 03dc98d1d..814dcaed5 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/security-group-details-CdE6iD9s.js +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/security-group-details-Dc-1r5cD.js @@ -1,3 +1,3 @@ -import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r}from"./schemas-DCQXG11d.js";import{c as i,i as a,n as o,s,t as c}from"./select-UwOVJofC.js";import{t as l}from"./link-BX-1BPor.js";import{t as u}from"./x-mlA6pp-8.js";import{t as d}from"./eye-yi4wz0yh.js";import{t as f}from"./maximize-2-BAlKoEj8.js";import{t as p}from"./plus-BK_7eO_G.js";import{t as m}from"./sliders-horizontal-DsGbsnBU.js";import{i as h,r as g,t as _}from"./cli-command-panel-Do14gxB9.js";import{t as v}from"./trash-BajuWzqn.js";import{a as y,o as b}from"./useValueAsRef-uzS1fuI8.js";import{c as x,f as S,r as C,t as ee}from"./field-iLG94M00.js";import{a as w,i as T,r as E,t as te}from"./detail-panel-DLM1ExsZ.js";import{I as ne,et as re,l as ie,tt as ae,u as oe}from"./ec2-mbMOQDVK.js";import{t as se}from"./error-banner-Cahg3Ix2.js";import{t as ce}from"./delete-confirmation-dialog-O7cqOW0Y.js";import{t as le}from"./resource-tags-DMnOITWf.js";import{n as ue,t as de}from"./form-lock-D8Cu0Sfu.js";import{t as fe}from"./form-panel-CtjudV7b.js";import{n as pe}from"./instance-overview-I3DWLmM0.js";import{c as me,o as he,t as ge}from"./index.esm-C31mnnYl.js";import{t as _e}from"./zod-nOHMBkds.js";import{x as ve}from"./ec2-CM16SST3.js";import{t as ye}from"./resource-delete-dialog-D3NYuO-k.js";var D=e(n(),1),be=r(),O=t();function xe(e,t,n){let r=[`IpProtocol=${n.ipProtocol}`,`FromPort=${n.fromPort}`,`ToPort=${n.toPort}`,`IpRanges=[{CidrIp=${g(n.cidrIp,`CidrIp`)}}]`].join(`,`);return[{label:e===`ingress`?`Authorize Ingress`:`Authorize Egress`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 authorize-security-group-${e}`},...h(`\\ +import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n,Mt as r}from"./schemas-DCQXG11d.js";import{c as i,i as a,n as o,s,t as c}from"./select-UwOVJofC.js";import{t as l}from"./link-BX-1BPor.js";import{t as u}from"./x-mlA6pp-8.js";import{t as d}from"./eye-yi4wz0yh.js";import{t as f}from"./maximize-2-BAlKoEj8.js";import{t as p}from"./plus-BK_7eO_G.js";import{t as m}from"./sliders-horizontal-DsGbsnBU.js";import{i as h,r as g,t as _}from"./cli-command-panel-Do14gxB9.js";import{t as v}from"./trash-BajuWzqn.js";import{a as y,o as b}from"./useValueAsRef-uzS1fuI8.js";import{c as x,f as S,r as C,t as ee}from"./field-iLG94M00.js";import{a as w,i as T,r as E,t as te}from"./detail-panel-DLM1ExsZ.js";import{I as ne,et as re,l as ie,tt as ae,u as oe}from"./ec2-mbMOQDVK.js";import{t as se}from"./error-banner-Cahg3Ix2.js";import{t as ce}from"./delete-confirmation-dialog-O7cqOW0Y.js";import{t as le}from"./resource-tags-DMnOITWf.js";import{n as ue,t as de}from"./form-lock-D8Cu0Sfu.js";import{t as fe}from"./form-panel-CtjudV7b.js";import{n as pe}from"./instance-overview-DWnPG_Ut.js";import{c as me,o as he,t as ge}from"./index.esm-C31mnnYl.js";import{t as _e}from"./zod-nOHMBkds.js";import{x as ve}from"./ec2-CM16SST3.js";import{t as ye}from"./resource-delete-dialog-D3NYuO-k.js";var D=e(n(),1),be=r(),O=t();function xe(e,t,n){let r=[`IpProtocol=${n.ipProtocol}`,`FromPort=${n.fromPort}`,`ToPort=${n.toPort}`,`IpRanges=[{CidrIp=${g(n.cidrIp,`CidrIp`)}}]`].join(`,`);return[{label:e===`ingress`?`Authorize Ingress`:`Authorize Egress`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 authorize-security-group-${e}`},...h(`\\ --group-id`,t),...h(`\\ --ip-permissions`,r)]}]}function Se(e){let t=(0,be.c)(107),{direction:n,groupId:r,onClose:l}=e,u=oe(),d=ie(),f=n===`ingress`?u:d,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={resolver:_e(ve),defaultValues:{ipProtocol:`tcp`,fromPort:0,toPort:0,cidrIp:`0.0.0.0/0`}},t[0]=p):p=t[0];let{control:m,handleSubmit:h,register:g,formState:v}=he(p),{errors:y,isSubmitting:b}=v,w;t[1]===m?w=t[2]:(w={control:m,name:`ipProtocol`},t[1]=m,t[2]=w);let T=me(w),E=T===`-1`||T===`icmp`,te;t[3]===m?te=t[4]:(te={control:m,name:`fromPort`},t[3]=m,t[4]=te);let ne=me(te),re;t[5]===m?re=t[6]:(re={control:m,name:`toPort`},t[5]=m,t[6]=re);let ae=me(re),se;t[7]===m?se=t[8]:(se={control:m,name:`cidrIp`},t[7]=m,t[8]=se);let ce=me(se),le;t[9]!==r||t[10]!==f||t[11]!==l||t[12]!==E?(le=async e=>{try{await f.mutateAsync({groupId:r,ipProtocol:e.ipProtocol,fromPort:E?-1:e.fromPort,toPort:E?-1:e.toPort,cidrIp:e.cidrIp})}catch{return}l()},t[9]=r,t[10]=f,t[11]=l,t[12]=E,t[13]=le):le=t[13];let pe=le,ye=`Add ${n===`ingress`?`inbound`:`outbound`} rule`,D;t[14]!==h||t[15]!==pe?(D=h(pe),t[14]=h,t[15]=pe,t[16]=D):D=t[16];let Se=f.isPending,Ce=`${n}-ipProtocol`,k;t[17]===Ce?k=t[18]:(k=(0,O.jsx)(x,{children:(0,O.jsx)(`label`,{htmlFor:Ce,children:`Protocol`})}),t[17]=Ce,t[18]=k);let A;t[19]===n?A=t[20]:(A=e=>{let{field:t}=e;return(0,O.jsxs)(c,{onValueChange:t.onChange,value:t.value,children:[(0,O.jsx)(s,{className:`w-full`,id:`${n}-ipProtocol`,children:(0,O.jsx)(i,{})}),(0,O.jsxs)(o,{children:[(0,O.jsx)(a,{value:`tcp`,children:`TCP`}),(0,O.jsx)(a,{value:`udp`,children:`UDP`}),(0,O.jsx)(a,{value:`icmp`,children:`ICMP`}),(0,O.jsx)(a,{value:`-1`,children:`All traffic (-1)`})]})]})},t[19]=n,t[20]=A);let j;t[21]!==m||t[22]!==A?(j=(0,O.jsx)(ge,{control:m,name:`ipProtocol`,render:A}),t[21]=m,t[22]=A,t[23]=j):j=t[23];let M;t[24]===y.ipProtocol?M=t[25]:(M=(0,O.jsx)(C,{errors:[y.ipProtocol]}),t[24]=y.ipProtocol,t[25]=M);let N;t[26]!==k||t[27]!==j||t[28]!==M?(N=(0,O.jsxs)(ee,{children:[k,j,M]}),t[26]=k,t[27]=j,t[28]=M,t[29]=N):N=t[29];let we=`${n}-fromPort`,P;t[30]===we?P=t[31]:(P=(0,O.jsx)(x,{children:(0,O.jsx)(`label`,{htmlFor:we,children:`From port`})}),t[30]=we,t[31]=P);let Te=!!y.fromPort,Ee=`${n}-fromPort`,De;t[32]===g?De=t[33]:(De=g(`fromPort`,{valueAsNumber:!0}),t[32]=g,t[33]=De);let F;t[34]!==E||t[35]!==Te||t[36]!==Ee||t[37]!==De?(F=(0,O.jsx)(S,{"aria-invalid":Te,disabled:E,id:Ee,type:`number`,...De}),t[34]=E,t[35]=Te,t[36]=Ee,t[37]=De,t[38]=F):F=t[38];let I;t[39]===y.fromPort?I=t[40]:(I=(0,O.jsx)(C,{errors:[y.fromPort]}),t[39]=y.fromPort,t[40]=I);let L;t[41]!==P||t[42]!==F||t[43]!==I?(L=(0,O.jsxs)(ee,{children:[P,F,I]}),t[41]=P,t[42]=F,t[43]=I,t[44]=L):L=t[44];let Oe=`${n}-toPort`,R;t[45]===Oe?R=t[46]:(R=(0,O.jsx)(x,{children:(0,O.jsx)(`label`,{htmlFor:Oe,children:`To port`})}),t[45]=Oe,t[46]=R);let ke=!!y.toPort,Ae=`${n}-toPort`,z;t[47]===g?z=t[48]:(z=g(`toPort`,{valueAsNumber:!0}),t[47]=g,t[48]=z);let B;t[49]!==E||t[50]!==ke||t[51]!==Ae||t[52]!==z?(B=(0,O.jsx)(S,{"aria-invalid":ke,disabled:E,id:Ae,type:`number`,...z}),t[49]=E,t[50]=ke,t[51]=Ae,t[52]=z,t[53]=B):B=t[53];let V;t[54]===y.toPort?V=t[55]:(V=(0,O.jsx)(C,{errors:[y.toPort]}),t[54]=y.toPort,t[55]=V);let H;t[56]!==R||t[57]!==B||t[58]!==V?(H=(0,O.jsxs)(ee,{children:[R,B,V]}),t[56]=R,t[57]=B,t[58]=V,t[59]=H):H=t[59];let U;t[60]!==L||t[61]!==H?(U=(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[L,H]}),t[60]=L,t[61]=H,t[62]=U):U=t[62];let je=`${n}-cidrIp`,Me=n===`ingress`?`Source`:`Destination`,W;t[63]!==je||t[64]!==Me?(W=(0,O.jsx)(x,{children:(0,O.jsxs)(`label`,{htmlFor:je,children:[Me,` CIDR`]})}),t[63]=je,t[64]=Me,t[65]=W):W=t[65];let Ne=!!y.cidrIp,Pe=`${n}-cidrIp`,G;t[66]===g?G=t[67]:(G=g(`cidrIp`),t[66]=g,t[67]=G);let K;t[68]!==Ne||t[69]!==Pe||t[70]!==G?(K=(0,O.jsx)(S,{"aria-invalid":Ne,id:Pe,placeholder:`0.0.0.0/0`,...G}),t[68]=Ne,t[69]=Pe,t[70]=G,t[71]=K):K=t[71];let q;t[72]===y.cidrIp?q=t[73]:(q=(0,O.jsx)(C,{errors:[y.cidrIp]}),t[72]=y.cidrIp,t[73]=q);let J;t[74]!==W||t[75]!==K||t[76]!==q?(J=(0,O.jsxs)(ee,{children:[W,K,q]}),t[74]=W,t[75]=K,t[76]=q,t[77]=J):J=t[77];let Fe=E?-1:ne,Ie=E?-1:ae,Y;t[78]!==ce||t[79]!==n||t[80]!==r||t[81]!==T||t[82]!==Fe||t[83]!==Ie?(Y=xe(n,r,{ipProtocol:T,fromPort:Fe,toPort:Ie,cidrIp:ce}),t[78]=ce,t[79]=n,t[80]=r,t[81]=T,t[82]=Fe,t[83]=Ie,t[84]=Y):Y=t[84];let X;t[85]===Y?X=t[86]:(X=(0,O.jsx)(_,{commands:Y}),t[85]=Y,t[86]=X);let Z;t[87]!==b||t[88]!==f.error||t[89]!==f.isPending||t[90]!==l?(Z=(0,O.jsx)(ue,{error:f.error,errorMsg:`Failed to add rule`,isPending:f.isPending,isSubmitting:b,onCancel:l,pendingLabel:`Adding…`,submitLabel:`Add rule`}),t[87]=b,t[88]=f.error,t[89]=f.isPending,t[90]=l,t[91]=Z):Z=t[91];let Q;t[92]!==f.isPending||t[93]!==N||t[94]!==U||t[95]!==J||t[96]!==X||t[97]!==Z?(Q=(0,O.jsxs)(de,{className:`space-y-6`,locked:Se,children:[N,U,J,X,Z]}),t[92]=f.isPending,t[93]=N,t[94]=U,t[95]=J,t[96]=X,t[97]=Z,t[98]=Q):Q=t[98];let $;t[99]!==Q||t[100]!==D?($=(0,O.jsx)(`form`,{onSubmit:D,children:Q}),t[99]=Q,t[100]=D,t[101]=$):$=t[101];let Le;return t[102]!==r||t[103]!==l||t[104]!==$||t[105]!==ye?(Le=(0,O.jsx)(fe,{onClose:l,subtitle:r,title:ye,children:$}),t[102]=r,t[103]=l,t[104]=$,t[105]=ye,t[106]=Le):Le=t[106],Le}function Ce(e){return[...(e.IpRanges??[]).map(e=>({kind:`cidr`,value:e.CidrIp??``})),...(e.UserIdGroupPairs??[]).map(e=>({kind:`group`,value:e.GroupId??``})),...(e.Ipv6Ranges??[]).map(e=>({kind:`ipv6`,value:e.CidrIpv6??``})),...(e.PrefixListIds??[]).map(e=>({kind:`prefix`,value:e.PrefixListId??``}))]}function k({rule:e,source:t,groupId:n,direction:r}){let i=ae(),a=re(),o=r===`ingress`?i:a,[s,c]=(0,D.useState)(!1),d=pe(e),f=t.kind===`group`&&t.value===n,p=r===`ingress`?`from`:`to`,m=t.kind===`cidr`||t.kind===`group`;async function h(){try{await o.mutateAsync({groupId:n,ipProtocol:e.IpProtocol??`-1`,fromPort:e.FromPort??-1,toPort:e.ToPort??-1,...t.kind===`group`?{sourceGroupId:t.value}:{cidrIp:t.value}})}catch{}finally{c(!1)}}return(0,O.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,O.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:d}),(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:p}),t.kind===`group`?(0,O.jsx)(l,{className:`truncate font-mono text-xs text-primary hover:underline`,params:{id:t.value},title:t.value,to:`/ec2/describe-security-groups/$id`,children:f?`this security group`:t.value}):(0,O.jsx)(`span`,{className:`truncate font-mono text-xs`,children:t.value})]}),(0,O.jsx)(y,{"aria-label":`Remove rule`,disabled:!m||o.isPending,onClick:()=>{c(!0)},size:`icon-xs`,variant:`ghost`,children:(0,O.jsx)(u,{})})]}),o.error&&(0,O.jsx)(se,{error:o.error,msg:`Failed to remove rule`}),(0,O.jsx)(ce,{confirmLabel:`Remove`,description:`Remove the ${r===`ingress`?`inbound`:`outbound`} rule ${d} ${p} ${f?`${t.value} (this security group)`:t.value} from ${n}?`,isPending:o.isPending,onConfirm:()=>{h()},onOpenChange:c,open:s,pendingLabel:`Removing…`,title:`Remove rule`})]})}function A(e){let t=(0,be.c)(31),{sg:n,direction:r}=e,i=n.GroupId??``,[a,o]=(0,D.useState)(!1),s;t[0]!==r||t[1]!==n.IpPermissions||t[2]!==n.IpPermissionsEgress?(s=(r===`ingress`?n.IpPermissions:n.IpPermissionsEgress)??[],t[0]=r,t[1]=n.IpPermissions,t[2]=n.IpPermissionsEgress,t[3]=s):s=t[3];let c=s,l,u,d,f,m;if(t[4]!==r||t[5]!==i||t[6]!==c){let e=c.flatMap(j);u=r===`ingress`?`Inbound`:`Outbound`,l=w,m=`${u} rules (${e.length})`,d=`flex flex-col gap-2`,f=e.length>0?(0,O.jsx)(`ul`,{className:`divide-y text-sm`,children:e.map(e=>{let{rule:t,source:n}=e;return(0,O.jsx)(k,{direction:r,groupId:i,rule:t,source:n},`${t.IpProtocol}-${t.FromPort}-${t.ToPort}-${n.kind}-${n.value}`)})}):(0,O.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No `,u.toLowerCase(),` rules.`]}),t[4]=r,t[5]=i,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=m}else l=t[7],u=t[8],d=t[9],f=t[10],m=t[11];let h;t[12]===u?h=t[13]:(h=u.toLowerCase(),t[12]=u,t[13]=h);let g=`Add ${h} rule`,_;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{o(!0)},t[14]=_):_=t[14];let v;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,O.jsx)(p,{"data-icon":`inline-start`}),t[15]=v):v=t[15];let b;t[16]===g?b=t[17]:(b=(0,O.jsx)(`div`,{children:(0,O.jsxs)(y,{"aria-label":g,onClick:_,size:`sm`,variant:`outline`,children:[v,`Add rule`]})}),t[16]=g,t[17]=b);let x;t[18]!==d||t[19]!==f||t[20]!==b?(x=(0,O.jsxs)(`div`,{className:d,children:[f,b]}),t[18]=d,t[19]=f,t[20]=b,t[21]=x):x=t[21];let S;t[22]!==a||t[23]!==r||t[24]!==i?(S=a&&(0,O.jsx)(Se,{direction:r,groupId:i,onClose:()=>{o(!1)}}),t[22]=a,t[23]=r,t[24]=i,t[25]=S):S=t[25];let C;return t[26]!==l||t[27]!==x||t[28]!==S||t[29]!==m?(C=(0,O.jsxs)(l,{title:m,children:[x,S]}),t[26]=l,t[27]=x,t[28]=S,t[29]=m,t[30]=C):C=t[30],C}function j(e){return Ce(e).map(t=>({rule:e,source:t}))}function M(e){let t=(0,be.c)(27),{sg:n}=e,r;t[0]===n.GroupId?r=t[1]:(r=(0,O.jsx)(E,{copy:n.GroupId,label:`Group ID`,mono:!0,children:n.GroupId}),t[0]=n.GroupId,t[1]=r);let i;t[2]===n.GroupName?i=t[3]:(i=(0,O.jsx)(E,{label:`Group name`,children:n.GroupName}),t[2]=n.GroupName,t[3]=i);let a;t[4]===n.Description?a=t[5]:(a=n.Description&&(0,O.jsx)(`span`,{title:n.Description,children:n.Description}),t[4]=n.Description,t[5]=a);let o;t[6]===a?o=t[7]:(o=(0,O.jsx)(E,{label:`Description`,children:a}),t[6]=a,t[7]=o);let s;t[8]===n.VpcId?s=t[9]:(s=n.VpcId&&(0,O.jsx)(l,{className:`text-primary hover:underline`,params:{id:n.VpcId},to:`/ec2/describe-vpcs/$id`,children:n.VpcId}),t[8]=n.VpcId,t[9]=s);let c;t[10]===s?c=t[11]:(c=(0,O.jsx)(E,{label:`VPC`,mono:!0,children:s}),t[10]=s,t[11]=c);let u;t[12]===n.OwnerId?u=t[13]:(u=(0,O.jsx)(E,{label:`Owner`,mono:!0,children:n.OwnerId}),t[12]=n.OwnerId,t[13]=u);let d;t[14]!==r||t[15]!==i||t[16]!==o||t[17]!==c||t[18]!==u?(d=(0,O.jsx)(w,{title:`Details`,children:(0,O.jsxs)(T,{children:[r,i,o,c,u]})}),t[14]=r,t[15]=i,t[16]=o,t[17]=c,t[18]=u,t[19]=d):d=t[19];let f,p;t[20]===n?(f=t[21],p=t[22]):(p=(0,O.jsx)(A,{direction:`ingress`,sg:n}),f=(0,O.jsx)(A,{direction:`egress`,sg:n}),t[20]=n,t[21]=f,t[22]=p);let m;return t[23]!==f||t[24]!==d||t[25]!==p?(m=(0,O.jsxs)(O.Fragment,{children:[d,p,f]}),t[23]=f,t[24]=d,t[25]=p,t[26]=m):m=t[26],m}function N(e){let t=(0,be.c)(23),{sg:n,onDeleted:r}=e,i=n.GroupId??``,a=ne(),[o,s]=(0,D.useState)(!1),c=n.GroupName==="default",l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=[`ec2`,`securityGroups`],t[0]=l):l=t[0];let u;t[1]!==n.GroupId||t[2]!==n.Tags?(u=(0,O.jsx)(le,{id:n.GroupId,invalidate:l,tags:n.Tags}),t[1]=n.GroupId,t[2]=n.Tags,t[3]=u):u=t[3];let d;t[4]===c?d=t[5]:(d=c&&(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The default security group cannot be deleted.`}),t[4]=c,t[5]=d);let f=c||a.isPending,p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{s(!0)},t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,O.jsx)(v,{"data-icon":`inline-start`}),t[7]=m):m=t[7];let h;t[8]===f?h=t[9]:(h=(0,O.jsxs)(y,{disabled:f,onClick:p,size:`sm`,variant:`destructive`,children:[m,`Delete security group`]}),t[8]=f,t[9]=h);let g;t[10]!==d||t[11]!==h?(g=(0,O.jsx)(w,{title:`Manage`,children:(0,O.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[d,h]})}),t[10]=d,t[11]=h,t[12]=g):g=t[12];let _=`Delete ${i}? No instance or other group may still reference it. This cannot be undone.`,b;t[13]!==o||t[14]!==i||t[15]!==r||t[16]!==a||t[17]!==_?(b=(0,O.jsx)(ye,{description:_,identifier:i,mutation:a,onDeleted:r,onOpenChange:s,open:o,title:`Delete security group`}),t[13]=o,t[14]=i,t[15]=r,t[16]=a,t[17]=_,t[18]=b):b=t[18];let x;return t[19]!==b||t[20]!==u||t[21]!==g?(x=(0,O.jsxs)(O.Fragment,{children:[u,g,b]}),t[19]=b,t[20]=u,t[21]=g,t[22]=x):x=t[22],x}function we(e){let t=(0,be.c)(22),{sg:n,tab:r,onTabChange:i,onClose:a,layout:o}=e,s=o===void 0?`auto`:o,c=n.GroupId??``,u=s===`page`?`Back to security groups`:`Close security group details`,p;t[0]!==c||t[1]!==s||t[2]!==r?(p=s===`auto`&&(0,O.jsx)(l,{"aria-label":`Open security group page`,className:b({size:`icon-sm`,variant:`ghost`}),params:{id:c},search:{tab:r},to:`/ec2/describe-security-groups/$id`,children:(0,O.jsx)(f,{})}),t[0]=c,t[1]=s,t[2]=r,t[3]=p):p=t[3];let h=n.GroupName?c:void 0,g;t[4]===n?g=t[5]:(g={id:`overview`,label:`Overview`,icon:d,content:(0,O.jsx)(M,{sg:n})},t[4]=n,t[5]=g);let _;t[6]!==a||t[7]!==n?(_={id:`settings`,label:`Settings`,icon:m,content:(0,O.jsx)(N,{onDeleted:a,sg:n})},t[6]=a,t[7]=n,t[8]=_):_=t[8];let v;t[9]!==g||t[10]!==_?(v=[g,_],t[9]=g,t[10]=_,t[11]=v):v=t[11];let y=n.GroupName??c,x;return t[12]!==s||t[13]!==a||t[14]!==i||t[15]!==u||t[16]!==p||t[17]!==h||t[18]!==v||t[19]!==y||t[20]!==r?(x=(0,O.jsx)(te,{closeLabel:u,fullPage:p,label:`Security group details`,layout:s,onClose:a,onTabChange:i,subtitle:h,tab:r,tabs:v,title:y}),t[12]=s,t[13]=a,t[14]=i,t[15]=u,t[16]=p,t[17]=h,t[18]=v,t[19]=y,t[20]=r,t[21]=x):x=t[21],x}export{we as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/assets/subnet-routing-CyGJGaO-.js b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/subnet-routing-CyGJGaO-.js new file mode 100644 index 000000000..797604d91 --- /dev/null +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/assets/subnet-routing-CyGJGaO-.js @@ -0,0 +1 @@ +function e(e,t){let{SubnetId:n,VpcId:r}=e;return((n===void 0?void 0:t.find(e=>e.Associations?.some(e=>e.SubnetId===n)))??t.find(e=>e.VpcId===r&&e.Associations?.some(e=>e.Main)))?.Routes?.some(e=>e.GatewayId?.startsWith(`igw-`))??!1}export{e as t}; \ No newline at end of file diff --git a/spinifex/runtime/roles/spinifexui/frontend/dist/index.html b/spinifex/runtime/roles/spinifexui/frontend/dist/index.html index 9c7d07ae7..4c1457315 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/dist/index.html +++ b/spinifex/runtime/roles/spinifexui/frontend/dist/index.html @@ -9,7 +9,7 @@ - + @@ -150,15 +150,16 @@ - + - - - + + + + @@ -173,14 +174,14 @@ - + - - + + diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/lib/subnet-routing.test.ts b/spinifex/runtime/roles/spinifexui/frontend/src/lib/subnet-routing.test.ts new file mode 100644 index 000000000..30bcb201e --- /dev/null +++ b/spinifex/runtime/roles/spinifexui/frontend/src/lib/subnet-routing.test.ts @@ -0,0 +1,61 @@ +import type { RouteTable, Subnet } from "@aws-sdk/client-ec2" +import { describe, expect, it } from "vitest" + +import { subnetIsPublic } from "./subnet-routing" + +const SUBNET: Subnet = { SubnetId: "subnet-a", VpcId: "vpc-1" } + +const MAIN_TO_IGW: RouteTable = { + RouteTableId: "rtb-main", + VpcId: "vpc-1", + Associations: [{ Main: true }], + Routes: [ + { DestinationCidrBlock: "10.0.0.0/16", GatewayId: "local" }, + { DestinationCidrBlock: "0.0.0.0/0", GatewayId: "igw-1" }, + ], +} + +const EXPLICIT_TO_NAT: RouteTable = { + RouteTableId: "rtb-private", + VpcId: "vpc-1", + Associations: [{ SubnetId: "subnet-a" }], + Routes: [ + { DestinationCidrBlock: "10.0.0.0/16", GatewayId: "local" }, + { DestinationCidrBlock: "0.0.0.0/0", NatGatewayId: "nat-1" }, + ], +} + +describe("subnetIsPublic", () => { + it("is public through the VPC's main table when it has no association", () => { + expect(subnetIsPublic(SUBNET, [MAIN_TO_IGW])).toBeTruthy() + }) + + it("follows the explicit association over the main table", () => { + expect(subnetIsPublic(SUBNET, [MAIN_TO_IGW, EXPLICIT_TO_NAT])).toBeFalsy() + }) + + it("is public through an explicit table with an internet gateway route", () => { + const explicit: RouteTable = { + ...MAIN_TO_IGW, + RouteTableId: "rtb-public", + Associations: [{ SubnetId: "subnet-a" }], + } + + const privateMain: RouteTable = { + ...EXPLICIT_TO_NAT, + Associations: [{ Main: true }], + } + + expect(subnetIsPublic(SUBNET, [privateMain, explicit])).toBeTruthy() + }) + + it("ignores another VPC's main table", () => { + expect( + subnetIsPublic(SUBNET, [{ ...MAIN_TO_IGW, VpcId: "vpc-2" }]), + ).toBeFalsy() + }) + + it("is private with no table to route by", () => { + expect(subnetIsPublic(SUBNET, [])).toBeFalsy() + }) +}) diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/lib/subnet-routing.ts b/spinifex/runtime/roles/spinifexui/frontend/src/lib/subnet-routing.ts new file mode 100644 index 000000000..9d49f9232 --- /dev/null +++ b/spinifex/runtime/roles/spinifexui/frontend/src/lib/subnet-routing.ts @@ -0,0 +1,22 @@ +import type { RouteTable, Subnet } from "@aws-sdk/client-ec2" + +// A subnet is public when the table it routes by, its explicit association or +// else its VPC's main table, sends some destination to an internet gateway. +export function subnetIsPublic( + subnet: Subnet, + routeTables: readonly RouteTable[], +): boolean { + const { SubnetId: subnetId, VpcId: vpcId } = subnet + + const table = + (subnetId === undefined + ? undefined + : routeTables.find((rt) => + rt.Associations?.some((a) => a.SubnetId === subnetId), + )) ?? + routeTables.find( + (rt) => rt.VpcId === vpcId && rt.Associations?.some((a) => a.Main), + ) + + return table?.Routes?.some((r) => r.GatewayId?.startsWith("igw-")) ?? false +} diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-helpers.ts b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-helpers.ts index dad146f68..2695cf35e 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-helpers.ts +++ b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-helpers.ts @@ -65,14 +65,29 @@ export function subnetLabel(subnet: Subnet): string { return name ? `${name} (${subnet.SubnetId})` : (subnet.SubnetId ?? "") } -export function subnetSummary(subnet: Subnet): string { +function routePhrase(isPublic: boolean | undefined): string { + if (isPublic === undefined) { + return "internet gateway route unknown" + } + + return isPublic + ? "public: routes to an internet gateway" + : "private: no internet gateway route" +} + +// isPublic is undefined when the subnet's route tables could not be read. +export function subnetSummary( + subnet: Subnet, + isPublic: boolean | undefined, +): string { return [ subnet.CidrBlock, subnet.AvailabilityZone, subnet.VpcId, + routePhrase(isPublic), subnet.MapPublicIpOnLaunch ? "public IP assigned on launch" - : "private address only", + : "no public IP on launch", ] .filter(Boolean) .join(" · ") diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.test.tsx b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.test.tsx index 57f65eaad..57bbccc4c 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.test.tsx +++ b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.test.tsx @@ -4,6 +4,7 @@ import type { InstanceTypeInfo, LaunchTemplate, PlacementGroup, + RouteTable, RunInstancesCommandInput, Subnet, } from "@aws-sdk/client-ec2" @@ -38,6 +39,7 @@ import { ec2KeyPairsQueryOptions, ec2LaunchTemplatesQueryOptions, ec2PlacementGroupsQueryOptions, + ec2RouteTablesQueryOptions, ec2SecurityGroupsQueryOptions, ec2SubnetsQueryOptions, ec2VpcsQueryOptions, @@ -117,11 +119,27 @@ const DEFAULT_SUBNET: Subnet = { MapPublicIpOnLaunch: true, } +// The default VPC's main table routes to its internet gateway. +const DEFAULT_ROUTE_TABLES: RouteTable[] = [ + { + RouteTableId: "rtb-main", + VpcId: "vpc-1", + Associations: [{ Main: true }], + Routes: [{ DestinationCidrBlock: "0.0.0.0/0", GatewayId: "igw-1" }], + }, +] + +function namedSubnet(id: string, name: string): Subnet { + return { SubnetId: id, VpcId: "vpc-2", Tags: [{ Key: "Name", Value: name }] } +} + interface SetupOptions { images?: Image[] instanceTypes?: InstanceTypeInfo[] capacity?: Record subnets?: Subnet[] + // "denied" refuses DescribeRouteTables instead of seeding an answer. + routeTables?: RouteTable[] | "denied" launchTemplates?: LaunchTemplate[] placementGroups?: PlacementGroup[] onClose?: (instanceId?: string) => void @@ -132,6 +150,7 @@ function setup({ instanceTypes = INSTANCE_TYPES, capacity = CAPACITY, subnets = [DEFAULT_SUBNET], + routeTables = DEFAULT_ROUTE_TABLES, launchTemplates = [], placementGroups = [], onClose = vi.fn(), @@ -158,6 +177,20 @@ function setup({ $metadata: {}, Subnets: subnets, }) + + if (routeTables === "denied") { + sdk.setHandler("DescribeRouteTablesCommand", () => { + throw Object.assign(new Error("not authorized"), { + name: "UnauthorizedOperation", + }) + }) + } else { + queryClient.setQueryData(ec2RouteTablesQueryOptions.queryKey, { + $metadata: {}, + RouteTables: routeTables, + }) + } + queryClient.setQueryData(ec2PlacementGroupsQueryOptions.queryKey, { $metadata: {}, PlacementGroups: placementGroups, @@ -508,11 +541,113 @@ describe("run-instances network", () => { ) expect( screen.getByText( - "172.31.0.0/20 · ap-southeast-2a · vpc-1 · public IP assigned on launch", + "172.31.0.0/20 · ap-southeast-2a · vpc-1 · public: routes to an internet gateway · public IP assigned on launch", ), ).toBeInTheDocument() }) + it("groups the other subnets as public or private by their route tables", async () => { + const user = userEvent.setup() + + setup({ + subnets: [ + DEFAULT_SUBNET, + namedSubnet("subnet-web", "web"), + namedSubnet("subnet-app", "app"), + namedSubnet("subnet-db", "db"), + ], + routeTables: [ + ...DEFAULT_ROUTE_TABLES, + { + RouteTableId: "rtb-public", + VpcId: "vpc-2", + Associations: [{ SubnetId: "subnet-web" }], + Routes: [{ DestinationCidrBlock: "0.0.0.0/0", GatewayId: "igw-2" }], + }, + { + RouteTableId: "rtb-private", + VpcId: "vpc-2", + Associations: [{ Main: true }], + Routes: [ + { DestinationCidrBlock: "0.0.0.0/0", NatGatewayId: "nat-1" }, + ], + }, + ], + }) + + await user.click(await screen.findByLabelText("Subnet")) + + const listbox = await screen.findByRole("listbox") + + const listed = within(listbox) + .getAllByRole("group") + .map((group) => ({ + label: within(group).getByText(/subnets$/u).textContent, + options: within(group) + .getAllByRole("option") + .map((option) => option.textContent), + })) + + expect(listed).toStrictEqual([ + { label: "Public subnets", options: ["web (subnet-web)"] }, + { + label: "Private subnets", + options: ["app (subnet-app)", "db (subnet-db)"], + }, + ]) + + await user.click(screen.getByRole("option", { name: "app (subnet-app)" })) + + expect( + screen.getByText( + /private: no internet gateway route · no public IP on launch/u, + ), + ).toBeInTheDocument() + }) + + it("leaves out a group with no subnets", async () => { + const user = userEvent.setup() + setup({ + subnets: [DEFAULT_SUBNET, { SubnetId: "subnet-pub", VpcId: "vpc-1" }], + }) + + await user.click(await screen.findByLabelText("Subnet")) + + await expect( + screen.findByText("Public subnets"), + ).resolves.toBeInTheDocument() + expect(screen.queryByText("Private subnets")).not.toBeInTheDocument() + }) + + it("lists subnets ungrouped when route tables cannot be read", async () => { + const user = userEvent.setup() + + setup({ + subnets: [ + DEFAULT_SUBNET, + namedSubnet("subnet-web", "web"), + namedSubnet("subnet-app", "app"), + ], + routeTables: "denied", + }) + + await expect( + screen.findByText(/internet gateway route unknown/u), + ).resolves.toBeInTheDocument() + + await user.click(screen.getByLabelText("Subnet")) + + const options = await screen.findAllByRole("option") + + expect(options.map((option) => option.textContent)).toStrictEqual([ + "Default: subnet-def", + "app (subnet-app)", + "web (subnet-web)", + ]) + expect(screen.queryByText("Public subnets")).not.toBeInTheDocument() + expect(screen.queryByText("Private subnets")).not.toBeInTheDocument() + }) + it("warns when the account has no default subnet", async () => { setup({ subnets: [] }) diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.tsx b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.tsx index 1273672b4..6884b091f 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.tsx +++ b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-page.tsx @@ -25,6 +25,7 @@ import { ec2KeyPairsQueryOptions, ec2LaunchTemplatesQueryOptions, ec2PlacementGroupsQueryOptions, + ec2RouteTablesQueryOptions, ec2SecurityGroupsQueryOptions, ec2SubnetsQueryOptions, ec2VpcsQueryOptions, @@ -72,6 +73,9 @@ function useRunInstancesData() { // Not a suspense query: the figure is a refinement of the form, so a session // whose policy does not grant the action still gets a usable launch panel. const { data: capacityData } = useQuery(instanceTypeCapacityQueryOptions) + // Route tables only sort subnets into public and private, so a session that + // cannot describe them still gets the flat list. + const { data: routeTablesData } = useQuery(ec2RouteTablesQueryOptions) const { data: subnetsData } = useSuspenseQuery(ec2SubnetsQueryOptions) const { data: pgData } = useSuspenseQuery(ec2PlacementGroupsQueryOptions) @@ -96,6 +100,7 @@ function useRunInstancesData() { instanceTypeCapacity: capacityData?.available ?? {}, keyPairs: keyPairsData.KeyPairs ?? [], subnets, + routeTables: routeTablesData?.RouteTables, placementGroups: pgData.PlacementGroups ?? [], securityGroups: sgData.SecurityGroups ?? [], launchTemplates: ltData.LaunchTemplates ?? [], @@ -116,6 +121,7 @@ export function RunInstancesPage({ instanceTypeCapacity, keyPairs, subnets, + routeTables, placementGroups, securityGroups, launchTemplates, @@ -313,6 +319,7 @@ export function RunInstancesPage({ effectiveVpcId={effectiveVpcId} errors={errors} otherSubnets={otherSubnets} + routeTables={routeTables} register={register} securityGroups={securityGroups} selectedSubnetId={selectedSubnetId} diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-sections.tsx b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-sections.tsx index 27ab8985e..b221158f2 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-sections.tsx +++ b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(instances)/-components/run-instances-sections.tsx @@ -5,6 +5,7 @@ import type { KeyPairInfo, LaunchTemplate, PlacementGroup, + RouteTable, SecurityGroup, Subnet, } from "@aws-sdk/client-ec2" @@ -38,13 +39,16 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group" import { Select, SelectContent, + SelectGroup, SelectItem, + SelectLabel, SelectTrigger, SelectValue, } from "@/components/ui/select" import { Switch } from "@/components/ui/switch" import { getRegion } from "@/lib/cluster-config" import type { Architecture } from "@/lib/os-images" +import { subnetIsPublic } from "@/lib/subnet-routing" import { formatVRAMMiB } from "@/lib/utils" import { ec2LaunchTemplateVersionsQueryOptions } from "@/queries/ec2" import { type CreateInstanceFormData, VOLUME_TYPES } from "@/types/ec2" @@ -594,6 +598,8 @@ interface NetworkSectionProps { errors: FormErrors otherSubnets: readonly Subnet[] register: FormRegister + // Undefined until DescribeRouteTables answers, or when it is refused. + routeTables: readonly RouteTable[] | undefined securityGroups: SecurityGroup[] selectedSubnetId: string | undefined setValue: UseFormSetValue @@ -607,6 +613,7 @@ export function NetworkSection({ errors, otherSubnets, register, + routeTables, securityGroups, selectedSubnetId, setValue, @@ -633,6 +640,7 @@ export function NetworkSection({ defaultSubnet={defaultSubnet} effectiveSubnet={effectiveSubnet} otherSubnets={otherSubnets} + routeTables={routeTables} selectedSubnetId={selectedSubnetId} /> @@ -655,14 +663,42 @@ type SubnetFieldProps = Pick< | "defaultSubnet" | "effectiveSubnet" | "otherSubnets" + | "routeTables" | "selectedSubnetId" > +// Each group is sorted by its label, and an empty group is left out. Without +// route tables there is one unlabelled group. +function subnetGroups( + subnets: readonly Subnet[], + routeTables: readonly RouteTable[] | undefined, +): { label?: string; subnets: Subnet[] }[] { + const sorted = subnets.toSorted((a, b) => + subnetLabel(a).localeCompare(subnetLabel(b)), + ) + + if (!routeTables) { + return [{ subnets: sorted }].filter((group) => group.subnets.length > 0) + } + + return [ + { + label: "Public subnets", + subnets: sorted.filter((s) => subnetIsPublic(s, routeTables)), + }, + { + label: "Private subnets", + subnets: sorted.filter((s) => !subnetIsPublic(s, routeTables)), + }, + ].filter((group) => group.subnets.length > 0) +} + function SubnetField({ control, defaultSubnet, effectiveSubnet, otherSubnets, + routeTables, selectedSubnetId, }: SubnetFieldProps) { return ( @@ -699,10 +735,18 @@ function SubnetField({ ? `Default: ${subnetLabel(defaultSubnet)}` : "No subnet"} - {otherSubnets.map((subnet) => ( - - {subnetLabel(subnet)} - + {subnetGroups(otherSubnets, routeTables).map((group) => ( + + {group.label && {group.label}} + {group.subnets.map((subnet) => ( + + {subnetLabel(subnet)} + + ))} + ))} @@ -710,7 +754,10 @@ function SubnetField({ /> {effectiveSubnet - ? subnetSummary(effectiveSubnet) + ? subnetSummary( + effectiveSubnet, + routeTables && subnetIsPublic(effectiveSubnet, routeTables), + ) : "This account has no default subnet, so an instance launched without one gets no VPC network interface. Choose a subnet."} diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(nat-gateways)/-components/create-nat-gateway-page.test.tsx b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(nat-gateways)/-components/create-nat-gateway-page.test.tsx new file mode 100644 index 000000000..3be3b8967 --- /dev/null +++ b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(nat-gateways)/-components/create-nat-gateway-page.test.tsx @@ -0,0 +1,118 @@ +import type { RouteTable, Subnet } from "@aws-sdk/client-ec2" +import { screen } from "@testing-library/react" +import userEvent from "@testing-library/user-event" +import { describe, expect, it, vi } from "vitest" + +import { createTestQueryClient, renderWithClient } from "@/test/render" + +const send = vi.hoisted(() => vi.fn()) + +vi.mock("@/lib/aws-client", async () => { + const { mockAwsClients } = await import("@/test/aws-clients") + + return mockAwsClients(send) +}) + +vi.mock("@tanstack/react-router", async (importOriginal) => { + const { mockRouter } = await import("@/test/router") + + return await mockRouter(importOriginal) +}) + +import { + ec2AddressesQueryOptions, + ec2RouteTablesQueryOptions, + ec2SubnetsQueryOptions, +} from "@/queries/ec2" + +import { CreateNatGatewayPage } from "./create-nat-gateway-page" + +// Both subnets assign public IPs on launch; only one routes to a gateway. +const SUBNETS: Subnet[] = [ + { + SubnetId: "subnet-pub", + VpcId: "vpc-1", + CidrBlock: "10.0.1.0/24", + MapPublicIpOnLaunch: true, + }, + { + SubnetId: "subnet-priv", + VpcId: "vpc-1", + CidrBlock: "10.0.2.0/24", + MapPublicIpOnLaunch: true, + }, +] + +// "denied" refuses DescribeRouteTables instead of seeding an answer. +function setup(routeTables: RouteTable[] | "denied") { + const queryClient = createTestQueryClient() + + send.mockReset() + send.mockRejectedValue( + Object.assign(new Error("not authorized"), { + name: "UnauthorizedOperation", + }), + ) + queryClient.setQueryData(ec2SubnetsQueryOptions.queryKey, { + $metadata: {}, + Subnets: SUBNETS, + }) + + if (routeTables !== "denied") { + queryClient.setQueryData(ec2RouteTablesQueryOptions.queryKey, { + $metadata: {}, + RouteTables: routeTables, + }) + } + + queryClient.setQueryData(ec2AddressesQueryOptions.queryKey, { + $metadata: {}, + Addresses: [], + }) + + renderWithClient(, queryClient) +} + +async function subnetOptions(): Promise<(string | null)[]> { + await userEvent.setup().click(await screen.findByLabelText("Public subnet")) + + const options = await screen.findAllByRole("option") + + return options.map((o) => o.textContent) +} + +describe("CreateNatGatewayPage", () => { + it("offers only subnets whose route table reaches an internet gateway", async () => { + setup([ + { + RouteTableId: "rtb-public", + VpcId: "vpc-1", + Associations: [{ SubnetId: "subnet-pub" }], + Routes: [{ DestinationCidrBlock: "0.0.0.0/0", GatewayId: "igw-1" }], + }, + { + RouteTableId: "rtb-main", + VpcId: "vpc-1", + Associations: [{ Main: true }], + Routes: [{ DestinationCidrBlock: "10.0.0.0/16", GatewayId: "local" }], + }, + ]) + + await expect(subnetOptions()).resolves.toStrictEqual([ + "subnet-pub (10.0.1.0/24)", + ]) + }) + + it.each([ + ["none routes to an internet gateway", []], + ["route tables cannot be read", "denied"], + ] as const)("offers every subnet when %s", async (_, routeTables) => { + setup(routeTables === "denied" ? routeTables : [...routeTables]) + + await expect(subnetOptions()).resolves.toStrictEqual([ + "subnet-pub (10.0.1.0/24)", + "subnet-priv (10.0.2.0/24)", + ]) + expect(send).toHaveBeenCalledTimes(routeTables === "denied" ? 1 : 0) + }) +}) diff --git a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(nat-gateways)/-components/create-nat-gateway-page.tsx b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(nat-gateways)/-components/create-nat-gateway-page.tsx index a17b85e8a..0be175a5a 100644 --- a/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(nat-gateways)/-components/create-nat-gateway-page.tsx +++ b/spinifex/runtime/roles/spinifexui/frontend/src/routes/_auth/ec2/(nat-gateways)/-components/create-nat-gateway-page.tsx @@ -1,5 +1,5 @@ import { zodResolver } from "@hookform/resolvers/zod" -import { useSuspenseQuery } from "@tanstack/react-query" +import { useQuery, useSuspenseQuery } from "@tanstack/react-query" import { Link } from "@tanstack/react-router" import { Controller, @@ -26,9 +26,14 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select" +import { subnetIsPublic } from "@/lib/subnet-routing" import { getNameTag } from "@/lib/utils" import { useCreateNatGateway } from "@/mutations/ec2" -import { ec2AddressesQueryOptions, ec2SubnetsQueryOptions } from "@/queries/ec2" +import { + ec2AddressesQueryOptions, + ec2RouteTablesQueryOptions, + ec2SubnetsQueryOptions, +} from "@/queries/ec2" import { type CreateNatGatewayFormData, createNatGatewaySchema, @@ -41,13 +46,16 @@ interface CreateNatGatewayPageProps { export function CreateNatGatewayPage({ onClose }: CreateNatGatewayPageProps) { const { data: subnetsData } = useSuspenseQuery(ec2SubnetsQueryOptions) + // Not a suspense query: without route tables the form offers every subnet. + const { data: routeTablesData } = useQuery(ec2RouteTablesQueryOptions) const { data: addressesData } = useSuspenseQuery(ec2AddressesQueryOptions) const createMutation = useCreateNatGateway() const subnets = subnetsData.Subnets ?? [] - // A NAT gateway must live in a public subnet (one with auto-assigned public - // IP). Fall back to all subnets if none are flagged public. - const publicSubnets = subnets.filter((s) => s.MapPublicIpOnLaunch) + const routeTables = routeTablesData?.RouteTables ?? [] + // A public NAT gateway belongs in a public subnet, one that routes to an + // internet gateway. Fall back to all subnets if none is public. + const publicSubnets = subnets.filter((s) => subnetIsPublic(s, routeTables)) const subnetOptions = publicSubnets.length > 0 ? publicSubnets : subnets // Only Elastic IPs that are not already associated can back a NAT gateway.