import{a as S}from"./asyncComputed.41e37f4b.js";import{a as m}from"./router.2687a12c.js";import{d as _,r as I,eN as B,H as f,b as g,c as C,w as a,u as e,f as t,ar as s,e as b,eD as v,bz as E,cE as P,eB as T,ev as D,ex as F}from"./outputWidgets.3c3deba7.js";import"./index.79fda194.js";import{P as h}from"./project.a7f8dc6e.js";import{_ as N}from"./SaveButton.vue_vue_type_script_setup_true_lang.8ae419ac.js";import{A as j}from"./Title.ee2bfa7b.js";import{A as x}from"./Paragraph.d0a77c93.js";import{A as i}from"./Text.9ff37267.js";import{A as H,F as U}from"./Form.21b032af.js";import"./index.cf4c23b9.js";import"./record.e2163ce9.js";import"./pubsub.59f66cb7.js";import"./Base.c0a62eaa.js";import"./Typography.828881b4.js";import"./hasIn.26cab181.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]="7dfd0bcd-02b1-425d-b164-db8cedf521fa",n._sentryDebugIdIdentifier="sentry-dbid-7dfd0bcd-02b1-425d-b164-db8cedf521fa")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),d=B.exports.debounce(async()=>{try{const{available:l}=await r.project.checkSubdomain();o.value=l?"available":"unavailable"}catch{o.value=void 0}},500);function u(){r.project.subdomain?(o.value="loading",d()):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=h.formatSubdomain(r.project.subdomain),u()};function A(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),C(e(P),{direction:"vertical"},{default:a(()=>[t(e(j),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(x),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(m),null,{default:a(()=>[t(e(i),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(i),{code:""},{default:a(()=>[b("span",null,v(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(m),null,{default:a(()=>[t(e(i),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(i),{code:""},{default:a(()=>[b("span",null,v(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(U),null,{default:a(()=>[t(e(H),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(E),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=w=>l.project.subdomain=w),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(N,{model:l.project,disabled:o.value!=="available",onError:A},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},te=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:d}=S(()=>h.get(o));return(u,c)=>e(d)?(g(),D("div",R,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(d)},null,8,["project"])])):F("",!0)}});export{te as default};
//# sourceMappingURL=ProjectSettings.c08e373e.js.map
