1import{r as e}from"./B0Z9INg1.js";import{kt as t,t as n}from"./C-jl1tqw.js";import{n as r}from"./CJ17ZCi6.js";import{t as i}from"./DDdyfk2q.js";function a(){return e=>e}function o(e,t,n,r,i){let a=[];return e?.fields&&Object.keys(e.fields).forEach(s=>{let c=e.fields[s];if(!c)return;let l=c.type,u=t?.[s],d=n[s],f=`${r}-${s}`,p={id:i(f),name:s,type:l};c.enabled!==void 0&&(p.enabled=c.enabled),u&&u.enabled!==void 0&&(p.enabled=u.enabled),d&&Object.hasOwn(d,`enabled`)&&(p.enabled=d.enabled);let m,h=!1;d&&Object.hasOwn(d,`value`)?(m=d.value,h=!0):u&&u.value!==void 0?(m=u.value,h=!0):c.default!==void 0&&(m=c.default,h=!0),l===`collection`&&Array.isArray(m)?p[l]=m.map((e,t)=>{let n=`${f}-item-${t}`,r=e;if(e&&Array.isArray(e.fields)){r={};for(let t of e.fields){let e={},n=t[t.type];n!==void 0&&(e.value=n),t.enabled!==void 0&&(e.enabled=t.enabled),r[t.name]=e}}return{id:i(n),fields:o({fields:c.fields||{}},r,{},n,i)}}):h&&(p[l]=m),a.push(p)}),a}function s(e,t,n){let r={value:0};return(e||[]).map(e=>c(e,t,n,r))}function c(e,t,n,r){let i=n.getSlice(e.component),a=`${t}-${++r.value}-${e.component}`,s=n.createId(a),l=o(i,e.fields,{},a,n.createId),u=(e.elements||[]).map(e=>c(e,a,n,r));return{id:s,label:i?.name?.label||e.component,type:`slice`,component:e.component,properties:{dom_id:``,settings:[]},slot:e.slot||`default`,enabled:e.enabled!==!1,xp_status:`approved`,hydration_mode:`load`,fields:l,elements:u}}function l(e,t,n,r){return{fields:o(e,t?.fields,{},n,r.createId),elements:s(t?.elements,n,r)}}function u(e,t){return t?e?.templates?.find(e=>e.label===t)??null:null}function d(e){return(e?.templates||[]).filter(e=>!e.hidden)}var f=e({useSliceStore:()=>p});n();var p=r(`sliceStore`,{state:()=>({slices:{}}),actions:{initializeSlices(e){for(let n in e)Object.hasOwn(e,n)&&(this.slice
1s=t(e))},buildSliceDataFromSliceConfig(e,t,n){let r=this.getSlice(e);if(!r)throw Error(`Slice configuration not found for component: ${e}`);let a=u(r,n),{fields:o,elements:s}=a?l(r,a,e,{getSlice:e=>this.getSlice(e),createId:()=>i()}):{fields:[],elements:[]};return{id:i(),type:`slice`,component:e,enabled:!0,xp_status:`approved`,hydration_mode:r.hydrationMode??`load`,slot:t||`default`,label:r.name.label,fields:o,elements:s,properties:{dom_id:``,settings:[]},administration:{gui:{el:null,hydrationOptions:r.hydrationOptions},permissions:[]}}}},getters:{getSlice:e=>t=>e.slices[t]||null,getSliceComponentNameFromLabelAndGroup:e=>t=>{if(!t.label||t.label===``)return null;for(let n in e.slices){let r=e.slices[n];if(r.name.label===t.label&&r.name.group===t.group)return n}return null}}});export{a,o as i,p as n,u as o,s as r,d as s,f as t};
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.