zenml-nightly 0.66.0.dev20240925__py3-none-any.whl → 0.66.0.dev20240926__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/integrations/__init__.py +1 -0
- zenml/integrations/constants.py +1 -0
- zenml/integrations/deepchecks/__init__.py +1 -1
- zenml/integrations/deepchecks/data_validators/deepchecks_data_validator.py +55 -14
- zenml/integrations/deepchecks/validation_checks.py +62 -5
- zenml/integrations/skypilot/orchestrators/skypilot_base_vm_orchestrator.py +38 -26
- zenml/integrations/skypilot_kubernetes/__init__.py +52 -0
- zenml/integrations/skypilot_kubernetes/flavors/__init__.py +26 -0
- zenml/integrations/skypilot_kubernetes/flavors/skypilot_orchestrator_kubernetes_vm_flavor.py +125 -0
- zenml/integrations/skypilot_kubernetes/orchestrators/__init__.py +25 -0
- zenml/integrations/skypilot_kubernetes/orchestrators/skypilot_kubernetes_vm_orchestrator.py +74 -0
- zenml/zen_server/dashboard/assets/{404-iO8vpun1.js → 404-CMnKjD-L.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-B6kq9fJZ.js → @reactflow-CEC2f0cl.js} +1 -1
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-BqM1UpCD.js +1 -0
- zenml/zen_server/dashboard/assets/{CodeSnippet-DNWdQmbo.js → CodeSnippet-DRy_0J4D.js} +2 -2
- zenml/zen_server/dashboard/assets/{CollapsibleCard-B2OVjWYE.js → CollapsibleCard-lE-75Zob.js} +1 -1
- zenml/zen_server/dashboard/assets/{Commands-DsoaVElZ.js → Commands-CVx2RAoT.js} +1 -1
- zenml/zen_server/dashboard/assets/{CopyButton-BqE_-PHO.js → CopyButton-C_yRGWuP.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-Dyasr2jU.js → CsvVizualization-Dd0P02Iz.js} +1 -1
- zenml/zen_server/dashboard/assets/{DialogItem-Cz1VLRwa.js → DialogItem-BCrc2wIk.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-DorJD_va.js → Error-BuMJbG-M.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-CIfQTutR.js → ExecutionStatus-fIulMG4w.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-CmfvtNeq.js → Helpbox-CJAp4kbv.js} +1 -1
- zenml/zen_server/dashboard/assets/Infobox-CC70zvGO.js +1 -0
- zenml/zen_server/dashboard/assets/{InlineAvatar-Ds2ZFHPc.js → InlineAvatar-C3QXdFW1.js} +1 -1
- zenml/zen_server/dashboard/assets/{Partials-DX-8iEa1.js → Partials-Cb8lrNsi.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-BOQJgapd.js → ProviderIcon-C9BuYVSN.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-BsYBw9YA.js → ProviderRadio-GYc9PJtG.js} +1 -1
- zenml/zen_server/dashboard/assets/{SearchField-W3GXpLlI.js → SearchField-BeF1yR7M.js} +1 -1
- zenml/zen_server/dashboard/assets/SecretTooltip-DgVWrPxX.js +1 -0
- zenml/zen_server/dashboard/assets/{SetPassword-B-0a8UCj.js → SetPassword-nAhHddXW.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tick-i1DYsVcX.js → Tick-C5ZVvNRQ.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-C6Zb7ASL.js → UpdatePasswordSchemas-7KFsDbKb.js} +1 -1
- zenml/zen_server/dashboard/assets/UsageReason-DL5NL_ZD.js +1 -0
- zenml/zen_server/dashboard/assets/{WizardFooter-BHbO7zOa.js → WizardFooter-CgvFSppz.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-BBEe6I9-.js → all-pipeline-runs-query-DAPSF_74.js} +1 -1
- zenml/zen_server/dashboard/assets/{cloud-only-BuP4Kt_7.js → cloud-only-CxoNxh86.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-B2x2d4r1.js → create-stack-BfgeXFuV.js} +1 -1
- zenml/zen_server/dashboard/assets/delete-run-OkGmZQ5G.js +1 -0
- zenml/zen_server/dashboard/assets/{form-schemas-Bap0f854.js → form-schemas-C09PrQUJ.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-DFi8BroH.js → index-CLT4K7oC.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-B9wVwe7u.js → index-D0bJjaey.js} +3 -3
- zenml/zen_server/dashboard/assets/index-PcI3Xw77.css +1 -0
- zenml/zen_server/dashboard/assets/{login-mutation-DwxUz8VA.js → login-mutation-CB45FHbP.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-D5i9DunU.js → not-found-NtCUfXiV.js} +1 -1
- zenml/zen_server/dashboard/assets/page-AvcQe_oR.js +1 -0
- zenml/zen_server/dashboard/assets/page-B6DccgPa.js +1 -0
- zenml/zen_server/dashboard/assets/{page-xQG6GmFJ.js → page-B7DTiwhv.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CIbehp7V.js → page-B7LduaiG.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CEJWu1YO.js → page-B8WlhDq6.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BitfWsiW.js → page-BIhP9udn.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DE03uZZR.js → page-BLS9bXB8.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DFCK65G9.js → page-BYXn4SXu.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-bimkItOg.js → page-Bfvwt3AB.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D5F3DJjm.js → page-BipKr1Pt.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BwG4f5qc.js +1 -0
- zenml/zen_server/dashboard/assets/page-C1c_unjg.js +9 -0
- zenml/zen_server/dashboard/assets/{page-DQdwZZ9x.js → page-C25tiRdj.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CIATsAA7.js +1 -0
- zenml/zen_server/dashboard/assets/{page-iwoJnwPv.js → page-CKUVhcYr.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BiF8hLbO.js → page-CXLwze-m.js} +1 -1
- zenml/zen_server/dashboard/assets/page-D7TD0k_A.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CDOQLrPC.js → page-DIlOQjGU.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DGMa3ZQL.js → page-DJ31Huvj.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-J0s8Sq3N.js → page-DOqsdVzG.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DQGCHKrQ.js → page-DUapawuM.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-WCQ659by.js → page-Dd3jZyrf.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CrSdkteO.js → page-DyZzYHWA.js} +2 -2
- zenml/zen_server/dashboard/assets/page-L_xNBh_5.js +3 -0
- zenml/zen_server/dashboard/assets/{page-oS4hqS8M.js → page-VsrKiIdF.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DgM-N9RL.js → page-ioO58ULo.js} +1 -1
- zenml/zen_server/dashboard/assets/page-kalpiPZz.js +6 -0
- zenml/zen_server/dashboard/assets/{persist-xsYgVtR1.js → persist-ChKZVcn3.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-mEZN_fgH.js → persist-DodaLO0k.js} +1 -1
- zenml/zen_server/dashboard/assets/{sharedSchema-BfZcy7aP.js → sharedSchema-BvRWAv-c.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-CU4egfhp.js → stack-detail-query-C9XwNP1E.js} +1 -1
- zenml/zen_server/dashboard/assets/tick-circle-m-hJG8i9.js +1 -0
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-DNqmQXDM.js → update-server-settings-mutation-DJDefwqW.js} +1 -1
- zenml/zen_server/dashboard/assets/{url-DwbuKk1b.js → url-DdWrpIhi.js} +1 -1
- zenml/zen_server/dashboard/index.html +4 -4
- zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
- zenml/zen_server/dashboard_legacy/index.html +1 -1
- zenml/zen_server/dashboard_legacy/{precache-manifest.290b95d5b43efa3368b3dc63d20c4782.js → precache-manifest.4f9db97de1b48fd5944e8a766c1300fe.js} +4 -4
- zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
- zenml/zen_server/dashboard_legacy/static/js/{main.840d1bf0.chunk.js → main.0fdd4aad.chunk.js} +2 -2
- zenml/zen_server/dashboard_legacy/static/js/{main.840d1bf0.chunk.js.map → main.0fdd4aad.chunk.js.map} +1 -1
- {zenml_nightly-0.66.0.dev20240925.dist-info → zenml_nightly-0.66.0.dev20240926.dist-info}/METADATA +1 -1
- {zenml_nightly-0.66.0.dev20240925.dist-info → zenml_nightly-0.66.0.dev20240926.dist-info}/RECORD +92 -85
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-BXeSvmMY.js +0 -1
- zenml/zen_server/dashboard/assets/EditSecretDialog-Du423_3U.js +0 -1
- zenml/zen_server/dashboard/assets/Infobox-BL9NOS37.js +0 -1
- zenml/zen_server/dashboard/assets/UsageReason-CCnzmwS8.js +0 -1
- zenml/zen_server/dashboard/assets/index-6DYjZgDn.css +0 -1
- zenml/zen_server/dashboard/assets/page-BFuJICXM.js +0 -9
- zenml/zen_server/dashboard/assets/page-CLiRGfWo.js +0 -1
- zenml/zen_server/dashboard/assets/page-CV44mQn9.js +0 -1
- zenml/zen_server/dashboard/assets/page-DI-qTWrm.js +0 -1
- zenml/zen_server/dashboard/assets/page-Dt8VgzbE.js +0 -1
- zenml/zen_server/dashboard/assets/page-oSqx9dkH.js +0 -1
- zenml/zen_server/dashboard/assets/page-p3GqEAUW.js +0 -1
- zenml/zen_server/dashboard/assets/page-qvcUVPE-.js +0 -1
- {zenml_nightly-0.66.0.dev20240925.dist-info → zenml_nightly-0.66.0.dev20240926.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.66.0.dev20240925.dist-info → zenml_nightly-0.66.0.dev20240926.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.66.0.dev20240925.dist-info → zenml_nightly-0.66.0.dev20240926.dist-info}/entry_points.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{r as _,j as t}from"./@radix-DnFH_oo1.js";import{u as k,g as Je,S as Xe,C as oe,P as ie,W as et,L as tt}from"./ProviderRadio-BsYBw9YA.js";import{W as O,H as T,B as D,S as E}from"./WizardFooter-BHbO7zOa.js";import{t as B}from"./zod-uFd1wBcd.js";import{z as h,l as je,m as ge,k as _e,n as Ee,F as ve,S as Y,I as W,f as w,au as rt,av as st,aw as nt,ax as ot,aK as it,ay as at,ak as ct,ae as lt,ag as ut,ai as dt,d as ft,Z as mt,i as Me,j as ht,r as xt,A as pt,b as yt,a6 as jt}from"./index-B9wVwe7u.js";import{b as y,C as b,u as $,F as V,a as gt}from"./index.esm-BE1uqCX5.js";import{C as Se,a as _t,S as vt,s as Re}from"./sharedSchema-BfZcy7aP.js";import{R as K,a as H,u as St}from"./create-stack-B2x2d4r1.js";import{q as Le,a as J,b as bt,j as qe,c as Ct}from"./@tanstack-QbMbTrh5.js";import{o as wt,s as Nt}from"./url-DwbuKk1b.js";import{C as M}from"./ProviderIcon-BOQJgapd.js";import{S as Ft}from"./Lock-CmIn0szs.js";import{S as Pt}from"./plus-Bc8eLSDM.js";import{S as kt}from"./trash-DUWZWzse.js";import{S as At}from"./dots-horizontal-C6K59vUm.js";import{T as be}from"./Tick-i1DYsVcX.js";import{C as zt}from"./persist-mEZN_fgH.js";import{e as It}from"./components-Br2ezRib.js";import{L as Ot}from"./@react-router-APVeuk-U.js";import"./@reactflow-B6kq9fJZ.js";import"./stack-detail-query-CU4egfhp.js";import"./layout-Dru15_XR.js";import"./rocket-SESCGQXm.js";import"./gcp-Dj6ntk0L.js";const Be=_.createContext(null);function Tt({children:e}){const[r,s]=_.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Be.Provider,{value:{data:r,setData:s},children:e})}function C(){const e=_.useContext(Be);if(e===null)throw new Error("useExistingInfraContext must be used within an ExistingInfraProvider");return e}const We=_.createContext(null);function Pe({children:e,initialSchema:r}){const[s,n]=_.useState(r);return t.jsx(We.Provider,{value:{schema:s,setSchema:n},children:e})}function X(){const e=_.useContext(We);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Dt=h.object({resourceId:h.string().min(1),flavor:h.string()});function Et(){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(Se,{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 $e=Symbol.for("immer-nothing"),ke=Symbol.for("immer-draftable"),j=Symbol.for("immer-state");function v(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var A=Object.getPrototypeOf;function z(e){return!!e&&!!e[j]}function F(e){var r;return e?Ve(e)||Array.isArray(e)||!!e[ke]||!!((r=e.constructor)!=null&&r[ke])||te(e)||re(e):!1}var Mt=Object.prototype.constructor.toString();function Ve(e){if(!e||typeof e!="object")return!1;const r=A(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)===Mt}function U(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[j];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 Ze(e,r,s){const n=ee(e);n===2?e.set(r,s):n===3?e.add(s):e[r]=s}function Rt(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 N(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=Ve(e);if(r===!0||r==="class_only"&&!s){const n=Object.getOwnPropertyDescriptors(e);delete n[j];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const i=o[a],u=n[i];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[i]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[i]})}return Object.create(A(e),n)}else{const n=A(e);if(n!==null&&s)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function Ce(e,r=!1){return se(e)||z(e)||!F(e)||(ee(e)>1&&(e.set=e.add=e.clear=e.delete=Lt),Object.freeze(e),r&&Object.entries(e).forEach(([s,n])=>Ce(n,!0))),e}function Lt(){v(2)}function se(e){return Object.isFrozen(e)}var qt={};function P(e){const r=qt[e];return r||v(0,e),r}var R;function Ke(){return R}function Bt(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ae(e,r){r&&(P("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function me(e){he(e),e.drafts_.forEach(Wt),e.drafts_=null}function he(e){e===R&&(R=e.parent_)}function ze(e){return R=Bt(R,e)}function Wt(e){const r=e[j];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Ie(e,r){r.unfinalizedDrafts_=r.drafts_.length;const s=r.drafts_[0];return e!==void 0&&e!==s?(s[j].modified_&&(me(r),v(4)),F(e)&&(e=Q(r,e),r.parent_||G(r,e)),r.patches_&&P("Patches").generateReplacementPatches_(s[j].base_,e,r.patches_,r.inversePatches_)):e=Q(r,s,[]),me(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==$e?e:void 0}function Q(e,r,s){if(se(r))return r;const n=r[j];if(!n)return U(r,(o,a)=>Oe(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,i=!1;n.type_===3&&(a=new Set(o),o.clear(),i=!0),U(a,(u,f)=>Oe(e,n,o,u,f,s,i)),G(e,o,!1),s&&e.patches_&&P("Patches").generatePatches_(n,s,e.patches_,e.inversePatches_)}return n.copy_}function Oe(e,r,s,n,o,a,i){if(z(o)){const u=a&&r&&r.type_!==3&&!de(r.assigned_,n)?a.concat(n):void 0,f=Q(e,o,u);if(Ze(s,n,f),z(f))e.canAutoFreeze_=!1;else return}else i&&s.add(o);if(F(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_&&Ce(r,s)}function $t(e,r){const s=Array.isArray(e),n={type_:s?1:0,scope_:r?r.scope_:Ke(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=we;s&&(o=[n],a=L);const{revoke:i,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=i,u}var we={get(e,r){if(r===j)return e;const s=N(e);if(!de(s,r))return Vt(e,s,r);const n=s[r];return e.finalized_||!F(n)?n:n===ae(e.base_,r)?(ce(e),e.copy_[r]=pe(n,e)):n},has(e,r){return r in N(e)},ownKeys(e){return Reflect.ownKeys(N(e))},set(e,r,s){const n=He(N(e),r);if(n!=null&&n.set)return n.set.call(e.draft_,s),!0;if(!e.modified_){const o=ae(N(e),r),a=o==null?void 0:o[j];if(a&&a.base_===s)return e.copy_[r]=s,e.assigned_[r]=!1,!0;if(Rt(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=N(e),n=Reflect.getOwnPropertyDescriptor(s,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:s[r]}},defineProperty(){v(11)},getPrototypeOf(e){return A(e.base_)},setPrototypeOf(){v(12)}},L={};U(we,(e,r)=>{L[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});L.deleteProperty=function(e,r){return L.set.call(this,e,r,void 0)};L.set=function(e,r,s){return we.set.call(this,e[0],r,s,e[0])};function ae(e,r){const s=e[j];return(s?N(s):e)[r]}function Vt(e,r,s){var o;const n=He(r,s);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function He(e,r){if(!(r in e))return;let s=A(e);for(;s;){const n=Object.getOwnPropertyDescriptor(s,r);if(n)return n;s=A(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 Zt=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 i=this;return function(f=a,...d){return i.produce(f,c=>s.call(this,c,...d))}}typeof s!="function"&&v(6),n!==void 0&&typeof n!="function"&&v(7);let o;if(F(r)){const a=ze(this),i=pe(r,void 0);let u=!0;try{o=s(i),u=!1}finally{u?me(a):he(a)}return Ae(a,n),Ie(o,a)}else if(!r||typeof r!="object"){if(o=s(r),o===void 0&&(o=r),o===$e&&(o=void 0),this.autoFreeze_&&Ce(o,!0),n){const a=[],i=[];P("Patches").generateReplacementPatches_(r,o,a,i),n(a,i)}return o}else v(1,r)},this.produceWithPatches=(r,s)=>{if(typeof r=="function")return(i,...u)=>this.produceWithPatches(i,f=>r(f,...u));let n,o;return[this.produce(r,s,(i,u)=>{n=i,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){F(e)||v(8),z(e)&&(e=Kt(e));const r=ze(this),s=pe(e,void 0);return s[j].isManual_=!0,he(r),s}finishDraft(e,r){const s=e&&e[j];(!s||!s.isManual_)&&v(9);const{scope_:n}=s;return Ae(n,r),Ie(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 z(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):$t(e,r);return(r?r.scope_:Ke()).drafts_.push(s),s}function Kt(e){return z(e)||v(10,e),Ue(e)}function Ue(e){if(!F(e)||se(e))return e;const r=e[j];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 U(s,(n,o)=>{Ze(s,n,Ue(o))}),r&&(r.finalized_=!1),s}var g=new Zt,I=g.produce;g.produceWithPatches.bind(g);g.setAutoFreeze.bind(g);g.setUseStrictShallowCopy.bind(g);g.applyPatches.bind(g);g.createDraft.bind(g);g.finishDraft.bind(g);function Ht(){const{data:e,setData:r}=C(),{setCurrentStep:s}=k();if(!e.fullstackResources)return s(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const n=e.fullstackResources.components_resources_info.artifact_store,o=n.flatMap(i=>i.accessible_by_service_connector.map(u=>({...i,value:u})));function a({flavor:i,resourceId:u}){const f=n.find(d=>d.flavor===i);f&&(r(d=>I(d,c=>{c.artifactStoreConfig={flavor:i,configuration:Object.fromEntries(Object.keys(f.required_configuration||{}).map(m=>[m,u])),service_connector_resource_id:u}})),s(d=>d+1))}return{handleFormSubmit:a,flattenedInstances:o}}async function Ut(e){const r=je(ge.flavors.all)+(e?`?${wt(e)}`:""),s=await _e(r,{method:"GET",headers:{"Content-Type":"application/json"}});if(s.status===404&&Ee(),!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching flavors");throw new ve({status:s.status,statusText:s.statusText,message:n})}return s.json()}const Qe={all:["flavors"],flavorList:e=>Le({queryKey:[...Qe.all,e],queryFn:async()=>Ut(e)})};function q({flavor:e,type:r,width:s=32,height:n=32,...o}){var i;const a=J({...Qe.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:Nt(((i=a.data.items[0].body)==null?void 0:i.logo_url)??"")})}const Qt="artifact_store";function Gt(){const[e,r]=_.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:i,trigger:u,reset:f}=y(),{flattenedInstances:d,handleFormSubmit:c}=Ht(),m=d.filter(l=>l.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(W,{placeholder:"Search...",onChange:l=>{f(),r(l.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:m.map(l=>t.jsx("li",{children:t.jsx(b,{name:"resourceId",control:s,render:({field:{onChange:x,...p}})=>t.jsxs(K,{"data-state":i("resourceId")===l.value?"selected":"unselected",htmlFor:l.value,children:[t.jsx(H,{id:l.value,type:"radio",...p,onChange:S=>{n("flavor",l.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),x(S.target.value),u()},value:l.value,name:"connector-radio"}),t.jsx(q,{type:Qt,width:24,height:24,flavor:l.flavor})," ",t.jsx("span",{children:l.value})]})})},l.value))})]})]})}function Yt(){const e=$({resolver:B(Dt),shouldUnregister:!0});return t.jsx(V,{...e,children:t.jsxs(O,{children:[t.jsx(T,{children:"Artifact Store"}),t.jsx(D,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Et,{}),t.jsx(Gt,{})]})}),t.jsx(E,{children:t.jsx(Jt,{})})]})})}function Jt(){const e=y();return t.jsx(w,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}function Xt(e,r){const s=Object.keys(e).reduce((n,o)=>{var d,c;const a=e[o];let i;const u=Ge(o,r);switch(a.type||((c=(d=a.anyOf)==null?void 0:d.find(m=>m.type!==null))==null?void 0:c.type)){case"string":i=h.string().trim();break;case"boolean":i=h.boolean();break;case"array":i=h.array(h.string());break;default:i=h.string();break}return u&&(i=i.optional()),!u&&a.type==="string"&&i instanceof h.ZodString&&(i=i.min(1,"Required")),n[o]=i,n},{});return h.object(s)}function Ge(e,r){return!r.includes(e)}async function er(e){const r=je(ge.serviceConnectors.types.detail(e)),s=await _e(r,{method:"GET",headers:{"Content-Type":"application/json"}});if(s.status===404&&Ee(),!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 ve({status:s.status,statusText:s.statusText,message:n})}return s.json()}const Ne={connectorTypes:["service_connector_types"],serviceConnectorTypeDetail:e=>Le({queryKey:[...Ne.connectorTypes,e],queryFn:async()=>er(e)})},Ye=h.object({authMethod:h.string().min(1),stackName:_t});function tr(){var c,m;const{data:e}=C(),{setCurrentStep:r}=k(),{control:s,watch:n,resetField:o}=y(),{setSchema:a}=X(),i=J({...Ne.serviceConnectorTypeDetail(((c=e.connectorConfig)==null?void 0:c.type)||"")});if(i.isError)return null;if(i.isPending)return t.jsx(Y,{className:"h-[40px] w-[100px]"});const u=i.data.auth_methods.filter(l=>l.auth_method!=="implicit").map(l=>({name:l.name,auth_method:l.auth_method}));if(!((m=e.connectorConfig)!=null&&m.type)){r(1);return}function f(){var Fe;const l=n("authMethod"),x=(Fe=i.data)==null?void 0:Fe.auth_methods.find(ne=>ne.auth_method===l);if(!x)return;const p=Xt(x.config_schema.properties,x.config_schema.required);a(Ye.merge(p)),Object.keys(p.shape).forEach(ne=>o(ne))}const d=e.connectorConfig.type||"";return t.jsx(b,{control:s,name:"authMethod",render:({field:{onChange:l,ref:x,...p}})=>t.jsxs(rt,{...p,onValueChange:S=>{l(S),f()},children:[t.jsx(st,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(nt,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(ot,{children:t.jsx(it,{viewportClassName:"max-h-[300px]",children:u.map(S=>t.jsx(at,{className:"space-x-2",value:S.auth_method,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(M,{provider:d}),t.jsx("div",{children:S.name})]})},S.auth_method))})})]})})}function rr(){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(vt,{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(tr,{})]})}function sr({schema:e,name:r,isOptional:s}){var o,a;const n=e.type||((a=(o=e.anyOf)==null?void 0:o.find(i=>i.type!==null))==null?void 0:a.type);if(!n)return null;switch(n){case"string":return t.jsx(nr,{isOptional:s,schema:e,name:r});case"array":return t.jsx(or,{isOptional:s,schema:e,name:r});case"boolean":return t.jsx(ir,{isOptional:s,schema:e,name:r});default:return null}}function nr({name:e,schema:r,isOptional:s}){const n=y(),o=r.format==="password";return t.jsxs("div",{children:[t.jsxs("label",{htmlFor:e,className:"text-text-sm",children:[r.title," ",s?"(optional)":""]}),t.jsx(b,{defaultValue:"",control:n.control,name:e,render:({field:a})=>t.jsx(W,{inputSize:"md",className:"w-full",id:e,...a,type:o?"password":"text"})})]})}function or({name:e,schema:r,isOptional:s}){const{control:n}=y(),{fields:o,append:a,remove:i}=gt({name:e,control:n});return t.jsxs("div",{className:"space-y-3",children:[t.jsxs("label",{className:"text-text-sm",children:[r.title," ",s?"(optional)":""]}),t.jsx("ul",{className:"space-y-5",children:o.map((u,f)=>t.jsxs("li",{className:"flex w-full items-center gap-4 [&>div]:w-full",children:[t.jsx(b,{defaultValue:"",name:`${e}.${f}`,render:({field:d})=>t.jsx(W,{className:"w-full flex-1",inputSize:"md",...d})}),t.jsxs(w,{className:"h-7 w-7",emphasis:"subtle",size:"sm",type:"button",onClick:()=>i(f),children:[t.jsx(kt,{className:"h-5 w-5 fill-primary-900"}),t.jsx("span",{className:"sr-only",children:"remove"})]})]},u.id))}),t.jsxs(w,{className:"h-7 w-7",emphasis:"subtle",type:"button",onClick:()=>a(""),children:[t.jsx(Pt,{className:"h-5 w-5 fill-primary-900"}),t.jsx("p",{className:"sr-only",children:"Add Item"})]})]})}function ir({name:e,schema:r,isOptional:s}){const n=y(),o=r.default||!1;return t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("label",{htmlFor:e,className:"text-text-sm",children:[r.title," ",s?"(optional)":""]}),t.jsx(b,{defaultValue:o,control:n.control,name:e,render:({field:{onChange:a,value:i,...u}})=>t.jsx(ct,{id:e,checked:i,onCheckedChange:f=>a(f),...u})})]})}function ar(){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(Ft,{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(cr,{})]})}function cr(){var f,d;const{data:e}=C(),{watch:r}=y(),s=J({...Ne.serviceConnectorTypeDetail(((f=e.connectorConfig)==null?void 0:f.type)||"")}),n=r("authMethod"),o=(d=s.data)==null?void 0:d.auth_methods.find(c=>c.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.properties,i=o.config_schema.required,u=Object.entries(a).sort(([c],[m])=>i.includes(c)&&!i.includes(m)?-1:!i.includes(c)&&i.includes(m)?1:0);return t.jsx("div",{className:"space-y-5",children:u.map(([c,m])=>t.jsx(sr,{isOptional:Ge(c,i),name:c,schema:m},c))})}function lr({open:e,loadingComponents:r}){var n,o;const{data:s}=C();return(n=s.connectorConfig)!=null&&n.type?t.jsx(lt,{open:e,children:t.jsxs(ut,{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(dt,{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(ft,{className:"h-[60px] w-[60px]"}),t.jsx("div",{className:"flex h-[60px] w-[60px] items-center justify-center",children:t.jsx(At,{className:"h-5 w-5 fill-theme-text-tertiary"})}),t.jsx(M,{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 ",Je(((o=s.connectorConfig)==null?void 0:o.type)||"aws")," ","and retrieving your custom components. This process typically takes about 30-60 seconds."]}),t.jsx(ur,{loadingComponents:r})]})]})}):null}function ur({loadingComponents:e}){const[r,s]=_.useState(!0),[n,o]=_.useState(!0);return _.useEffect(()=>{const a=setTimeout(()=>{s(!1)},Math.floor(Math.random()*1e3)+500),i=setTimeout(()=>{o(!1)},1500);return()=>{clearTimeout(a),clearTimeout(i)}},[]),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(mt,{className:"h-5 w-5 border-2"}):t.jsx(be,{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 dr({payload:e}){const r=je(ge.serviceConnectors.fullStackResources),s=await _e(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 ve({status:s.status,statusText:s.statusText,message:n})}return s.json()}function fr(e){return bt({...e,mutationFn:async({payload:r})=>dr({payload:r})})}function mr(e){return new Promise(r=>setTimeout(r,e))}function hr(){const{setCurrentStep:e}=k(),[r,s]=_.useState(!0),{toast:n}=Me(),{setData:o,data:a}=C(),i=fr({onSuccess:async f=>{o(d=>I(d,c=>{c.fullstackResources=f})),s(!1),await mr(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(l=>{(c[l]===""||c[l]===null||c[l]===void 0||Array.isArray(c[l])&&c[l].length===0)&&delete c[l]});const m=I(a,l=>{l.stackName=d,l.connectorConfig&&(l.connectorConfig.auth_method=f,l.connectorConfig.configuration={...c})});o(m),m.connectorConfig&&i.mutate({payload:m.connectorConfig})},fullStackResources:i,loadingComponents:r}}function xr(){const{handleSubmit:e,formState:{isSubmitting:r}}=y(),{handleFormSubmit:s,fullStackResources:n,loadingComponents:o}=hr();return t.jsxs("form",{onSubmit:e(s),id:"connect-form",children:[t.jsx(lr,{loadingComponents:o,open:r||n.isPending}),t.jsx(rr,{}),t.jsx(Xe,{}),t.jsx(ar,{})]})}function pr(){const{schema:e}=X(),r=$({shouldUnregister:!0,mode:"onChange",resolver:B(e)});return t.jsx(V,{...r,children:t.jsxs(O,{children:[t.jsx(T,{children:"Connect to your Cloud"}),t.jsx(D,{children:t.jsx(xr,{})}),t.jsx(E,{children:t.jsx(yr,{})})]})})}function yr(){const{formState:{isValid:e,isSubmitting:r}}=y(),s=!!qe();return t.jsx(w,{className:"justify-center gap-2",disabled:!e||s||r,form:"connect-form",size:"md",children:s||r?"Loading...":"Next"})}function jr(){const{data:e,setData:r}=C(),s=Ct(),{toast:n}=Me(),{setCurrentStep:o}=k(),{mutate:a}=St({onError:d=>{d instanceof Error&&n({status:"error",emphasis:"subtle",icon:t.jsx(ht,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess:async d=>{r(c=>I(c,m=>{m.createdStackId=d.id})),o(c=>c+1),s.invalidateQueries({queryKey:Re.all})}});if(!e.fullstackResources)return o(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const i=e.fullstackResources.components_resources_info.container_registry,u=i.flatMap(d=>d.accessible_by_service_connector.map(c=>({...d,value:c})));function f({flavor:d,resourceId:c}){const m=i.find(x=>x.flavor===d);if(!m)return;const l=I(e,x=>{x.registryConfig={flavor:d,configuration:Object.fromEntries(Object.keys(m.required_configuration||{}).map(p=>[p,c])),service_connector_resource_id:c}});r(l),a({workspaceId:"default",payload:{name:l.stackName||Math.random().toString(36).substring(7),service_connectors:l.connectorConfig?[l.connectorConfig]:[],components:{orchestrator:[{...l.orchestratorConfig,service_connector_index:0}],artifact_store:[{...l.artifactStoreConfig,service_connector_index:0}],container_registry:[{...l.registryConfig,service_connector_index:0}]}}})}return{handleFormSubmit:f,flattenedInstances:u}}const gr="container_registry";function _r(){const[e,r]=_.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:i,trigger:u,reset:f}=y(),{flattenedInstances:d,handleFormSubmit:c}=jr(),m=d.filter(l=>l.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(W,{placeholder:"Search...",onChange:l=>{f(),r(l.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:m.map(l=>t.jsx("li",{children:t.jsx(b,{name:"resourceId",control:s,render:({field:{onChange:x,...p}})=>t.jsxs(K,{"data-state":i("resourceId")===l.value?"selected":"unselected",htmlFor:l.value,children:[t.jsx(H,{id:l.value,type:"radio",...p,onChange:S=>{n("flavor",l.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),x(S.target.value),u()},value:l.value,name:"connector-radio"}),t.jsx(q,{width:24,height:24,type:gr,flavor:l.flavor})," ",t.jsx("span",{children:l.value})]})})},l.value))})]})]})}function vr(){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(Se,{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 Sr=h.object({flavor:h.string().min(1),resourceId:h.string().min(1)});function br(){const e=$({resolver:B(Sr),shouldUnregister:!0});return t.jsx(V,{...e,children:t.jsxs(O,{children:[t.jsx(T,{children:"Container Registry"}),t.jsx(D,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(vr,{}),t.jsx(_r,{})]})}),t.jsx(E,{children:t.jsx(Cr,{})})]})})}function Cr(){const e=y(),r=!!qe();return t.jsxs(w,{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 wr(){var a;const{data:e,setData:r}=C(),{setCurrentStep:s}=k();if(!e.fullstackResources)return s(2),{orchestrators:[],handleFormSubmit:()=>{}};const n=((a=e.fullstackResources.components_resources_info)==null?void 0:a.orchestrator)||[];function o({flavor:i,resourceId:u,...f}){const d=n.find(c=>c.flavor===i);d&&(r(c=>{const m=d!=null&&d.use_resource_value_as_fixed_config?Object.fromEntries(Object.keys(d.required_configuration||{}).map(l=>[l,u])):{...f};return I(c,l=>{l.orchestratorConfig={flavor:i,configuration:m,service_connector_resource_id:u}})}),s(c=>c+1))}return{orchestrators:n,handleFormSubmit:o}}const ye=h.object({flavor:h.string().min(1),resourceId:h.string().min(1)});function Nr(e){const r=Object.keys(e).reduce((s,n)=>(s[n]=h.string().trim().min(1),s),{});return h.object(r)}const Z="kubernetes",Te="orchestrator";function Fr(){const{orchestrators:e,handleFormSubmit:r}=wr(),{setSchema:s}=X(),{control:n,watch:o,setValue:a,register:i,reset:u,handleSubmit:f}=y(),d=o("flavor");return t.jsxs("form",{onSubmit:f(r),id:"artifact-store-form",children:[d!==Z&&t.jsx("input",{...i("resourceId"),type:"hidden"}),t.jsx("ul",{className:"space-y-1",children:e.map((c,m)=>t.jsxs("li",{children:[t.jsx(b,{control:n,name:"flavor",render:({field:{onChange:l,...x}})=>t.jsxs(K,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(H,{onChange:p=>{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(Nr(c.required_configuration))),c.flavor!==Z&&c.accessible_by_service_connector.length>0&&a("resourceId",c.accessible_by_service_connector[0]),l(p)},...x,id:c.flavor,type:"radio",value:c.flavor,name:"orchestrator-flavor-radio"}),t.jsx(q,{width:24,height:24,type:Te,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===Z||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===Z&&t.jsx("ul",{className:"space-y-1",children:c.accessible_by_service_connector.map(l=>t.jsx("li",{children:t.jsx(b,{control:n,name:"resourceId",render:({field:x})=>t.jsxs(K,{"data-state":o("resourceId")===l?"selected":"unselected",htmlFor:l,children:[t.jsx(H,{...x,id:l,type:"radio",value:l,name:"instance-radio"}),t.jsx(q,{type:Te,width:24,height:24,flavor:c.flavor}),t.jsx("span",{children:l})]})})},l))}),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(([l,x])=>t.jsx("div",{children:t.jsx(b,{name:l,control:n,render:({field:p})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:l,className:"text-text-sm",children:x}),t.jsx(W,{...p,inputSize:"md",required:!0,className:"w-full",id:l})]})})},l))})]})]},m))})]})}function Pr(){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(Se,{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 kr(){const{schema:e}=X(),r=$({resolver:B(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx(V,{...r,children:t.jsxs(O,{children:[t.jsx(T,{children:"Orchestrator"}),t.jsxs(D,{children:[t.jsx(Pr,{}),t.jsx(Fr,{})]}),t.jsx(E,{children:t.jsx(Ar,{})})]})})}function Ar(){const e=y();return t.jsx(w,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const zr=h.object({provider:h.string().min(1)});function Ir(){var a;const{setData:e,data:r}=C(),{setCurrentStep:s}=k(),n=$({resolver:B(zr),defaultValues:{provider:((a=r.connectorConfig)==null?void 0:a.type)||""}});function o(i){e(u=>({...u,connectorConfig:{type:i.provider,auth_method:""}})),s(u=>u+1)}return t.jsx(V,{...n,children:t.jsxs(O,{children:[t.jsx(T,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(D,{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(M,{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(M,{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(M,{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(E,{children:t.jsx(Or,{})})]})})}function Or(){const{formState:{isValid:e}}=y();return t.jsx(w,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function Tr(){var o;const{data:e}=C(),r=J({...Re.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(O,{children:[t.jsx(T,{children:"Your stack"}),t.jsx(D,{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(Er,{stack:s}),n.map(a=>t.jsx(Mr,{component:a},a.id))]})]})}),t.jsx(E,{displayCancel:!1,children:t.jsx(Dr,{})})]})}function Dr(){return t.jsx(w,{size:"md",asChild:!0,children:t.jsx(Ot,{to:xt.stacks.overview,children:"Finish"})})}function Er({stack:e}){return t.jsxs("div",{className:"flex items-center gap-3 bg-theme-surface-secondary p-5 font-semibold",children:[t.jsx(be,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(pt,{type:"square",size:"lg",children:t.jsx(yt,{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 Mr({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(be,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(q,{width:24,height:24,flavor:((r=e.body)==null?void 0:r.flavor)||"",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(zt,{type:((n=e.body)==null?void 0:n.type)||"alerter",children:jt((o=e.body)==null?void 0:o.type)})]},e.id)}function Rr(){const{currentStep:e}=k();if(e===1)return t.jsx(Ir,{});if(e===2)return t.jsx(Pe,{initialSchema:Ye,children:t.jsx(pr,{})});if(e===3)return t.jsx(Yt,{});if(e===4)return t.jsx(Pe,{initialSchema:ye,children:t.jsx(kr,{})});if(e===5)return t.jsx(br,{});if(e===6)return t.jsx(Tr,{})}const De=["Infrastructure Type","Cloud Provider","Connect your Cloud","Artifact Store","Orchestrator","Container Registry"];function ls(){return t.jsx(et,{maxSteps:De.length+1,initialStep:1,children:t.jsx(Tt,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(tt,{entries:De}),t.jsx("div",{className:"w-full",children:t.jsx(Rr,{})})]})})})}export{ls as default};
|
1
|
+
import{r as _,j as t}from"./@radix-DnFH_oo1.js";import{u as k,g as Je,S as Xe,C as oe,P as ie,W as et,L as tt}from"./ProviderRadio-GYc9PJtG.js";import{W as O,H as T,B as D,S as E}from"./WizardFooter-CgvFSppz.js";import{t as B}from"./zod-uFd1wBcd.js";import{z as h,l as je,m as ge,k as _e,n as Ee,F as ve,S as Y,I as W,f as w,aw as rt,ax as st,ay as nt,az as ot,aL as it,aA as at,am as ct,ag as lt,ai as ut,ak as dt,d as ft,U as mt,i as Me,j as ht,r as xt,A as pt,b as yt,a1 as jt}from"./index-D0bJjaey.js";import{b as y,C as b,u as $,F as V,a as gt}from"./index.esm-BE1uqCX5.js";import{C as Se,a as _t,S as vt,s as Re}from"./sharedSchema-BvRWAv-c.js";import{R as H,a as K,u as St}from"./create-stack-BfgeXFuV.js";import{q as Le,a as J,b as bt,j as qe,c as Ct}from"./@tanstack-QbMbTrh5.js";import{o as wt,s as Nt}from"./url-DdWrpIhi.js";import{C as M}from"./ProviderIcon-C9BuYVSN.js";import{S as Ft}from"./Lock-CmIn0szs.js";import{S as Pt}from"./plus-Bc8eLSDM.js";import{S as kt}from"./trash-DUWZWzse.js";import{S as At}from"./dots-horizontal-C6K59vUm.js";import{T as be}from"./Tick-C5ZVvNRQ.js";import{C as zt}from"./persist-DodaLO0k.js";import{e as It}from"./components-Br2ezRib.js";import{L as Ot}from"./@react-router-APVeuk-U.js";import"./@reactflow-CEC2f0cl.js";import"./stack-detail-query-C9XwNP1E.js";import"./layout-Dru15_XR.js";import"./rocket-SESCGQXm.js";import"./gcp-Dj6ntk0L.js";const Be=_.createContext(null);function Tt({children:e}){const[r,s]=_.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Be.Provider,{value:{data:r,setData:s},children:e})}function C(){const e=_.useContext(Be);if(e===null)throw new Error("useExistingInfraContext must be used within an ExistingInfraProvider");return e}const We=_.createContext(null);function Pe({children:e,initialSchema:r}){const[s,n]=_.useState(r);return t.jsx(We.Provider,{value:{schema:s,setSchema:n},children:e})}function X(){const e=_.useContext(We);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Dt=h.object({resourceId:h.string().min(1),flavor:h.string()});function Et(){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(Se,{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 $e=Symbol.for("immer-nothing"),ke=Symbol.for("immer-draftable"),j=Symbol.for("immer-state");function v(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var A=Object.getPrototypeOf;function z(e){return!!e&&!!e[j]}function F(e){var r;return e?Ve(e)||Array.isArray(e)||!!e[ke]||!!((r=e.constructor)!=null&&r[ke])||te(e)||re(e):!1}var Mt=Object.prototype.constructor.toString();function Ve(e){if(!e||typeof e!="object")return!1;const r=A(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)===Mt}function U(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[j];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 Ze(e,r,s){const n=ee(e);n===2?e.set(r,s):n===3?e.add(s):e[r]=s}function Rt(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 N(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=Ve(e);if(r===!0||r==="class_only"&&!s){const n=Object.getOwnPropertyDescriptors(e);delete n[j];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const i=o[a],u=n[i];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[i]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[i]})}return Object.create(A(e),n)}else{const n=A(e);if(n!==null&&s)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function Ce(e,r=!1){return se(e)||z(e)||!F(e)||(ee(e)>1&&(e.set=e.add=e.clear=e.delete=Lt),Object.freeze(e),r&&Object.entries(e).forEach(([s,n])=>Ce(n,!0))),e}function Lt(){v(2)}function se(e){return Object.isFrozen(e)}var qt={};function P(e){const r=qt[e];return r||v(0,e),r}var R;function He(){return R}function Bt(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ae(e,r){r&&(P("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function me(e){he(e),e.drafts_.forEach(Wt),e.drafts_=null}function he(e){e===R&&(R=e.parent_)}function ze(e){return R=Bt(R,e)}function Wt(e){const r=e[j];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Ie(e,r){r.unfinalizedDrafts_=r.drafts_.length;const s=r.drafts_[0];return e!==void 0&&e!==s?(s[j].modified_&&(me(r),v(4)),F(e)&&(e=Q(r,e),r.parent_||G(r,e)),r.patches_&&P("Patches").generateReplacementPatches_(s[j].base_,e,r.patches_,r.inversePatches_)):e=Q(r,s,[]),me(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==$e?e:void 0}function Q(e,r,s){if(se(r))return r;const n=r[j];if(!n)return U(r,(o,a)=>Oe(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,i=!1;n.type_===3&&(a=new Set(o),o.clear(),i=!0),U(a,(u,f)=>Oe(e,n,o,u,f,s,i)),G(e,o,!1),s&&e.patches_&&P("Patches").generatePatches_(n,s,e.patches_,e.inversePatches_)}return n.copy_}function Oe(e,r,s,n,o,a,i){if(z(o)){const u=a&&r&&r.type_!==3&&!de(r.assigned_,n)?a.concat(n):void 0,f=Q(e,o,u);if(Ze(s,n,f),z(f))e.canAutoFreeze_=!1;else return}else i&&s.add(o);if(F(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_&&Ce(r,s)}function $t(e,r){const s=Array.isArray(e),n={type_:s?1:0,scope_:r?r.scope_:He(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=we;s&&(o=[n],a=L);const{revoke:i,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=i,u}var we={get(e,r){if(r===j)return e;const s=N(e);if(!de(s,r))return Vt(e,s,r);const n=s[r];return e.finalized_||!F(n)?n:n===ae(e.base_,r)?(ce(e),e.copy_[r]=pe(n,e)):n},has(e,r){return r in N(e)},ownKeys(e){return Reflect.ownKeys(N(e))},set(e,r,s){const n=Ke(N(e),r);if(n!=null&&n.set)return n.set.call(e.draft_,s),!0;if(!e.modified_){const o=ae(N(e),r),a=o==null?void 0:o[j];if(a&&a.base_===s)return e.copy_[r]=s,e.assigned_[r]=!1,!0;if(Rt(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=N(e),n=Reflect.getOwnPropertyDescriptor(s,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:s[r]}},defineProperty(){v(11)},getPrototypeOf(e){return A(e.base_)},setPrototypeOf(){v(12)}},L={};U(we,(e,r)=>{L[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});L.deleteProperty=function(e,r){return L.set.call(this,e,r,void 0)};L.set=function(e,r,s){return we.set.call(this,e[0],r,s,e[0])};function ae(e,r){const s=e[j];return(s?N(s):e)[r]}function Vt(e,r,s){var o;const n=Ke(r,s);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function Ke(e,r){if(!(r in e))return;let s=A(e);for(;s;){const n=Object.getOwnPropertyDescriptor(s,r);if(n)return n;s=A(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 Zt=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 i=this;return function(f=a,...d){return i.produce(f,c=>s.call(this,c,...d))}}typeof s!="function"&&v(6),n!==void 0&&typeof n!="function"&&v(7);let o;if(F(r)){const a=ze(this),i=pe(r,void 0);let u=!0;try{o=s(i),u=!1}finally{u?me(a):he(a)}return Ae(a,n),Ie(o,a)}else if(!r||typeof r!="object"){if(o=s(r),o===void 0&&(o=r),o===$e&&(o=void 0),this.autoFreeze_&&Ce(o,!0),n){const a=[],i=[];P("Patches").generateReplacementPatches_(r,o,a,i),n(a,i)}return o}else v(1,r)},this.produceWithPatches=(r,s)=>{if(typeof r=="function")return(i,...u)=>this.produceWithPatches(i,f=>r(f,...u));let n,o;return[this.produce(r,s,(i,u)=>{n=i,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){F(e)||v(8),z(e)&&(e=Ht(e));const r=ze(this),s=pe(e,void 0);return s[j].isManual_=!0,he(r),s}finishDraft(e,r){const s=e&&e[j];(!s||!s.isManual_)&&v(9);const{scope_:n}=s;return Ae(n,r),Ie(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 z(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):$t(e,r);return(r?r.scope_:He()).drafts_.push(s),s}function Ht(e){return z(e)||v(10,e),Ue(e)}function Ue(e){if(!F(e)||se(e))return e;const r=e[j];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 U(s,(n,o)=>{Ze(s,n,Ue(o))}),r&&(r.finalized_=!1),s}var g=new Zt,I=g.produce;g.produceWithPatches.bind(g);g.setAutoFreeze.bind(g);g.setUseStrictShallowCopy.bind(g);g.applyPatches.bind(g);g.createDraft.bind(g);g.finishDraft.bind(g);function Kt(){const{data:e,setData:r}=C(),{setCurrentStep:s}=k();if(!e.fullstackResources)return s(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const n=e.fullstackResources.components_resources_info.artifact_store,o=n.flatMap(i=>i.accessible_by_service_connector.map(u=>({...i,value:u})));function a({flavor:i,resourceId:u}){const f=n.find(d=>d.flavor===i);f&&(r(d=>I(d,c=>{c.artifactStoreConfig={flavor:i,configuration:Object.fromEntries(Object.keys(f.required_configuration||{}).map(m=>[m,u])),service_connector_resource_id:u}})),s(d=>d+1))}return{handleFormSubmit:a,flattenedInstances:o}}async function Ut(e){const r=je(ge.flavors.all)+(e?`?${wt(e)}`:""),s=await _e(r,{method:"GET",headers:{"Content-Type":"application/json"}});if(s.status===404&&Ee(),!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching flavors");throw new ve({status:s.status,statusText:s.statusText,message:n})}return s.json()}const Qe={all:["flavors"],flavorList:e=>Le({queryKey:[...Qe.all,e],queryFn:async()=>Ut(e)})};function q({flavor:e,type:r,width:s=32,height:n=32,...o}){var i;const a=J({...Qe.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:Nt(((i=a.data.items[0].body)==null?void 0:i.logo_url)??"")})}const Qt="artifact_store";function Gt(){const[e,r]=_.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:i,trigger:u,reset:f}=y(),{flattenedInstances:d,handleFormSubmit:c}=Kt(),m=d.filter(l=>l.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(W,{placeholder:"Search...",onChange:l=>{f(),r(l.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:m.map(l=>t.jsx("li",{children:t.jsx(b,{name:"resourceId",control:s,render:({field:{onChange:x,...p}})=>t.jsxs(H,{"data-state":i("resourceId")===l.value?"selected":"unselected",htmlFor:l.value,children:[t.jsx(K,{id:l.value,type:"radio",...p,onChange:S=>{n("flavor",l.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),x(S.target.value),u()},value:l.value,name:"connector-radio"}),t.jsx(q,{type:Qt,width:24,height:24,flavor:l.flavor})," ",t.jsx("span",{children:l.value})]})})},l.value))})]})]})}function Yt(){const e=$({resolver:B(Dt),shouldUnregister:!0});return t.jsx(V,{...e,children:t.jsxs(O,{children:[t.jsx(T,{children:"Artifact Store"}),t.jsx(D,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Et,{}),t.jsx(Gt,{})]})}),t.jsx(E,{children:t.jsx(Jt,{})})]})})}function Jt(){const e=y();return t.jsx(w,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}function Xt(e,r){const s=Object.keys(e).reduce((n,o)=>{var d,c;const a=e[o];let i;const u=Ge(o,r);switch(a.type||((c=(d=a.anyOf)==null?void 0:d.find(m=>m.type!==null))==null?void 0:c.type)){case"string":i=h.string().trim();break;case"boolean":i=h.boolean();break;case"array":i=h.array(h.string());break;default:i=h.string();break}return u&&(i=i.optional()),!u&&a.type==="string"&&i instanceof h.ZodString&&(i=i.min(1,"Required")),n[o]=i,n},{});return h.object(s)}function Ge(e,r){return!r.includes(e)}async function er(e){const r=je(ge.serviceConnectors.types.detail(e)),s=await _e(r,{method:"GET",headers:{"Content-Type":"application/json"}});if(s.status===404&&Ee(),!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 ve({status:s.status,statusText:s.statusText,message:n})}return s.json()}const Ne={connectorTypes:["service_connector_types"],serviceConnectorTypeDetail:e=>Le({queryKey:[...Ne.connectorTypes,e],queryFn:async()=>er(e)})},Ye=h.object({authMethod:h.string().min(1),stackName:_t});function tr(){var c,m;const{data:e}=C(),{setCurrentStep:r}=k(),{control:s,watch:n,resetField:o}=y(),{setSchema:a}=X(),i=J({...Ne.serviceConnectorTypeDetail(((c=e.connectorConfig)==null?void 0:c.type)||"")});if(i.isError)return null;if(i.isPending)return t.jsx(Y,{className:"h-[40px] w-[100px]"});const u=i.data.auth_methods.filter(l=>l.auth_method!=="implicit").map(l=>({name:l.name,auth_method:l.auth_method}));if(!((m=e.connectorConfig)!=null&&m.type)){r(1);return}function f(){var Fe;const l=n("authMethod"),x=(Fe=i.data)==null?void 0:Fe.auth_methods.find(ne=>ne.auth_method===l);if(!x)return;const p=Xt(x.config_schema.properties,x.config_schema.required);a(Ye.merge(p)),Object.keys(p.shape).forEach(ne=>o(ne))}const d=e.connectorConfig.type||"";return t.jsx(b,{control:s,name:"authMethod",render:({field:{onChange:l,ref:x,...p}})=>t.jsxs(rt,{...p,onValueChange:S=>{l(S),f()},children:[t.jsx(st,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(nt,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(ot,{children:t.jsx(it,{viewportClassName:"max-h-[300px]",children:u.map(S=>t.jsx(at,{className:"space-x-2",value:S.auth_method,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(M,{provider:d}),t.jsx("div",{children:S.name})]})},S.auth_method))})})]})})}function rr(){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(vt,{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(tr,{})]})}function sr({schema:e,name:r,isOptional:s}){var o,a;const n=e.type||((a=(o=e.anyOf)==null?void 0:o.find(i=>i.type!==null))==null?void 0:a.type);if(!n)return null;switch(n){case"string":return t.jsx(nr,{isOptional:s,schema:e,name:r});case"array":return t.jsx(or,{isOptional:s,schema:e,name:r});case"boolean":return t.jsx(ir,{isOptional:s,schema:e,name:r});default:return null}}function nr({name:e,schema:r,isOptional:s}){const n=y(),o=r.format==="password";return t.jsxs("div",{children:[t.jsxs("label",{htmlFor:e,className:"text-text-sm",children:[r.title," ",s?"(optional)":""]}),t.jsx(b,{defaultValue:"",control:n.control,name:e,render:({field:a})=>t.jsx(W,{inputSize:"md",className:"w-full",id:e,...a,type:o?"password":"text"})})]})}function or({name:e,schema:r,isOptional:s}){const{control:n}=y(),{fields:o,append:a,remove:i}=gt({name:e,control:n});return t.jsxs("div",{className:"space-y-3",children:[t.jsxs("label",{className:"text-text-sm",children:[r.title," ",s?"(optional)":""]}),t.jsx("ul",{className:"space-y-5",children:o.map((u,f)=>t.jsxs("li",{className:"flex w-full items-center gap-4 [&>div]:w-full",children:[t.jsx(b,{defaultValue:"",name:`${e}.${f}`,render:({field:d})=>t.jsx(W,{className:"w-full flex-1",inputSize:"md",...d})}),t.jsxs(w,{className:"h-7 w-7",emphasis:"subtle",size:"sm",type:"button",onClick:()=>i(f),children:[t.jsx(kt,{className:"h-5 w-5 fill-primary-900"}),t.jsx("span",{className:"sr-only",children:"remove"})]})]},u.id))}),t.jsxs(w,{className:"h-7 w-7",emphasis:"subtle",type:"button",onClick:()=>a(""),children:[t.jsx(Pt,{className:"h-5 w-5 fill-primary-900"}),t.jsx("p",{className:"sr-only",children:"Add Item"})]})]})}function ir({name:e,schema:r,isOptional:s}){const n=y(),o=r.default||!1;return t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("label",{htmlFor:e,className:"text-text-sm",children:[r.title," ",s?"(optional)":""]}),t.jsx(b,{defaultValue:o,control:n.control,name:e,render:({field:{onChange:a,value:i,...u}})=>t.jsx(ct,{id:e,checked:i,onCheckedChange:f=>a(f),...u})})]})}function ar(){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(Ft,{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(cr,{})]})}function cr(){var f,d;const{data:e}=C(),{watch:r}=y(),s=J({...Ne.serviceConnectorTypeDetail(((f=e.connectorConfig)==null?void 0:f.type)||"")}),n=r("authMethod"),o=(d=s.data)==null?void 0:d.auth_methods.find(c=>c.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.properties,i=o.config_schema.required,u=Object.entries(a).sort(([c],[m])=>i.includes(c)&&!i.includes(m)?-1:!i.includes(c)&&i.includes(m)?1:0);return t.jsx("div",{className:"space-y-5",children:u.map(([c,m])=>t.jsx(sr,{isOptional:Ge(c,i),name:c,schema:m},c))})}function lr({open:e,loadingComponents:r}){var n,o;const{data:s}=C();return(n=s.connectorConfig)!=null&&n.type?t.jsx(lt,{open:e,children:t.jsxs(ut,{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(dt,{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(ft,{className:"h-[60px] w-[60px]"}),t.jsx("div",{className:"flex h-[60px] w-[60px] items-center justify-center",children:t.jsx(At,{className:"h-5 w-5 fill-theme-text-tertiary"})}),t.jsx(M,{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 ",Je(((o=s.connectorConfig)==null?void 0:o.type)||"aws")," ","and retrieving your custom components. This process typically takes about 30-60 seconds."]}),t.jsx(ur,{loadingComponents:r})]})]})}):null}function ur({loadingComponents:e}){const[r,s]=_.useState(!0),[n,o]=_.useState(!0);return _.useEffect(()=>{const a=setTimeout(()=>{s(!1)},Math.floor(Math.random()*1e3)+500),i=setTimeout(()=>{o(!1)},1500);return()=>{clearTimeout(a),clearTimeout(i)}},[]),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(mt,{className:"h-5 w-5 border-2"}):t.jsx(be,{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 dr({payload:e}){const r=je(ge.serviceConnectors.fullStackResources),s=await _e(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 ve({status:s.status,statusText:s.statusText,message:n})}return s.json()}function fr(e){return bt({...e,mutationFn:async({payload:r})=>dr({payload:r})})}function mr(e){return new Promise(r=>setTimeout(r,e))}function hr(){const{setCurrentStep:e}=k(),[r,s]=_.useState(!0),{toast:n}=Me(),{setData:o,data:a}=C(),i=fr({onSuccess:async f=>{o(d=>I(d,c=>{c.fullstackResources=f})),s(!1),await mr(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(l=>{(c[l]===""||c[l]===null||c[l]===void 0||Array.isArray(c[l])&&c[l].length===0)&&delete c[l]});const m=I(a,l=>{l.stackName=d,l.connectorConfig&&(l.connectorConfig.auth_method=f,l.connectorConfig.configuration={...c})});o(m),m.connectorConfig&&i.mutate({payload:m.connectorConfig})},fullStackResources:i,loadingComponents:r}}function xr(){const{handleSubmit:e,formState:{isSubmitting:r}}=y(),{handleFormSubmit:s,fullStackResources:n,loadingComponents:o}=hr();return t.jsxs("form",{onSubmit:e(s),id:"connect-form",children:[t.jsx(lr,{loadingComponents:o,open:r||n.isPending}),t.jsx(rr,{}),t.jsx(Xe,{}),t.jsx(ar,{})]})}function pr(){const{schema:e}=X(),r=$({shouldUnregister:!0,mode:"onChange",resolver:B(e)});return t.jsx(V,{...r,children:t.jsxs(O,{children:[t.jsx(T,{children:"Connect to your Cloud"}),t.jsx(D,{children:t.jsx(xr,{})}),t.jsx(E,{children:t.jsx(yr,{})})]})})}function yr(){const{formState:{isValid:e,isSubmitting:r}}=y(),s=!!qe();return t.jsx(w,{className:"justify-center gap-2",disabled:!e||s||r,form:"connect-form",size:"md",children:s||r?"Loading...":"Next"})}function jr(){const{data:e,setData:r}=C(),s=Ct(),{toast:n}=Me(),{setCurrentStep:o}=k(),{mutate:a}=St({onError:d=>{d instanceof Error&&n({status:"error",emphasis:"subtle",icon:t.jsx(ht,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess:async d=>{r(c=>I(c,m=>{m.createdStackId=d.id})),o(c=>c+1),s.invalidateQueries({queryKey:Re.all})}});if(!e.fullstackResources)return o(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const i=e.fullstackResources.components_resources_info.container_registry,u=i.flatMap(d=>d.accessible_by_service_connector.map(c=>({...d,value:c})));function f({flavor:d,resourceId:c}){const m=i.find(x=>x.flavor===d);if(!m)return;const l=I(e,x=>{x.registryConfig={flavor:d,configuration:Object.fromEntries(Object.keys(m.required_configuration||{}).map(p=>[p,c])),service_connector_resource_id:c}});r(l),a({workspaceId:"default",payload:{name:l.stackName||Math.random().toString(36).substring(7),service_connectors:l.connectorConfig?[l.connectorConfig]:[],components:{orchestrator:[{...l.orchestratorConfig,service_connector_index:0}],artifact_store:[{...l.artifactStoreConfig,service_connector_index:0}],container_registry:[{...l.registryConfig,service_connector_index:0}]}}})}return{handleFormSubmit:f,flattenedInstances:u}}const gr="container_registry";function _r(){const[e,r]=_.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:i,trigger:u,reset:f}=y(),{flattenedInstances:d,handleFormSubmit:c}=jr(),m=d.filter(l=>l.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(W,{placeholder:"Search...",onChange:l=>{f(),r(l.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:m.map(l=>t.jsx("li",{children:t.jsx(b,{name:"resourceId",control:s,render:({field:{onChange:x,...p}})=>t.jsxs(H,{"data-state":i("resourceId")===l.value?"selected":"unselected",htmlFor:l.value,children:[t.jsx(K,{id:l.value,type:"radio",...p,onChange:S=>{n("flavor",l.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),x(S.target.value),u()},value:l.value,name:"connector-radio"}),t.jsx(q,{width:24,height:24,type:gr,flavor:l.flavor})," ",t.jsx("span",{children:l.value})]})})},l.value))})]})]})}function vr(){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(Se,{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 Sr=h.object({flavor:h.string().min(1),resourceId:h.string().min(1)});function br(){const e=$({resolver:B(Sr),shouldUnregister:!0});return t.jsx(V,{...e,children:t.jsxs(O,{children:[t.jsx(T,{children:"Container Registry"}),t.jsx(D,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(vr,{}),t.jsx(_r,{})]})}),t.jsx(E,{children:t.jsx(Cr,{})})]})})}function Cr(){const e=y(),r=!!qe();return t.jsxs(w,{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 wr(){var a;const{data:e,setData:r}=C(),{setCurrentStep:s}=k();if(!e.fullstackResources)return s(2),{orchestrators:[],handleFormSubmit:()=>{}};const n=((a=e.fullstackResources.components_resources_info)==null?void 0:a.orchestrator)||[];function o({flavor:i,resourceId:u,...f}){const d=n.find(c=>c.flavor===i);d&&(r(c=>{const m=d!=null&&d.use_resource_value_as_fixed_config?Object.fromEntries(Object.keys(d.required_configuration||{}).map(l=>[l,u])):{...f};return I(c,l=>{l.orchestratorConfig={flavor:i,configuration:m,service_connector_resource_id:u}})}),s(c=>c+1))}return{orchestrators:n,handleFormSubmit:o}}const ye=h.object({flavor:h.string().min(1),resourceId:h.string().min(1)});function Nr(e){const r=Object.keys(e).reduce((s,n)=>(s[n]=h.string().trim().min(1),s),{});return h.object(r)}const Z="kubernetes",Te="orchestrator";function Fr(){const{orchestrators:e,handleFormSubmit:r}=wr(),{setSchema:s}=X(),{control:n,watch:o,setValue:a,register:i,reset:u,handleSubmit:f}=y(),d=o("flavor");return t.jsxs("form",{onSubmit:f(r),id:"artifact-store-form",children:[d!==Z&&t.jsx("input",{...i("resourceId"),type:"hidden"}),t.jsx("ul",{className:"space-y-1",children:e.map((c,m)=>t.jsxs("li",{children:[t.jsx(b,{control:n,name:"flavor",render:({field:{onChange:l,...x}})=>t.jsxs(H,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(K,{onChange:p=>{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(Nr(c.required_configuration))),c.flavor!==Z&&c.accessible_by_service_connector.length>0&&a("resourceId",c.accessible_by_service_connector[0]),l(p)},...x,id:c.flavor,type:"radio",value:c.flavor,name:"orchestrator-flavor-radio"}),t.jsx(q,{width:24,height:24,type:Te,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===Z||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===Z&&t.jsx("ul",{className:"space-y-1",children:c.accessible_by_service_connector.map(l=>t.jsx("li",{children:t.jsx(b,{control:n,name:"resourceId",render:({field:x})=>t.jsxs(H,{"data-state":o("resourceId")===l?"selected":"unselected",htmlFor:l,children:[t.jsx(K,{...x,id:l,type:"radio",value:l,name:"instance-radio"}),t.jsx(q,{type:Te,width:24,height:24,flavor:c.flavor}),t.jsx("span",{children:l})]})})},l))}),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(([l,x])=>t.jsx("div",{children:t.jsx(b,{name:l,control:n,render:({field:p})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:l,className:"text-text-sm",children:x}),t.jsx(W,{...p,inputSize:"md",required:!0,className:"w-full",id:l})]})})},l))})]})]},m))})]})}function Pr(){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(Se,{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 kr(){const{schema:e}=X(),r=$({resolver:B(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx(V,{...r,children:t.jsxs(O,{children:[t.jsx(T,{children:"Orchestrator"}),t.jsxs(D,{children:[t.jsx(Pr,{}),t.jsx(Fr,{})]}),t.jsx(E,{children:t.jsx(Ar,{})})]})})}function Ar(){const e=y();return t.jsx(w,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const zr=h.object({provider:h.string().min(1)});function Ir(){var a;const{setData:e,data:r}=C(),{setCurrentStep:s}=k(),n=$({resolver:B(zr),defaultValues:{provider:((a=r.connectorConfig)==null?void 0:a.type)||""}});function o(i){e(u=>({...u,connectorConfig:{type:i.provider,auth_method:""}})),s(u=>u+1)}return t.jsx(V,{...n,children:t.jsxs(O,{children:[t.jsx(T,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(D,{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(M,{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(M,{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(M,{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(E,{children:t.jsx(Or,{})})]})})}function Or(){const{formState:{isValid:e}}=y();return t.jsx(w,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function Tr(){var o;const{data:e}=C(),r=J({...Re.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(O,{children:[t.jsx(T,{children:"Your stack"}),t.jsx(D,{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(Er,{stack:s}),n.map(a=>t.jsx(Mr,{component:a},a.id))]})]})}),t.jsx(E,{displayCancel:!1,children:t.jsx(Dr,{})})]})}function Dr(){return t.jsx(w,{size:"md",asChild:!0,children:t.jsx(Ot,{to:xt.stacks.overview,children:"Finish"})})}function Er({stack:e}){return t.jsxs("div",{className:"flex items-center gap-3 bg-theme-surface-secondary p-5 font-semibold",children:[t.jsx(be,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(pt,{type:"square",size:"lg",children:t.jsx(yt,{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 Mr({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(be,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(q,{width:24,height:24,flavor:((r=e.body)==null?void 0:r.flavor)||"",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(zt,{type:((n=e.body)==null?void 0:n.type)||"alerter",children:jt((o=e.body)==null?void 0:o.type)})]},e.id)}function Rr(){const{currentStep:e}=k();if(e===1)return t.jsx(Ir,{});if(e===2)return t.jsx(Pe,{initialSchema:Ye,children:t.jsx(pr,{})});if(e===3)return t.jsx(Yt,{});if(e===4)return t.jsx(Pe,{initialSchema:ye,children:t.jsx(kr,{})});if(e===5)return t.jsx(br,{});if(e===6)return t.jsx(Tr,{})}const De=["Infrastructure Type","Cloud Provider","Connect your Cloud","Artifact Store","Orchestrator","Container Registry"];function ls(){return t.jsx(et,{maxSteps:De.length+1,initialStep:1,children:t.jsx(Tt,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(tt,{entries:De}),t.jsx("div",{className:"w-full",children:t.jsx(Rr,{})})]})})})}export{ls as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e}from"./@radix-DnFH_oo1.js";import{B as r,
|
1
|
+
import{j as e}from"./@radix-DnFH_oo1.js";import{B as r,P as o,e as i}from"./index-D0bJjaey.js";import{C as n}from"./CodeSnippet-DRy_0J4D.js";import{I as c}from"./Infobox-CC70zvGO.js";import{c as l}from"./@react-router-APVeuk-U.js";import{C as m,a as f}from"./cloud-only-CxoNxh86.js";import"./@tanstack-QbMbTrh5.js";import"./@reactflow-CEC2f0cl.js";import"./copy-CaGlDsUy.js";function x(){return e.jsx(c,{children:e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-x-2 gap-y-0.5 text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"This is a ZenML Pro feature. "}),e.jsx("p",{children:"Upgrade to ZenML Pro to access the Artifact Control Plane and interact with your artifacts in the Dashboard."})]})})}function d(){const[s]=l(),t=s.get("artifact");function a(){return t?`zenml artifact list --name='contains:${t}'`:"zenml artifact list"}return e.jsxs(r,{className:"flex flex-wrap justify-between p-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-text-xl font-semibold",children:"Staying Open Source? "}),e.jsx("p",{className:"text-theme-text-secondary",children:"No problem! Use this CLI command to list your artifacts"})]}),e.jsx(n,{code:a()})]})}const p="/assets/acp-DOsXjFc7.webp";function w(){return e.jsxs("div",{children:[e.jsxs(o,{className:"flex items-center gap-1",children:[e.jsx("h1",{className:"text-display-xs font-semibold",children:"Artifacts"}),e.jsx(i,{color:"purple",rounded:!0,size:"sm",children:e.jsx("span",{className:"font-semibold text-primary-500",children:"Pro"})})]}),e.jsxs("div",{className:"layout-container space-y-5 py-5",children:[e.jsx(x,{}),e.jsx(m,{feature:"artifact",image:{src:p,alt:"Screenshot of the ZenML Pro Artifact Control plane"},features:f}),e.jsx(d,{})]})]})}export{w as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e,r as f}from"./@radix-DnFH_oo1.js";import{
|
1
|
+
import{j as e,r as f}from"./@radix-DnFH_oo1.js";import{P as j,t as g,z as o,E as b,r as i,T as y,v as N,w as v,x as P,y as p,f as S,G as T,S as x,N as k}from"./index-D0bJjaey.js";import{c as C,L as c,g as h}from"./@react-router-APVeuk-U.js";import{S as E}from"./refresh-hfgWPeto.js";import{u as R}from"./all-pipeline-runs-query-DAPSF_74.js";import{S as _,P as D}from"./SearchField-BeF1yR7M.js";import{C as u}from"./CopyButton-C_yRGWuP.js";import{D as F}from"./DisplayDate-DkCy54Bp.js";import{g as w,E as A}from"./ExecutionStatus-fIulMG4w.js";import{I}from"./InlineAvatar-C3QXdFW1.js";import"./@tanstack-QbMbTrh5.js";import"./@reactflow-CEC2f0cl.js";import"./url-DdWrpIhi.js";import"./dots-horizontal-C6K59vUm.js";import"./chevron-right-double-c9H46Kl8.js";import"./index-5GJ5ysEZ.js";import"./copy-CaGlDsUy.js";import"./check-circle-DOoS4yhF.js";function z({namespace:s}){return e.jsx(j,{children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(g,{className:"h-5 w-5 fill-neutral-400"}),e.jsx("h1",{className:"text-display-xs font-semibold",children:decodeURIComponent(s)})]})})}const l=1,B=o.object({page:o.coerce.number().min(l).optional().default(l).catch(l),name:o.string().optional(),operator:o.enum(["and","or"]).optional()});function L(){const[s]=C(),{page:a,name:r,operator:t}=B.parse({page:s.get("page")||void 0,name:s.get("name")||void 0});return{page:a,name:r,logical_operator:t}}function U(){return[{id:"run",header:"Run",accessorFn:s=>{var a;return{name:s.name,id:s.id,status:(a=s.body)==null?void 0:a.status}},cell:({getValue:s})=>{const{name:a,status:r,id:t}=s();return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(b,{className:`h-5 w-5 shrink-0 ${w(r)}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(c,{to:i.runs.detail(t),className:"flex items-center gap-1",children:e.jsx("h2",{className:"text-text-md font-semibold",children:a})}),e.jsx(y,{children:e.jsxs(N,{children:[e.jsx(v,{className:"hover:text-theme-text-brand hover:underline",children:e.jsx(A,{status:r})}),e.jsx(P,{className:"z-20 capitalize",children:r})]})}),e.jsx(u,{copyText:a})]}),e.jsxs(c,{to:i.runs.detail(t),className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:t.split("-")[0]}),e.jsx(u,{copyText:t})]})]})]})}},{id:"stack",header:"Stack",accessorFn:s=>{var a,r,t,n;return{name:(r=(a=s.body)==null?void 0:a.stack)==null?void 0:r.name,id:(n=(t=s.body)==null?void 0:t.stack)==null?void 0:n.id}},cell:({getValue:s})=>{const{name:a,id:r}=s();return!a||!r?null:e.jsx(c,{to:i.stacks.overview,children:e.jsx(p,{rounded:!1,className:"inline-block",color:"turquoise",emphasis:"subtle",children:a})})}},{id:"repository",header:"Repository",accessorFn:s=>{var a,r,t,n,m,d;return{name:(t=(r=(a=s.body)==null?void 0:a.code_reference)==null?void 0:r.body)==null?void 0:t.code_repository.name,id:(d=(m=(n=s.body)==null?void 0:n.code_reference)==null?void 0:m.body)==null?void 0:d.code_repository.id}},cell:({getValue:s})=>{const{name:a,id:r}=s();return!a||!r?null:e.jsx("div",{children:e.jsx(p,{rounded:!1,className:"inline-block",color:"grey",emphasis:"subtle",children:a})})}},{id:"created",header:"Created at",accessorFn:s=>{var a;return(a=s.body)==null?void 0:a.created},cell:({getValue:s})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(F,{dateString:s()})})},{id:"author",header:"Author",accessorFn:s=>{var a;return{author:(a=s.body)==null?void 0:a.user}},cell:({getValue:s})=>{const{author:a}=s();return e.jsx(I,{username:a.name})}}]}function G(){const{namespace:s}=h(),a=L(),r=U(),{data:t,refetch:n}=R({params:{pipeline_name:decodeURIComponent(s),...a,sort_by:"desc:updated"}},{throwOnError:!0});return e.jsxs("div",{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(_,{searchParams:a}),e.jsxs(S,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>n(),children:[e.jsx(E,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:t?e.jsx(T,{columns:r,data:t.items}):e.jsx(x,{className:"h-[500px] w-full"})}),t?t.total_pages>1&&e.jsx(D,{searchParams:a,paginate:t}):e.jsx(x,{className:"h-[36px] w-[300px]"})]})]})}function ne(){const{namespace:s}=h(),{setCurrentBreadcrumbData:a}=k();return f.useEffect(()=>{s&&a({segment:"pipeline_detail",data:{name:s}})},[s]),e.jsxs("div",{children:[e.jsx(z,{namespace:s}),e.jsx(G,{})]})}export{ne as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e,r as m}from"./@radix-DnFH_oo1.js";import{
|
1
|
+
import{j as e,r as m}from"./@radix-DnFH_oo1.js";import{aw as f,ax as b,ay as v,az as y,aA as S,B as h,aB as C}from"./index-D0bJjaey.js";import{I as l}from"./Infobox-CC70zvGO.js";import{V as d,g as p}from"./Commands-CVx2RAoT.js";import{H as j}from"./Helpbox-CJAp4kbv.js";import{S as w,a as k,b as A}from"./gcp-Dj6ntk0L.js";import{S as z}from"./kubernetes-BjbR6D-1.js";import{S as T}from"./docker-BFAFXr2_.js";import"./@tanstack-QbMbTrh5.js";import"./@react-router-APVeuk-U.js";import"./@reactflow-CEC2f0cl.js";import"./CodeSnippet-DRy_0J4D.js";import"./copy-CaGlDsUy.js";import"./help-CwN931fX.js";const N="/assets/connectors-video-C9qY4syJ.svg",s="w-5 h-5",P=[{label:"Kubernetes",value:"kubernetes",icon:e.jsx(z,{className:s})},{label:"GCP",value:"gcp",icon:e.jsx(w,{className:s})},{label:"Docker",value:"docker",icon:e.jsx(T,{className:s})},{label:"Azure",value:"azure",icon:e.jsx(k,{className:s})},{label:"AWS",value:"aws",icon:e.jsx(A,{className:s})}],I={help:{href:"https://docs.zenml.io/how-to/auth-management/kubernetes-service-connector",text:"Use the complete guide to set up your Kubernetes Service Connector."},prerequisites:i("kubernetes","Kubernetes"),listCommand:a("kubernetes","Kubernetes"),topInfobox:"The ZenML Kubernetes service connector facilitates authenticating and connecting to a Kubernetes cluster. The connector can be used to access to any generic Kubernetes cluster by providing pre-authenticated Kubernetes python clients to Stack Components that are linked to it and also allows configuring the local Kubernetes CLI (i.e. kubectl).",bottomInfobox:"Upon completion of the installation of the required prerequisites and integration, our documentation provides you with a comprehensive list of resource types that can be employed to establish your connector. Please refer to the documentation to explore all available options."},q={help:{text:"Use the complete guide to set up your GCP Service Connector.",href:"https://docs.zenml.io/how-to/auth-management/gcp-service-connector"},prerequisites:i("gcp","GCP"),listCommand:a("gcp","GCP"),bottomInfobox:"Upon completion of the installation of the required prerequisites and integration, our documentation will guide you with a comprehensive list of all the resource types that can be employed to establish your GCP connector. Please refer to the documentation to explore all available options.",topInfobox:"The ZenML GCP Service Connector facilitates the authentication and access to managed GCP services and resources. These encompass a range of resources, including GCS buckets, GCR container repositories, and GKE clusters. The connector provides support for various authentication methods, including GCP user accounts, service accounts, short-lived OAuth 2.0 tokens, and implicit authentication."},G={help:{text:"Use the complete guide to set up your Docker Service Connector.",href:"https://docs.zenml.io/how-to/auth-management/docker-service-connector"},listCommand:a("docker","Docker"),topInfobox:"The ZenML Docker Service Connector allows authenticating with a Docker or OCI container registry and managing Docker clients for the registry. This connector provides pre-authenticated python-docker Python clients to Stack Components that are linked to it.",bottomInfobox:"No Python packages are required for this Service Connector. All prerequisites are included in the base ZenML Python package. Docker needs to be installed on environments where container images are built and pushed to the target container registry. Please refer to the documentation to explore all available options."},K={help:{text:"Use the complete guide to set up your Azure Service Connector.",href:"https://docs.zenml.io/how-to/auth-management/azure-service-connector"},listCommand:a("azure","Azure"),prerequisites:i("azure","Azure"),topInfobox:"The ZenML Azure Service Connector facilitates the authentication and access to managed Azure services and resources. These encompass a range of resources, including blob storage containers, ACR repositories, and AKS clusters.",bottomInfobox:"Upon completion of the installation of the required prerequisites and integration, our documentation will guide you with a comprehensive list of all the resource types that can be employed to establish your Azure connector. Please refer to the documentation to explore all available options."},L={help:{text:"Use the complete guide to set up your AWS Service Connector.",href:"https://docs.zenml.io/how-to/auth-management/aws-service-connector"},listCommand:a("aws","AWS"),prerequisites:i("aws","AWS"),topInfobox:"The ZenML AWS Service Connector facilitates the authentication and access to managed AWS services and resources. These encompass a range of resources, including S3 buckets, ECR container repositories, and EKS clusters. The connector provides support for various authentication methods, including explicit long-lived AWS secret keys, IAM roles, short-lived STS tokens, and implicit authentication.",bottomInfobox:"Upon completion of the installation of the required prerequisites and integration, our documentation will guide you with a comprehensive list of all the resource types that can be employed to establish your AWS connector. Please refer to the documentation to explore all available options."};function a(t,o){return{command:`zenml service-connector list-types --type ${t}`,description:`List ${o} Connector Types`}}function i(t,o){return[{description:"Install the prerequisites",command:`pip install "zenml[connectors-${t}]"`},{description:`Install the entire ${o} ZenML integration`,command:`zenml integration install ${t}`}]}function M({id:t,selectedType:o,onTypeChange:c}){return e.jsxs(f,{value:o,onValueChange:n=>c(n),children:[e.jsx(b,{id:t,className:"w-[250px] border border-neutral-300 px-2 text-left text-text-md",children:e.jsx(v,{placeholder:"Select Connector Type"})}),e.jsx(y,{className:"",children:P.map(n=>e.jsx(S,{value:n.value,children:e.jsxs("div",{className:"flex items-center gap-1",children:[n.icon,n.label]})},n.value))})]})}function W(){return e.jsx(l,{children:e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-x-2 gap-y-0.5 text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"We are creating a new Connectors experience"}),e.jsx("p",{children:"In the meanwhile you can use the CLI to add and manage your connectors."})]})})}function D(){const t="https://zenml.portal.trainn.co/share/V6magMJZZvMptz1wdnUmPA/embed?autoplay=false";return e.jsxs(h,{className:"flex flex-col-reverse items-stretch overflow-hidden lg:flex-row",children:[e.jsxs("div",{className:"w-full p-7 lg:w-2/3",children:[e.jsx("h2",{className:"text-display-xs font-semibold",children:"Learn More about Connectors"}),e.jsx("p",{className:"mt-2 text-text-lg text-theme-text-secondary",children:"Dive into Service Connector Types for a documented approach to secure authentication and authorization practices."}),e.jsx(d,{videoLink:t,buttonText:"Watch the Starter Guide (2 min)"})]}),e.jsx("div",{className:"flex w-full items-center justify-center bg-primary-50 lg:w-1/3",children:e.jsx(d,{fallbackImage:e.jsx("img",{src:N,alt:"Purple squares with text indicating a starter guide for secrets",className:"h-full w-full"}),videoLink:t,isButton:!1})})]})}function U(){const[t,o]=m.useState("kubernetes");return e.jsxs("section",{className:"space-y-5 pl-8 pr-5",children:[e.jsx(M,{selectedType:t,onTypeChange:o,id:"connector-select"}),Z(t)]})}function r({topInfobox:t,bottomInfobox:o,listCommand:c,prerequisites:n,help:u}){return e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"text-text-md",intent:"neutral",children:t}),p(c),n&&e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"Prerequisites"}),n.map((x,g)=>e.jsx(m.Fragment,{children:p(x)},g))]}),e.jsx(l,{className:"text-text-md",intent:"neutral",children:o}),e.jsx(j,{text:u.text,link:u.href})]})}function Z(t){switch(t){case"kubernetes":return r(I);case"gcp":return r(q);case"docker":return r(G);case"azure":return r(K);case"aws":return r(L)}}function te(){return e.jsxs(h,{className:"space-y-4 p-5",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Secrets"}),e.jsx(W,{}),e.jsx(D,{}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{}),"Administering your Connectors"]}),e.jsx(U,{})]})}export{te as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,j as e}from"./@radix-DnFH_oo1.js";import{u as c,S as x,a as y,b as v}from"./form-schemas-
|
1
|
+
import{r as l,j as e}from"./@radix-DnFH_oo1.js";import{u as c,S as x,a as y,b as v}from"./form-schemas-C09PrQUJ.js";import{A as j,I as U,P as h,U as b,S as _}from"./UsageReason-DL5NL_ZD.js";import{i as g,au as C,aR as P,j as w,at as A,S as E}from"./index-D0bJjaey.js";import{c as F}from"./@tanstack-QbMbTrh5.js";import"./check-circle-DOoS4yhF.js";import"./url-DdWrpIhi.js";import"./@react-router-APVeuk-U.js";import"./UpdatePasswordSchemas-7KFsDbKb.js";import"./zod-uFd1wBcd.js";import"./index.esm-BE1uqCX5.js";import"./gcp-Dj6ntk0L.js";import"./kubernetes-BjbR6D-1.js";import"./rocket-SESCGQXm.js";import"./@reactflow-CEC2f0cl.js";const S=l.createContext(null);function H({children:t,initialUser:a}){const[n,r]=l.useState(a||{});return e.jsx(S.Provider,{value:{user:n,setUser:r},children:t})}function d(){const t=l.useContext(S);if(t===null)throw new Error("useSurveyUserContext must be used within an SurveyUserProvider");return t}function R({user:t}){var u,i;const{setSurveyStep:a}=c(),{setUser:n}=d();function r({fullName:s,getUpdates:m,email:o}){n(p=>({...p,...o?{email:o}:{email:null},full_name:s,email_opted_in:m})),a(2)}return e.jsx(j,{email:(u=t.metadata)==null?void 0:u.email,fullName:(i=t.body)==null?void 0:i.full_name,submitHandler:r})}function D(){const{user:t}=d(),{setSurveyStep:a}=c(),{toast:n}=g(),r=F(),{mutate:u}=C({onSuccess:async()=>{await r.invalidateQueries({queryKey:P()}),a(s=>s+1)},onError:s=>{s instanceof Error&&n({status:"error",emphasis:"subtle",icon:e.jsx(w,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})}});function i({other:s,providers:m,otherVal:o}){const f={infra_providers:s?[...m,o]:m,finished_onboarding_survey:!0};u({...t,user_metadata:{...t.user_metadata,...f}})}return e.jsx(U,{submitHandler:i})}function I({user:t}){const{setSurveyStep:a}=c(),{setUser:n}=d();function r({primaryUse:u}){const i={primary_use:u};n(s=>({...s,user_metadata:{...s.user_metadata,...i}})),a(3)}return e.jsx(h,{user:t,submitHandler:r})}function k(){const{setSurveyStep:t}=c(),{setUser:a}=d();function n({usageReason:r,comparison_tools:u,otherTool:i,otherToolVal:s}){const m={usage_reason:r,...!!u&&{comparing_tools:i&&s?[...u,s]:u}};a(o=>({...o,user_metadata:{...o.user_metadata,...m}})),t(o=>o+1)}return e.jsx(b,{submitHandler:n})}function M(){const{data:t,isPending:a,isError:n}=A({throwOnError:!0}),{surveyStep:r}=c();return n?null:a?e.jsx(E,{className:"h-[300px]"}):e.jsx(e.Fragment,{children:e.jsxs(H,{children:[e.jsx(x,{stepAmount:5}),r===1&&e.jsx(R,{user:t}),r===2&&e.jsx(I,{user:t}),r===3&&e.jsx(k,{}),r===4&&e.jsx(D,{}),r===5&&e.jsx(_,{}),r===6&&e.jsx(y,{subHeader:"Your ZenML account is now updated",displayBody:!1,username:t.name})]})})}function $(){return e.jsx("div",{children:e.jsx(v,{children:e.jsx(M,{})})})}export{$ as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as c,j as e}from"./@radix-DnFH_oo1.js";import{ag as A,ah as E,ai as R,F as M,l as U,m as q,i as W,r as N,j as Q,o as Y,q as G,ao as K,t as V,f as x,D as S,x as J,y as X,$ as Z,ae as ee,af as se,a6 as I,aB as b,aC as C,a2 as te,a3 as ae,a4 as re,S as u,A as P,b as z,B as ne,z as g,M as ie,U as ce,aD as le,V as oe}from"./index-B9wVwe7u.js";import{S as de}from"./plus-Bc8eLSDM.js";import{S as me}from"./refresh-hfgWPeto.js";import{S as xe,P as ue}from"./SearchField-W3GXpLlI.js";import{s as h}from"./sharedSchema-BfZcy7aP.js";import{b as he,c as pe,a as f}from"./@tanstack-QbMbTrh5.js";import{b as fe,L as k,c as je}from"./@react-router-APVeuk-U.js";import{C as v}from"./CopyButton-BqE_-PHO.js";import{D as ge}from"./DisplayDate-DkCy54Bp.js";import{I as Ne}from"./InlineAvatar-Ds2ZFHPc.js";import{S as ye}from"./dots-horizontal-C6K59vUm.js";import{D as we,S as be}from"./DialogItem-Cz1VLRwa.js";import{S as ke}from"./trash-DUWZWzse.js";import{I as y}from"./Infobox-BL9NOS37.js";import{C as p}from"./CodeSnippet-DNWdQmbo.js";import{A as ve}from"./AlertDialogDropdownItem-BXeSvmMY.js";import{C as Se}from"./CollapsibleCard-B2OVjWYE.js";import{F as Ce}from"./chevron-right-double-c9H46Kl8.js";import{e as D}from"./components-Br2ezRib.js";import{s as De}from"./url-DwbuKk1b.js";import{N as T}from"./NumberBox-CrN0_kqI.js";import{C as Te,p as F,c as Ae}from"./persist-mEZN_fgH.js";import{p as O,c as Ee}from"./persist-xsYgVtR1.js";import"./@reactflow-B6kq9fJZ.js";import"./index-5GJ5ysEZ.js";import"./stack-detail-query-CU4egfhp.js";import"./layout-Dru15_XR.js";import"./rocket-SESCGQXm.js";import"./copy-CaGlDsUy.js";import"./chevron-down-Cwb-W_B_.js";const $=c.forwardRef(({closeModal:s,name:t,...a},r)=>e.jsxs(A,{...a,ref:r,children:[e.jsx(E,{children:e.jsx(R,{children:"Update Stack"})}),e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx(Re,{action:"update"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Update a stack"}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml stack update ${t} -o NEW_ORCHESTRATOR_NAME`})]})]})]}));$.displayName="UpdateStackDialog";function Re({action:s}){function t(){switch(s){case"delete":return"delete";case"update":return"update";case"describe":return"get details of"}}return e.jsx(y,{children:e.jsx("div",{className:"flex w-full flex-wrap justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-text-sm font-semibold",children:"We are working on the new Stacks experience."}),e.jsxs("p",{className:"truncate text-text-sm",children:["Meanwhile you can use the CLI to ",t()," your stack."]})]})})})}async function Ie({stackId:s},t){const a=U(q.stacks.detail(s)),r=await fetch(a,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{}}});if(!r.ok){const n=await r.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>`Error while deleting stack ${s}`);throw new M({status:r.status,statusText:r.statusText,message:n})}return r.json()}function Pe(s){return he({...s,mutationFn:async({stackId:t})=>Ie({stackId:t})})}function ze(s){const{toast:t}=W(),a=pe(),r=fe(),n=Pe({onSuccess:async()=>{a.invalidateQueries({queryKey:h.all}),r(N.stacks.overview)},onError:l=>{t({status:"error",emphasis:"subtle",icon:e.jsx(Q,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:l.message,rounded:!0})}});function i(){n.mutate({stackId:s})}return{handleDelete:i,deleteStack:n}}const B=c.forwardRef(({closeModal:s,name:t,stackId:a,...r},n)=>{const{handleDelete:i,deleteStack:l}=ze(a);return e.jsxs(Y,{...r,className:"p-0",ref:n,children:[e.jsxs(G,{className:"m-0 py-2 pl-5 pr-3 text-text-lg font-semibold",children:["Delete ",t]}),e.jsx("div",{className:"border-y border-theme-border-moderate px-5 py-5",children:e.jsxs(K,{children:["Are you sure you want to delete this stack? ",e.jsx("br",{}),"This action cannot be undone."]})}),e.jsxs("div",{className:"flex justify-end gap-3 px-5 py-3",children:[e.jsx(V,{onClick:()=>s==null?void 0:s(),asChild:!0,children:e.jsx(x,{intent:"secondary",children:"Cancel"})}),e.jsxs(x,{disabled:l.isPending,type:"button",onClick:()=>i(),intent:"danger",children:[l.isPending&&e.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-error"}),"Delete"]})]})]})});B.displayName="DeleteStackDialog";function Fe({name:s,id:t}){const[a,r]=c.useState(!1),[n,i]=c.useState(!1),l=c.useRef(null),d=c.useRef(null);function o(){d.current=l.current}function m(j){r(j),j===!1&&i(!1)}return e.jsx(S,{open:n,onOpenChange:i,children:e.jsxs(S,{children:[e.jsx(J,{className:"z-10",ref:l,children:e.jsx(ye,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(X,{hidden:a,onCloseAutoFocus:j=>{d.current&&(d.current.focus(),d.current=null,j.preventDefault())},className:"z-10",align:"end",sideOffset:1,children:[e.jsx(we,{onSelect:o,onOpenChange:m,icon:e.jsx(be,{className:"h-3 w-3 !fill-neutral-400"}),triggerChildren:"Update",children:e.jsx($,{name:s,className:"lg:min-w-[600px]",closeModal:()=>m(!1)})}),e.jsx(ve,{onSelect:o,onOpenChange:m,icon:e.jsx(ke,{className:"h-3 w-3 !fill-neutral-400"}),triggerChildren:"Delete",children:e.jsx(B,{stackId:t,name:s,className:"lg:min-w-[600px]",closeModal:()=>m(!1)})})]})]})})}function Oe(){return e.jsx("div",{className:"flex h-9 items-center border-b border-theme-border-moderate bg-theme-surface-primary px-4 py-3",children:e.jsxs(Z,{className:"focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(Ce,{className:"h-5 w-5 fill-neutral-500"}),e.jsx("span",{className:"sr-only",children:"Close"})]})})}const L=c.forwardRef(({name:s,children:t,type:a,...r},n)=>e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:t}),e.jsxs(A,{className:"w-fit max-w-fit",...r,ref:n,children:[e.jsx(E,{children:e.jsx(R,{children:I(a||"")})}),e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx($e,{type:a}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Describe your ",b(a)]}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml ${C(a)} describe ${s}`})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Update your ",b(a)]}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml ${C(a)} update ${s}`})]})]})]})]}));L.displayName="ComponentFallbackDialog";function $e({type:s}){return e.jsx(y,{children:e.jsx("div",{className:"flex w-full flex-wrap justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-text-sm font-semibold",children:"We are working on the new Stacks experience."}),e.jsxs("p",{className:"truncate text-text-sm",children:["Meanwhile you can use the CLI to manage your ",b(s),"."]})]})})})}const _=c.createContext(null);function Be({children:s}){const[t,a]=c.useState([]);return e.jsx(_.Provider,{value:{integrations:t,setIntegrations:a},children:s})}function H(){const s=c.useContext(_);if(s===null)throw new Error("useIntegrationsContext must be used within an AuthProvider");return s}function Le({children:s,stackId:t,stackName:a}){return e.jsxs(te,{children:[e.jsx(ae,{children:s}),e.jsx(re,{className:"w-[1000px] overflow-y-auto",children:e.jsxs(Be,{children:[e.jsx(Oe,{}),e.jsx(_e,{stackId:t}),e.jsx(Ue,{name:a}),e.jsx(He,{stackId:t})]})})]})}function _e({stackId:s}){const t=f({...h.stackDetail(s)});return t.isError?null:t.isPending?e.jsx("div",{className:"p-5",children:e.jsx(u,{className:"h-6 w-full"})}):e.jsxs("div",{className:"flex items-center space-x-2 border-b border-theme-border-moderate bg-theme-surface-primary p-5",children:[e.jsx(P,{type:"square",size:"lg",children:e.jsx(z,{size:"lg",children:t.data.name[0]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"group/copybutton flex items-center gap-0.5",children:[e.jsx("p",{className:"mb-0.5 text-text-sm text-theme-text-secondary",children:t.data.id}),e.jsx(v,{copyText:t.data.id})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("h2",{className:"text-display-xs font-semibold",children:t.data.name})})]})]})}function He({stackId:s}){var n;const{setIntegrations:t}=H(),a=f({...h.stackDetail(s)});if(c.useEffect(()=>{var d;if(!a.data)return;const l=D((d=a.data.metadata)==null?void 0:d.components).map(o=>{var m;return(m=o.body)==null?void 0:m.integration}).filter(o=>!!o&&o!=="built-in"&&o!=="custom");l.length>=1&&t(o=>Array.from(new Set([...o,...l])))},[a.data]),a.isError)return null;if(a.isPending)return e.jsx("div",{className:"p-5",children:e.jsx(u,{className:"h-[300px] w-full"})});const r=D((n=a.data.metadata)==null?void 0:n.components);return e.jsx("ul",{className:"space-y-5 p-5",children:r.map(i=>e.jsx("li",{children:e.jsx(Me,{component:i})},i.id))})}function Me({component:s}){var t,a,r,n,i;return e.jsxs(ne,{className:"flex items-center justify-between p-5",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("img",{width:32,height:32,alt:`${(t=s.body)==null?void 0:t.flavor} logo`,src:De(((a=s.body)==null?void 0:a.logo_url)||"")}),e.jsxs("div",{children:[e.jsx(L,{type:((r=s.body)==null?void 0:r.type)||"orchestrator",name:s.name,children:e.jsx("button",{className:"text-text-xl",children:s.name})}),e.jsxs("div",{className:"group/copybutton flex items-center gap-0.5",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:s.id.split("-")[0]}),e.jsx(v,{copyText:s.id})]})]})]}),e.jsx(Te,{type:((n=s.body)==null?void 0:n.type)||"orchestrator",children:I(((i=s.body)==null?void 0:i.type)||"")})]})}function Ue({name:s}){const{integrations:t}=H();return e.jsx("section",{className:"px-5 pt-5",children:e.jsx(Se,{title:e.jsx("span",{className:"text-text-lg",children:"Set this stack"}),children:e.jsxs("ul",{className:"space-y-5",children:[e.jsxs("li",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{children:"1"}),e.jsx("p",{className:"font-semibold",children:"Set your stack"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Set the stack as active on your client"}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml stack set ${s}`})]})]}),t.length>=1&&e.jsxs("li",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{children:"2"}),e.jsx("p",{className:"font-semibold",children:"Install the integrations"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Install the required integrations to run pipelines in your stack"}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml integration install ${t.join(" ")}`})]})]})]})})})}function qe(){return[{id:"name",header:"Stack",accessorFn:s=>({name:s.name,id:s.id}),cell:({getValue:s})=>{const{name:t,id:a}=s();return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(P,{type:"square",size:"md",children:e.jsx(z,{size:"md",children:t[0]})}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(Le,{stackName:t,stackId:a,children:e.jsx("h2",{className:"text-text-md font-semibold",children:t})})}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:a.split("-")[0]}),e.jsx(v,{copyText:a})]})]})]})}},{id:"created",header:"Created at",accessorFn:s=>{var t;return(t=s.body)==null?void 0:t.created},cell:({getValue:s})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(ge,{dateString:s()})})},{id:"author",header:"Author",accessorFn:s=>{var t;return{author:(t=s.body)==null?void 0:t.user}},cell:({getValue:s})=>{const{author:t}=s();return t?e.jsx(Ne,{username:t.name}):null}},{id:"actions",header:"",accessorFn:s=>({name:s.name,id:s.id}),cell:({getValue:s})=>{const{id:t,name:a}=s();return e.jsx(Fe,{name:a,id:t})}}]}function We({setHasResumeableStack:s}){const{success:t,data:a}=F(),r=f({...h.stackDeploymentStack({provider:(a==null?void 0:a.provider)||"aws",stack_name:(a==null?void 0:a.stackName)||"",date_start:a==null?void 0:a.timestamp}),enabled:t,throwOnError:!0});return c.useEffect(()=>{r.data&&(Ae(),s(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(u,{className:"h-[70px] w-full"}):e.jsx(y,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(x,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(k,{to:N.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}const w=1,Qe=g.object({page:g.coerce.number().min(w).optional().default(w).catch(w),name:g.string().optional(),operator:g.enum(["and","or"]).optional()});function Ye(){const[s]=je(),{page:t,name:a,operator:r}=Qe.parse({page:s.get("page")||void 0,name:s.get("name")||void 0});return{page:t,name:a,logical_operator:r}}function Ge({setHasResumeableTerraform:s}){const{success:t,data:a}=O(),r=f({...h.stackDeploymentStack({provider:(a==null?void 0:a.provider)||"aws",stack_name:(a==null?void 0:a.stackName)||"",date_start:a==null?void 0:a.timestamp}),enabled:t,throwOnError:!0});return c.useEffect(()=>{r.data&&(Ee(),s(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(u,{className:"h-[70px] w-full"}):e.jsx(y,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(x,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(k,{to:N.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function Ke(){const[s,t]=c.useState(F().success),[a,r]=c.useState(O().success),n=Ye(),{refetch:i,data:l}=f({...h.stackList({...n,sort_by:"desc:updated"}),throwOnError:!0});return e.jsx("section",{className:"p-5",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-4",children:[e.jsx(xe,{searchParams:n}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs(x,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>i(),children:[e.jsx(me,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]}),e.jsx(x,{size:"md",asChild:!0,children:e.jsxs(k,{to:N.stacks.create.index,children:[e.jsx(de,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Stack"})]})})]})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s&&e.jsx(We,{setHasResumeableStack:t}),a&&e.jsx(Ge,{setHasResumeableTerraform:r}),e.jsx("div",{className:"w-full",children:l?e.jsx(ie,{columns:qe(),data:l.items}):e.jsx(u,{className:"h-[500px] w-full"})}),l?l.total_pages>1&&e.jsx(ue,{searchParams:n,paginate:l}):e.jsx(u,{className:"h-[36px] w-[300px]"})]})]})})}function Ts(){const{setCurrentBreadcrumbData:s}=ce(),{setTourState:t,tourState:{tourActive:a}}=le();return c.useEffect(()=>{a&&t(r=>({...r,run:!0,stepIndex:r.stepIndex}))},[a]),c.useEffect(()=>{s({segment:"stacks",data:null})},[]),e.jsxs("div",{children:[e.jsx(Ve,{}),e.jsx(Ke,{})]})}function Ve(){return e.jsx(oe,{children:e.jsx("h1",{className:"text-display-xs font-semibold",children:"Stacks"})})}export{Ts as default};
|
1
|
+
import{r as c,j as e}from"./@radix-DnFH_oo1.js";import{ai as E,aj as A,ak as P,F as q,l as M,m as U,i as W,r as N,j as Q,ab as Y,ad as G,aq as K,af as V,f as x,D as S,q as Z,s as J,V as X,ag as ee,ah as se,a1 as R,aD as b,aE as C,Y as te,Z as ae,$ as re,S as u,A as I,b as z,B as ne,z as g,G as ie,N as ce,aF as le,P as oe}from"./index-D0bJjaey.js";import{S as de}from"./plus-Bc8eLSDM.js";import{S as me}from"./refresh-hfgWPeto.js";import{S as xe,P as ue}from"./SearchField-BeF1yR7M.js";import{s as h}from"./sharedSchema-BvRWAv-c.js";import{b as he,c as pe,a as f}from"./@tanstack-QbMbTrh5.js";import{b as fe,L as k,c as je}from"./@react-router-APVeuk-U.js";import{C as v}from"./CopyButton-C_yRGWuP.js";import{D as ge}from"./DisplayDate-DkCy54Bp.js";import{I as Ne}from"./InlineAvatar-C3QXdFW1.js";import{S as ye}from"./dots-horizontal-C6K59vUm.js";import{D as we,S as be}from"./DialogItem-BCrc2wIk.js";import{S as ke}from"./trash-DUWZWzse.js";import{I as y}from"./Infobox-CC70zvGO.js";import{C as p}from"./CodeSnippet-DRy_0J4D.js";import{A as ve}from"./AlertDialogDropdownItem-BqM1UpCD.js";import{C as Se}from"./CollapsibleCard-lE-75Zob.js";import{F as Ce}from"./chevron-right-double-c9H46Kl8.js";import{e as D}from"./components-Br2ezRib.js";import{s as De}from"./url-DdWrpIhi.js";import{N as T}from"./NumberBox-CrN0_kqI.js";import{C as Te,p as F,c as Ee}from"./persist-DodaLO0k.js";import{p as O,c as Ae}from"./persist-ChKZVcn3.js";import"./@reactflow-CEC2f0cl.js";import"./index-5GJ5ysEZ.js";import"./stack-detail-query-C9XwNP1E.js";import"./layout-Dru15_XR.js";import"./rocket-SESCGQXm.js";import"./copy-CaGlDsUy.js";import"./chevron-down-Cwb-W_B_.js";const $=c.forwardRef(({closeModal:s,name:t,...a},r)=>e.jsxs(E,{...a,ref:r,children:[e.jsx(A,{children:e.jsx(P,{children:"Update Stack"})}),e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx(Pe,{action:"update"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Update a stack"}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml stack update ${t} -o NEW_ORCHESTRATOR_NAME`})]})]})]}));$.displayName="UpdateStackDialog";function Pe({action:s}){function t(){switch(s){case"delete":return"delete";case"update":return"update";case"describe":return"get details of"}}return e.jsx(y,{children:e.jsx("div",{className:"flex w-full flex-wrap justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-text-sm font-semibold",children:"We are working on the new Stacks experience."}),e.jsxs("p",{className:"truncate text-text-sm",children:["Meanwhile you can use the CLI to ",t()," your stack."]})]})})})}async function Re({stackId:s},t){const a=M(U.stacks.detail(s)),r=await fetch(a,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{}}});if(!r.ok){const n=await r.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>`Error while deleting stack ${s}`);throw new q({status:r.status,statusText:r.statusText,message:n})}return r.json()}function Ie(s){return he({...s,mutationFn:async({stackId:t})=>Re({stackId:t})})}function ze(s){const{toast:t}=W(),a=pe(),r=fe(),n=Ie({onSuccess:async()=>{a.invalidateQueries({queryKey:h.all}),r(N.stacks.overview)},onError:l=>{t({status:"error",emphasis:"subtle",icon:e.jsx(Q,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:l.message,rounded:!0})}});function i(){n.mutate({stackId:s})}return{handleDelete:i,deleteStack:n}}const B=c.forwardRef(({closeModal:s,name:t,stackId:a,...r},n)=>{const{handleDelete:i,deleteStack:l}=ze(a);return e.jsxs(Y,{...r,className:"p-0",ref:n,children:[e.jsxs(G,{className:"m-0 py-2 pl-5 pr-3 text-text-lg font-semibold",children:["Delete ",t]}),e.jsx("div",{className:"border-y border-theme-border-moderate px-5 py-5",children:e.jsxs(K,{children:["Are you sure you want to delete this stack? ",e.jsx("br",{}),"This action cannot be undone."]})}),e.jsxs("div",{className:"flex justify-end gap-3 px-5 py-3",children:[e.jsx(V,{onClick:()=>s==null?void 0:s(),asChild:!0,children:e.jsx(x,{intent:"secondary",children:"Cancel"})}),e.jsxs(x,{disabled:l.isPending,type:"button",onClick:()=>i(),intent:"danger",children:[l.isPending&&e.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-error"}),"Delete"]})]})]})});B.displayName="DeleteStackDialog";function Fe({name:s,id:t}){const[a,r]=c.useState(!1),[n,i]=c.useState(!1),l=c.useRef(null),d=c.useRef(null);function o(){d.current=l.current}function m(j){r(j),j===!1&&i(!1)}return e.jsx(S,{open:n,onOpenChange:i,children:e.jsxs(S,{children:[e.jsx(Z,{className:"z-10",ref:l,children:e.jsx(ye,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(J,{hidden:a,onCloseAutoFocus:j=>{d.current&&(d.current.focus(),d.current=null,j.preventDefault())},className:"z-10",align:"end",sideOffset:1,children:[e.jsx(we,{onSelect:o,onOpenChange:m,icon:e.jsx(be,{className:"h-3 w-3 !fill-neutral-400"}),triggerChildren:"Update",children:e.jsx($,{name:s,className:"lg:min-w-[600px]",closeModal:()=>m(!1)})}),e.jsx(ve,{onSelect:o,onOpenChange:m,icon:e.jsx(ke,{className:"h-3 w-3 !fill-neutral-400"}),triggerChildren:"Delete",children:e.jsx(B,{stackId:t,name:s,className:"lg:min-w-[600px]",closeModal:()=>m(!1)})})]})]})})}function Oe(){return e.jsx("div",{className:"flex h-9 items-center border-b border-theme-border-moderate bg-theme-surface-primary px-4 py-3",children:e.jsxs(X,{className:"focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(Ce,{className:"h-5 w-5 fill-neutral-500"}),e.jsx("span",{className:"sr-only",children:"Close"})]})})}const L=c.forwardRef(({name:s,children:t,type:a,...r},n)=>e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:t}),e.jsxs(E,{className:"w-fit max-w-fit",...r,ref:n,children:[e.jsx(A,{children:e.jsx(P,{children:R(a||"")})}),e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx($e,{type:a}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Describe your ",b(a)]}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml ${C(a)} describe ${s}`})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Update your ",b(a)]}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml ${C(a)} update ${s}`})]})]})]})]}));L.displayName="ComponentFallbackDialog";function $e({type:s}){return e.jsx(y,{children:e.jsx("div",{className:"flex w-full flex-wrap justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-text-sm font-semibold",children:"We are working on the new Stacks experience."}),e.jsxs("p",{className:"truncate text-text-sm",children:["Meanwhile you can use the CLI to manage your ",b(s),"."]})]})})})}const _=c.createContext(null);function Be({children:s}){const[t,a]=c.useState([]);return e.jsx(_.Provider,{value:{integrations:t,setIntegrations:a},children:s})}function H(){const s=c.useContext(_);if(s===null)throw new Error("useIntegrationsContext must be used within an AuthProvider");return s}function Le({children:s,stackId:t,stackName:a}){return e.jsxs(te,{children:[e.jsx(ae,{children:s}),e.jsx(re,{className:"w-[1000px] overflow-y-auto",children:e.jsxs(Be,{children:[e.jsx(Oe,{}),e.jsx(_e,{stackId:t}),e.jsx(Me,{name:a}),e.jsx(He,{stackId:t})]})})]})}function _e({stackId:s}){const t=f({...h.stackDetail(s)});return t.isError?null:t.isPending?e.jsx("div",{className:"p-5",children:e.jsx(u,{className:"h-6 w-full"})}):e.jsxs("div",{className:"flex items-center space-x-2 border-b border-theme-border-moderate bg-theme-surface-primary p-5",children:[e.jsx(I,{type:"square",size:"lg",children:e.jsx(z,{size:"lg",children:t.data.name[0]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"group/copybutton flex items-center gap-0.5",children:[e.jsx("p",{className:"mb-0.5 text-text-sm text-theme-text-secondary",children:t.data.id}),e.jsx(v,{copyText:t.data.id})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("h2",{className:"text-display-xs font-semibold",children:t.data.name})})]})]})}function He({stackId:s}){var n;const{setIntegrations:t}=H(),a=f({...h.stackDetail(s)});if(c.useEffect(()=>{var d;if(!a.data)return;const l=D((d=a.data.metadata)==null?void 0:d.components).map(o=>{var m;return(m=o.body)==null?void 0:m.integration}).filter(o=>!!o&&o!=="built-in"&&o!=="custom");l.length>=1&&t(o=>Array.from(new Set([...o,...l])))},[a.data]),a.isError)return null;if(a.isPending)return e.jsx("div",{className:"p-5",children:e.jsx(u,{className:"h-[300px] w-full"})});const r=D((n=a.data.metadata)==null?void 0:n.components);return e.jsx("ul",{className:"space-y-5 p-5",children:r.map(i=>e.jsx("li",{children:e.jsx(qe,{component:i})},i.id))})}function qe({component:s}){var t,a,r,n,i;return e.jsxs(ne,{className:"flex items-center justify-between p-5",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("img",{width:32,height:32,alt:`${(t=s.body)==null?void 0:t.flavor} logo`,src:De(((a=s.body)==null?void 0:a.logo_url)||"")}),e.jsxs("div",{children:[e.jsx(L,{type:((r=s.body)==null?void 0:r.type)||"orchestrator",name:s.name,children:e.jsx("button",{className:"text-text-xl",children:s.name})}),e.jsxs("div",{className:"group/copybutton flex items-center gap-0.5",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:s.id.split("-")[0]}),e.jsx(v,{copyText:s.id})]})]})]}),e.jsx(Te,{type:((n=s.body)==null?void 0:n.type)||"orchestrator",children:R(((i=s.body)==null?void 0:i.type)||"")})]})}function Me({name:s}){const{integrations:t}=H();return e.jsx("section",{className:"px-5 pt-5",children:e.jsx(Se,{title:e.jsx("span",{className:"text-text-lg",children:"Set this stack"}),children:e.jsxs("ul",{className:"space-y-5",children:[e.jsxs("li",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{children:"1"}),e.jsx("p",{className:"font-semibold",children:"Set your stack"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Set the stack as active on your client"}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml stack set ${s}`})]})]}),t.length>=1&&e.jsxs("li",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{children:"2"}),e.jsx("p",{className:"font-semibold",children:"Install the integrations"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Install the required integrations to run pipelines in your stack"}),e.jsx(p,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml integration install ${t.join(" ")}`})]})]})]})})})}function Ue(){return[{id:"name",header:"Stack",accessorFn:s=>({name:s.name,id:s.id}),cell:({getValue:s})=>{const{name:t,id:a}=s();return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(I,{type:"square",size:"md",children:e.jsx(z,{size:"md",children:t[0]})}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(Le,{stackName:t,stackId:a,children:e.jsx("h2",{className:"text-text-md font-semibold",children:t})})}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:a.split("-")[0]}),e.jsx(v,{copyText:a})]})]})]})}},{id:"created",header:"Created at",accessorFn:s=>{var t;return(t=s.body)==null?void 0:t.created},cell:({getValue:s})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(ge,{dateString:s()})})},{id:"author",header:"Author",accessorFn:s=>{var t;return{author:(t=s.body)==null?void 0:t.user}},cell:({getValue:s})=>{const{author:t}=s();return t?e.jsx(Ne,{username:t.name}):null}},{id:"actions",header:"",accessorFn:s=>({name:s.name,id:s.id}),cell:({getValue:s})=>{const{id:t,name:a}=s();return e.jsx(Fe,{name:a,id:t})}}]}function We({setHasResumeableStack:s}){const{success:t,data:a}=F(),r=f({...h.stackDeploymentStack({provider:(a==null?void 0:a.provider)||"aws",stack_name:(a==null?void 0:a.stackName)||"",date_start:a==null?void 0:a.timestamp}),enabled:t,throwOnError:!0});return c.useEffect(()=>{r.data&&(Ee(),s(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(u,{className:"h-[70px] w-full"}):e.jsx(y,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(x,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(k,{to:N.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}const w=1,Qe=g.object({page:g.coerce.number().min(w).optional().default(w).catch(w),name:g.string().optional(),operator:g.enum(["and","or"]).optional()});function Ye(){const[s]=je(),{page:t,name:a,operator:r}=Qe.parse({page:s.get("page")||void 0,name:s.get("name")||void 0});return{page:t,name:a,logical_operator:r}}function Ge({setHasResumeableTerraform:s}){const{success:t,data:a}=O(),r=f({...h.stackDeploymentStack({provider:(a==null?void 0:a.provider)||"aws",stack_name:(a==null?void 0:a.stackName)||"",date_start:a==null?void 0:a.timestamp}),enabled:t,throwOnError:!0});return c.useEffect(()=>{r.data&&(Ae(),s(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(u,{className:"h-[70px] w-full"}):e.jsx(y,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(x,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(k,{to:N.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function Ke(){const[s,t]=c.useState(F().success),[a,r]=c.useState(O().success),n=Ye(),{refetch:i,data:l}=f({...h.stackList({...n,sort_by:"desc:updated"}),throwOnError:!0});return e.jsx("section",{className:"p-5",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-4",children:[e.jsx(xe,{searchParams:n}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs(x,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>i(),children:[e.jsx(me,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]}),e.jsx(x,{size:"md",asChild:!0,children:e.jsxs(k,{to:N.stacks.create.index,children:[e.jsx(de,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Stack"})]})})]})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s&&e.jsx(We,{setHasResumeableStack:t}),a&&e.jsx(Ge,{setHasResumeableTerraform:r}),e.jsx("div",{className:"w-full",children:l?e.jsx(ie,{columns:Ue(),data:l.items}):e.jsx(u,{className:"h-[500px] w-full"})}),l?l.total_pages>1&&e.jsx(ue,{searchParams:n,paginate:l}):e.jsx(u,{className:"h-[36px] w-[300px]"})]})]})})}function Ts(){const{setCurrentBreadcrumbData:s}=ce(),{setTourState:t,tourState:{tourActive:a}}=le();return c.useEffect(()=>{a&&t(r=>({...r,run:!0,stepIndex:r.stepIndex}))},[a]),c.useEffect(()=>{s({segment:"stacks",data:null})},[]),e.jsxs("div",{children:[e.jsx(Ve,{}),e.jsx(Ke,{})]})}function Ve(){return e.jsx(oe,{children:e.jsx("h1",{className:"text-display-xs font-semibold",children:"Stacks"})})}export{Ts as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as d,j as e,aw as N,ax as B,ay as V,az as Z}from"./@radix-DnFH_oo1.js";import{l as q,m as H,k as K,n as G,F as W,ag as J,ah as X,ai as Y,aj as ee,ak as te,a1 as x,aE as se,z as l,T as re,v as ae,w as ne,W as oe,x as ie,I as E,U as ce,f as k,aD as le,r as O,i as de,j as me,Q as pe}from"./index-D0bJjaey.js";import{b as m,C as ue,u as he,F as xe}from"./index.esm-BE1uqCX5.js";import{i as fe,h as ge,j as je,a as ke,c as ye}from"./@tanstack-QbMbTrh5.js";import{o as be,s as ve}from"./url-DdWrpIhi.js";import{d as Ne}from"./index-5GJ5ysEZ.js";import{R as we,a as Se,u as Ce}from"./create-stack-BfgeXFuV.js";import{C as Le}from"./CodeSnippet-DRy_0J4D.js";import{a as _e,C as P,s as Te}from"./sharedSchema-BvRWAv-c.js";import{D as ze}from"./DisplayDate-DkCy54Bp.js";import{I as Fe}from"./InlineAvatar-C3QXdFW1.js";import{S as Me}from"./check-circle-DOoS4yhF.js";import{L as Ie,b as Ae}from"./@react-router-APVeuk-U.js";import{w as De}from"./index-CLT4K7oC.js";import{t as $e}from"./zod-uFd1wBcd.js";import"./@reactflow-CEC2f0cl.js";import"./copy-CaGlDsUy.js";import"./stack-detail-query-C9XwNP1E.js";import"./layout-Dru15_XR.js";import"./rocket-SESCGQXm.js";async function Ee(t){const s=q(H.components.all)+(t?`?${be(t)}`:""),r=await K(s,{method:"GET",headers:{"Content-Type":"application/json"}});if(r.status===404&&G(),!r.ok){const n=await r.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching stack components");throw new W({status:r.status,statusText:r.statusText,message:n})}return r.json()}const Q={all:["components"],componentListInfinite:t=>fe({queryKey:[...Q.all,t],queryFn:async({pageParam:s})=>Ee({...t,page:s}),getNextPageParam:s=>s.index<s.total_pages?s.index+1:null,initialPageParam:1})},R=d.forwardRef(({closeModal:t,type:s,children:r,...n},o)=>e.jsxs(J,{children:[e.jsx(X,{asChild:!0,children:r}),e.jsxs(Y,{className:"max-w-2xl",...n,ref:o,children:[e.jsx(ee,{children:e.jsx(te,{children:"Create New "})}),e.jsx("div",{className:"space-y-5 overflow-auto p-7",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Create a new ",x(s)]}),e.jsx(Le,{codeClasses:"whitespace-pre-wrap",wrap:!0,code:`zenml ${se(s)} register ${s.toUpperCase()}_NAME --flavor=${s.toUpperCase()}_FLAVOR [--${s.toUpperCase()}_OPTIONS]`})]})})]})]}));R.displayName="UpdateStackDialog";const b=["orchestrator","artifact_store","container_registry","step_operator","model_deployer","feature_store","experiment_tracker","alerter","annotator","data_validator","image_builder","model_registry"],y=l.object({id:l.string().trim().min(1),name:l.string().trim().min(1),logoUrl:l.string().trim().min(1)}),Oe=b.reduce((t,s)=>(t[s]=y.nullable(),t),{}),Pe=l.object({stackName:_e,components:l.object({...Oe,orchestrator:y,artifact_store:y})}),w={helpLink:"https://docs.zenml.io/stack-components/orchestrators",description:"An orchestrator is a special kind of backend that manages the running of each step of the pipeline. Orchestrators administer the actual pipeline runs. By default, ZenML initializes your repository with an orchestrator that runs everything on your local machine."},S={helpLink:"https://docs.zenml.io/stack-components/artifact-stores",description:"The Artifact Store is a central component in any MLOps stack. As the name suggests, it acts as a data persistence layer where artifacts (e.g. datasets, models) ingested or generated by the machine learning pipelines are stored."},C={helpLink:"https://docs.zenml.io/stack-components/container-registries",description:"Container registry is used to store container images that are built to run machine learning pipelines in remote environments. Containerization of the pipeline code creates a portable environment that allows code to run in an isolated manner."},L={description:"Step operators allow you to run individual steps in a custom environment different from the default one used by your active orchestrator.",helpLink:"https://docs.zenml.io/stack-components/step-operators"},_={description:"Model deployers are stack components responsible for online model serving. They are responsible for deploying models to a remote server. Model deployers also act as a registry for models that are served with ZenML.",helpLink:"https://docs.zenml.io/stack-components/model-deployers"},T={description:"ZenML supports connecting to a Redis-backed Feast feature store as a stack component integration.",helpLink:"https://docs.zenml.io/stack-components/feature-stores"},z={description:"Experiment trackers let you track your ML experiments by logging the parameters and allowing you to compare between different runs.",helpLink:"https://docs.zenml.io/stack-components/experiment-trackers"},F={description:"Alerters allow you to send messages to chat services (like Slack, Discord, Mattermost, etc.) from within your pipelines. This is useful to immediately get notified when failures happen, for general monitoring/reporting, and also for building human-in-the-loop ML.",helpLink:"https://docs.zenml.io/stack-components/alerters "},M={description:"Annotators are a stack component that enables the use of data annotation as part of your ZenML stack and pipelines.",helpLink:"https://docs.zenml.io/stack-components/annotators"},I={description:"Data Validators used in ZenML pipelines usually generate data profiles and data quality check reports that are versioned and stored in the Artifact Store and can be retrieved and visualized later.",helpLink:"https://docs.zenml.io/stack-components/data-validators"},A={description:"The image builder is an essential part of most remote MLOps stacks. It is used to build container images such that your machine-learning pipelines and steps can be executed in remote environments.",helpLink:"https://docs.zenml.io/stack-components/image-builders"},D={description:"Model registries are centralized storage solutions for managing and tracking machine learning models across various stages of development and deployment.",helpLink:"https://docs.zenml.io/stack-components/model-registries"};function Qe({type:t}){const{description:s,link:r}=Re(t);return e.jsx(re,{children:e.jsxs(ae,{delayDuration:200,children:[e.jsxs(ne,{children:[e.jsx(oe,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsxs("div",{className:"sr-only",children:["Info for ",t]})]}),e.jsxs(ie,{align:"start",side:"bottom",className:"flex max-w-xl flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:s}),e.jsx("a",{className:"link mt-2 text-primary-400",target:"_blank",href:r,children:"Learn more"})]})]})})}function Re(t){switch(t){case"orchestrator":return{description:w.description,link:w.helpLink};case"alerter":return{description:F.description,link:F.helpLink};case"annotator":return{description:M.description,link:M.helpLink};case"artifact_store":return{description:S.description,link:S.helpLink};case"container_registry":return{description:C.description,link:C.helpLink};case"data_validator":return{description:I.description,link:I.helpLink};case"experiment_tracker":return{description:z.description,link:z.helpLink};case"feature_store":return{description:T.description,link:T.helpLink};case"image_builder":return{description:A.description,link:A.helpLink};case"model_deployer":return{description:_.description,link:_.helpLink};case"model_registry":return{description:D.description,link:D.helpLink};case"step_operator":return{description:L.description,link:L.helpLink}}}function Ue(){return e.jsxs(e.Fragment,{children:[b.map(t=>e.jsx(N,{className:"h-full space-y-5 p-5",value:t,children:e.jsx(Ze,{type:t})},t)),e.jsx(N,{className:"h-full",value:"",children:e.jsx("div",{className:"flex h-full w-full items-center justify-center text-theme-text-tertiary",children:"Select a category to add a new component"})})]})}function Be({type:t,search:s}){const r=ge({...Q.componentListInfinite({sort_by:"desc:updated",type:t,...s?{name:`contains:${s}`}:{}})}),{control:n,watch:o,setValue:c}=m();return r.isError?e.jsx("p",{children:"Error while fetching Components"}):r.isPending?e.jsx("div",{className:"flex w-full flex-1 items-center justify-center",children:e.jsx(ce,{})}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("ul",{className:"space-y-1",children:r.data.pages.map(i=>i.items.map(a=>e.jsx("li",{children:e.jsx(ue,{name:`components.${t}.id`,control:n,render:({field:{onChange:g,...j}})=>{var p,u,f,h;return e.jsxs(we,{className:"justify-between bg-theme-surface-primary font-medium","data-state":o(`components.${t}.id`)===a.id?"selected":"unselected",htmlFor:a.id,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Se,{...j,id:a.id,type:"radio",value:a.id,onChange:U=>{var v;c(`components.${t}.name`,a.name),c(`components.${t}.logoUrl`,((v=a.body)==null?void 0:v.logo_url)||""),g(U)},checked:o(`components.${t}.id`)===a.id,name:t}),e.jsx("img",{alt:"flavor icon",src:ve(((p=a.body)==null?void 0:p.logo_url)||""),width:24,height:24}),e.jsxs("div",{className:"min-w-0 truncate",children:[e.jsx("div",{className:"truncate font-semibold",children:a.name}),e.jsx("div",{className:"truncate text-text-xs text-theme-text-secondary",children:a.id.split("-")[0]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-text-sm",children:[((f=(u=a.body)==null?void 0:u.user)==null?void 0:f.name)&&e.jsx(Fe,{username:a.body.user.name}),((h=a.body)==null?void 0:h.updated)&&e.jsx("div",{className:"whitespace-nowrap text-theme-text-secondary",children:e.jsx(ze,{short:!0,dateString:a.body.updated})})]})]})}})},a.id)))}),e.jsx(He,{type:t}),r.hasNextPage&&e.jsx(k,{onClick:()=>r.fetchNextPage(),type:"button",size:"md",intent:"secondary",emphasis:"subtle",className:"flex w-full items-center justify-center bg-theme-surface-primary",children:e.jsxs("div",{className:"flex items-center gap-1",children:[r.isFetchingNextPage&&e.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"}),"Load more"]})})]})}function Ve({type:t}){return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"h-5 w-5 fill-primary-400",type:t}),e.jsx("h2",{className:"text-text-lg font-semibold",children:x(t)}),e.jsx(Qe,{type:t})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Select a existing ",le(t)," from your server:"]})]})}function Ze({type:t}){const[s,r]=d.useState("");return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{type:t}),e.jsx(qe,{search:s,setSearch:r}),e.jsx(Be,{search:s,type:t})]})}function qe({setSearch:t,search:s}){const[r,n]=d.useState(s),o=d.useCallback(Ne(t,500),[]);d.useEffect(()=>()=>{o.cancel()},[o]);function c(i){n(i),o(i)}return e.jsx(E,{value:r,onChange:i=>c(i.target.value),placeholder:"Search..."})}function He({type:t}){return e.jsx(R,{type:t,children:e.jsxs("button",{className:"w-full rounded-md border border-dashed border-neutral-300 bg-theme-surface-tertiary py-5 text-theme-text-secondary",children:["New ",x(t)]})})}function Ke({type:t}){const{watch:s,formState:{errors:r}}=m(),n=s(`components.${t}`),o=n&&n.id;return e.jsx("div",{"data-error":!o&&r.components&&r.components[t]?"true":"false","data-filled":o?"true":"false",className:"flex h-[110px] flex-col items-center justify-center space-y-2 truncate whitespace-nowrap rounded-md border border-theme-border-moderate bg-theme-surface-secondary py-5 text-center text-text-sm text-theme-text-secondary transition-all duration-150 hover:bg-theme-surface-primary hover:shadow-sm data-[error=true]:border-theme-text-error data-[filled=true]:border-success-400 data-[filled=true]:bg-theme-surface-primary data-[state=active]:bg-theme-surface-primary group-data-[state=active]/trigger:bg-theme-surface-primary group-data-[state=active]/trigger:shadow-md data-[error=false]:data-[filled=false]:group-data-[state=active]/trigger:border-theme-border-bold",children:o?e.jsx(Ge,{type:t}):e.jsx(We,{type:t})})}function Ge({type:t}){const{watch:s}=m(),r=s(`components.${t}`);return r&&r.id?e.jsxs("div",{className:"flex flex-col items-center gap-2 text-text-sm",children:[e.jsx("img",{width:24,height:24,src:r.logoUrl,alt:`Icon of ${r.name}`}),e.jsxs("div",{className:"space-y-0.25",children:[e.jsx("div",{className:"text-theme-text-primary",children:r.name}),e.jsx("div",{className:"text-text-xs text-theme-text-tertiary",children:x(t)})]})]}):null}function We({type:t}){return e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong",type:t}),e.jsx("span",{children:x(t)})]})}function Je(){return e.jsxs("div",{className:"flex h-full flex-col justify-between space-y-5",children:[e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsx(et,{}),e.jsx(Xe,{})]}),e.jsx(Ye,{})]})}function Xe(){const{watch:t,resetField:s}=m();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:"Add Components"}),e.jsxs("p",{className:"text-theme-text-secondary",children:["All stacks have at minimum an orchestrator and an artifact store."," ",e.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.zenml.io/stack-components/component-guide",className:"link text-primary-400",children:"Learn more"})]})]}),e.jsx(B,{children:e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:b.map(r=>e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"group/trigger w-full",value:r,children:e.jsx(Ke,{type:r})}),t(`components.${r}.id`)&&e.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),s(`components.${r}`)},className:"absolute right-[-12px] top-[-12px] flex aspect-square h-[28px] w-[28px] items-center justify-center rounded-rounded bg-theme-surface-primary",children:e.jsx(Me,{className:"h-5 w-5 shrink-0 fill-success-400"})})]},r))})})]})}function Ye(){const{formState:{isSubmitting:t}}=m(),s=!!je();return e.jsxs("div",{className:"flex items-center justify-end space-x-2 border-t border-theme-border-moderate p-5",children:[e.jsx(k,{asChild:!0,intent:"secondary",size:"md",children:e.jsx(Ie,{to:O.stacks.create.index,children:"Cancel"})}),e.jsxs(k,{className:"flex items-center gap-1",disabled:t||s,size:"md",children:[(s||t)&&e.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"}),"Register Stack"]})]})}function et(){var r;const{register:t,formState:{errors:s}}=m();return e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-text-sm",htmlFor:"stack-name",children:"Stack Name"}),e.jsx(E,{id:"stack-name",className:`${s.stackName?"border-red-500":""} w-full`,placeholder:"zenml-stack",...t("stackName")}),s.stackName&&e.jsx("p",{className:"text-text-xs text-red-500",children:(r=s.stackName.message)==null?void 0:r.toString()})]})}function tt(){const t=ke({...De.workspaceDetail("default")}),{toast:s}=de(),r=Ae(),n=ye(),o=Ce({onSuccess:async()=>{n.invalidateQueries({queryKey:Te.all}),r(O.stacks.overview)},onError:a=>{s({status:"error",emphasis:"subtle",icon:e.jsx(me,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:a.message,rounded:!0})}});function c(a){var p;const g=Object.entries(a.components).reduce((u,[f,h])=>(h&&(u[f]=[h.id]),u),{}),j={name:a.stackName,components:g};o.mutate({workspaceId:((p=t.data)==null?void 0:p.id)||"",payload:j})}const i=he({resolver:$e(Pe),defaultValues:{components:{alerter:null,orchestrator:{},annotator:null,artifact_store:{},container_registry:null,data_validator:null,experiment_tracker:null,feature_store:null,model_registry:null,image_builder:null,model_deployer:null,step_operator:null},stackName:""}});return{createManualStack:c,form:i}}function vt(){const[t,s]=d.useState(""),{createManualStack:r,form:n}=tt();return e.jsx(xe,{...n,children:e.jsx(Z,{value:t,onValueChange:s,className:"h-full",children:e.jsxs("form",{onSubmit:n.handleSubmit(r),className:"flex h-[calc(100vh_-_4rem_-_4rem_-_2px)] flex-1 flex-col divide-y divide-theme-border-moderate xl:flex-row-reverse xl:divide-x xl:divide-y-0 xl:divide-x-reverse",children:[e.jsx($,{className:"h-full flex-1 bg-theme-surface-primary",children:e.jsx(Je,{})}),e.jsx($,{children:e.jsx(Ue,{})})]})})})}function $({className:t,...s}){return e.jsx("div",{className:pe("w-full overflow-y-auto xl:w-1/2",t),...s})}export{vt as default};
|