import{cK as L,cL as P,z as p,s as R,v,E as l,cM as _,cC as m,cN as c,D as w}from"./stepForm-13c8d592.js";import{e as z,b,a as h,c as T,M,m as U,u as I}from"./eventBooking-7a4a8f8c.js";import"./customerPanel-9745d54a.js";import"./eventListForm-22b87be3.js";const k=L({modules:{entities:z,booking:b,eventEntities:h,eventBooking:T}});window.stylesInjectedV3=async function(){};const B=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeCatalog-2e4dad73.js")+""),[],import.meta.url)}),V=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeCustomerPanel-1b05a656.js")+""),[],import.meta.url)}),S=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeEmployeePanel-bbf27b4c.js")+""),[],import.meta.url)}),H=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeEventCalendar-79679ba3.js")+""),[],import.meta.url)}),K=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeEventList-cf64589d.js")+""),[],import.meta.url)}),C=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeStepNew-e2bafeae.js")+""),[],import.meta.url)}),E=window.wpAmeliaUrls.wpAmeliaPluginURL+"v3/public/";window.__dynamic_handler__=function(e){return E+"assets/"+e};window.__dynamic_preload__=function(e){return e.map(s=>E+s)};function N(){const e=Array.isArray(window.localeLanguage)?window.localeLanguage[0]:"";return typeof e!="string"||!e?"en":e.toLowerCase().replace("_","-").split("-")[0]||"en"}function j(){let e=[];{const s=Array.from(document.getElementsByTagName("link")).filter(o=>o.getAttribute("rel")==="stylesheet"&&o.getAttribute("href")?.includes("ameliabooking/v3/public/assets")),i=Array.from(document.getElementsByTagName("style")).filter(o=>o.textContent?.includes("/* purgecss start ignore */"));e=[...s,...i]}return e}async function D(e){if(!e)return;const i=await(()=>new Promise(n=>{const t=()=>{const a=j();return a!==void 0&&a.length>0&&window.customizeComponentLoaded?a:null},r=t();if(r){n(r);return}const u=new MutationObserver(()=>{const a=t();a&&(u.disconnect(),n(a))});u.observe(document.head,{childList:!0,subtree:!0});const d=()=>{const a=t();a?(u.disconnect(),n(a)):window.customizeComponentLoaded||requestAnimationFrame(d)};requestAnimationFrame(d)}))(),o=document.createDocumentFragment();i.forEach((n,t)=>{const r=n.cloneNode(!0);r.id=`v3-style-${t}`,n.tagName==="LINK"&&n.href&&(r.href=n.href),o.appendChild(r)}),e.appendChild(o),window.stylesInjectedV3()}function y(){const s=document.getElementsByClassName("amd-cp__preview")[0]?.shadowRoot,i=s?.getElementById("amelia-app-backend-new");if(!i){setTimeout(y,100);return}const o=window.v3?.componentToMount!==void 0?window.v3.componentToMount:"Customize";let n,t;switch(o){case"CustomizeCatalog":n=B,t="CustomizeCatalog";break;case"CustomizeCustomerPanel":n=V,t="CustomizeCustomerPanel";break;case"CustomizeEmployeePanel":n=S,t="CustomizeEmployeePanel";break;case"CustomizeEventCalendar":n=H,t="CustomizeEventCalendar";break;case"CustomizeEventList":n=K,t="CustomizeEventList";break;case"CustomizeStepNew":n=C,t="CustomizeStepNew";break;default:n=C,t="CustomizeStepNew"}P({setup(){const r=p(window.wpAmeliaUrls),u=w(window.wpAmeliaLanguages),d=w(window.wpAmeliaSettings),a=p("wpAmeliaTimeZone"in window?window.wpAmeliaTimeZone[0]:""),A=p(window.localeLanguage[0]),f=w(window.wpAmeliaLabels),g=w(I());l("settings",m(d)),l("baseUrls",m(r)),l("timeZone",m(a)),l("localLanguage",m(A)),l("languages",m(u)),l("labels",m(f)),l("licence",g),R(async()=>{await D(s)})},template:`<${t} />`}).component(t,n).use(M,{theme:{preset:U,strategy:"runtime",darkModeStrategy:"class"},translations:{locale:N(),fallbackLocale:"en"}}).use(k).mount(i)}window.onUnmountedV3Callback||(window.onUnmountedV3Callback=async()=>{});async function O(){const s=document.getElementsByClassName("amd-cp__preview")[0]?.shadowRoot,i=s?.getElementById("amelia-app-backend-new"),o=i?.__vue_app__;if(s?.querySelectorAll('[id^="v3-style-"]')?.forEach(t=>{t.remove()}),o){o.unmount(),await v();const t=!i?.innerHTML||i.innerHTML.trim()==="";typeof window.onUnmountedV3Callback=="function"&&t&&await window.onUnmountedV3Callback()}}window.mountUnmountV3App=async()=>{window.v3?y():await O()};
