zenml-nightly 0.84.2.dev20250826__py3-none-any.whl → 0.84.3.dev20250828__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zenml/VERSION +1 -1
- zenml/cli/login.py +30 -19
- zenml/cli/server.py +6 -10
- zenml/login/credentials.py +27 -0
- zenml/login/credentials_store.py +80 -80
- zenml/login/pro/client.py +74 -54
- zenml/login/pro/utils.py +1 -3
- zenml/utils/package_utils.py +1 -1
- zenml/zen_server/dashboard/assets/{404-CMbwR10f.js → 404-JcbBcNWG.js} +1 -1
- zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-BpLj419i.js → AlertDialogDropdownItem-DuTp8JFP.js} +1 -1
- zenml/zen_server/dashboard/assets/{ButtonGroup-DVhzbQxV.js → ButtonGroup-B9_gfcC-.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-B7Wd4R8u.js → CodeSnippet-D7OZMz7I.js} +1 -1
- zenml/zen_server/dashboard/assets/{CollapsibleCard-DSZzbjx5.js → CollapsibleCard-Aqd_AiGn.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-MVT08kBV.js → ComponentBadge-BVRb7wgm.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentIcon-C9AY8usJ.js → ComponentIcon-CWDJZO4Q.js} +1 -1
- zenml/zen_server/dashboard/assets/{DeleteAlertDialog-CzhTVQaC.js → DeleteAlertDialog-C5z9RupH.js} +1 -1
- zenml/zen_server/dashboard/assets/{DialogItem-DD_7v3UY.js → DialogItem-Ce3ugDgT.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-Cakgjexo.js → Error-BGej6F2q.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-CQbWovhV.js → ExecutionStatus-BhDlfndt.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-7FZpmsHB.js → Helpbox-CQjyNo0n.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-DnduZjNU.js → Infobox-CXOIY92f.js} +1 -1
- zenml/zen_server/dashboard/assets/{LeftSideMenu-D5UEs4vB.js → LeftSideMenu-DGICatl7.js} +1 -1
- zenml/zen_server/dashboard/assets/{NestedCollapsible-0yviIfaA.js → NestedCollapsible-DmryIMwk.js} +1 -1
- zenml/zen_server/dashboard/assets/{NumberBox-C2Pju4PR.js → NumberBox-7OIA56xe.js} +1 -1
- zenml/zen_server/dashboard/assets/{Pagination-C1sE5Nzn.js → Pagination-CVYIgR9l.js} +1 -1
- zenml/zen_server/dashboard/assets/{Partials-DosysQMU.js → Partials-NicibWrh.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProCta-CUkpV3PJ.js → ProCta-DspRnbtD.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-aQjTuTRX.js → ProviderIcon-DwKsXziU.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-C6pLVNxC.js → ProviderRadio-BixXi4GC.js} +1 -1
- zenml/zen_server/dashboard/assets/{RunsBody-CZAiSxYK.js → RunsBody-BSOSIxRG.js} +1 -1
- zenml/zen_server/dashboard/assets/{SearchField-Byv1PtST.js → SearchField-BbwrusMV.js} +1 -1
- zenml/zen_server/dashboard/assets/{SecretTooltip-CErfhVgF.js → SecretTooltip-BsFul9Oe.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-C4OH-cn1.js → SetPassword-D-V7D0OR.js} +1 -1
- zenml/zen_server/dashboard/assets/{SheetHeader-Bb3v9rha.js → SheetHeader-xumE4haD.js} +1 -1
- zenml/zen_server/dashboard/assets/{StackComponentList-D85oab98.js → StackComponentList-CLnkE6-6.js} +1 -1
- zenml/zen_server/dashboard/assets/{StackList-DSAjbVb5.js → StackList-DhsbaNva.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tabs-2uwqXsdL.js → Tabs-CkY3GwhK.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tick-BQ7_xDBl.js → Tick-Bo7jwBjb.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DNkYgzN6.js → UpdatePasswordSchemas-BP4hg95A.js} +1 -1
- zenml/zen_server/dashboard/assets/{Wizard-2FIi8JNY.js → Wizard-0nbnAM1R.js} +1 -1
- zenml/zen_server/dashboard/assets/{WizardFooter-DQEnlDmZ.js → WizardFooter-CLPi4VBo.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-CdvWtiAY.js → all-pipeline-runs-query-mPYeJsKz.js} +1 -1
- zenml/zen_server/dashboard/assets/{bulk-delete-wdObjfps.js → bulk-delete-Bgf_MsSj.js} +1 -1
- zenml/zen_server/dashboard/assets/{configuration-form-BbcNBQTO.js → configuration-form-Bnyw4-V5.js} +1 -1
- zenml/zen_server/dashboard/assets/{constants-DfvsDtcH.js → constants-Ddhz1mpL.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-D4Sf7QpF.js → create-stack-BpTy7-E4.js} +1 -1
- zenml/zen_server/dashboard/assets/{delete-run-XSre8ru-.js → delete-run-MHYb1wuH.js} +1 -1
- zenml/zen_server/dashboard/assets/form-VRON3-kT.js +1 -0
- zenml/zen_server/dashboard/assets/{form-schemas-BjWDRvGd.js → form-schemas-CpTCEVoG.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BYHxFvoG.js → index-BYCBKUXk.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-CO6UN3UX.js → index-Ci5z7q6x.js} +2 -2
- zenml/zen_server/dashboard/assets/{index-d_QrPL-8.js → index-D_-iUPTg.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BYzR7YrM.js → index-rnWXXblA.js} +1 -1
- zenml/zen_server/dashboard/assets/{layout-Cyc-V16c.js → layout-DhFllShI.js} +1 -1
- zenml/zen_server/dashboard/assets/{login-mutation-CDgTlQBD.js → login-mutation-DOxF97JV.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Bncp08FW.js → page-62MHYKGv.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CMvcoaSZ.js → page-6YPAQ0BU.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CEHZzQ1Q.js → page-8ZbMMHB-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D654xHWd.js → page-AWVW_lra.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BnZEAhNn.js → page-B1rTgWkQ.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BbsvGfyi.js → page-B5YCjh4t.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DgOEl3Bc.js → page-BDawWKR9.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DOnAInjC.js → page-BFzVhfws.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BaQw51KO.js +1 -0
- zenml/zen_server/dashboard/assets/{page-C4Jnp1qP.js → page-Bh4TFAum.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CGtll3Jk.js → page-BjuIRasU.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-43SWdz4k.js → page-BoQ_Wheb.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Du6bFZTS.js → page-Bs6NTqHo.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B4QBxV0B.js → page-Bsiqb0ZN.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-AOVMuHDc.js → page-C09_xoEs.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-O5xnz_nW.js → page-CI0U7nE4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-C9IsnFid.js → page-CId8DuKX.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CzDjN1wE.js → page-CJSSCJ58.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B8ict_cR.js → page-CJXxkmGx.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DgblJuXC.js → page-CS3tgRFg.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Cd8VCEYG.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DsFXol8x.js → page-CicaAxfg.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CkFIY_Cg.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BnAMyQZb.js → page-CkX3R4er.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DerIbaqa.js → page-Cu-ZYOrj.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CyID6Sp5.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DZ5hcS1o.js → page-D0Z9wEBf.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-hX7NkNdA.js → page-D83H0IPX.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DgSu4pTE.js → page-DAF5ySum.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-ClqRvz_V.js → page-DMiWibIV.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Bi4I23Hs.js → page-DMtUDzEY.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BDre_qCO.js → page-DNLxVFH7.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DLrYW-Dn.js → page-Dfaj9bx6.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DznxxpKA.js → page-DhlhT_XT.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CKPkbOoE.js → page-DqXw1YhM.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-E9Mx9_rn.js → page-DtjangP-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DQncGJeH.js → page-GJ63jkFi.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DSn1Jcvs.js → page-RtFcujP8.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-HrebZOAM.js → page-T1JEtrlC.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DQzNmXk3.js → page-cS5O9iLC.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Dpw-xP4q.js → page-s1bm6Xid.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-Dkbp9MFP.js → persist-C98EYq5I.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-B3Hb8HDW.js → persist-FuiGbvJD.js} +1 -1
- zenml/zen_server/dashboard/assets/{primary-role-CjkpP9fL.js → primary-role-Bsu7s76U.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-tyes-list-CugyWUAE.js → resource-tyes-list-C7I0VL8e.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-type-tooltip-V-zdiLKz.js → resource-type-tooltip-2vjL6Wh9.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-FjqYTmBw.js → service-BPdLzxxT.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-connectors-nF4-OXB9.js → service-connectors-BkE8Ol4i.js} +1 -1
- zenml/zen_server/dashboard/assets/{sharedSchema-Br1JPr8d.js → sharedSchema-CKFbjwmg.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-DnyMCdVE.js → stack-detail-query-JsrqFo3U.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-current-user-mutation-B3Dpv3u6.js → update-current-user-mutation-C4CPf7vG.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-s7tlHN8s.js → update-server-settings-mutation-BYfIU-xU.js} +1 -1
- zenml/zen_server/dashboard/index.html +2 -2
- zenml/zen_server/routers/service_accounts_endpoints.py +24 -0
- zenml/zen_stores/migrations/versions/0.84.3_release.py +23 -0
- zenml/zen_stores/rest_zen_store.py +16 -5
- {zenml_nightly-0.84.2.dev20250826.dist-info → zenml_nightly-0.84.3.dev20250828.dist-info}/METADATA +2 -2
- {zenml_nightly-0.84.2.dev20250826.dist-info → zenml_nightly-0.84.3.dev20250828.dist-info}/RECORD +116 -115
- zenml/zen_server/dashboard/assets/form-C1jJgRy1.js +0 -1
- zenml/zen_server/dashboard/assets/page-1DXG7hp8.js +0 -1
- zenml/zen_server/dashboard/assets/page-C7Z2sDHE.js +0 -1
- zenml/zen_server/dashboard/assets/page-C8t9qLdV.js +0 -1
- zenml/zen_server/dashboard/assets/page-CVwTAlzd.js +0 -1
- {zenml_nightly-0.84.2.dev20250826.dist-info → zenml_nightly-0.84.3.dev20250828.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.84.2.dev20250826.dist-info → zenml_nightly-0.84.3.dev20250828.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.84.2.dev20250826.dist-info → zenml_nightly-0.84.3.dev20250828.dist-info}/entry_points.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{r as p,j as t}from"./@radix-B1sy0Lhr.js";import{u as F,W as Ze,L as Ue}from"./LeftSideMenu-D5UEs4vB.js";import{W as D,H as O,B as E}from"./Wizard-2FIi8JNY.js";import{t as q}from"./zod-D48zuELD.js";import{z as y,d as Y,s as Ke,I as ge,B as M,aZ as Ie,b2 as Qe,b3 as Ge,b4 as Ye,b5 as Je,aG as Xe,b6 as et,aH as tt,aJ as rt,D as st,aX as nt,N as ot,a7 as it,x as at,F as ct,G as lt,H as ut,v as De,w as dt,A as ft,f as mt,aa as ht,r as xt}from"./index-CO6UN3UX.js";import{a as v,C as k,u as W,F as H}from"./index.esm-SBF9nn_P.js";import{S as R}from"./WizardFooter-DQEnlDmZ.js";import{C as je}from"./ComponentIcon-C9AY8usJ.js";import{R as Z,a as U,s as pt,u as yt}from"./create-stack-D4Sf7QpF.js";import{f as gt}from"./index-d_QrPL-8.js";import{b as J,c as jt,k as Oe,h as _t}from"./@tanstack-Dwlisomv.js";import{g as vt,S as St,C as oe,P as ie}from"./ProviderRadio-C6pLVNxC.js";import{S as Ct}from"./transform-S7omcvTm.js";import{C as L}from"./ProviderIcon-aQjTuTRX.js";import{g as bt,a as wt,D as Nt,b as Pt,z as Ft}from"./form-C1jJgRy1.js";import{s as kt}from"./sharedSchema-Br1JPr8d.js";import{S as zt}from"./Lock-u8WOoTTd.js";import{T as _e}from"./Tick-BQ7_xDBl.js";import{s as Ee}from"./index-BYHxFvoG.js";import{C as At}from"./ComponentBadge-MVT08kBV.js";import{e as It}from"./components-Br2ezRib.js";import{L as Dt}from"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./persist-Dkbp9MFP.js";import"./plus-DOrkJCmy.js";import"./trash-D9LA4VFD.js";import"./info-CI2szPUG.js";import"./index.es-CZMSrR6z.js";import"./check-C9Nye5lR.js";import"./stack-detail-query-DnyMCdVE.js";const Me=p.createContext(null);function Ot({children:e}){const[r,s]=p.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Me.Provider,{value:{data:r,setData:s},children:e})}function S(){const e=p.useContext(Me);if(e===null)throw new Error("useExistingInfraContext must be used within an ExistingInfraProvider");return e}const Re=p.createContext(null);function be({children:e,initialSchema:r}){const[s,n]=p.useState(r),[o,a]=p.useState({});return t.jsx(Re.Provider,{value:{schema:s,setSchema:n,defaultValues:o,setDefaultValues:a},children:e})}function X(){const e=p.useContext(Re);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Et=y.object({resourceId:y.string().min(1),flavor:y.string()});function Mt(){return t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"artifact_store",className:"h-5 w-5 fill-primary-400"}),"Select your Artifact Store"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Choose one of the storages for the new Artifact Store."})]})}var Le=Symbol.for("immer-nothing"),we=Symbol.for("immer-draftable"),g=Symbol.for("immer-state");function _(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function A(e){return!!e&&!!e[g]}function N(e){var r;return e?Te(e)||Array.isArray(e)||!!e[we]||!!((r=e.constructor)!=null&&r[we])||te(e)||re(e):!1}var Rt=Object.prototype.constructor.toString();function Te(e){if(!e||typeof e!="object")return!1;const r=z(e);if(r===null)return!0;const s=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Rt}function K(e,r){ee(e)===0?Reflect.ownKeys(e).forEach(s=>{r(s,e[s],e)}):e.forEach((s,n)=>r(n,s,e))}function ee(e){const r=e[g];return r?r.type_:Array.isArray(e)?1:te(e)?2:re(e)?3:0}function de(e,r){return ee(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function Be(e,r,s){const n=ee(e);n===2?e.set(r,s):n===3?e.add(s):e[r]=s}function Lt(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}function te(e){return e instanceof Map}function re(e){return e instanceof Set}function w(e){return e.copy_||e.base_}function fe(e,r){if(te(e))return new Map(e);if(re(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const s=Te(e);if(r===!0||r==="class_only"&&!s){const n=Object.getOwnPropertyDescriptors(e);delete n[g];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const l=o[a],u=n[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(z(e),n)}else{const n=z(e);if(n!==null&&s)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function ve(e,r=!1){return se(e)||A(e)||!N(e)||(ee(e)>1&&(e.set=e.add=e.clear=e.delete=Tt),Object.freeze(e),r&&Object.entries(e).forEach(([s,n])=>ve(n,!0))),e}function Tt(){_(2)}function se(e){return Object.isFrozen(e)}var Bt={};function P(e){const r=Bt[e];return r||_(0,e),r}var T;function Ve(){return T}function Vt(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ne(e,r){r&&(P("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function me(e){he(e),e.drafts_.forEach(qt),e.drafts_=null}function he(e){e===T&&(T=e.parent_)}function Pe(e){return T=Vt(T,e)}function qt(e){const r=e[g];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Fe(e,r){r.unfinalizedDrafts_=r.drafts_.length;const s=r.drafts_[0];return e!==void 0&&e!==s?(s[g].modified_&&(me(r),_(4)),N(e)&&(e=Q(r,e),r.parent_||G(r,e)),r.patches_&&P("Patches").generateReplacementPatches_(s[g].base_,e,r.patches_,r.inversePatches_)):e=Q(r,s,[]),me(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==Le?e:void 0}function Q(e,r,s){if(se(r))return r;const n=r[g];if(!n)return K(r,(o,a)=>ke(e,n,r,o,a,s)),r;if(n.scope_!==e)return r;if(!n.modified_)return G(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const o=n.copy_;let a=o,l=!1;n.type_===3&&(a=new Set(o),o.clear(),l=!0),K(a,(u,f)=>ke(e,n,o,u,f,s,l)),G(e,o,!1),s&&e.patches_&&P("Patches").generatePatches_(n,s,e.patches_,e.inversePatches_)}return n.copy_}function ke(e,r,s,n,o,a,l){if(A(o)){const u=a&&r&&r.type_!==3&&!de(r.assigned_,n)?a.concat(n):void 0,f=Q(e,o,u);if(Be(s,n,f),A(f))e.canAutoFreeze_=!1;else return}else l&&s.add(o);if(N(o)&&!se(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),(!r||!r.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,n)&&G(e,o)}}function G(e,r,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ve(r,s)}function Wt(e,r){const s=Array.isArray(e),n={type_:s?1:0,scope_:r?r.scope_:Ve(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=Se;s&&(o=[n],a=B);const{revoke:l,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=l,u}var Se={get(e,r){if(r===g)return e;const s=w(e);if(!de(s,r))return Ht(e,s,r);const n=s[r];return e.finalized_||!N(n)?n:n===ae(e.base_,r)?(ce(e),e.copy_[r]=pe(n,e)):n},has(e,r){return r in w(e)},ownKeys(e){return Reflect.ownKeys(w(e))},set(e,r,s){const n=qe(w(e),r);if(n!=null&&n.set)return n.set.call(e.draft_,s),!0;if(!e.modified_){const o=ae(w(e),r),a=o==null?void 0:o[g];if(a&&a.base_===s)return e.copy_[r]=s,e.assigned_[r]=!1,!0;if(Lt(s,o)&&(s!==void 0||de(e.base_,r)))return!0;ce(e),xe(e)}return e.copy_[r]===s&&(s!==void 0||r in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=s,e.assigned_[r]=!0),!0},deleteProperty(e,r){return ae(e.base_,r)!==void 0||r in e.base_?(e.assigned_[r]=!1,ce(e),xe(e)):delete e.assigned_[r],e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const s=w(e),n=Reflect.getOwnPropertyDescriptor(s,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:s[r]}},defineProperty(){_(11)},getPrototypeOf(e){return z(e.base_)},setPrototypeOf(){_(12)}},B={};K(Se,(e,r)=>{B[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});B.deleteProperty=function(e,r){return B.set.call(this,e,r,void 0)};B.set=function(e,r,s){return Se.set.call(this,e[0],r,s,e[0])};function ae(e,r){const s=e[g];return(s?w(s):e)[r]}function Ht(e,r,s){var o;const n=qe(r,s);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function qe(e,r){if(!(r in e))return;let s=z(e);for(;s;){const n=Object.getOwnPropertyDescriptor(s,r);if(n)return n;s=z(s)}}function xe(e){e.modified_||(e.modified_=!0,e.parent_&&xe(e.parent_))}function ce(e){e.copy_||(e.copy_=fe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $t=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,s,n)=>{if(typeof r=="function"&&typeof s!="function"){const a=s;s=r;const l=this;return function(f=a,...d){return l.produce(f,c=>s.call(this,c,...d))}}typeof s!="function"&&_(6),n!==void 0&&typeof n!="function"&&_(7);let o;if(N(r)){const a=Pe(this),l=pe(r,void 0);let u=!0;try{o=s(l),u=!1}finally{u?me(a):he(a)}return Ne(a,n),Fe(o,a)}else if(!r||typeof r!="object"){if(o=s(r),o===void 0&&(o=r),o===Le&&(o=void 0),this.autoFreeze_&&ve(o,!0),n){const a=[],l=[];P("Patches").generateReplacementPatches_(r,o,a,l),n(a,l)}return o}else _(1,r)},this.produceWithPatches=(r,s)=>{if(typeof r=="function")return(l,...u)=>this.produceWithPatches(l,f=>r(f,...u));let n,o;return[this.produce(r,s,(l,u)=>{n=l,o=u}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){N(e)||_(8),A(e)&&(e=Zt(e));const r=Pe(this),s=pe(e,void 0);return s[g].isManual_=!0,he(r),s}finishDraft(e,r){const s=e&&e[g];(!s||!s.isManual_)&&_(9);const{scope_:n}=s;return Ne(n,r),Fe(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,r){let s;for(s=r.length-1;s>=0;s--){const o=r[s];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}s>-1&&(r=r.slice(s+1));const n=P("Patches").applyPatches_;return A(e)?n(e,r):this.produce(e,o=>n(o,r))}};function pe(e,r){const s=te(e)?P("MapSet").proxyMap_(e,r):re(e)?P("MapSet").proxySet_(e,r):Wt(e,r);return(r?r.scope_:Ve()).drafts_.push(s),s}function Zt(e){return A(e)||_(10,e),We(e)}function We(e){if(!N(e)||se(e))return e;const r=e[g];let s;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,s=fe(e,r.scope_.immer_.useStrictShallowCopy_)}else s=fe(e,!0);return K(s,(n,o)=>{Be(s,n,We(o))}),r&&(r.finalized_=!1),s}var j=new $t,I=j.produce;j.produceWithPatches.bind(j);j.setAutoFreeze.bind(j);j.setUseStrictShallowCopy.bind(j);j.applyPatches.bind(j);j.createDraft.bind(j);j.finishDraft.bind(j);function Ut(){const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const n=e.fullstackResources.components_resources_info.artifact_store,o=n.flatMap(l=>l.accessible_by_service_connector.map(u=>({...l,value:u})));function a({flavor:l,resourceId:u}){const f=n.find(d=>d.flavor===l);f&&(r(d=>I(d,c=>{c.artifactStoreConfig={flavor:l,configuration:Object.fromEntries(Object.keys(f.required_configuration||{}).map(h=>[h,u])),service_connector_resource_id:u}})),s(d=>d+1))}return{handleFormSubmit:a,flattenedInstances:o}}function V({flavor:e,type:r,width:s=32,height:n=32,...o}){var l;const a=J({...gt.flavorList({name:e,type:r})});return a.isError?null:a.isPending?t.jsx(Y,{style:{height:`${n}px`,width:`${s}px`}}):t.jsx("img",{width:s,height:n,alt:`${e} logo`,...o,src:Ke(((l=a.data.items[0].body)==null?void 0:l.logo_url)??"")})}const Kt="artifact_store";function Qt(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=Ut(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{type:Kt,width:24,height:24,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function Gt(){const e=W({resolver:q(Et),shouldUnregister:!0});return t.jsx(H,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Artifact Store"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Mt,{}),t.jsx(Qt,{})]})}),t.jsx(R,{children:t.jsx(Yt,{})})]})})}function Yt(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const He=y.object({authMethod:y.string().min(1),stackName:kt});function Jt(){var h,i;const{data:e}=S(),{setCurrentStep:r}=F(),{control:s,watch:n,resetField:o}=v(),{setSchema:a,setDefaultValues:l}=X(),u=J({...Ie.serviceConnectorTypeDetail(((h=e.connectorConfig)==null?void 0:h.type)||"")});if(u.isError)return null;if(u.isPending)return t.jsx(Y,{className:"h-[40px] w-[100px]"});const f=u.data.auth_methods.filter(m=>m.auth_method!=="implicit").map(m=>({name:m.name,auth_method:m.auth_method}));if(!((i=e.connectorConfig)!=null&&i.type)){r(1);return}function d(){var Ce;const m=n("authMethod"),x=(Ce=u.data)==null?void 0:Ce.auth_methods.find(ne=>ne.auth_method===m);if(!x)return;const C=x.config_schema,b=bt(C),$e=wt(C);a(He.merge(b)),l($e),Object.keys(b.shape).forEach(ne=>o(ne))}const c=e.connectorConfig.type||"";return t.jsx(k,{control:s,name:"authMethod",render:({field:{onChange:m,ref:x,...C}})=>t.jsxs(Qe,{...C,onValueChange:b=>{m(b),d()},children:[t.jsx(Ge,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(Ye,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(Je,{children:t.jsx(Xe,{viewportClassName:"max-h-[300px]",children:f.map(b=>t.jsx(et,{className:"space-x-2",value:b.auth_method,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(L,{provider:c}),t.jsx("div",{children:b.name})]})},b.auth_method))})})]})})}function Xt(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(Ct,{className:"h-5 w-5 fill-primary-400"}),"Select an Authentication Method"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Connect ZenML to your resources for seamless integration of cloud services into your ML pipelines."})]}),t.jsx(Jt,{})]})}function er(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(zt,{className:"h-5 w-5 fill-primary-400"}),"Add your Configuration"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Your credentials are securely stored and encrypted. ZenML uses these credentials to interact with your resources."})]}),t.jsx(tr,{})]})}function tr(){var c,h;const{data:e}=S(),{watch:r}=v(),s=J({...Ie.serviceConnectorTypeDetail(((c=e.connectorConfig)==null?void 0:c.type)||"")}),n=r("authMethod"),o=(h=s.data)==null?void 0:h.auth_methods.find(i=>i.auth_method===n);if(s.isError)return null;if(s.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});if(!o)return null;const a=o.config_schema,l=a.properties||{},u=a.required||[],f=a.$defs,d=Object.entries(l).sort(([i],[m])=>u.includes(i)&&!u.includes(m)?-1:!u.includes(i)&&u.includes(m)?1:0);return t.jsx("div",{className:"space-y-5",children:d.map(([i,m])=>t.jsx(Nt,{definitions:f,isOptional:Pt(i,u),name:i,schema:m},i))})}function rr({open:e,loadingComponents:r}){var n,o;const{data:s}=S();return(n=s.connectorConfig)!=null&&n.type?t.jsx(tt,{open:e,children:t.jsxs(rt,{onPointerDownOutside:a=>a.preventDefault(),onEscapeKeyDown:a=>a.preventDefault(),className:"max-w-[600px]",children:[t.jsx("div",{className:"flex items-center justify-between border-b border-theme-border-moderate py-2 pl-5 pr-3",children:t.jsx(st,{className:"text-text-lg",children:"Connecting and loading your components..."})}),t.jsxs("div",{className:"flex h-[200px] items-center justify-center gap-5 bg-primary-50",children:[t.jsx(nt,{className:"h-[60px] w-[60px]"}),t.jsx("div",{className:"flex h-[60px] w-[60px] items-center justify-center",children:t.jsx(ot,{className:"h-5 w-5 fill-theme-text-tertiary"})}),t.jsx(L,{className:"h-[60px] w-[60px]",provider:s.connectorConfig.type})]}),t.jsxs("div",{className:"flex flex-col gap-1 px-7 pb-6 pt-5",children:[t.jsxs("p",{className:"text-theme-text-secondary",children:["We're securely connecting to ",vt(((o=s.connectorConfig)==null?void 0:o.type)||"aws")," ","and retrieving your custom components. This process typically takes about 30-60 seconds."]}),t.jsx(sr,{loadingComponents:r})]})]})}):null}function sr({loadingComponents:e}){const[r,s]=p.useState(!0),[n,o]=p.useState(!0);return p.useEffect(()=>{const a=setTimeout(()=>{s(!1)},Math.floor(Math.random()*1e3)+500),l=setTimeout(()=>{o(!1)},1500);return()=>{clearTimeout(a),clearTimeout(l)}},[]),t.jsxs("ul",{className:"mt-3 space-y-3 text-theme-text-secondary",children:[t.jsxs(ue,{children:[t.jsx(le,{loading:r}),"Establishing a secure connection"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:n}),"Authenticating your account"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:e}),"Fetching your existing components"]})]})}function le({loading:e}){return e?t.jsx(it,{className:"h-5 w-5 border-2"}):t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"})}function ue({children:e}){return t.jsx("li",{className:"flex items-center gap-1",children:e})}async function nr({payload:e}){const r=ct(ut.serviceConnectors.fullStackResources),s=await at(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching service connector type");throw new lt({status:s.status,statusText:s.statusText,message:n})}return s.json()}function or(e){return jt({...e,mutationFn:async({payload:r})=>nr({payload:r})})}function ir(){const{setCurrentStep:e}=F(),[r,s]=p.useState(!0),{toast:n}=De(),{setData:o,data:a}=S(),l=or({onSuccess:async f=>{o(d=>I(d,c=>{c.fullstackResources=f})),s(!1),await pt(200),e(d=>d+1)},onError:f=>{n({status:"error",emphasis:"subtle",description:f.message,rounded:!0})}});return{handleFormSubmit:({authMethod:f,stackName:d,...c})=>{Object.keys(c).forEach(i=>{(c[i]===""||c[i]===null||c[i]===void 0||Array.isArray(c[i])&&c[i].length===0)&&delete c[i]});const h=I(a,i=>{i.stackName=d,i.connectorConfig&&(i.connectorConfig.auth_method=f,i.connectorConfig.configuration={...c})});o(h),h.connectorConfig&&l.mutate({payload:h.connectorConfig})},fullStackResources:l,loadingComponents:r}}function ar(){const{handleSubmit:e,formState:{isSubmitting:r}}=v(),{handleFormSubmit:s,fullStackResources:n,loadingComponents:o}=ir();return t.jsxs("form",{onSubmit:e(s),id:"connect-form",children:[t.jsx(rr,{loadingComponents:o,open:r||n.isPending}),t.jsx(Xt,{}),t.jsx(St,{}),t.jsx(er,{})]})}function cr(){const{schema:e,defaultValues:r}=X(),s=W({shouldUnregister:!0,mode:"onChange",resolver:q(e),defaultValues:{stackName:"",authMethod:"",...r}});return t.jsx(H,{...s,children:t.jsxs(D,{children:[t.jsx(O,{children:"Connect to your Cloud"}),t.jsx(E,{children:t.jsx(ar,{})}),t.jsx(R,{children:t.jsx(lr,{})})]})})}function lr(){const{formState:{isValid:e,isSubmitting:r}}=v(),s=!!Oe();return t.jsx(M,{className:"justify-center gap-2",disabled:!e||s||r,form:"connect-form",size:"md",children:s||r?"Loading...":"Next"})}function ur(){const{data:e,setData:r}=S(),s=_t(),{toast:n}=De(),{setCurrentStep:o}=F(),{mutate:a}=yt({onError:d=>{d instanceof Error&&n({status:"error",emphasis:"subtle",icon:t.jsx(dt,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess:async d=>{r(c=>I(c,h=>{h.createdStackId=d.id})),o(c=>c+1),s.invalidateQueries({queryKey:Ee.all})}});if(!e.fullstackResources)return o(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const l=e.fullstackResources.components_resources_info.container_registry,u=l.flatMap(d=>d.accessible_by_service_connector.map(c=>({...d,value:c})));function f({flavor:d,resourceId:c}){const h=l.find(m=>m.flavor===d);if(!h)return;const i=I(e,m=>{m.registryConfig={flavor:d,configuration:Object.fromEntries(Object.keys(h.required_configuration||{}).map(x=>[x,c])),service_connector_resource_id:c}});r(i),a({payload:{name:i.stackName||Math.random().toString(36).substring(7),service_connectors:i.connectorConfig?[i.connectorConfig]:[],components:{orchestrator:[{...i.orchestratorConfig,service_connector_index:0}],artifact_store:[{...i.artifactStoreConfig,service_connector_index:0}],container_registry:[{...i.registryConfig,service_connector_index:0}]}}})}return{handleFormSubmit:f,flattenedInstances:u}}const dr="container_registry";function fr(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=ur(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{width:24,height:24,type:dr,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function mr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"container_registry",className:"h-5 w-5 fill-primary-400"}),"Select your Container Registry"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the Container Registries for your new stack"})]})})}const hr=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)});function xr(){const e=W({resolver:q(hr),shouldUnregister:!0});return t.jsx(H,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Container Registry"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(mr,{}),t.jsx(fr,{})]})}),t.jsx(R,{children:t.jsx(pr,{})})]})})}function pr(){const e=v(),r=!!Oe();return t.jsxs(M,{className:"justify-center gap-2",disabled:!e.formState.isValid||r,form:"artifact-store-form",size:"md",children:[r&&t.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),r?"Loading...":"Next"]})}function yr(){var a;const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{orchestrators:[],handleFormSubmit:()=>{}};const n=((a=e.fullstackResources.components_resources_info)==null?void 0:a.orchestrator)||[];function o({flavor:l,resourceId:u,...f}){const d=n.find(c=>c.flavor===l);d&&(r(c=>{const h=d!=null&&d.use_resource_value_as_fixed_config?Object.fromEntries(Object.keys(d.required_configuration||{}).map(i=>[i,u])):{...f};return I(c,i=>{i.orchestratorConfig={flavor:l,configuration:h,service_connector_resource_id:u}})}),s(c=>c+1))}return{orchestrators:n,handleFormSubmit:o}}const ye=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)}),$="kubernetes",ze="orchestrator";function gr(){const{orchestrators:e,handleFormSubmit:r}=yr(),{setSchema:s}=X(),{control:n,watch:o,setValue:a,register:l,reset:u,handleSubmit:f}=v(),d=o("flavor");return t.jsxs("form",{onSubmit:f(r),id:"artifact-store-form",children:[d!==$&&t.jsx("input",{...l("resourceId"),type:"hidden"}),t.jsx("ul",{className:"space-y-1",children:e.map((c,h)=>t.jsxs("li",{children:[t.jsx(k,{control:n,name:"flavor",render:({field:{onChange:i,...m}})=>t.jsxs(Z,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(U,{onChange:x=>{u({flavor:c.flavor}),c.use_resource_value_as_fixed_config===!0&&s(ye),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&s(ye.merge(Ft(c.required_configuration))),c.flavor!==$&&c.accessible_by_service_connector.length>0&&a("resourceId",c.accessible_by_service_connector[0]),i(x)},...m,id:c.flavor,type:"radio",value:c.flavor,name:"orchestrator-flavor-radio"}),t.jsx(V,{width:24,height:24,type:ze,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===$||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===$&&t.jsx("ul",{className:"space-y-1",children:c.accessible_by_service_connector.map(i=>t.jsx("li",{children:t.jsx(k,{control:n,name:"resourceId",render:({field:m})=>t.jsxs(Z,{"data-state":o("resourceId")===i?"selected":"unselected",htmlFor:i,children:[t.jsx(U,{...m,id:i,type:"radio",value:i,name:"instance-radio"}),t.jsx(V,{type:ze,width:24,height:24,flavor:c.flavor}),t.jsx("span",{children:i})]})})},i))}),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&Object.keys(c.required_configuration).length>=1&&t.jsx("div",{children:Object.entries(c.required_configuration).map(([i,m])=>t.jsx("div",{children:t.jsx(k,{defaultValue:"",name:i,control:n,render:({field:x})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:i,className:"text-text-sm",children:m}),t.jsx(ge,{...x,inputSize:"md",required:!0,className:"w-full",id:i})]})})},i))})]})]},h))})]})}function jr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"orchestrator",className:"h-5 w-5 fill-primary-400"}),"Select your Orchestrator"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the connected orchestrators for your new stack"})]})})}function _r(){const{schema:e}=X(),r=W({resolver:q(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx(H,{...r,children:t.jsxs(D,{children:[t.jsx(O,{children:"Orchestrator"}),t.jsxs(E,{children:[t.jsx(jr,{}),t.jsx(gr,{})]}),t.jsx(R,{children:t.jsx(vr,{})})]})})}function vr(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const Sr=y.object({provider:y.string().min(1)});function Cr(){var a;const{setData:e,data:r}=S(),{setCurrentStep:s}=F(),n=W({resolver:q(Sr),defaultValues:{provider:((a=r.connectorConfig)==null?void 0:a.type)||""}});function o(l){e(u=>({...u,connectorConfig:{type:l.provider,auth_method:""}})),s(u=>u+1)}return t.jsx(H,{...n,children:t.jsxs(D,{children:[t.jsx(O,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where you have existing infrastructure to connect with ZenML. This will allow you to integrate your current cloud resources with ZenML for model deployment and management."})]}),t.jsxs("form",{id:"provider-form",onSubmit:n.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[t.jsx(oe,{id:"aws-provider",...n.register("provider"),value:"aws",children:t.jsx(ie,{icon:t.jsx(L,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),t.jsx(oe,{id:"gcp-provider",...n.register("provider"),value:"gcp",children:t.jsx(ie,{icon:t.jsx(L,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),t.jsx(oe,{id:"azure-provider",...n.register("provider"),value:"azure",children:t.jsx(ie,{icon:t.jsx(L,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),t.jsx(R,{children:t.jsx(br,{})})]})})}function br(){const{formState:{isValid:e}}=v();return t.jsx(M,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function wr(){var o;const{data:e}=S(),r=J({...Ee.stackDetail(e.createdStackId||""),throwOnError:!0});if(r.isError)return null;if(r.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});const s=r.data,n=It((o=r.data.metadata)==null?void 0:o.components);return t.jsxs(D,{children:[t.jsx(O,{children:"Your stack"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsx("p",{className:"text-theme-text-secondary",children:"Here you can review the created stack and stack components. Now you can start running pipelines using this new configuration."}),t.jsxs("div",{className:"divide-y divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[t.jsx(Pr,{stack:s}),n.map(a=>t.jsx(Fr,{component:a},a.id))]})]})}),t.jsx(R,{displayCancel:!1,children:t.jsx(Nr,{})})]})}function Nr(){return t.jsx(M,{size:"md",asChild:!0,children:t.jsx(Dt,{to:xt.stacks.overview,children:"Finish"})})}function Pr({stack:e}){return t.jsxs("div",{className:"flex items-center gap-3 bg-theme-surface-secondary p-5 font-semibold",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(ft,{type:"square",size:"lg",children:t.jsx(mt,{size:"lg",children:e.name[0]})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]})}function Fr({component:e}){var r,s,n,o;return t.jsxs("div",{className:"flex items-center justify-between py-3 pl-9 pr-5",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(V,{width:24,height:24,flavor:((r=e.body)==null?void 0:r.flavor_name)||"",type:((s=e.body)==null?void 0:s.type)||"orchestrator"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg font-semibold",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]}),t.jsx(At,{type:((n=e.body)==null?void 0:n.type)||"alerter",children:ht((o=e.body)==null?void 0:o.type)})]},e.id)}function kr(){const{currentStep:e}=F();if(e===1)return t.jsx(Cr,{});if(e===2)return t.jsx(be,{initialSchema:He,children:t.jsx(cr,{})});if(e===3)return t.jsx(Gt,{});if(e===4)return t.jsx(be,{initialSchema:ye,children:t.jsx(_r,{})});if(e===5)return t.jsx(xr,{});if(e===6)return t.jsx(wr,{})}const Ae=["Infrastructure Type","Cloud Provider","Connect your Cloud","Artifact Store","Orchestrator","Container Registry"];function ls(){return t.jsx(Ze,{maxSteps:Ae.length+1,initialStep:1,children:t.jsx(Ot,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(Ue,{entries:Ae}),t.jsx("div",{className:"w-full",children:t.jsx(kr,{})})]})})})}export{ls as default};
|
1
|
+
import{r as p,j as t}from"./@radix-B1sy0Lhr.js";import{u as F,W as Ze,L as Ue}from"./LeftSideMenu-DGICatl7.js";import{W as D,H as O,B as E}from"./Wizard-0nbnAM1R.js";import{t as q}from"./zod-D48zuELD.js";import{z as y,d as Y,s as Ke,I as ge,B as M,aZ as Ie,b2 as Qe,b3 as Ge,b4 as Ye,b5 as Je,aG as Xe,b6 as et,aH as tt,aJ as rt,D as st,aX as nt,N as ot,a7 as it,x as at,F as ct,G as lt,H as ut,v as De,w as dt,A as ft,f as mt,aa as ht,r as xt}from"./index-Ci5z7q6x.js";import{a as v,C as k,u as W,F as H}from"./index.esm-SBF9nn_P.js";import{S as R}from"./WizardFooter-CLPi4VBo.js";import{C as je}from"./ComponentIcon-CWDJZO4Q.js";import{R as Z,a as U,s as pt,u as yt}from"./create-stack-BpTy7-E4.js";import{f as gt}from"./index-D_-iUPTg.js";import{b as J,c as jt,k as Oe,h as _t}from"./@tanstack-Dwlisomv.js";import{g as vt,S as St,C as oe,P as ie}from"./ProviderRadio-BixXi4GC.js";import{S as Ct}from"./transform-S7omcvTm.js";import{C as L}from"./ProviderIcon-DwKsXziU.js";import{g as bt,a as wt,D as Nt,b as Pt,z as Ft}from"./form-VRON3-kT.js";import{s as kt}from"./sharedSchema-CKFbjwmg.js";import{S as zt}from"./Lock-u8WOoTTd.js";import{T as _e}from"./Tick-Bo7jwBjb.js";import{s as Ee}from"./index-BYCBKUXk.js";import{C as At}from"./ComponentBadge-BVRb7wgm.js";import{e as It}from"./components-Br2ezRib.js";import{L as Dt}from"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./persist-C98EYq5I.js";import"./plus-DOrkJCmy.js";import"./trash-D9LA4VFD.js";import"./info-CI2szPUG.js";import"./index.es-CZMSrR6z.js";import"./check-C9Nye5lR.js";import"./stack-detail-query-JsrqFo3U.js";const Me=p.createContext(null);function Ot({children:e}){const[r,s]=p.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Me.Provider,{value:{data:r,setData:s},children:e})}function S(){const e=p.useContext(Me);if(e===null)throw new Error("useExistingInfraContext must be used within an ExistingInfraProvider");return e}const Re=p.createContext(null);function be({children:e,initialSchema:r}){const[s,n]=p.useState(r),[o,a]=p.useState({});return t.jsx(Re.Provider,{value:{schema:s,setSchema:n,defaultValues:o,setDefaultValues:a},children:e})}function X(){const e=p.useContext(Re);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Et=y.object({resourceId:y.string().min(1),flavor:y.string()});function Mt(){return t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"artifact_store",className:"h-5 w-5 fill-primary-400"}),"Select your Artifact Store"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Choose one of the storages for the new Artifact Store."})]})}var Le=Symbol.for("immer-nothing"),we=Symbol.for("immer-draftable"),g=Symbol.for("immer-state");function _(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function A(e){return!!e&&!!e[g]}function N(e){var r;return e?Te(e)||Array.isArray(e)||!!e[we]||!!((r=e.constructor)!=null&&r[we])||te(e)||re(e):!1}var Rt=Object.prototype.constructor.toString();function Te(e){if(!e||typeof e!="object")return!1;const r=z(e);if(r===null)return!0;const s=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Rt}function K(e,r){ee(e)===0?Reflect.ownKeys(e).forEach(s=>{r(s,e[s],e)}):e.forEach((s,n)=>r(n,s,e))}function ee(e){const r=e[g];return r?r.type_:Array.isArray(e)?1:te(e)?2:re(e)?3:0}function de(e,r){return ee(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function Be(e,r,s){const n=ee(e);n===2?e.set(r,s):n===3?e.add(s):e[r]=s}function Lt(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}function te(e){return e instanceof Map}function re(e){return e instanceof Set}function w(e){return e.copy_||e.base_}function fe(e,r){if(te(e))return new Map(e);if(re(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const s=Te(e);if(r===!0||r==="class_only"&&!s){const n=Object.getOwnPropertyDescriptors(e);delete n[g];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const l=o[a],u=n[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(z(e),n)}else{const n=z(e);if(n!==null&&s)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function ve(e,r=!1){return se(e)||A(e)||!N(e)||(ee(e)>1&&(e.set=e.add=e.clear=e.delete=Tt),Object.freeze(e),r&&Object.entries(e).forEach(([s,n])=>ve(n,!0))),e}function Tt(){_(2)}function se(e){return Object.isFrozen(e)}var Bt={};function P(e){const r=Bt[e];return r||_(0,e),r}var T;function Ve(){return T}function Vt(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ne(e,r){r&&(P("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function me(e){he(e),e.drafts_.forEach(qt),e.drafts_=null}function he(e){e===T&&(T=e.parent_)}function Pe(e){return T=Vt(T,e)}function qt(e){const r=e[g];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Fe(e,r){r.unfinalizedDrafts_=r.drafts_.length;const s=r.drafts_[0];return e!==void 0&&e!==s?(s[g].modified_&&(me(r),_(4)),N(e)&&(e=Q(r,e),r.parent_||G(r,e)),r.patches_&&P("Patches").generateReplacementPatches_(s[g].base_,e,r.patches_,r.inversePatches_)):e=Q(r,s,[]),me(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==Le?e:void 0}function Q(e,r,s){if(se(r))return r;const n=r[g];if(!n)return K(r,(o,a)=>ke(e,n,r,o,a,s)),r;if(n.scope_!==e)return r;if(!n.modified_)return G(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const o=n.copy_;let a=o,l=!1;n.type_===3&&(a=new Set(o),o.clear(),l=!0),K(a,(u,f)=>ke(e,n,o,u,f,s,l)),G(e,o,!1),s&&e.patches_&&P("Patches").generatePatches_(n,s,e.patches_,e.inversePatches_)}return n.copy_}function ke(e,r,s,n,o,a,l){if(A(o)){const u=a&&r&&r.type_!==3&&!de(r.assigned_,n)?a.concat(n):void 0,f=Q(e,o,u);if(Be(s,n,f),A(f))e.canAutoFreeze_=!1;else return}else l&&s.add(o);if(N(o)&&!se(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),(!r||!r.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,n)&&G(e,o)}}function G(e,r,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ve(r,s)}function Wt(e,r){const s=Array.isArray(e),n={type_:s?1:0,scope_:r?r.scope_:Ve(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=Se;s&&(o=[n],a=B);const{revoke:l,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=l,u}var Se={get(e,r){if(r===g)return e;const s=w(e);if(!de(s,r))return Ht(e,s,r);const n=s[r];return e.finalized_||!N(n)?n:n===ae(e.base_,r)?(ce(e),e.copy_[r]=pe(n,e)):n},has(e,r){return r in w(e)},ownKeys(e){return Reflect.ownKeys(w(e))},set(e,r,s){const n=qe(w(e),r);if(n!=null&&n.set)return n.set.call(e.draft_,s),!0;if(!e.modified_){const o=ae(w(e),r),a=o==null?void 0:o[g];if(a&&a.base_===s)return e.copy_[r]=s,e.assigned_[r]=!1,!0;if(Lt(s,o)&&(s!==void 0||de(e.base_,r)))return!0;ce(e),xe(e)}return e.copy_[r]===s&&(s!==void 0||r in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=s,e.assigned_[r]=!0),!0},deleteProperty(e,r){return ae(e.base_,r)!==void 0||r in e.base_?(e.assigned_[r]=!1,ce(e),xe(e)):delete e.assigned_[r],e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const s=w(e),n=Reflect.getOwnPropertyDescriptor(s,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:s[r]}},defineProperty(){_(11)},getPrototypeOf(e){return z(e.base_)},setPrototypeOf(){_(12)}},B={};K(Se,(e,r)=>{B[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});B.deleteProperty=function(e,r){return B.set.call(this,e,r,void 0)};B.set=function(e,r,s){return Se.set.call(this,e[0],r,s,e[0])};function ae(e,r){const s=e[g];return(s?w(s):e)[r]}function Ht(e,r,s){var o;const n=qe(r,s);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function qe(e,r){if(!(r in e))return;let s=z(e);for(;s;){const n=Object.getOwnPropertyDescriptor(s,r);if(n)return n;s=z(s)}}function xe(e){e.modified_||(e.modified_=!0,e.parent_&&xe(e.parent_))}function ce(e){e.copy_||(e.copy_=fe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $t=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,s,n)=>{if(typeof r=="function"&&typeof s!="function"){const a=s;s=r;const l=this;return function(f=a,...d){return l.produce(f,c=>s.call(this,c,...d))}}typeof s!="function"&&_(6),n!==void 0&&typeof n!="function"&&_(7);let o;if(N(r)){const a=Pe(this),l=pe(r,void 0);let u=!0;try{o=s(l),u=!1}finally{u?me(a):he(a)}return Ne(a,n),Fe(o,a)}else if(!r||typeof r!="object"){if(o=s(r),o===void 0&&(o=r),o===Le&&(o=void 0),this.autoFreeze_&&ve(o,!0),n){const a=[],l=[];P("Patches").generateReplacementPatches_(r,o,a,l),n(a,l)}return o}else _(1,r)},this.produceWithPatches=(r,s)=>{if(typeof r=="function")return(l,...u)=>this.produceWithPatches(l,f=>r(f,...u));let n,o;return[this.produce(r,s,(l,u)=>{n=l,o=u}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){N(e)||_(8),A(e)&&(e=Zt(e));const r=Pe(this),s=pe(e,void 0);return s[g].isManual_=!0,he(r),s}finishDraft(e,r){const s=e&&e[g];(!s||!s.isManual_)&&_(9);const{scope_:n}=s;return Ne(n,r),Fe(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,r){let s;for(s=r.length-1;s>=0;s--){const o=r[s];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}s>-1&&(r=r.slice(s+1));const n=P("Patches").applyPatches_;return A(e)?n(e,r):this.produce(e,o=>n(o,r))}};function pe(e,r){const s=te(e)?P("MapSet").proxyMap_(e,r):re(e)?P("MapSet").proxySet_(e,r):Wt(e,r);return(r?r.scope_:Ve()).drafts_.push(s),s}function Zt(e){return A(e)||_(10,e),We(e)}function We(e){if(!N(e)||se(e))return e;const r=e[g];let s;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,s=fe(e,r.scope_.immer_.useStrictShallowCopy_)}else s=fe(e,!0);return K(s,(n,o)=>{Be(s,n,We(o))}),r&&(r.finalized_=!1),s}var j=new $t,I=j.produce;j.produceWithPatches.bind(j);j.setAutoFreeze.bind(j);j.setUseStrictShallowCopy.bind(j);j.applyPatches.bind(j);j.createDraft.bind(j);j.finishDraft.bind(j);function Ut(){const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const n=e.fullstackResources.components_resources_info.artifact_store,o=n.flatMap(l=>l.accessible_by_service_connector.map(u=>({...l,value:u})));function a({flavor:l,resourceId:u}){const f=n.find(d=>d.flavor===l);f&&(r(d=>I(d,c=>{c.artifactStoreConfig={flavor:l,configuration:Object.fromEntries(Object.keys(f.required_configuration||{}).map(h=>[h,u])),service_connector_resource_id:u}})),s(d=>d+1))}return{handleFormSubmit:a,flattenedInstances:o}}function V({flavor:e,type:r,width:s=32,height:n=32,...o}){var l;const a=J({...gt.flavorList({name:e,type:r})});return a.isError?null:a.isPending?t.jsx(Y,{style:{height:`${n}px`,width:`${s}px`}}):t.jsx("img",{width:s,height:n,alt:`${e} logo`,...o,src:Ke(((l=a.data.items[0].body)==null?void 0:l.logo_url)??"")})}const Kt="artifact_store";function Qt(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=Ut(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{type:Kt,width:24,height:24,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function Gt(){const e=W({resolver:q(Et),shouldUnregister:!0});return t.jsx(H,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Artifact Store"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Mt,{}),t.jsx(Qt,{})]})}),t.jsx(R,{children:t.jsx(Yt,{})})]})})}function Yt(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const He=y.object({authMethod:y.string().min(1),stackName:kt});function Jt(){var h,i;const{data:e}=S(),{setCurrentStep:r}=F(),{control:s,watch:n,resetField:o}=v(),{setSchema:a,setDefaultValues:l}=X(),u=J({...Ie.serviceConnectorTypeDetail(((h=e.connectorConfig)==null?void 0:h.type)||"")});if(u.isError)return null;if(u.isPending)return t.jsx(Y,{className:"h-[40px] w-[100px]"});const f=u.data.auth_methods.filter(m=>m.auth_method!=="implicit").map(m=>({name:m.name,auth_method:m.auth_method}));if(!((i=e.connectorConfig)!=null&&i.type)){r(1);return}function d(){var Ce;const m=n("authMethod"),x=(Ce=u.data)==null?void 0:Ce.auth_methods.find(ne=>ne.auth_method===m);if(!x)return;const C=x.config_schema,b=bt(C),$e=wt(C);a(He.merge(b)),l($e),Object.keys(b.shape).forEach(ne=>o(ne))}const c=e.connectorConfig.type||"";return t.jsx(k,{control:s,name:"authMethod",render:({field:{onChange:m,ref:x,...C}})=>t.jsxs(Qe,{...C,onValueChange:b=>{m(b),d()},children:[t.jsx(Ge,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(Ye,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(Je,{children:t.jsx(Xe,{viewportClassName:"max-h-[300px]",children:f.map(b=>t.jsx(et,{className:"space-x-2",value:b.auth_method,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(L,{provider:c}),t.jsx("div",{children:b.name})]})},b.auth_method))})})]})})}function Xt(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(Ct,{className:"h-5 w-5 fill-primary-400"}),"Select an Authentication Method"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Connect ZenML to your resources for seamless integration of cloud services into your ML pipelines."})]}),t.jsx(Jt,{})]})}function er(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(zt,{className:"h-5 w-5 fill-primary-400"}),"Add your Configuration"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Your credentials are securely stored and encrypted. ZenML uses these credentials to interact with your resources."})]}),t.jsx(tr,{})]})}function tr(){var c,h;const{data:e}=S(),{watch:r}=v(),s=J({...Ie.serviceConnectorTypeDetail(((c=e.connectorConfig)==null?void 0:c.type)||"")}),n=r("authMethod"),o=(h=s.data)==null?void 0:h.auth_methods.find(i=>i.auth_method===n);if(s.isError)return null;if(s.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});if(!o)return null;const a=o.config_schema,l=a.properties||{},u=a.required||[],f=a.$defs,d=Object.entries(l).sort(([i],[m])=>u.includes(i)&&!u.includes(m)?-1:!u.includes(i)&&u.includes(m)?1:0);return t.jsx("div",{className:"space-y-5",children:d.map(([i,m])=>t.jsx(Nt,{definitions:f,isOptional:Pt(i,u),name:i,schema:m},i))})}function rr({open:e,loadingComponents:r}){var n,o;const{data:s}=S();return(n=s.connectorConfig)!=null&&n.type?t.jsx(tt,{open:e,children:t.jsxs(rt,{onPointerDownOutside:a=>a.preventDefault(),onEscapeKeyDown:a=>a.preventDefault(),className:"max-w-[600px]",children:[t.jsx("div",{className:"flex items-center justify-between border-b border-theme-border-moderate py-2 pl-5 pr-3",children:t.jsx(st,{className:"text-text-lg",children:"Connecting and loading your components..."})}),t.jsxs("div",{className:"flex h-[200px] items-center justify-center gap-5 bg-primary-50",children:[t.jsx(nt,{className:"h-[60px] w-[60px]"}),t.jsx("div",{className:"flex h-[60px] w-[60px] items-center justify-center",children:t.jsx(ot,{className:"h-5 w-5 fill-theme-text-tertiary"})}),t.jsx(L,{className:"h-[60px] w-[60px]",provider:s.connectorConfig.type})]}),t.jsxs("div",{className:"flex flex-col gap-1 px-7 pb-6 pt-5",children:[t.jsxs("p",{className:"text-theme-text-secondary",children:["We're securely connecting to ",vt(((o=s.connectorConfig)==null?void 0:o.type)||"aws")," ","and retrieving your custom components. This process typically takes about 30-60 seconds."]}),t.jsx(sr,{loadingComponents:r})]})]})}):null}function sr({loadingComponents:e}){const[r,s]=p.useState(!0),[n,o]=p.useState(!0);return p.useEffect(()=>{const a=setTimeout(()=>{s(!1)},Math.floor(Math.random()*1e3)+500),l=setTimeout(()=>{o(!1)},1500);return()=>{clearTimeout(a),clearTimeout(l)}},[]),t.jsxs("ul",{className:"mt-3 space-y-3 text-theme-text-secondary",children:[t.jsxs(ue,{children:[t.jsx(le,{loading:r}),"Establishing a secure connection"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:n}),"Authenticating your account"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:e}),"Fetching your existing components"]})]})}function le({loading:e}){return e?t.jsx(it,{className:"h-5 w-5 border-2"}):t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"})}function ue({children:e}){return t.jsx("li",{className:"flex items-center gap-1",children:e})}async function nr({payload:e}){const r=ct(ut.serviceConnectors.fullStackResources),s=await at(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching service connector type");throw new lt({status:s.status,statusText:s.statusText,message:n})}return s.json()}function or(e){return jt({...e,mutationFn:async({payload:r})=>nr({payload:r})})}function ir(){const{setCurrentStep:e}=F(),[r,s]=p.useState(!0),{toast:n}=De(),{setData:o,data:a}=S(),l=or({onSuccess:async f=>{o(d=>I(d,c=>{c.fullstackResources=f})),s(!1),await pt(200),e(d=>d+1)},onError:f=>{n({status:"error",emphasis:"subtle",description:f.message,rounded:!0})}});return{handleFormSubmit:({authMethod:f,stackName:d,...c})=>{Object.keys(c).forEach(i=>{(c[i]===""||c[i]===null||c[i]===void 0||Array.isArray(c[i])&&c[i].length===0)&&delete c[i]});const h=I(a,i=>{i.stackName=d,i.connectorConfig&&(i.connectorConfig.auth_method=f,i.connectorConfig.configuration={...c})});o(h),h.connectorConfig&&l.mutate({payload:h.connectorConfig})},fullStackResources:l,loadingComponents:r}}function ar(){const{handleSubmit:e,formState:{isSubmitting:r}}=v(),{handleFormSubmit:s,fullStackResources:n,loadingComponents:o}=ir();return t.jsxs("form",{onSubmit:e(s),id:"connect-form",children:[t.jsx(rr,{loadingComponents:o,open:r||n.isPending}),t.jsx(Xt,{}),t.jsx(St,{}),t.jsx(er,{})]})}function cr(){const{schema:e,defaultValues:r}=X(),s=W({shouldUnregister:!0,mode:"onChange",resolver:q(e),defaultValues:{stackName:"",authMethod:"",...r}});return t.jsx(H,{...s,children:t.jsxs(D,{children:[t.jsx(O,{children:"Connect to your Cloud"}),t.jsx(E,{children:t.jsx(ar,{})}),t.jsx(R,{children:t.jsx(lr,{})})]})})}function lr(){const{formState:{isValid:e,isSubmitting:r}}=v(),s=!!Oe();return t.jsx(M,{className:"justify-center gap-2",disabled:!e||s||r,form:"connect-form",size:"md",children:s||r?"Loading...":"Next"})}function ur(){const{data:e,setData:r}=S(),s=_t(),{toast:n}=De(),{setCurrentStep:o}=F(),{mutate:a}=yt({onError:d=>{d instanceof Error&&n({status:"error",emphasis:"subtle",icon:t.jsx(dt,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess:async d=>{r(c=>I(c,h=>{h.createdStackId=d.id})),o(c=>c+1),s.invalidateQueries({queryKey:Ee.all})}});if(!e.fullstackResources)return o(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const l=e.fullstackResources.components_resources_info.container_registry,u=l.flatMap(d=>d.accessible_by_service_connector.map(c=>({...d,value:c})));function f({flavor:d,resourceId:c}){const h=l.find(m=>m.flavor===d);if(!h)return;const i=I(e,m=>{m.registryConfig={flavor:d,configuration:Object.fromEntries(Object.keys(h.required_configuration||{}).map(x=>[x,c])),service_connector_resource_id:c}});r(i),a({payload:{name:i.stackName||Math.random().toString(36).substring(7),service_connectors:i.connectorConfig?[i.connectorConfig]:[],components:{orchestrator:[{...i.orchestratorConfig,service_connector_index:0}],artifact_store:[{...i.artifactStoreConfig,service_connector_index:0}],container_registry:[{...i.registryConfig,service_connector_index:0}]}}})}return{handleFormSubmit:f,flattenedInstances:u}}const dr="container_registry";function fr(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=ur(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{width:24,height:24,type:dr,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function mr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"container_registry",className:"h-5 w-5 fill-primary-400"}),"Select your Container Registry"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the Container Registries for your new stack"})]})})}const hr=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)});function xr(){const e=W({resolver:q(hr),shouldUnregister:!0});return t.jsx(H,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Container Registry"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(mr,{}),t.jsx(fr,{})]})}),t.jsx(R,{children:t.jsx(pr,{})})]})})}function pr(){const e=v(),r=!!Oe();return t.jsxs(M,{className:"justify-center gap-2",disabled:!e.formState.isValid||r,form:"artifact-store-form",size:"md",children:[r&&t.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),r?"Loading...":"Next"]})}function yr(){var a;const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{orchestrators:[],handleFormSubmit:()=>{}};const n=((a=e.fullstackResources.components_resources_info)==null?void 0:a.orchestrator)||[];function o({flavor:l,resourceId:u,...f}){const d=n.find(c=>c.flavor===l);d&&(r(c=>{const h=d!=null&&d.use_resource_value_as_fixed_config?Object.fromEntries(Object.keys(d.required_configuration||{}).map(i=>[i,u])):{...f};return I(c,i=>{i.orchestratorConfig={flavor:l,configuration:h,service_connector_resource_id:u}})}),s(c=>c+1))}return{orchestrators:n,handleFormSubmit:o}}const ye=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)}),$="kubernetes",ze="orchestrator";function gr(){const{orchestrators:e,handleFormSubmit:r}=yr(),{setSchema:s}=X(),{control:n,watch:o,setValue:a,register:l,reset:u,handleSubmit:f}=v(),d=o("flavor");return t.jsxs("form",{onSubmit:f(r),id:"artifact-store-form",children:[d!==$&&t.jsx("input",{...l("resourceId"),type:"hidden"}),t.jsx("ul",{className:"space-y-1",children:e.map((c,h)=>t.jsxs("li",{children:[t.jsx(k,{control:n,name:"flavor",render:({field:{onChange:i,...m}})=>t.jsxs(Z,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(U,{onChange:x=>{u({flavor:c.flavor}),c.use_resource_value_as_fixed_config===!0&&s(ye),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&s(ye.merge(Ft(c.required_configuration))),c.flavor!==$&&c.accessible_by_service_connector.length>0&&a("resourceId",c.accessible_by_service_connector[0]),i(x)},...m,id:c.flavor,type:"radio",value:c.flavor,name:"orchestrator-flavor-radio"}),t.jsx(V,{width:24,height:24,type:ze,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===$||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===$&&t.jsx("ul",{className:"space-y-1",children:c.accessible_by_service_connector.map(i=>t.jsx("li",{children:t.jsx(k,{control:n,name:"resourceId",render:({field:m})=>t.jsxs(Z,{"data-state":o("resourceId")===i?"selected":"unselected",htmlFor:i,children:[t.jsx(U,{...m,id:i,type:"radio",value:i,name:"instance-radio"}),t.jsx(V,{type:ze,width:24,height:24,flavor:c.flavor}),t.jsx("span",{children:i})]})})},i))}),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&Object.keys(c.required_configuration).length>=1&&t.jsx("div",{children:Object.entries(c.required_configuration).map(([i,m])=>t.jsx("div",{children:t.jsx(k,{defaultValue:"",name:i,control:n,render:({field:x})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:i,className:"text-text-sm",children:m}),t.jsx(ge,{...x,inputSize:"md",required:!0,className:"w-full",id:i})]})})},i))})]})]},h))})]})}function jr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"orchestrator",className:"h-5 w-5 fill-primary-400"}),"Select your Orchestrator"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the connected orchestrators for your new stack"})]})})}function _r(){const{schema:e}=X(),r=W({resolver:q(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx(H,{...r,children:t.jsxs(D,{children:[t.jsx(O,{children:"Orchestrator"}),t.jsxs(E,{children:[t.jsx(jr,{}),t.jsx(gr,{})]}),t.jsx(R,{children:t.jsx(vr,{})})]})})}function vr(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const Sr=y.object({provider:y.string().min(1)});function Cr(){var a;const{setData:e,data:r}=S(),{setCurrentStep:s}=F(),n=W({resolver:q(Sr),defaultValues:{provider:((a=r.connectorConfig)==null?void 0:a.type)||""}});function o(l){e(u=>({...u,connectorConfig:{type:l.provider,auth_method:""}})),s(u=>u+1)}return t.jsx(H,{...n,children:t.jsxs(D,{children:[t.jsx(O,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where you have existing infrastructure to connect with ZenML. This will allow you to integrate your current cloud resources with ZenML for model deployment and management."})]}),t.jsxs("form",{id:"provider-form",onSubmit:n.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[t.jsx(oe,{id:"aws-provider",...n.register("provider"),value:"aws",children:t.jsx(ie,{icon:t.jsx(L,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),t.jsx(oe,{id:"gcp-provider",...n.register("provider"),value:"gcp",children:t.jsx(ie,{icon:t.jsx(L,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),t.jsx(oe,{id:"azure-provider",...n.register("provider"),value:"azure",children:t.jsx(ie,{icon:t.jsx(L,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),t.jsx(R,{children:t.jsx(br,{})})]})})}function br(){const{formState:{isValid:e}}=v();return t.jsx(M,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function wr(){var o;const{data:e}=S(),r=J({...Ee.stackDetail(e.createdStackId||""),throwOnError:!0});if(r.isError)return null;if(r.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});const s=r.data,n=It((o=r.data.metadata)==null?void 0:o.components);return t.jsxs(D,{children:[t.jsx(O,{children:"Your stack"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsx("p",{className:"text-theme-text-secondary",children:"Here you can review the created stack and stack components. Now you can start running pipelines using this new configuration."}),t.jsxs("div",{className:"divide-y divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[t.jsx(Pr,{stack:s}),n.map(a=>t.jsx(Fr,{component:a},a.id))]})]})}),t.jsx(R,{displayCancel:!1,children:t.jsx(Nr,{})})]})}function Nr(){return t.jsx(M,{size:"md",asChild:!0,children:t.jsx(Dt,{to:xt.stacks.overview,children:"Finish"})})}function Pr({stack:e}){return t.jsxs("div",{className:"flex items-center gap-3 bg-theme-surface-secondary p-5 font-semibold",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(ft,{type:"square",size:"lg",children:t.jsx(mt,{size:"lg",children:e.name[0]})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]})}function Fr({component:e}){var r,s,n,o;return t.jsxs("div",{className:"flex items-center justify-between py-3 pl-9 pr-5",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(V,{width:24,height:24,flavor:((r=e.body)==null?void 0:r.flavor_name)||"",type:((s=e.body)==null?void 0:s.type)||"orchestrator"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg font-semibold",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]}),t.jsx(At,{type:((n=e.body)==null?void 0:n.type)||"alerter",children:ht((o=e.body)==null?void 0:o.type)})]},e.id)}function kr(){const{currentStep:e}=F();if(e===1)return t.jsx(Cr,{});if(e===2)return t.jsx(be,{initialSchema:He,children:t.jsx(cr,{})});if(e===3)return t.jsx(Gt,{});if(e===4)return t.jsx(be,{initialSchema:ye,children:t.jsx(_r,{})});if(e===5)return t.jsx(xr,{});if(e===6)return t.jsx(wr,{})}const Ae=["Infrastructure Type","Cloud Provider","Connect your Cloud","Artifact Store","Orchestrator","Container Registry"];function ls(){return t.jsx(Ze,{maxSteps:Ae.length+1,initialStep:1,children:t.jsx(Ot,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(Ue,{entries:Ae}),t.jsx("div",{className:"w-full",children:t.jsx(kr,{})})]})})})}export{ls as default};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as u,j as a}from"./@radix-B1sy0Lhr.js";import{u as h,c as b,S as v,a as y,b as k}from"./form-schemas-
|
1
|
+
import{r as u,j as a}from"./@radix-B1sy0Lhr.js";import{u as h,c as b,S as v,a as y,b as k}from"./form-schemas-CpTCEVoG.js";import{S}from"./SetPassword-D-V7D0OR.js";import{I as x,B as j,x as N,F as A,G as C,H as q,t as P,v as z,w as E}from"./index-Ci5z7q6x.js";import{u as F}from"./index.esm-SBF9nn_P.js";import{t as M}from"./zod-D48zuELD.js";import{c as T}from"./@tanstack-Dwlisomv.js";import{u as U}from"./login-mutation-DOxF97JV.js";import"./check-circle-CG6XAdk-.js";import"./@react-router-CHjLNlgw.js";import"./UpdatePasswordSchemas-BP4hg95A.js";import"./PasswordChecker-DOPLfvg7.js";import"./@reactflow-gbyyU3kq.js";const g=u.createContext(null);function $({children:e,initialSettings:r}){const[t,i]=u.useState(r||{});return a.jsx(g.Provider,{value:{serverSettings:t,setServerSettings:i},children:e})}function f(){const e=u.useContext(g);if(e===null)throw new Error("useServerActivationContext must be used within an ServerActivationProvider");return e}function H(){const{setSurveyStep:e}=h(),{setServerSettings:r}=f();function t({newPassword:i,username:o}){r(s=>({...s,admin_password:i,admin_username:o})),e(s=>s+1)}return a.jsx(S,{displayUsername:!0,headline:"Create your admin user and password",subHeadine:"Select a username and password for your admin account",submitHandler:t})}const m=e=>{e=1831565813+(e|=0)|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296};class I{constructor(r){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:t,separator:i,dictionaries:o,style:s,seed:l}=r;this.dictionaries=o,this.separator=i,this.length=t,this.style=s,this.seed=l}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
|
2
2
|
Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let r=this.seed;return this.dictionaries.slice(0,this.length).reduce((t,i)=>{let o;r?(o=(l=>{if(typeof l=="string"){const c=l.split("").map(d=>d.charCodeAt(0)).reduce((d,w)=>d+w,1),n=Math.floor(Number(c));return m(n)}return m(l)})(r),r=4294967296*o):o=Math.random();let s=i[Math.floor(o*i.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[l,...c]=s.split("");s=l.toUpperCase()+c.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return t?`${t}${this.separator}${s}`:`${s}`},"")}}const p={separator:"_",dictionaries:[]},L=e=>{const r=[...e&&e.dictionaries||p.dictionaries],t={...p,...e,length:e&&e.length||r.length,dictionaries:r};if(!e||!e.dictionaries||!e.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new I(t).generate()};var _=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],B=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const D=["booby","swallow"];function G(){return L({dictionaries:[B,_.filter(e=>!D.includes(e))]})}function R({submitHandler:e}){const r=u.useId(),{handleSubmit:t,register:i,formState:{isValid:o}}=F({resolver:M(b),defaultValues:{serverName:G()}});return a.jsxs("div",{className:"max-w-[570px] space-y-5",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-display-xs font-semibold",children:"Almost there! Select a server name"}),a.jsx("p",{className:"text-theme-text-secondary",children:"This will identify your ZenML server. You can use the generated name or create your own."})]}),a.jsxs("form",{onSubmit:t(e),className:"space-y-5",children:[a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("label",{htmlFor:r,className:"text-text-sm",children:"Server Name"}),a.jsx(x,{...i("serverName"),id:r,className:"w-full"})]})}),a.jsx(j,{disabled:!o,className:"w-full text-center",size:"md",children:a.jsx("span",{className:"w-full",children:"Activate your Server"})})]})]})}async function V(e){const r=A(q.activate),t=await N(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const i=await t.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Failed to activate server");throw new C({status:t.status,statusText:t.statusText,message:i})}return t.json()}function Y(e){return T({mutationFn:async r=>V(r),...e})}function Z({setUsername:e}){const{serverSettings:r}=f(),{setSurveyStep:t}=h(),{setAuthState:i}=P(),{toast:o}=z(),{mutate:s}=U({onSuccess:()=>{i("true"),t(n=>n+1)}}),{mutate:l}=Y({onSuccess:async n=>{e(n.name),s({username:n.name,password:r.admin_password??void 0})},onError:n=>{n instanceof Error&&o({status:"error",emphasis:"subtle",icon:a.jsx(E,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:n.message,rounded:!0})}});function c({serverName:n}){l({...r,server_name:n})}return a.jsx(R,{submitHandler:c})}function J(){const{surveyStep:e}=h(),[r,t]=u.useState("");return a.jsx(a.Fragment,{children:a.jsxs($,{children:[a.jsx(v,{stepAmount:2}),e===1&&a.jsx(H,{}),e===2&&a.jsx(Z,{setUsername:t}),e===3&&a.jsx(y,{subHeader:"Your created your ZenML account",username:r})]})})}function le(){return a.jsx(k,{children:a.jsx(J,{})})}export{le as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e,r as j}from"./@radix-B1sy0Lhr.js";import{B as i,r as u,x as D,F as S,G as b,H as T,aZ as x,J as g,K as k,z as c,L as R,M as A,N as P,O as B,aw as _,Q as h,X as p,a2 as E,d as f,Y as L,k as F}from"./index-
|
1
|
+
import{j as e,r as j}from"./@radix-B1sy0Lhr.js";import{B as i,r as u,x as D,F as S,G as b,H as T,aZ as x,J as g,K as k,z as c,L as R,M as A,N as P,O as B,aw as _,Q as h,X as p,a2 as E,d as f,Y as L,k as F}from"./index-Ci5z7q6x.js";import{S as M}from"./SearchField-BbwrusMV.js";import{c as I,b as y}from"./@tanstack-Dwlisomv.js";import{S as z}from"./refresh-C8BXS3Fb.js";import{S as H}from"./plus-DOrkJCmy.js";import{L as m,f as O}from"./@react-router-CHjLNlgw.js";import{c as Q,u as $}from"./bulk-delete-Bgf_MsSj.js";import{S as C}from"./trash-D9LA4VFD.js";import{D as G,a as K}from"./DeleteAlertDialog-C5z9RupH.js";import{P as U}from"./Pagination-CVYIgR9l.js";import{C as q,R as J}from"./resource-type-tooltip-2vjL6Wh9.js";import{e as X,R as Y,E as Z}from"./service-connectors-BkE8Ol4i.js";import"./@reactflow-gbyyU3kq.js";import"./index-g7wOyc86.js";import"./zod-D48zuELD.js";import"./index.esm-SBF9nn_P.js";import"./chevron-right-double-CbMG1dOM.js";function V(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Connectors"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your service connectors."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/infrastructure-deployment/auth-management",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}function W(){return e.jsx(i,{size:"md",asChild:!0,children:e.jsxs(m,{to:u.settings.connectors.create,children:[e.jsx(H,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Connector"})]})})}async function ee({connectorId:t}){const s=S(T.serviceConnectors.detail(t)),r=await D(s,{method:"DELETE"});if(!r.ok){const n=await r.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Error while deleting connector ${t}`);throw new b({status:r.status,statusText:r.statusText,message:n})}return r.json()}function te(t){return I({...t,mutationFn:async({connectorId:s})=>ee({connectorId:s})})}const{ContextProvider:se,useContext:l}=Q();function v(){const{setRowSelection:t}=l(),{mutateAsync:s}=te();async function r(n){await s({connectorId:n})}return $({deleteFn:r,queryKeyToInvalidate:[...x.connectors],setRowSelection:t})}function w({deleteHandler:t}){return e.jsx(G,{title:"Delete Connectors",handleDelete:t,children:e.jsxs(K,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})}function re({deleteHandler:t,open:s,setOpen:r}){return e.jsx(g,{open:s,onOpenChange:r,children:e.jsx(w,{deleteHandler:t})})}function ne(){const{selectedRowCount:t,selectedRowIDs:s}=l(),{bulkDelete:r}=v();async function n(){await r(s)}const o=t>1?"s":"",a=`${t} Service connector${o} selected`;return e.jsxs("div",{className:"flex h-7 items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:a}),e.jsxs(g,{children:[e.jsx(k,{asChild:!0,children:e.jsxs(i,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(C,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(w,{deleteHandler:n})]})]})}function oe({queryParams:t}){const{selectedRowCount:s}=l();return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s>0?e.jsx(ne,{}):e.jsx(M,{searchParams:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{queryParams:t}),e.jsx(W,{})]})]})})}function ae({queryParams:t}){const{refetch:s}=y(x.serviceConnectorList(t));return e.jsxs(i,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>s(),children:[e.jsx(z,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})}const d=1,ce=c.object({page:c.coerce.number().min(d).optional().default(d).catch(d),name:c.string().optional(),operator:c.enum(["and","or"]).optional()});function ie(){const[t]=O(),{page:s,name:r,operator:n}=ce.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,sortBy:t.get("sort_by")||void 0});return{page:s,name:r,logical_operator:n}}function le({id:t}){const[s,r]=j.useState(!1),{bulkDelete:n}=v();async function o(){await n([t]),r(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(re,{deleteHandler:o,open:s,setOpen:r}),e.jsxs(R,{children:[e.jsx(A,{asChild:!0,children:e.jsx(i,{intent:"secondary",emphasis:"minimal",className:"flex aspect-square items-center justify-center p-0",children:e.jsx(P,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"})})}),e.jsx(B,{align:"end",sideOffset:7,children:e.jsxs(_,{onSelect:()=>r(!0),className:"cursor-pointer space-x-2",children:[e.jsx(C,{className:"h-3 w-3 fill-neutral-400"}),e.jsx("p",{children:"Delete"})]})})]})]})}function de(){return j.useMemo(()=>[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(h,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(h,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Service Connector",accessorKey:"name",cell:({row:t})=>{var o;const s=t.original.id,r=t.original.name,n=(o=t.original.body)==null?void 0:o.connector_type;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[!!n&&typeof n!="string"&&e.jsx(q,{connectorType:n}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),className:"block max-w-[200px] truncate text-text-md font-semibold",children:r}),e.jsx(p,{copyText:r})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),children:s.split("-")[0]}),e.jsx(p,{copyText:s})]})]})]})}},{id:"resource_types",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Types"})},cell:({row:t})=>{const s=X(t.original);return e.jsx("div",{className:"flex items-center gap-0.5",children:s.map((r,n)=>e.jsx(J,{resourceType:r},n))})}},{id:"resource-name",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Name"})},cell:({row:t})=>e.jsx("div",{className:"max-w-[100px]",children:e.jsx(Y,{connector:t.original})})},{id:"user",header:"Author",accessorFn:t=>{var s,r;return(r=(s=t.resources)==null?void 0:s.user)==null?void 0:r.name},cell:({row:t})=>{var r,n,o;const s=(r=t.original.resources)==null?void 0:r.user;return s?e.jsx(E,{className:"max-w-[200px] truncate",avatarUrl:((n=s.body)==null?void 0:n.avatar_url)??void 0,username:s.name,isServiceAccount:!!((o=s.body)!=null&&o.is_service_account)}):null}},{id:"expires",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Expires in"})},accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.expires_at},cell:({row:t})=>{var r;const s=(r=t.original.body)==null?void 0:r.expires_at;return s?e.jsx(Z,{expires:s}):e.jsx("p",{children:"Never"})}},{id:"admin_actions",header:"",cell:({row:t})=>e.jsx(le,{id:t.original.id})}],[])}function ue({queryParams:t}){const{rowSelection:s,setRowSelection:r}=l(),n=y({...x.serviceConnectorList(t)}),o=de();if(n.isPending)return e.jsxs("div",{className:"space-y-5",children:[e.jsx(f,{className:"h-[300px] w-full"}),e.jsx(f,{className:"mx-auto h-[36px] w-[300px]"})]});if(n.isError)return null;const a=n.data;return e.jsx("section",{className:"flex flex-col gap-5",children:e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:e.jsx(L,{columns:o,data:a.items,rowSelection:s,getRowId:N=>N.id,onRowSelectionChange:r})}),a.total_pages>1&&e.jsx(U,{searchParams:t,paginate:a})]})})}function me(){const s={...ie(),sort_by:"desc:updated"};return e.jsxs(e.Fragment,{children:[e.jsx(oe,{queryParams:s}),e.jsx(ue,{queryParams:s})]})}function Pe(){return e.jsxs(F,{className:"space-y-4 p-5",children:[e.jsx(V,{}),e.jsx(se,{children:e.jsx(me,{})})]})}export{Pe as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e,r as u}from"./@radix-B1sy0Lhr.js";import{x as p,F as f,G as y,H as j,aH as g,aJ as v,a7 as N,B as l,ay as m,a_ as d,aZ as b,d as w,C,o as k,p as S,q as D,w as P}from"./index-
|
1
|
+
import{j as e,r as u}from"./@radix-B1sy0Lhr.js";import{x as p,F as f,G as y,H as j,aH as g,aJ as v,a7 as N,B as l,ay as m,a_ as d,aZ as b,d as w,C,o as k,p as S,q as D,w as P}from"./index-Ci5z7q6x.js";import{S as _}from"./chevron-down-Bl7WwQAL.js";import{I as E}from"./Infobox-CXOIY92f.js";import{c as F,b as R}from"./@tanstack-Dwlisomv.js";import{a as T}from"./@react-router-CHjLNlgw.js";import{F as z}from"./icon--Tp6obFZ.js";import"./@reactflow-gbyyU3kq.js";import"./info-CI2szPUG.js";async function O({connectorId:s}){const t=f(j.serviceConnectors.verifyExisting(s)),n=await p(t,{method:"PUT",headers:{"Content-Type":"application/json"}});if(!n.ok){const r=await n.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>"Failed to verify connector");throw new y({status:n.status,statusText:n.statusText,message:r})}return n.json()}function V(s){return F({...s,mutationFn:async({connectorId:t})=>O({connectorId:t})})}const B="/assets/connectivity-4UKGMYnr.webp";function I({open:s,isLoading:t,isError:n,onClose:r,onSuccess:i,data:a}){const c=!!(a!=null&&a.error),o=(a==null?void 0:a.error)??void 0;return e.jsx(g,{open:s,children:e.jsx(v,{onPointerDownOutside:x=>t?x.preventDefault():r==null?void 0:r(),onEscapeKeyDown:x=>t?x.preventDefault():r==null?void 0:r(),className:"max-w-[540px] p-8",children:e.jsxs("div",{className:"flex w-full flex-col items-center justify-center space-y-5",children:[t&&!a&&e.jsx(A,{onClose:r}),!t&&!n&&!c&&e.jsx(H,{onSuccess:i}),!t&&(n||c)&&e.jsx(Q,{error:o,onClose:r})]})})})}function A({onClose:s}){return e.jsxs(e.Fragment,{children:[e.jsx(N,{}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Verifying your service connector"}),e.jsxs("p",{className:"text-text-lg text-theme-text-secondary",children:["Please wait while we check your connection ",e.jsx("br",{}),"This may take up to a minute."]})]}),e.jsx(l,{size:"md",emphasis:"subtle",onClick:s,intent:"secondary",className:"mt-4",children:"Cancel"})]})}function H({onSuccess:s}){return e.jsxs(e.Fragment,{children:[e.jsx(m,{width:180,height:180,className:"fill-theme-text-success"}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Connection verified successfully!"}),e.jsx("p",{className:"text-text-lg text-theme-text-secondary",children:"Ready to show your available resources"})]}),e.jsx(l,{size:"md",onClick:s,className:"mt-4",children:"Display Resources"})]})}function Q({onClose:s,error:t}){return e.jsxs(e.Fragment,{children:[e.jsx("img",{src:B,alt:"Connectivity",width:180,height:180}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"We couldn't verify your connection"}),t&&e.jsx("p",{className:"max-h-[250px] overflow-auto rounded-md border border-theme-border-moderate bg-theme-surface-secondary p-1 text-left font-mono",children:t}),e.jsx("p",{className:"text-text-lg text-theme-text-secondary",children:"Please try again to list your resources"})]}),e.jsx(l,{size:"md",emphasis:"subtle",onClick:s,intent:"secondary",className:"mt-4",children:"Close"})]})}function h({children:s}){const{setResources:t}=d(),{connectorId:n}=T(),r=R({...b.serviceConnectorDetail(n),throwOnError:!0}),[i,a]=u.useState(!1),c=V();if(r.isPending)return e.jsx(w,{className:"h-7 w-[150px]"});if(r.isError)return null;const o=()=>{a(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(I,{data:c.data,open:i,isLoading:c.isPending,isError:c.isError,onClose:o,onSuccess:()=>{c.data&&(t(c.data),a(!1))}}),e.jsxs(l,{disabled:c.isPending&&i,onClick:()=>{a(!0),c.mutate({connectorId:n})},className:"gap-1",size:"md",children:[e.jsx(m,{width:24,height:24,className:"size-5 shrink-0 fill-white"}),s]})]})}function G(){var n;const{resources:s}=d();if(!s)return null;const t=s.connector_type;return!t||typeof t=="string"?null:e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{children:e.jsx("span",{children:"Reverify now"})})}),(n=s.resources)==null?void 0:n.map(r=>{var i,a;return e.jsx(K,{title:(i=t.resource_types.find(c=>c.resource_type===r.resource_type))==null?void 0:i.name,logoUrl:((a=t.resource_types.find(c=>c.resource_type===r.resource_type))==null?void 0:a.logo_url)??void 0,resource:r},r.resource_type)})]})}function K({resource:s,title:t,logoUrl:n}){const[r,i]=u.useState(!0),a=s.error,c=s.resource_ids??[];return e.jsxs(C,{open:r,onOpenChange:i,children:[e.jsx(k,{className:"flex items-center gap-[10px]",children:e.jsxs(S,{className:"flex w-full items-center gap-[10px] text-text-lg",children:[e.jsx(_,{className:` ${r?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`}),t||s.resource_type]})}),e.jsx(D,{className:"space-y-5 border-t border-theme-border-moderate bg-theme-surface-primary",children:a?e.jsx("div",{className:"p-5",children:e.jsx(E,{intent:"error",children:a})}):e.jsx("ul",{className:"divide-y divide-theme-border-moderate",children:c.map(o=>e.jsxs("li",{className:"flex items-center space-x-2 py-3 pl-8",children:[!!n&&e.jsx("img",{width:24,height:24,src:n,alt:t,className:"size-5 shrink-0"}),e.jsx("span",{children:o})]},o))})})]})}function M(){return e.jsx("div",{className:"p-9",children:e.jsxs("div",{className:"flex flex-col items-center space-y-5",children:[e.jsx(z,{icon:e.jsx(P,{className:"h-[36px] w-[36px] fill-primary-400"})}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Please verify your service connector"}),e.jsxs("p",{className:"text-text-lg text-theme-text-secondary",children:["We'll check your connection and load available resources.",e.jsx("br",{}),"This may take up to a minute."]})]}),e.jsx(h,{children:e.jsx("span",{children:"Verify now"})})]})})}function ee(){const{resources:s}=d();return s===null?e.jsx(M,{}):e.jsx(G,{})}export{ee as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as v,j as e}from"./@radix-B1sy0Lhr.js";import{z as n,v as S,aU as g,d as j,I as y,B as N,aY as b,bd as w,aP as E,w as F,k as I}from"./index-
|
1
|
+
import{r as v,j as e}from"./@radix-B1sy0Lhr.js";import{z as n,v as S,aU as g,d as j,I as y,B as N,aY as b,bd as w,aP as E,w as F,k as I}from"./index-Ci5z7q6x.js";import{u as P}from"./update-server-settings-mutation-BYfIU-xU.js";import{t as K}from"./zod-D48zuELD.js";import{h as k}from"./@tanstack-Dwlisomv.js";import{u as q}from"./index.esm-SBF9nn_P.js";import"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";const B=n.object({serverName:n.string().min(1)});function G(){var i;const r=v.useId(),{toast:t}=S(),a=k(),{isError:o,isPending:l,data:m}=g({throwOnError:!0}),{mutate:c,isPending:u}=P({onError(s){E(s)&&t({status:"error",emphasis:"subtle",icon:e.jsx(F,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})},onSuccess:async()=>{a.invalidateQueries({queryKey:b()}),a.invalidateQueries({queryKey:w()}),t({status:"success",emphasis:"subtle",rounded:!0,description:"Server Settings updated successfully"}),p()}}),{handleSubmit:d,register:x,reset:p,formState:{isValid:f}}=q({resolver:K(B)});function h(s){c({server_name:s.serverName})}return o?null:l?e.jsx(j,{className:"h-[150px] max-w-[600px]"}):e.jsx("div",{className:"w-full max-w-[600px]",children:e.jsxs("form",{className:"space-y-2",onSubmit:d(h),children:[e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{htmlFor:r,className:"text-text-sm",children:"Server Name"}),e.jsx(y,{placeholder:(i=m.body)==null?void 0:i.server_name,...x("serverName"),id:r,className:"w-full"})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsx(N,{disabled:u||!f,size:"md",intent:"primary",children:"Update"})})]})})}function R(){return e.jsxs(I,{className:"flex flex-col gap-5 p-5",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"General"}),e.jsx(G,{})]})}export{R as default};
|