import{a as S}from"./asyncComputed.a16c4c65.js";import{a as f}from"./router.e51f5f97.js";import{d as _,r as I,eM as B,H as m,b as g,c as C,w as a,u as e,f as t,ar as s,e as v,eD as b,bz as E,cE as P,eB as T,ev as D,ex as F}from"./outputWidgets.25dce6ef.js";import"./index.9de01bc6.js";import{P as h}from"./project.568c17db.js";import{_ as x}from"./SaveButton.vue_vue_type_script_setup_true_lang.9d899b87.js";import{A as j}from"./Title.83602e90.js";import{A as H}from"./Paragraph.fadf37c7.js";import{A as u}from"./Text.b67c302b.js";import{A as N,F as U}from"./Form.3655a4e5.js";import"./popupNotifcation.c74dae43.js";import"./index.cf4c23b9.js";import"./record.7f3a448e.js";import"./pubsub.d8283e38.js";import"./Base.fa280ef3.js";import"./Typography.339a5435.js";import"./hasIn.e0d864a0.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]="2830ff96-0ff4-416f-a86d-f7453e717563",n._sentryDebugIdIdentifier="sentry-dbid-2830ff96-0ff4-416f-a86d-f7453e717563")}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=m(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),y=m(()=>{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),d()};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(H),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(f),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[v("span",null,b(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(f),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[v("span",null,b(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(U),null,{default:a(()=>[t(e(N),{"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(x,{model:l.project,disabled:o.value!=="available",onError:A},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},oe=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:i}=S(()=>h.get(o));return(d,c)=>e(i)?(g(),D("div",R,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(i)},null,8,["project"])])):F("",!0)}});export{oe as default};
//# sourceMappingURL=ProjectSettings.169787c4.js.map
