import{_ as O}from"./BContainer.vue_vue_type_script_setup_true_lang-Bi1hGl0B-Bd4Gid1V.js";import{_ as x,a as B}from"./BListGroupItem.vue_vue_type_script_setup_true_lang-J0Ydbiva-Cr65tDD4.js";import{_ as M}from"./BImg.vue_vue_type_script_setup_true_lang-BJeFN9OT-6jJZkpT2.js";import{_ as N}from"./BForm.vue_vue_type_script_setup_true_lang-u44ElAm9-BpNSPhCc.js";import{_ as A}from"./useFormSelect-DvaFh_iu-BGTVaqMd.js";import{_ as E}from"./BFormSelect.vue_vue_type_script_setup_true_lang-CkLgnxVA-_BER9NPg.js";import{_ as I}from"./BFormGroup.vue_vue_type_script_setup_true_lang-BmZN8qcE-Cpaz2jd5.js";import{_ as F,d as h,o as i,a as f,b as n,e as l,t as c,g as P,w as o,c as _,h as g,F as b,r as $}from"./index-D02r7Zsc.js";import"./useDefaults-DESCdb0p-CFLjYrdG.js";import"./BLink.vue_vue_type_script_setup_true_lang-Ct47WhzE-DDPYis_D.js";import"./object-0ALvRU0O-3BORTTD-.js";import"./stringUtils-gJJ6T6UC-g5BZrMym.js";import"./useRadiusElementClasses-DtKYQuWz-DKKObN9q.js";import"./useStateClass-BGbSLWFN-BcKQ8Z3i.js";import"./index-C0p9vHHI-DoOEDIMw.js";import"./useId-t29UARy6-BH5d2231.js";import"./dom-DVb-f0ZG-Crdf0-mU.js";import"./BCol.vue_vue_type_script_setup_true_lang-D0xTJQ30-C8E8teuV.js";import"./getClasses-CsgNQabU-zDOdZIGY.js";import"./BFormValidFeedback.vue_vue_type_script_setup_true_lang-D5WYd1j7-BqGw1a2-.js";import"./useColorVariantClasses-ZDE19TZw-Cvu7SygP.js";const R={data:function(){return{sections:[],helpMessage:this.$t("sections.helpMessage"),locations:[],selectedLocation:0}},created:async function(){this.publish("showOverlay",!0),this.selectedLocation="all",this.locations=await this.get("ws").getLocations(),await this.getAllSections(),this.publish("showOverlay",!1)},methods:{async getResults(t){this.publish("showOverlay",!0);const e=this.selectedLocation==="all"?"expl_location":this.selectedLocation,r=await this.getModule("search").simpleSearchLocalise(this.get("sessionId"),"0","*",e,t,!0);this.$router.push({name:"searchresult",params:{searchId:r}})},async changeLocation(){this.selectedLocation==="all"?await this.getAllSections():this.sections=await this.get("ws").getSections(this.selectedLocation)},async getAllSections(){this.publish("showOverlay",!0);const t=this.locations.map(m=>this.get("ws").getSections(m.location_id)),e=await Promise.all(t),r=[],p=new Set;e.forEach(m=>{m.forEach(a=>{p.has(a.section_id)||(p.add(a.section_id),r.push(a))})}),this.sections=r,this.publish("showOverlay",!1)}}},T={class:"d-flex justify-content-around align-items-baseline mb-2"},j={class:"h3 title text-center text-secondary"};function D(t,e,r,p,m,a){const w=P("help"),y=I,u=A,L=E,v=N,S=M,k=B,C=x,V=O;return i(),h("div",null,[f("div",T,[e[2]||(e[2]=l("   ",-1)),f("h1",j,c(t.$t("menusLabels.sections.full")),1),n(w,{help:this.helpMessage},null,8,["help"])]),n(V,{fluid:"sm"},{default:o(()=>[t.locations.length>1?(i(),_(v,{key:0,class:"my-4"},{default:o(()=>[n(y,null,{default:o(()=>[l(c(t.$t("sections.locationSelectorTitle")),1)]),_:1}),n(L,{onChange:e[0]||(e[0]=s=>a.changeLocation()),modelValue:t.selectedLocation,"onUpdate:modelValue":e[1]||(e[1]=s=>t.selectedLocation=s)},{default:o(()=>[n(u,{value:"",disabled:""},{default:o(()=>[l(c(t.$t("sections.locationSelectorCaption")),1)]),_:1}),n(u,{value:"all"},{default:o(()=>[l(c(t.$t("sections.allLocations")),1)]),_:1}),(i(!0),h(b,null,$(this.locations,(s,d)=>(i(),_(u,{key:d,value:s.location_id},{default:o(()=>[l(c(s.location_caption),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})):g("",!0),n(C,null,{default:o(()=>[(i(!0),h(b,null,$(t.sections,(s,d)=>(i(),_(k,{button:"",onClick:U=>a.getResults(s.section_id),key:d},{default:o(()=>[e[3]||(e[3]=f("i",{class:"bi bi-dot text-black-purple"},null,-1)),s.section_image?(i(),_(S,{key:0,src:s.section_image,height:"35px",width:"35px",thumbnail:"",fluid:""},null,8,["src"])):g("",!0),l("   "+c(s.section_caption),1)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})])}const mt=F(R,[["render",D]]);export{mt as default};
