1import{u as L}from"./index.2026.09.232.js";import{m as T,r as q,c as l,o as n,b as t,t as m,w as x,f as c,q as k,l as C,F as f,i as g,e as b,p as y,n as _,h as F,v as A}from"../app.2026.09.23.js";import H from"./accordion.2026.09.23.js";import{_ as M}from"./_plugin-vue_export-helper.2026.09.23.js";import"./apiurl.2026.09.23.js";import"./utils.2026.09.23.js";import"./index.2026.09.23.js";import"./fetch.2026.09.23.js";import"./_commonjshelpers.2026.09.23.js";import"./constants.2026.09.23.js";const S={name:"ellevio-web-faq-list",components:{EllevioWebAccordion:H},props:{categories:{type:Array,default:()=>[]},translations:{type:Object,default:()=>{}},apiUrl:{type:String,default:""},debounceDelay:{type:Number,default:200}},data(){return{faqCategories:[],itemFromUrl:[],inputText:"",inputTextStatic:"",dataFromApi:[],timeoutId:0,showSpinner:!1}},computed:{searchHeadingComputed(){return this.formatString(this.translations.searchHeading,this.inputTextStatic,this.getNumberOfHits)},getDataFromApi(){return this.dataFromApi},getNumberOfHits(){return this.getDataFromApi.length>0?this.getDataFromApi.reduce((s,e)=>s+e.questions.length,0):this.translations.noHitsNumberText??"inga"},matches(){const s=[...this.faqCategories].filter(e=>e.isHighlighted!==!0).sort(this.sortAlphabetically);return this.getDataFromApi.length>0?this.getDataFromApi:s},hasInputText(){return this.inputText.length>0},matchMediaQuery(){return window.matchMedia(" (min-width: 1024px) ")}},methods:{...T(L,["getTypeAheadCategoriesFaq"]),async getData(){return await this.getTypeAheadCategoriesFaq({query:this.inputText,apiUrl:this.apiUrl})},formatString(s,...e){return s.replace(/{(\d+)}/g,function(d,u){return typeof e[u]<"u"?+u==0?`"${e[u]}"`:e[u]:d})},toggleQuestions(s){s.currentTarget.parentElement.querySelector("ul").classList.toggle("hidden")},toggleAnswer(s){s.stopPropagation(),s.currentTarget.parentElement.querySelector("div+div:has(.wysiwyg)").classList.toggle("hidden")},makeApiCall(){this.showSpinner=!0,this.faqCategories=[],clearTimeout(this.timeoutId),this.timeoutId=setTimeout(async()=>{const s=await this.getData();this.showSpinner=!1,this.inputTextStatic=this.inputText,this.dataFromApi=s.data},this.debounceDelay)},keyUpEvents:async function(s){this.itemFromUrl=[],this.inputText=s.target.value,this.makeApiCall()},sortAlphabetically(s,e){return s.name<e.name?-1:s.name>e.name?1:0},scrollFaqListIntoView(){this.isMobile&&document.querySelector(".faq-list").scrollIntoView({behavior:"smooth"})},scrollIntoView(s){s.scrollIntoView({behavior:"smooth"})},removeTypedText(){this.inputText="",this.makeApiCall(),this.$refs["faq-filter"].focus()},resize:function(){this.isMobile=this.matchMediaQuery?!this.matchMediaQuery.matches:!0}},async mounted(){this.isMobile=this.matchMediaQuery?!this.matchMediaQuery.matches:!0,this.itemFromUrl=this.categories.filter(s=>s.isHighlighted===!0),this.faqCategories=[...this.categories],this.$nextTick(function(){const s=document.querySelectorAll(".is-extended");s.length>0&&this.scrollIntoView(s[0].previousSibling)})},unmounted(){window.removeEventListener("resize",this._boundedResize)}},I={class:"faq-list"},V={class:"bg-newColors-green-primaryA"},U={class:"container-small"},E={class:"flex flex-col items-center justify-center"},B={class:"mt-4 mb-5 text-3xl text-white md:text-7xl md:mt-16 md:mb-10"},D={class:"relative flex items-center w-full mb-3 max-w-928 md:mb-11"},Z={class:"bg-newColors-gray-baseC"},N={class:"container-small"},Q={class:"py-3 mx-auto md:py-6 max-w-928"},j={key:0,class:"mb-5 item-from-url faq-list"},z={class:"questions"},O={class:"flex items-start justify-between"},P={class:"flex flex-col w-full"},R={class:"faq-subheading"},Y={class:"wysiwyg wysiwyg-full"},K=["innerHTML"],W={class:"inline-block w-full mb-3 text-xl normal-case md:mb-5 md:text-2xl"},G={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"inline-block ml-5"},J={key:1,class:"faq-list"},X={class:"questions"},$={class:"flex items-start justify-between"},tt={class:"flex flex-col w-full"},et={class:"faq-subheading"},st={class:"wysiwyg wysiwyg-full"},it=["innerHTML"],lt={key:0,class:"mt-8 text-lg"};function nt(s,e,d,u,o,a){const v=q("ellevio-web-accordion");return n(),l("div",I,[t("div",V,[t("div",U,[t("div",E,[t("h1",B,m(d.translations.heading),
11),t("div",D,[x(t("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>o.inputText=i),onFocus:e[1]||(e[1]=(...i)=>a.scrollFaqListIntoView&&a.scrollFaqListIntoView(...i)),ref:"faq-filter",type:"text",name:"search",placeholder:"Skriv din fråga",onKeyup:e[2]||(e[2]=i=>a.keyUpEvents(i)),class:"w-full px-3 py-2 md:py-2.5 pr-24 text-lg bg-white rounded-lg b placeholder:italic font-futuraEfBook"},null,544),[[C,o.inputText]]),a.hasInputText?(n(),l("button",{key:0,onClick:e[3]||(e[3]=(...i)=>a.removeTypedText&&a.removeTypedText(...i)),class:"absolute flex items-center h-full px-3 right-[3.125rem]",type:"button"},[...e[6]||(e[6]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 16 16",fill:"none"},[t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.99995 6.54551L14.5455 0L16 1.45454L1.45457 16L2.52421e-05 14.5454L6.5454 8.00005L0 1.45465L1.45454 0.00010735L7.99995 6.54551ZM14.5454 16.0001L9.162 10.6167L10.6165 9.16211L16 14.5455L14.5454 16.0001Z",fill:"#363433"})],-1)])])):c("",!0),e[7]||(e[7]=k('<span class="absolute flex items-center h-8 pl-3.5 right-4 border-l-1 border-newColors-gray-baseB" data-v-8ff7b0f7><svg xmlns="http://www.w3.org/2000/svg" width="1.1875rem" height="1.25rem" fill="none" viewBox="0 0 19 20" data-v-8ff7b0f7><g clip-path="url(#a)" data-v-8ff7b0f7><mask id="b" width="19" height="20" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:luminance;" data-v-8ff7b0f7><path fill="#fff" d="M0 0h18.963v20H0V0Z" data-v-8ff7b0f7></path></mask><g mask="url(#b)" data-v-8ff7b0f7><path fill="#0B8454" fill-rule="evenodd" d="M12.545 11.905A5.986 5.986 0 0 1 8 14c-3.309 0-6-2.692-6-6 0-3.309 2.691-6 6-6a6.006 6.006 0 0 1 5.999 6c0 .915-.212 1.779-.579 2.555l1.807.853A7.912 7.912 0 0 0 15.999 8c0-4.411-3.589-8-7.999-8-4.412 0-8 3.589-8 8s3.588 8 8 8c1.44 0 2.852-.393 4.086-1.136L17.222 20l1.741-1.741-6.418-6.354Z" clip-rule="evenodd" data-v-8ff7b0f7></path></g></g><defs data-v-8ff7b0f7><clipPath id="a" data-v-8ff7b0f7><path fill="#fff" d="M0 0h19v20H0z" data-v-8ff7b0f7></path></clipPath></defs></svg></span>',1))])])])]),t("section",Z,[t("div",N,[t("div",Q,[o.itemFromUrl.length>0?(n(),l("ul",j,[(n(!0),l(f,null,g(o.itemFromUrl,(i,h)=>(n(),l("li",{key:h},[b(v,{lastItem:h===o.itemFromUrl.length-1,name:i.category,tagText:`${i.questions.length} st`,hiddenFromStart:!1},{default:y(()=>[t("ul",z,[(n(!0),l(f,null,g(i.questions,(r,p)=>(n(),l("li",{key:p,class:"mb-3 rounded question bg-newColors-gray-background"},[t("div",O,[t("div",P,[t("div",{onClick:e[4]||(e[4]=w=>a.toggleAnswer(w)),class:"flex cursor-pointer"},[t("h4",R,m(r.question),1),e[8]||(e[8]=t("button",{type:"button",class:"faq-toggle-button-lvl2"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},[t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.74697 9.75166L9.74697 1.25298H12.2529V20.7449L9.74697 20.7449L9.74697 12.2568L1.25387 12.2538L1.25387 9.75166L9.74697 9.75166ZM20.746 12.2541H14.255L14.255 9.7481H20.746L20.746 12.2541Z",fill:"#2C2827"})]),t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},[t("path",{d:"M20.7449 12.253H1.25299L1.25299 9.74703H20.7449L20.7449 12.253Z",fill:"#E07300"})])],-1))]),t("div",{class:_(["faq-answer",r.isExpanded?"is-extended":"hidden"])},[t("div",Y,[t("p",{innerHTML:r.answer},null,8,K)])],2)])])]))),128))])],void 0,!0),_:2},1032,["lastItem","name","tagText"])]))),128))])):c("",!0),t("h2",W,[F(m(this.inputTextStatic.length>0?a.searchHeadingComputed:d.translations.listHeading)+" ",1),x((n(),l("svg",G,[...e[9]||(e[9]=[t("circle",{class:"spinner_b2T7",cx:"4",cy:"12",r:"3"},null,-1),t("circle",{class:"spinner_b2T7 spinner_YRVV",cx:"12",cy:"12",r:"3"},null,-1),t("circle",{class:"spinner_b2T7 spinner_c9oY",cx:"20",cy:"12",r:"3"},null,-1)])],512)),[[A,o.showSpinner]])]),a.matches.length>0?(n(),l("ul",J,[(n(!0),l(f,null,g(a.matches,(i,h)=>(n(),l("li",{key:h},[b(v,{lastItem:h===a.matches.length-1,name:i.category,parentText:"",tagText:`${i.questions.length} st`,hiddenFromStart:!i.isExpanded},{default:y(()=>[t("ul",X,[(n(!0),l(f,null,g(i.questions,(r,p)=>(n(),l("li",{key:p,class:"mb-3 rounded question bg-newColors-gray-background"},[t("div",$,[t("div",tt,[t("div",{onClick:e[5]||(e[5]=w=>a.toggleAnswer(w)),class:"flex items-center justify-between w-full cursor-pointer"},[t("h4",et,m(r.question),1),e[10]||(e[10]=t("button",{type:"button",class:"faq-toggle-button-lvl2"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},[t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.74697 9.75166L9.74697 1.25298H12.2529V20.7449L9.74697 20.7449L9.74697 12.2568L1.25387 12.2538L1.25387 9.75166L9.74697 9.75166ZM20.746 12.2541H14.255L14.255 9.7481H20.746L20.746 12.2541Z",fill:"#2C2827"})]),t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22",fill:"none"},[t("path",{d:"M20.7449 12.253H1.25299L1.25299 9.74703H20.7449L20.7449 12.253Z",fill:"#E07300"})])],-1))]),t("div",{class:_(["faq-answer",r.isExpanded?"":"hidden"])},[t("div",st,[t("p",{innerHTML:r.answer}
1,null,8,it)]),r.lastChangedDate?(n(),l("p",lt,m(`${d.translations.updated}: ${r.lastChangedDate}`),1)):c("",!0)],2)])])]))),128))])],void 0,!0),_:2},1032,["lastItem","name","tagText","hiddenFromStart"])]))),128))])):c("",!0)])])])])}const pt=M(S,[["render",nt],["__scopeId","data-v-8ff7b0f7"]]);export{pt as default}; 2//# sourceMappingURL=faqlist.2026.09.23.js.map
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.