1import{a as et,b as dt}from"./chunk-IO7CTUSG.js";import{I as Z,K as tt,c as K,f as Q,k as X}from"./chunk-LR7MOASQ.js";import{a as Y,b as st}from"./chunk-BJKZCDMP.js";import{a as J,d as lt}from"./chunk-PIFN2AI6.js";import"./chunk-VRO7LARE.js";import{l as U,o as H,v as at}from"./chunk-TPMOPAJA.js";import"./chunk-QZLCDTFI.js";import"./chunk-4SWY45Q4.js";import{D as A,K as rt}from"./chunk-TX5W4VZ4.js";import{Ac as i,Bc as r,Cc as b,Ga as h,Gc as j,Hb as o,Jc as x,Kc as u,Md as p,Pb as c,Qa as F,Ra as $,Rd as G,Sa as y,Ta as D,Wb as N,Xa as L,Yc as l,Zc as _,_c as O,ac as f,ad as q,da as z,lc as R,mc as w,nc as V,oa as I,oc as M,va as ot,vc as g,xc as W,yc as P,zc as k}from"./chunk-RQ5WQXLP.js";import{a as v,b as T,f as it}from"./chunk-37EQZ6M3.js";function ct(e,d){e&1&&(i(0,"p",4),y(),i(1,"svg",17),b(2,"path",18),r(),l(3),r()),e&2&&(o(3),O(" ",d," analyzed "))}function pt(e,d){e&1&&(i(0,"p",5),l(1),r()),e&2&&(o(),_(d))}function gt(e,d){e&1&&l(0,"\u2026")}function mt(e,d){if(e&1&&(i(0,"span",9),l(1),f(2,gt,1,0),r()),e&2){let t=u();o(),q(" ",t.pageCount()," ",t.pageCount()===1?"page":"pages",": ",t.plannedPages().join(", "),""),o(),g(t.pageCount()>3?2:-1)}}function ut(e,d){if(e&1){let t=j();i(0,"button",23),x("click",function(){let n=F(t).$implicit,s=u(2);return $(s.setLook(n.key))}),i(1,"span",24),l(2),r(),i(3,"span",25),l(4),r()()}if(e&2){let t=d.$implicit,a=u(2);M("on",a.look()===t.key),R("aria-pressed",a.look()===t.key),o(2),_(t.label),o(2),_(t.description)}}function ht(e,d){if(e&1&&(i(0,"section",14)(1,"span",19),l(2,"Pick a look"),r(),i(3,"div",20),P(4,ut,5,5,"button",21,nt),r(),i(6,"p",22),l(7," This changes how the pages are set \u2014 the headings, the spacing, the corners. Your brand colors stay yours either way. "),r()()),e&2){let t=u();o(4),k(t.looks())}}function ft(e,d){e&1&&(i(0,"p",15),l(1,"Reading your brand\u2026"),r())}function bt(e,d){if(e&1&&b(0,"span",35),e&2){let t=d.$implicit;V("background",t)}}function xt(e,d){if(e&1&&(i(0,"span",32),P(1,bt,1,2,"span",34,W),r()),e&2){let t=u().$implicit;o(),k(t.swatches)}}function _t(e,d){if(e&1&&l(0),e&2){let t=u().$implicit;O(" ",t.label," ")}}function Ct(e,d){if(e&1&&(i(0,"span",31),f(1,xt,3,0,"span",32)(2,_t,1,1),i(3,"span",33),l(4),r()()),e&2){let t=d.$implicit;o(),g(t.swatches!=null&&t.swatches.length?1:-1),o(),g(t.label?2:-1),o(2),_(t.source)}}function vt(e,d){if(e&1&&(i(0,"section",16)(1,"div",26),y(),i(2,"svg",27),b(3,"path",28),r(),D(),i(4,"span",29),l(5,"Read from the brand"),r()(),i(6,"div",30),P(7,Ct,5,3,"span",31,nt),r(),i(9,"p",22),l(10," Nothing here was typed by you on this screen \u2014 change it on the brand and it changes here. "),r()()),e&2){let t=u();o(7),k(t.facts())}}var nt,Ft,yt=it(()=>{G();lt();ot();st();rt();tt();
1at();dt();G();tt();nt=(e,d)=>d.key;Ft=(()=>{class e{constructor(){this.websiteBuilder=h(et),this.router=h(H),this.route=h(U),this.globalBrand=h(Y),this.destroyRef=h(L),this.autoDescription="",this.mode=c("site"),this.description=c(""),this.brief=c(null),this.plans=c(null),this.looks=c([]),this.look=c(""),this.loading=c(!0),this.building=c(!1),this.error=c(null),this.brandName=p(()=>this.brief()?.brand?.name??""),this.facts=p(()=>this.brief()?.facts??[]),this.analysed=p(()=>this.brief()?.analysed??""),this.industry=p(()=>this.facts().find(t=>t.key==="industry")?.label??""),this.tone=p(()=>this.facts().find(t=>t.key==="tone")?.label??""),this.question=p(()=>{let t=this.brandName();return t?`What does ${t} do?`:"What does this business do?"}),this.pageCount=p(()=>this.plans()?.pages?.length??0),this.plannedPages=p(()=>(this.plans()?.pages??[]).slice(0,3).map(t=>t.name)),this.canBuild=p(()=>this.description().trim().length>0&&!this.building())}ngOnInit(){let t=this.route.snapshot.data?.mode;(t==="site"||t==="page")&&this.mode.set(t),this.websiteBuilder.looks().subscribe({next:a=>{this.looks.set(a?.looks??[]),this.look.set(a?.default??"")},error:()=>this.looks.set([])}),this.loadBrief(),this.globalBrand.selectedBrand$.pipe(I(1),z(),J(this.destroyRef)).subscribe(()=>this.loadBrief())}selectedBrandId(){let t=this.globalBrand.selectedBrand();return!t||t.source==="v2"?null:t.id??null}loadBrief(){let t=this.selectedBrandId();this.loading.set(!0),this.plans.set(null),this.websiteBuilder.brandBrief(t).subscribe({next:a=>{if(t!==this.selectedBrandId())return;this.brief.set(a),this.loading.set(!1);let n=this.description().trim();(!n||n===this.autoDescription.trim())&&(this.description.set(a?.description??""),this.autoDescription=a?.description??"");let s=this.industry();s&&this.loadPlans(s)},error:()=>{this.loading.set(!1)}})}loadPlans(t){this.websiteBuilder.sitePagePlans(t).subscribe({next:a=>this.plans.set(a),error:()=>this.plans.set(null)})}setMode(t){this.mode.set(t)}setLook(t){this.look.set(t)}build(){let t=this.description().trim();if(!t||this.building())return;this.building.set(!0),this.error.set(null);let a=this.selectedBrandId(),n=v(v(T(v({},a?{brand_id:a}:{}),{business_name:this.brandName(),industry:this.industry(),goal:t}),this.tone()?{tone:this.tone()}:{}),this.look()?{look:this.look()}:{});if(this.mode()==="page"){this.websiteBuilder.create({brief:n}).subscribe({next:s=>this.router.navigate(["/website-builder",s.id,"edit"]),error:s=>this.fail(s,"Could not start that page.")});return}this.websiteBuilder.generateSite({name:this.brandName()||t.slice(0,60),brief:n}).subscribe({next:s=>{let m=s?.site?.id;if(!m){this.fail(null,"The site was built but did not come back with an id.");return}let S=s?.pages_failed??[];if(S.length){this.router.navigate(["/website-builder/built"],{queryParams:{site:m,failed:S.map(C=>C.path).join(",")}});return}let B=s?.pages_created??[],E=B.find(C=>!C.path||C.path==="/")??B[0];if(E?.id){this.router.navigate(["/website-builder",E.id,"edit"]);return}this.router.navigate(["/website-builder/built"],{queryParams:{site:m}})},error:s=>this.fail(s,"Could not start that site.")})}fail(t,a){let n=t?.error?.detail;this.error.set(typeof n=="string"?n:a),this.building.set(!1)}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=N({type:e,selectors:[["app-builder-start"]],decls:24,vars:14,consts:[[1,"start"],["role","group","aria-label","What to build",1,"seg"],["type","button",3,"click"],[1,"sub"],[1,"analysed"],["role","alert",1,"error"],[1,"prompt"],["rows","3","name","description","placeholder","Family dental practice in Leeds \u2014 general dentistry, Invisalign, hygiene and emergency care. We want more new patients booking online.","aria-label","What the business does",3,"ngModelChange","ngModel","disabled"],[1,"foot"],[1,"chip"],[1,"spacer"],["type","button",1,"build",3,"click","disabled"],["width","15","height","15","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","aria-hidden","true"],["d","M5 12h14M13 6l6 6-6 6"],[1,"looks"],[1,"muted"],[1,"derived"],["width","13","height","13","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","aria-hidden","true"],["d","M13 2L3
114h8l-1 8 10-12h-8z"],[1,"lbl"],[1,"opts"],["type","button",1,"opt",3,"on"],[1,"note"],["type","button",1,"opt",3,"click"],[1,"nm"],[1,"ds"],[1,"hd"],["width","15","height","15","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.8","aria-hidden","true"],["d","M12 3l2.4 6.2L21 11l-6.6 1.8L12 19l-2.4-6.2L3 11l6.6-1.8z"],[1,"t"],[1,"chips"],[1,"chip","fact"],[1,"swatches"],[1,"x"],[1,"sw",3,"background"],[1,"sw"]],template:function(a,n){if(a&1&&(i(0,"div",0)(1,"div",1)(2,"button",2),x("click",function(){return n.setMode("page")}),l(3,"One page"),r(),i(4,"button",2),x("click",function(){return n.setMode("site")}),l(5,"Full website"),r()(),i(6,"h1"),l(7),r(),i(8,"p",3),l(9,"A sentence is enough. Everything else comes from the brand."),r(),f(10,ct,4,1,"p",4)(11,pt,2,1,"p",5),i(12,"div",6)(13,"textarea",7),x("ngModelChange",function(m){return n.description.set(m)}),r(),i(14,"div",8),f(15,mt,3,4,"span",9),b(16,"div",10),i(17,"button",11),x("click",function(){return n.build()}),l(18),y(),i(19,"svg",12),b(20,"path",13),r()()()(),f(21,ht,8,0,"section",14)(22,ft,2,0,"p",15)(23,vt,11,0,"section",16),r()),a&2){let s,m;o(2),M("on",n.mode()==="page"),o(2),M("on",n.mode()==="site"),o(3),_(n.question()),o(3),g((s=n.analysed())?10:-1,s),o(),g((m=n.error())?11:-1,m),o(2),w("ngModel",n.description())("disabled",n.building()),o(2),g(n.mode()==="site"&&n.pageCount()?15:-1),o(2),w("disabled",!n.canBuild()),o(),O(" ",n.building()?"Starting\u2026":n.mode()==="site"?"Build the site":"Build the page"," "),o(3),g(n.looks().length?21:-1),o(),g(n.loading()?22:n.facts().length?23:-1)}},dependencies:[A,Z,K,Q,X],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block}.light[_nghost-%COMP%], .light [_nghost-%COMP%], [data-mode=light][_nghost-%COMP%], [data-mode=light] [_nghost-%COMP%]{--surface-primary: var(--bg-card, #ffffff);--surface-secondary: var(--bg-tertiary, var(--bg-secondary, #f1f5f9));--surface-raised: var(--bg-card, #ffffff);--text-tertiary: var(--text-muted, #64748b)}.start[_ngcontent-%COMP%]{max-width:760px;margin:0 auto;padding:48px 24px 88px}.seg[_ngcontent-%COMP%]{display:inline-flex;padding:3px;margin-bottom:26px;background:var(--surface-secondary, #1e2a3a);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px}.seg[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:7px 16px;font-size:13.5px;font-weight:600;color:var(--text-secondary, #9e9e9e);background:transparent;border:0;border-radius:5px;cursor:pointer}.seg[_ngcontent-%COMP%] button.on[_ngcontent-%COMP%]{background:var(--surface-raised, #243444);color:var(--text-primary, #fafafa)}h1[_ngcontent-%COMP%]{margin:0 0 6px;font-size:clamp(24px,4vw,30px);font-weight:600;letter-spacing:-.02em;text-wrap:balance;color:var(--text-primary, #fafafa)}.sub[_ngcontent-%COMP%]{margin:0 0 14px;font-size:14.5px;color:var(--text-secondary, #9e9e9e)}.analysed[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;margin:0 0 20px;padding:4px 10px;font-size:12.5px;color:var(--mt-teal, #00bcd4);background:#00bcd41f;border-radius:4px}.error[_ngcontent-%COMP%]{margin:0 0 16px;padding:10px 12px;font-size:13px;color:#fca5a5;background:#ef44441a;border:1px solid rgba(239,68,68,.28);border-radius:8px}.muted[_ngcontent-%COMP%]{font-size:13px;color:var(--text-secondary, #9e9e9e)}.prompt[_ngcontent-%COMP%]{padding:16px;margin-bottom:18px;background:var(--surface-primary, #132038);border:1px solid var(--border-strong, rgba(255, 255, 255, .18));border-radius:10px}.prompt[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;padding:0;font-family:inherit;font-size:16px;line-height:1.5;color:var(--text-primary, #fafafa);background:transparent;border:0;resize:none}.prompt[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus{outline:none}.prompt[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:var(--text-tertiary, #6b7787)}.prompt[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:disabled{opacity:.6}.foot[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid var(--border-color, rgba(255, 255, 255, .1))}.spacer[_ngcontent-%COMP%]{flex:1}.chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;font-size:12.5px;color:var(--text-secondary, #9e9e9e);background:var(--surface-secondary, #1e2a3a);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:4px}button.build[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 14px;font-size:13.5px;font-weight:600;background:var(--mt-teal, #00bcd4);color:var(--mt-teal-ink, #062b31);border:0;border-radius:6px;cursor:pointer}button.build[_ngcontent-%COMP%]:hover:not(:disabled){filter:brightness(1.12)}button.build[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.derived[_ngcontent-%COMP%]{padding:16px;background:var(--surface-primary, #132038);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:10px}.derived[_ngcontent-%COMP%] .hd[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:12px;color:var(--mt-teal, #00bcd4)}.derived[_ngcontent-%COMP%] .t[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--text-primary, #fafafa)}.chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:7px}.chip.fact[_ngcontent-%COMP%]{color:var(--text-primary, #fafafa)}.chip.fact[_ngcontent-%COMP%] .x[_ngcontent-%COMP%]{font-size:11px;color:var(--text-tertiary, #6b7787)}.swatches[_ngcontent-%COMP%]{display:inline-flex;gap:4px}.sw[_ngcontent-%COMP%]{width:16px;height:16px;border-radius:3px;border:1px solid var(--border-color, rgba(255, 255, 255, .14))}.note[_ngcontent-%COMP%]{margin:12px 0 0;font-size:12.5px;line-height:1.5;color:var(--text-tertiary, #6b7787)}.looks[_ngcontent-%COMP%]{margin-bottom:18px}
1.looks[_ngcontent-%COMP%] .lbl[_ngcontent-%COMP%]{display:block;margin-bottom:8px;font-size:11.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-tertiary, #6b7787)}.looks[_ngcontent-%COMP%] .opts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:9px}.looks[_ngcontent-%COMP%] .opt[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3px;padding:11px 13px;text-align:left;background:var(--surface-secondary, #1e2a3a);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px;cursor:pointer}.looks[_ngcontent-%COMP%] .opt[_ngcontent-%COMP%]:hover{border-color:var(--border-strong, rgba(255, 255, 255, .24))}.looks[_ngcontent-%COMP%] .opt.on[_ngcontent-%COMP%]{border-color:var(--mt-teal, #00bcd4);background:rgb(var(--accent-teal-rgb, 0 188 212)/.08)}.looks[_ngcontent-%COMP%] .nm[_ngcontent-%COMP%]{font-size:13.5px;font-weight:600;color:var(--text-primary, #fafafa)}.looks[_ngcontent-%COMP%] .ds[_ngcontent-%COMP%]{font-size:12px;line-height:1.45;color:var(--text-secondary, #9e9e9e)}.looks[_ngcontent-%COMP%] .note[_ngcontent-%COMP%]{margin:9px 0 0;font-size:12.5px;line-height:1.5;color:var(--text-tertiary, #6b7787)}@media (max-width: 767px){.start[_ngcontent-%COMP%]{padding:24px 16px 64px}.prompt[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{display:block;min-height:7.5em;field-sizing:content}.foot[_ngcontent-%COMP%]{position:static;justify-content:flex-end}.looks[_ngcontent-%COMP%] .opts[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}}']})}}return e})()});yt();export{Ft as BuilderStartComponent};
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.