1import{_ as e}from"./E2XVAGg7.js";/* empty css */import{aG as a,aK as t,af as o,ag as l,bl as u,a1 as n,aA as s,aC as c,aB as r,aQ as i,q as d,r as p,az as v,ay as m}from"./DJ6SKgMk.js";import"./n-8iqlBe.js";import"./7pwdYOAV.js";import"./BiwPf8ce.js";const f={key:0,class:"loader-container"},g={key:1,class:"mt-3"},y={class:"form-field-inline"},C={key:0,class:"form-field-inline"},P={key:1,class:"form-field-inline"},S={key:2,class:"form-field-inline"},G=a({__name:"series-selector",setup(a){t({script:[{src:"https://app.kontent.ai/js-api/custom-element/v1/custom-element.min.js",onload(e){!function(){try{CustomElement.init((e,a)=>{if(null!==e.value){const a=JSON.parse(e.value);a&&(h.value=a.ProductCategory,b.value=a.ProductGroup,k.value=a.ProductSubGroup,G.value=a.MarketingSeriesName,O(),q(a.ProductCategory),z(a.ProductCategory,a.ProductGroup),B(a.ProductCategory,a.ProductGroup,a.ProductSubGroup))}e.config&&e.config.height&&CustomElement.setHeight(e.config.height)}),CustomElement.onDisabledChanged(M)}catch(e){console.error(e)}finally{j.value=!1}}()}}]},{mode:"client"});d().enableCdn;const m=p(null),G=p(""),h=p(""),b=p(""),k=p(""),$=p(!1),j=p(!0),w=p([]),I=p([]),R=p([]),U=p([]);O();const N=o(()=>w.value.filter(e=>e.ProductCategory===h.value&&e.ProductGroup===b.value&&e.ProductSubGroup===k.value).map(e=>e.MarketingSeriesName).filter((e,a,t)=>t.indexOf(e)===a&&void 0!==e));function M(e){$.value=e}async function _(e){h.value=e,await q(e),b.value="",k.value=""}async function E(e){b.value=e,await z(h.value,e),k.value=""}async function x(e){k.value=e,await B(h.value,b.value,e)}function J(e){G.value=e}async function O(){const{data:e}=await u("/api/products/series/selector","$iBqiFb6SzR");e.value&&e.value.data&&(I.value=[...e.value.data.map(e=>e["Product Category"])])}async function q(e){const{data:a}=await u(`/api/products/series/selector?category=${encodeURIComponent(e)}`,"$-aPnwvW14X");a.value&&a.value.data&&(R.value=[...a.value.data.map(e=>e["Product Group"])])}async function z(e,a){const t=`/api/products/series/selector?category=${encodeURIComponent(e)}&group=${encodeURIComponent(a)}`,{data:o}=await u(t,"$Ux9g7cPdNs");o.value&&o.value.data&&(U.value=[...o.value.data.map(e=>e["Marketing Product Sub Group"])])}async function B(e,a,t){const{data:o}=await u(`/api/products/series/selector?category=${encodeURIComponent(e)}&group=${encodeURIComponent(a)}&subgroup=${encodeURIComponent(t)}`,"$2Muj2JgP84");o.value&&o.value.data&&(w.value=[...o.value.data])}return l(G,e=>{e&&function(e){if(!$.value)try{const a=w.value.find(a=>a.MarketingSeriesName===e&&a.ProductCategory===h.value&&a.ProductGroup===b.value&&a.ProductSubGroup===k.value);a&&(m.value=a,CustomElement.setValue(JSON.stringify(a)))}catch(a){console.error(a)}}(e)}),(a,t)=>{const o=e;return n(j)?(v(),s("div",f,[...t[0]||(t[0]=[c("div",{class:"loader purple"},null,-1)])])):(v(),s("div",g,[c("div",y,[r(o,{options:n(I),selected:n(h),placeholder:"Select a Category",onSelect:_},null,8,["options","selected"])]),n(h)?(v(),s("div",C,[r(o,{options:n(R),selected:n(b),placeholder:"Select a Group",onSelect:E},null,8,["options","selected"])])):i("",!0),n(b)?(v(),s("div",P,[r(o,{options:n(U),selected:n(k),placeholder:"Select a Sub Group",onSelect:x},null,8,["options","selected"])])):i("",!0),n(k)?(v(),s("div",S,[r(o,{options:n(N),selected:n(G),placeholder:"Select a Series",onSelect:J},null,8,["options","selected"])])):i("",!0)]))}}}),h=m(G,[["__scopeId","data-v-66455c88"]]);export{h as default}; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6dc03e26-8f49-5533-847c-9b260470b4ee")}catch(e){}}(); 3//# debugId=6dc03e26-8f49-5533-847c-9b260470b4ee
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.