"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[925],{25:(e,t,n)=>{n.r(t),n.d(t,{CustomizeStoreController:()=>T,customizeStoreStateMachineActions:()=>h,customizeStoreStateMachineDefinition:()=>p,customizeStoreStateMachineServices:()=>u,default:()=>v});var r={};n.r(r),n.d(r,{assignThemeCards:()=>m});var o={};n.r(o),n.d(o,{fetchThemeCards:()=>d});var i=n(69307),a=n(11122),s=n(28226),c=n(50883),l=n(34374);const m=(0,n(5031).f0)({intro:(e,t)=>{const n=t.data;return{...e.intro,themeCards:n}}}),d=async()=>[{name:"Twenty Twenty One",description:"The default theme for WordPress."},{name:"Twenty Twenty",description:"The previous default theme for WordPress."}];var E=n(1718);const u={...o},h={...r},p=(0,a.C)({id:"customizeStore",initial:"intro",predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{},services:{}},context:{intro:{themeCards:[],activeTheme:""}},states:{intro:{id:"intro",initial:"preIntro",states:{preIntro:{invoke:{src:"fetchThemeCards",onDone:{target:"intro",actions:["assignThemeCards"]}}},intro:{meta:{component:e=>{let{sendEvent:t,context:n}=e;const{intro:{themeCards:r,activeTheme:o}}=n;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h1",null,"Intro"),(0,i.createElement)("div",null,"Active theme: ",o),null==r?void 0:r.map((e=>(0,i.createElement)("button",{key:e.name,onClick:()=>t({type:"SELECTED_NEW_THEME",payload:{theme:e.name}})},e.name))),(0,i.createElement)("button",{onClick:()=>t({type:"DESIGN_WITH_AI"})},"Design with AI"))}}}},on:{DESIGN_WITH_AI:{target:"designWithAi"},SELECTED_ACTIVE_THEME:{target:"assemblerHub"},CLICKED_ON_BREADCRUMB:{target:"backToHomescreen"},SELECTED_NEW_THEME:{target:"? Appearance Task ?"},SELECTED_BROWSE_ALL_THEMES:{target:"? Appearance Task ?"}}},designWithAi:{initial:"preDesignWithAi",states:{preDesignWithAi:{always:{target:"designWithAi"}},designWithAi:{meta:{component:e=>{let{sendEvent:t}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h1",null,"Design with AI"),(0,i.createElement)("button",{onClick:()=>t({type:"THEME_SUGGESTED"})},"Back to intro"))}}}},on:{THEME_SUGGESTED:{target:"assemblerHub"}}},assemblerHub:{on:{FINISH_CUSTOMIZATION:{target:"backToHomescreen"}}},backToHomescreen:{},"? Appearance Task ?":{}}}),T=e=>{let{actionOverrides:t,servicesOverrides:n}=e;(0,l.p0)(["woocommerce-customize-store"]);const r=(0,i.useMemo)((()=>p.withConfig({services:{...u,...n},actions:{...h,...t},guards:{}})),[t,n]),[o,a,m]=(0,s.e)(r,{devTools:!1}),d=(0,c.v)(m,(e=>{var t;return(0,E.r)(null!==(t=null==e?void 0:e.meta)&&void 0!==t?t:void 0)})),[T,v]=(0,i.useState)(null);(0,i.useEffect)((()=>{null!=d&&d.component&&v((()=>null==d?void 0:d.component))}),[T,null==d?void 0:d.component]);const g=o.value instanceof Object?Object.keys(o.value)[0]:o.value;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:`woocommerce-profile-wizard__container woocommerce-profile-wizard__step-${g}`},T?(0,i.createElement)(T,{sendEvent:a,context:o.context}):(0,i.createElement)("div",null)))},v=T},1718:(e,t,n)=>{function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;if(!t.has(e)){t.add(e);for(const n in e)if(e.hasOwnProperty(n)){if("component"===n)return e;if("object"==typeof e[n]&&null!==e[n]){const o=r(e[n],t);if(void 0!==o)return o}}}}n.d(t,{r:()=>r})}}]);