1import{a as m}from"./zypciNv-.js";import{C as h,c as S,s as v}from"./BI5BN1rn.js";import{z as P}from"./BA2cZanY.js";function F(r,c){const u=r.sharedCategory??[];return{id:"collection:"+String(r.id),name:r.name,usemarketingname:"0",subtype:String(h.SUBTYPE_CONTENT),canonical:c,channeldata:{description:r.description||""},ownLinkedcategory:u.map((s,a)=>({id:"collection-lc-"+String(s.id),product_id:"collection:"+String(r.id),linkedcategory_id:String(s.id),priority:a,title:"0",showdescription:0,hidetitle:0,view:"",searchplaceholder:""}))}}function y(r){return r.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function N(){const{$store:r}=P(),c=m.useSession(),{makeModernProductPart:u}=S(),{customerStorefronts:s}=v(r),a=s,d=(o,e,t)=>{const n=["/"+r.locale,"collection-"+o.canonical];if(e?.canonical&&n.push(e.canonical),t){const i=u(t,r.shopId).replace(/^\//,"");i&&n.push(i)}return n.join("/")},l=o=>{const e=a.value.find(t=>t.id===o);return e?d(e):""},f=(o,e,t)=>{const n=a.value.find(i=>i.id===o);return n?d(n,t,e):""},p=(o,e)=>{const t=[];if(e.hasProducts&&e.products&&t.push({products:e.products}),o.categories)for(const n of o.categories)t.push({category:n});return t},g=async()=>{const o=c.value?.data?.session?.token;return(await $fetch(r.apiUrl+r.shopId+"/"+r.locale+"/collections.json",{query:{storefront:"1"},headers:o?{"X-ApiKey":"betterauth:"+o}:void 0})??[]).map(t=>({id:String(t.id),name:t.name,canonical:t.canonical||y(t.name),description:t.description||void 0,frontPageProductId:t.frontpageproductid||void 0,categories:t.sharedCategory??[]}))};return{privateStorefronts:a,loadPrivateStorefronts:async()=>{try{a.value=await g()}catch{a.value=[]}},privateStorefrontFrontPageUrl:l,privateStorefrontProductUrl:f,makeCollectionUrl:d,buildMenuItemsForStorefront:p}}export{F as b,N as u};
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.