1import{cmsApi as v}from"./C8R0BvqS.js";import{u as P,M as w,r as l,c as f}from"./cl7XfM0u.js";function Z(){const{locale:d}=P(),c=w(),n=l([]),i=l([]),s=l(!1),u=l(null),y=e=>d.value==="en"?e.categoryNameEn:e.categoryNameZh,N=e=>{const a=[],r=o=>{for(const t of o)a.push(t),t.children&&t.children.length>0&&r(t.children)};return r(e),a},C=(e,a)=>c(`${a}/${e.categoryCode}`),g=(e,a)=>(console.log(`ð æå»º${a}头é¨åèå:`,e.map(r=>({code:r.categoryCode,name:r.categoryNameZh,order:r.orderNum,parentId:r.parentId}))),e.map(r=>({id:r.categoryCode,label:y(r),path:C(r,a),order:r.orderNum,isActive:!0})).sort((r,o)=>r.order-o.order)),p=async()=>{try{s.value=!0;const e=await v.category.getList();if(e.code===200&&e.data){const a=e.data;console.log("ð åå§æ å½¢æ°æ®:",a);const r=a.find(o=>o.categoryCode==="Brand");r&&r.children?(n.value=r.children,console.log("ð åçè¿è¥åæ ç®:",n.value.map(o=>({code:o.categoryCode,name:o.categoryNameZh,order:o.orderNum,parentId:o.parentId})))):(console.warn('â ï¸ æªæ¾å°"åçè¿è¥"èç¹'),n.value=[])}}catch(e){console.error("å è½½åçæ ç®å¤±è´¥:",e),u.value="å è½½åçèå失败"}finally{s.value=!1}},h=async()=>{try{s.value=!0;const e=await v.category.getList();if(e.code===200&&e.data){const a=e.data,o=N(a).filter(t=>{const m=t.orderNum;return m>=6&&m<=10&&t.parentId===0});console.log("ð åä½çææ ç® (orderNum 6-10):",o.map(t=>({code:t.categoryCode,name:t.categoryNameZh,order:t.orderNum,parentId:t.parentId}))),i.value=o}}catch(e){console.error("å è½½åä½çææ ç®å¤±è´¥:",e),u.value="å è½½åä½çæèå失败"}finally{s.value=!1}},b=f(()=>{const e=g(n.value,"/brand");return console.log("ð¯ åçè¿è¥å¯¼èªèåï¼å¤´é¨å¯¼èªï¼:",e),{id:"brand",label:d.value==="en"?"Brand Operation":"åçè¿è¥",path:c("/brand"),order:3,isActive:!0,children:e&&e.length>0?e:void 0}}),I=f(()=>{const e=g(i.value,"/partnership");return console.log("ð¯ åä½çæå¯¼èªèåï¼å¤´é¨å¯¼èªï¼:",e),{id:"partnership",label:d.value==="en"?"Partnership":"åä½çæ",path:c("/partnership"),order:4,isActive:!0,children:e&&e.length>0?e:void 0}});return{brandCategories:n,partnershipCategories:i,loading:s,error:u,getBrandNavigation:b,getPartnershipNavigation:I,loadBrandCategories:p,loadPartnershipCategories:h,init:async()=>{await Promise.all([p(),h()])}}}export{Z 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.