import{a as S}from"./asyncComputed.7c1b85ba.js";import{P as I}from"./project.3182f929.js";import"./gateway.b2e13b61.js";import{d as f,w as C,a as E,b as n,c,y as t,e as p,A as r,V as a,O as _,E as m,u as D,Q as v,R as g,t as y,K as P}from"./registerWidgets.2f354556.js";import"./index.a8dd38cc.js";import{n as x}from"./index.afe47008.js";import{L as N}from"./CircularLoading.f70f248e.js";import{M as A,b as B,N as V}from"./icons.1cdfa11b.js";import"./activeRecord.931023a0.js";import"./pubsub.cb65003c.js";import"./passwordlessManager.96ab3f5a.js";import"./lottie.61602e49.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]="54c9d886-9524-4afb-a9ea-c0edb7607c6f",s._sentryDebugIdIdentifier="sentry-dbid-54c9d886-9524-4afb-a9ea-c0edb7607c6f")}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)),R={key:0,class:"subdomain-presenter"},T={class:"link-item"},M=i(()=>t("div",{class:"link-title"},"Forms and Dashes available at:",-1)),O={class:"link"},z={class:"custom-subdomain"},F={class:"link-item"},K=i(()=>t("div",{class:"link-title"},"Hooks available at:",-1)),Q={class:"link"},U={class:"custom-subdomain"},q={key:1,class:"subdomain-value-editor"},G={class:"subdomain-change-warning"},J={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:{}},setup(s){const o=s,e=C({name:o.project.subdomain,error:"",editing:!1,loading:!1}),d=()=>e.editing=!0,h=()=>{k(),e.editing=!1,e.error=""},b=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=l=>{e.name=x(l.target.value,{replacement:"-",lower:!0,strict:!0})};return(l,lt)=>{const u=E("icon");return n(),c("div",$,[t("h2",H,[p(u,{width:"22",height:"22",path:r(A),fill:"#414A58"},null,8,["path"]),a("Subdomain ")]),L,e.editing?(n(),c("div",q,[t("div",G,[t("div",J,[p(u,{path:r(B),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,[p(u,{path:r(V),fill:"#D35249",width:"12",height:"12"},null,8,["path"]),a(" "+_(e.error),1)])):m("",!0),t("div",ot,[t("button",{class:"cancel-button",onClick:h},"Cancel"),t("button",{class:"save-button",onClick:b},[a(" Save Changes "),e.loading?(n(),D(N,{key:0,size:"16"})):m("",!0)])])])])):(n(),c("div",R,[t("div",T,[M,t("div",O,[a(" https://"),t("span",z,_(l.project.subdomain),1),a(".abstra.app/[PATH] ")])]),t("div",F,[K,t("div",Q,[a(" https://"),t("span",U,_(l.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=P().params.projectId,{result:d}=S(()=>I.get(e));return(h,b)=>r(d)?(n(),c("div",ct,[rt,p(nt,{project:r(d)},null,8,["project"])])):m("",!0)}});const wt=y(dt,[["__scopeId","data-v-0990f6ef"]]);export{wt as default};
//# sourceMappingURL=ProjectSettings.b5c679f5.js.map
