import{a as A}from"./asyncComputed.bdf01236.js";import{d as _,e as I,ei as B,f,c as C,w as a,u as e,o as g,b as t,ax as s,d5 as h,d3 as P,d4 as u,a as m,e6 as b,cs as D,bD as E,cr as F,e7 as T,W as x,R as N}from"./vue-router.2175af64.js";import"./gateway.9e5b6772.js";import{P as j}from"./project.81bc4bf8.js";import"./tables.d1c9cde2.js";import{S as R}from"./SaveButton.af01b96f.js";import{a as v}from"./router.3b8aa58b.js";import{A as U}from"./index.0d626be8.js";import"./popupNotifcation.906a72f4.js";import"./record.702887f1.js";import"./string.091ba4d2.js";import"./ExclamationCircleOutlined.1f0dc6e9.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="0562f537-7b5c-4701-b3c6-6960e5bfd0f2",n._sentryDebugIdIdentifier="sentry-dbid-0562f537-7b5c-4701-b3c6-6960e5bfd0f2")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),i=B.exports.debounce(async()=>{try{const{available:l}=await r.project.checkSubdomain();o.value=l?"available":"unavailable"}catch{o.value=void 0}},500);function d(){r.project.subdomain?(o.value="loading",i()):o.value="invalid"}const c=f(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),y=f(()=>{switch(o.value){case"loading":return"Checking availability...";case"available":return"Available";case"unavailable":return"Unavailable";case"invalid":return"Invalid subdomain";default:return}}),k=()=>{r.project.subdomain=j.formatSubdomain(r.project.subdomain),d()};function w(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),C(e(U),{direction:"vertical"},{default:a(()=>[t(e(h),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(P),null,{default:a(()=>[s(" Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ")]),_:1}),t(e(v),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[m("span",null,b(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(v),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[m("span",null,b(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(F),null,{default:a(()=>[t(e(D),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(E),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=S=>l.project.subdomain=S),type:"text",loading:o.value==="loading",onBlur:k},{addonBefore:a(()=>[s("https://")]),addonAfter:a(()=>[s(".abstra.app")]),_:1},8,["value","loading"])]),_:1},8,["validate-status","help"]),t(R,{model:l.project,disabled:o.value!=="available",onError:w},null,8,["model","disabled"])]),_:1})]),_:1}))}}),H={key:0,class:"project-settings"},Y=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:i}=A(()=>j.get(o));return(d,c)=>e(i)?(g(),x("div",H,[t(e(h),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(i)},null,8,["project"])])):N("",!0)}});export{Y as default};
//# sourceMappingURL=ProjectSettings.238ccfdd.js.map
