import{a as k}from"./asyncComputed.0126d7e4.js";import{P as w}from"./project.a65a8e44.js";import"./gateway.dfba55d6.js";import{d as f,v as j,b as n,c,x as e,e as l,z as r,S as a,N as p,D as _,t as S,a as I,O as C,Q as D,q as E,J as x}from"./registerWidgets.29e41a54.js";import{s as N}from"./index.27b8c9c1.js";import{L as B}from"./CircularLoading.0d1cd4f5.js";import{M as P,e as A,N as T}from"./icons.b931f659.js";import"./activeRecord.d63d0be1.js";import"./passwordlessManager.88f105f1.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]="5c6c1499-05c7-4796-ab72-5026ef8b7064",s._sentryDebugIdIdentifier="sentry-dbid-5c6c1499-05c7-4796-ab72-5026ef8b7064")}catch{}})();const i=s=>(C("data-v-43424e5e"),s=s(),D(),s),V={class:"subdomain-editor"},H={class:"title"},O=i(()=>e("div",{class:"subtitle"}," Every workspace in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. Only the workspace\u2019s owner can edit the subdomain. ",-1)),z={key:0,class:"subdomain-presenter"},L={class:"link-item"},M=i(()=>e("div",{class:"link-title"},"Forms and Dashes available at:",-1)),$={class:"link"},q={class:"custom-subdomain"},F={class:"link-item"},J=i(()=>e("div",{class:"link-title"},"Hooks available at:",-1)),Q={class:"link"},R={class:"custom-subdomain"},G={key:1,class:"subdomain-value-editor"},K={class:"subdomain-change-warning"},U={class:"section-title"},W=i(()=>e("div",{class:"section-body"}," Changing the workspace subdomain affects any links you've previously shared. The user wont be able to access old links. ",-1)),X={class:"input-section"},Y={class:"subdomain-value-input"},Z=i(()=>e("span",null,"https://",-1)),tt=["value"],et=i(()=>e("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,t=j({name:o.project.subdomain,error:"",editing:!1,loading:!1}),d=()=>t.editing=!0,m=()=>{g(),t.editing=!1,t.error=""},h=async()=>{t.error="",t.loading=!0,await v(),t.error||(t.editing=!1),t.loading=!1},v=async()=>{if(!(!o.project||o.project.subdomain===t.name)){if(!t.name){t.error="Subdomain cannot be empty";return}o.project.subdomain=t.name,await o.project.save()}},g=()=>t.name=o.project.subdomain,y=b=>{t.name=N(b.target.value,{replacement:"-",lower:!0,strict:!0})};return(b,ct)=>{const u=I("icon");return n(),c("div",V,[e("h2",H,[l(u,{width:"22",height:"22",path:r(P),fill:"#414A58"},null,8,["path"]),a("Subdomain ")]),O,t.editing?(n(),c("div",G,[e("div",K,[e("div",U,[l(u,{path:r(A),width:"12",height:"12",fill:"#D35249"},null,8,["path"]),a(" Be careful ")]),W]),e("div",X,[e("div",Y,[Z,e("input",{value:t.name,type:"text",onInput:y},null,40,tt),et]),t.error?(n(),c("div",st,[l(u,{path:r(T),fill:"#D35249",width:"12",height:"12"},null,8,["path"]),a(" "+p(t.error),1)])):_("",!0),e("div",ot,[e("button",{class:"cancel-button",onClick:m},"Cancel"),e("button",{class:"save-button",onClick:h},[a(" Save Changes "),t.loading?(n(),S(B,{key:0,size:"16"})):_("",!0)])])])])):(n(),c("div",z,[e("div",L,[M,e("div",$,[a(" https://"),e("span",q,p(s.project.subdomain),1),a(".abstra.app/[PATH] ")])]),e("div",F,[J,e("div",Q,[a(" https://"),e("span",R,p(s.project.subdomain),1),a(".abstra.app/_hooks/[PATH] ")])]),e("button",{onClick:d},"Edit Subdomain")]))])}}});const nt=E(at,[["__scopeId","data-v-43424e5e"]]),it={key:0,class:"project-settings"},ft=f({__name:"ProjectSettings",setup(s){const t=x().params.projectId,{result:d}=k(()=>w.get(t));return(m,h)=>r(d)?(n(),c("div",it,[l(nt,{project:r(d)},null,8,["project"])])):_("",!0)}});export{ft as default};
//# sourceMappingURL=ProjectSettings.6c474a06.js.map
