import{a as S}from"./asyncComputed.317e87c5.js";import{a as m}from"./router.ef5c7692.js";import{d as _,r as I,eM as C,H as f,b as g,c as P,w as a,u as e,f as t,aq as s,e as b,eD as v,bx as B,cC as D,eA as E,eu as F,ew as T}from"./outputWidgets.3681a2a5.js";import"./index.63f126f8.js";import{P as h}from"./project.8bd8a1e2.js";import{_ as x}from"./SaveButton.vue_vue_type_script_setup_true_lang.ac0c3f5b.js";import{A as j}from"./Title.142e78f1.js";import{A as H}from"./Paragraph.326f3875.js";import{A as d}from"./Text.1bf2a6e4.js";import{A as N,F as U}from"./Form.c15ea82d.js";import"./popupNotifcation.d8032226.js";import"./index.cf4c23b9.js";import"./record.220fa006.js";import"./pubsub.916b1e4d.js";import"./hasIn.127ddf2a.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]="314d2d77-a6fd-44fa-9b5d-a202a7fb9335",n._sentryDebugIdIdentifier="sentry-dbid-314d2d77-a6fd-44fa-9b5d-a202a7fb9335")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),i=C.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",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}}),A=()=>{r.project.subdomain=h.formatSubdomain(r.project.subdomain),u()};function k(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),P(e(D),{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(m),null,{default:a(()=>[t(e(d),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(d),{code:""},{default:a(()=>[b("span",null,v(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(m),null,{default:a(()=>[t(e(d),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(d),{code:""},{default:a(()=>[b("span",null,v(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(B),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=w=>l.project.subdomain=w),type:"text",loading:o.value==="loading",onBlur:A},{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:k},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},ae=_({__name:"ProjectSettings",setup(n){const o=E().params.projectId,{result:i}=S(()=>h.get(o));return(u,c)=>e(i)?(g(),F("div",R,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(i)},null,8,["project"])])):T("",!0)}});export{ae as default};
//# sourceMappingURL=ProjectSettings.a8234d71.js.map
