import{a as S}from"./asyncComputed.d00a688c.js";import{P as I}from"./project.d55020ea.js";import"./gateway.aefff1da.js";import{d as f,v as C,b as n,c,x as t,e as l,z as r,U as a,N as p,D as _,t as x,a as D,O as v,Q as g,q as y,J as E}from"./registerWidgets.60bba559.js";import"./index.320037c9.js";import{s as P}from"./index.7e7f8bb2.js";import{L as N}from"./CircularLoading.0edb8bc0.js";import{N as B,e as A,O as V}from"./icons.86798a2e.js";import"./activeRecord.5794d4d2.js";import"./pubsub.6df2423b.js";import"./passwordlessManager.e1b568b1.js";import"./lottie.fd5d7b21.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="e01b35c4-cc3f-4db0-bdf2-bb19fde69278",s._sentryDebugIdIdentifier="sentry-dbid-e01b35c4-cc3f-4db0-bdf2-bb19fde69278")}catch{}})();const i=s=>(v("data-v-263381f5"),s=s(),g(),s),$={class:"subdomain-editor"},H={class:"title"},L=i(()=>t("div",{class:"subtitle"}," Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ",-1)),O={key:0,class:"subdomain-presenter"},T={class:"link-item"},z=i(()=>t("div",{class:"link-title"},"Forms and Dashes available at:",-1)),R={class:"link"},U={class:"custom-subdomain"},q={class:"link-item"},F=i(()=>t("div",{class:"link-title"},"Hooks available at:",-1)),J={class:"link"},M={class:"custom-subdomain"},Q={key:1,class:"subdomain-value-editor"},G={class:"subdomain-change-warning"},K={class:"section-title"},W=i(()=>t("div",{class:"section-body"}," Changing the project's subdomain will result in the replacement of the previous URL, which may break any links you've shared previously. ",-1)),X={class:"input-section"},Y={class:"subdomain-value-input"},Z=i(()=>t("span",null,"https://",-1)),tt=["value"],et=i(()=>t("span",null,".abstra.app",-1)),st={key:0,class:"error"},ot={class:"option-buttons"},at=f({__name:"SubdomainEditor",props:{project:null},setup(s){const o=s,e=C({name:o.project.subdomain,error:"",editing:!1,loading:!1}),d=()=>e.editing=!0,m=()=>{k(),e.editing=!1,e.error=""},h=async()=>{e.error="",e.loading=!0,await j(),e.error||(e.editing=!1),e.loading=!1},j=async()=>{if(!(!o.project||o.project.subdomain===e.name)){if(!e.name){e.error="Subdomain cannot be empty";return}o.project.subdomain=e.name,await o.project.save()}},k=()=>e.name=o.project.subdomain,w=b=>{e.name=P(b.target.value,{replacement:"-",lower:!0,strict:!0})};return(b,lt)=>{const u=D("icon");return n(),c("div",$,[t("h2",H,[l(u,{width:"22",height:"22",path:r(B),fill:"#414A58"},null,8,["path"]),a("Subdomain ")]),L,e.editing?(n(),c("div",Q,[t("div",G,[t("div",K,[l(u,{path:r(A),width:"12",height:"12",fill:"#D35249"},null,8,["path"]),a(" Be careful ")]),W]),t("div",X,[t("div",Y,[Z,t("input",{value:e.name,type:"text",onInput:w},null,40,tt),et]),e.error?(n(),c("div",st,[l(u,{path:r(V),fill:"#D35249",width:"12",height:"12"},null,8,["path"]),a(" "+p(e.error),1)])):_("",!0),t("div",ot,[t("button",{class:"cancel-button",onClick:m},"Cancel"),t("button",{class:"save-button",onClick:h},[a(" Save Changes "),e.loading?(n(),x(N,{key:0,size:"16"})):_("",!0)])])])])):(n(),c("div",O,[t("div",T,[z,t("div",R,[a(" https://"),t("span",U,p(s.project.subdomain),1),a(".abstra.app/[PATH] ")])]),t("div",q,[F,t("div",J,[a(" https://"),t("span",M,p(s.project.subdomain),1),a(".abstra.app/_hooks/[PATH] ")])]),t("button",{onClick:d},"Edit Subdomain")]))])}}});const nt=y(at,[["__scopeId","data-v-263381f5"]]),it=s=>(v("data-v-0990f6ef"),s=s(),g(),s),ct={key:0,class:"project-settings"},rt=it(()=>t("div",{class:"header"},[t("div",{class:"title-wrapper"},[t("h1",null,"Project Settings")])],-1)),dt=f({__name:"ProjectSettings",setup(s){const e=E().params.projectId,{result:d}=S(()=>I.get(e));return(m,h)=>r(d)?(n(),c("div",ct,[rt,l(nt,{project:r(d)},null,8,["project"])])):_("",!0)}});const wt=y(dt,[["__scopeId","data-v-0990f6ef"]]);export{wt as default};
//# sourceMappingURL=ProjectSettings.e0d5828f.js.map
