1import{L as D,d as N,ac as G,j as x,o as l,i as t,D as H,l as d,t as L,p as S,g as r,f as g,e as v,k as M,r as B,A as a,N as R,M as E,E as q,c as I,bb as K,u as W,a as Y,aK as Z,z as O,b as $,V as J,aM as Q,aZ as X,aA as ee,aN as te,P as j,aP as A,s as U,m as re,b3 as ae,F as se,n as oe,dg as ie,ad as ne,Z as le}from"./index.js";import{_ as de}from"./Loading.vue_vue_type_style_index_0_lang.js";import{C as ge}from"./copy.js";import{C as ce}from"./check.js";import{useWebsiteStore as ue}from"./website.js";import{L as me}from"./layout-template.js";import{P as ye}from"./palette.js";/** 2 * @license lucide-vue-next v0.469.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const be=D("RocketIcon",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 7 * @license lucide-vue-next v0.469.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const xe=D("SaveIcon",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),pe=["href","title"],he="relative inline-flex items-center gap-3 rounded-lg border transition-all duration-300 font-mono hover:shadow-lg backdrop-blur-sm",fe=N({__name:"Url",props:{url:{default:void 0},size:{default:"md"},variant:{default:"primary"}},setup(s){const p=s,u=G(),{$toast:h}=I(),o=B(!1),k={sm:"px-4 py-1.5 !text-xs",md:"px-5 py-2.5 !text-sm",lg:"px-6 py-3 text-base"},c={sm:"py-1 !text-xs",md:"py-2 !text-sm",lg:"py-3 text-base"},w={primary:"border-blue-200 dark:border-blue-500/30 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-950/40 dark:to-indigo-950/40 hover:from-blue-100 hover:to-indigo-100 dark:hover:from-blue-900/50 dark:hover:to-indigo-900/50 hover:border-blue-300 dark:hover:border-blue-400/40 dark:shadow-blue-900/20 dark:hover:shadow-blue-800/30",secondary:"border-gray-200 dark:border-gray-700 bg-gradient-to-r from-gray-50 to-slate-50 dark:from-gray-800/50 dark:to-slate-800/50 hover:from-gray-100 hover:to-slate-100 dark:hover:from-gray-800 dark:hover:to-slate-800 hover:border-gray-300 dark:hover:border-gray-600 dark:shadow-gray-900/20",light:"border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800/50 hover:bg-gray-50 dark:hover:bg-gray-800 hover:border-gray-300 dark:hover:border-gray-600 dark:shadow-gray-900/20",outline:"border-gray-300 dark:border-gray-600 bg-transparent hover:bg-gray-100/50 dark:hover:bg-gray-800/50 hover:border-gray-400 dark:hover:border-gray-500"},m={primary:"font-medium text-blue-700 dark:text-blue-300 group-hover:text-blue-900 dark:group-hover:text-blue-100 transition-colors",secondary:"font-medium text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors",light:"font-medium text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors",outline:"font-medium text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors"},_={primary:"absolute size-4 text-blue-600 dark:text-blue-400 group-hover:text-blue-800 dark:group-hover:text-blue-200 transition-colors",secondary:"absolute size-4 text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200 transition-colors",light:"absolute size-4 text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200 transition-colors",outline:"absolute size-4 text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200 transition-colors"};function C(){var y;if(p.url)return p.url;const i=(y=u.default)==null?void 0:y.call(u);if(i&&i.length>0){const f=i[0];if(typeof f.children=="string")return f.children}return""}async function z(){const i=C();try{await navigator.clipboard.writeText(i),o.value=!0,h.success({title:"Copied!",message:"URL copied to clipboard"}),setTimeout(()=>{o.value=!1},2e3)}catch{h.error("Failed to copy URL")}}return(i,y)=>(l(),x("div",{class:S([a(q)([he,k[s.size],w[s.variant],"group"])])},[t("a",{href:s.url||void 0,target:"_blank",rel:"noopener noreferrer",title:s.url,class:S([m[s.variant],c[s.size],"truncate hover:underline cursor-pointer"])},[H(i.$slots,"default",{},()=>[d(L(s.url),1)],!0)],10,pe),t("button",{onClick:E(z,["stop"]),type:"button","aria-label":"Copy URL",title:"Copy URL",class:"relative flex items-center justify-center w-4 h-4 shrink-0 cursor-pointer"},[r(R,{name:"icon-fade"},{default:g(()=>[o.value?M("",!0):(l(),v(a(ge),{key:0,class:S(_[s.variant])},null,8,["class"]))]),_:1}),r(R,{name:"icon-scale"},{default:g(()=>[o.value?(l(),v(a(ce),{key:0,class:"absolute size-4 text-green-600 dark:text-green-400 drop-shadow-lg"})):M("",!0)]),_:1})])],2))}}),ve=K(fe,[["__scopeId","data-v-65e1cdfb"]]),ke={class:"w-[calc(100%_+_2.5rem)] relative h-[calc(100%_+_2.5rem)] -my-5 -mx-5"},we={key:0,class:"flex flex-col h-full"},_e={class:"flex flex-col sm:flex-row gap-3 sm:gap-4 justify-between items-start sm:items-center sticky top-0 z-[1] backdrop-blur-xl bg-white/80 dark:bg-gray-950/80 border-b border-gray-200 dark:border-gray-800 px-5 py-3.5"},Ce={class:"flex items-center gap-3"},ze={class:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center"},Se={class:"flex items-center gap-2.5 w-full sm:w-auto"},Le={key:0,class:"flex items-start sm:items-center gap-3 px-5 py-3 bg-amber-50 dark:bg-amber-950/30 border-b border-amber-200 dark:border-amber-900/40 text-amber-800 dark:text-amber-200"},Me={class:"flex-1 flex flex-col sm:flex-row items-start overflow-hidden min-h-0"},Ve={class:"w-full sm:w-64 shrink-0 border-b sm:border-b-0 sm:border-r border-gray-200 dark:border-gray-800 sm:h-full sm:overflow-y-auto bg-gray-50/60 dark:bg-gray-900/40"},Te={class:"flex sm:flex-col overflow-x-auto sm:overflow-x-visible sm:p-3 gap-0.5"},Re={class:"flex-1 overflow-y-auto h-full min-w-0"},$e={key:1,class:"flex items-center justify-center h-full bg-gray-50 dark:bg-gray-950"},je={class:"text-center max-w-sm px-6 py-12"},Ae={class:"w-16 h-16 mx-auto mb-5 rounded-2xl bg-white dark:bg-gray-900 shadow-md ring-1 ring-gray-200 dark:ring-gray-800 flex items-center justify-center"},Ue={class:"flex items-center gap-2 justify-center"},Ge=N({__name:"Index",setup(s){var V;const p=W(),{$toast:u}=I(),h=Y(),o=ue(),{hasCapability:k}=Z(),c=B(!1),w=re(()=>{var n,e;return((e=(n=o.sitedata)==null?void 0:n.template)==null?void 0:e.type)==="pro"&&!k("pro_templates")}
11),m=O({title:(V=h.vendor)==null?void 0:V.company_name}),_=n=>{window.dispatchEvent(new Event("action:"+n))},{state:C,execute:z}=$({fire:"immediately",onError:u.error,action:async()=>{await o.getSiteData(),await o.getTemplates()}}),{execute:i,state:y}=$({fire:"on-demand",onSuccess:()=>z(),action:async()=>{await p.website.createSiteData({title:m.title})}}),f=[{label:"Templates",to:"dashboard.website.templates",icon:me},{label:"Branding",to:"dashboard.website.branding",icon:ye},{label:"Booking widget",to:"dashboard.website.widget",icon:ie}];return J(()=>{Q("action:saving",n=>{c.value=n===X.LOADING})}),ee(()=>{te("action:saving")}),(n,e)=>{const T=j("RouterLink"),F=j("RouterView");return l(),v(de,{loading:n.$u.isLoading(a(C))||n.$u.isLoading(a(y))},{default:g(()=>[t("div",ke,[a(o).sitedata?(l(),x("div",we,[t("header",_e,[t("div",Ce,[t("div",ze,[r(a(A),{class:"size-5 dark:text-white text-primary"})]),e[3]||(e[3]=t("div",null,[t("h1",{class:"font-semibold text-base text-gray-900 dark:text-white leading-tight"}," My Website "),t("p",{class:"text-xs text-gray-500 dark:text-gray-400 leading-tight"}," Manage your online presence ")],-1))]),t("div",Se,[r(ve,{size:"sm",class:"flex-1 sm:flex-initial",url:a(o).siteurl},null,8,["url"]),r(U,{onClick:e[0]||(e[0]=E(()=>_("save"),["prevent","stop"])),class:"gap-1.5 items-center whitespace-nowrap shrink-0",loading:c.value,disabled:c.value,size:"sm"},{default:g(()=>[r(a(xe),{class:"size-3.5"}),d(" "+L(c.value?"Savingâ¦":"Save"),1)]),_:1},8,["loading","disabled"])])]),w.value?(l(),x("div",Le,[r(a(ae),{class:"size-4 shrink-0 mt-0.5 sm:mt-0"}),e[5]||(e[5]=t("p",{class:"text-xs sm:text-sm leading-snug flex-1"}," Your live site is showing a free template because your current plan doesn't include pro templates. Your pro design is saved â resubscribe to restore it. ",-1)),r(T,{to:{name:"dashboard.billing.index"},class:"shrink-0 text-xs sm:text-sm font-semibold underline underline-offset-2 hover:no-underline whitespace-nowrap"},{default:g(()=>[...e[4]||(e[4]=[d(" View plans ",-1)])]),_:1})])):M("",!0),t("section",Me,[t("aside",Ve,[t("nav",Te,[(l(),x(se,null,oe(f,(b,P)=>r(T,{key:P,to:{name:b.to},class:"flex items-center gap-2.5 px-3.5 py-2.5 sm:rounded-md rounded-none text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-white dark:hover:bg-gray-800 transition-all whitespace-nowrap shrink-0 sm:shrink","active-class":"bg-white dark:bg-gray-800 text-gray-900 dark:text-white font-medium shadow-sm ring-1 ring-gray-200 dark:ring-gray-700"},{default:g(()=>[(l(),v(ne(b.icon),{class:"size-4 opacity-70 shrink-0"})),d(" "+L(b.label),1)]),_:2},1032,["to"])),64))]),e[6]||(e[6]=t("div",{class:"hidden sm:block px-4 pt-4 pb-3 mt-2 border-t border-gray-200 dark:border-gray-800"},[t("p",{class:"text-xs text-gray-400 dark:text-gray-500 leading-relaxed"},[d(" Changes are saved manually. Click "),t("strong",{class:"font-medium text-gray-500 dark:text-gray-400"},"Save"),d(" when you're done editing. ")])],-1))]),t("main",Re,[r(F)])])])):(l(),x("div",$e,[t("div",je,[t("div",Ae,[r(a(A),{class:"w-7 h-7 text-gray-700 dark:text-gray-300"})]),e[8]||(e[8]=t("h2",{class:"text-xl font-semibold text-gray-900 dark:text-white mb-2"}," Create your website ",-1)),e[9]||(e[9]=t("p",{class:"text-sm text-gray-500 dark:text-gray-400 leading-relaxed mb-7"}," Showcase your business online with a beautiful, professional site â ready in seconds. ",-1)),t("div",Ue,[r(le,{size:"sm",innerCss:"!text-sm",modelValue:m.title,"onUpdate:modelValue":e[1]||(e[1]=b=>m.title=b),placeholder:"Enter site title",class:"flex-1 max-w-[220px]"},null,8,["modelValue"]),r(U,{size:"sm",onClick:e[2]||(e[2]=()=>a(i)()),class:"shrink-0 gap-1.5 items-center"},{default:g(()=>[r(a(be),{class:"size-3.5"}),e[7]||(e[7]=d(" Get started ",-1))]),_:1})])])]))])]),_:1},8,["loading"])}}});export{Ge as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.