1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/js/DocHotSpotMap.async-CGW_k4Ql.js","entry/js/main-DqXmKUqu.js","assets/css/main-CaCwPISZ.css","assets/css/DocHotSpotMap-CC47dbVi.css"])))=>i.map(i=>d[i]); 2import{d as Ce,v as p,$ as Be,o as v,e as m,k as P,t as U,j as S,F as ae,m as W,h,p as oe,g as me,f as G,X as he,a0 as Ae,a1 as ge,a2 as Me,a as He,a3 as Ve,a4 as Oe,a5 as Te,a6 as ye,a7 as _e,P as ze,R as qe,a8 as je,S as Ue}from"../../entry/js/main-DqXmKUqu.js";import{u as X}from"./useUrlBuilder-CdL_zIFV.js";import{_ as We}from"./DocLightBox.async-eVb3nsKv.js";import{_ as ne}from"./AbnMultiSelect.async-B4eL1kUT.js";import"./chevron-right-zKcuZoWg.js";const Ge=B=>(ze("data-v-c88521f8"),B=B(),qe(),B),Xe={class:"abn"},Ke={class:"mb-2 flex flex-row items-center justify-between"},Je={key:0,class:"abn-h2"},De=["href"],Qe=Ge(()=>P("span",{class:"hidden h-0"},null,-1)),Ye={class:"grid auto-rows-fr grid-cols-1 gap-3 self-stretch md:grid-cols-2"},Ze=["id","name","epiFindPropertyName","value","checked","data-fieldId","onChange"],ea={class:"mb-3 flex flex-row flex-wrap justify-center gap-4 sm:justify-start"},aa={class:"label-abn mb-1 text-abn-off-black",role:"alert"},la={class:"label-abn sr-only text-abn-off-black"},sa={key:2},ta={key:3},ia={id:"region-map",class:"p-1; hidden bg-[#E5F5FE]"},w="^^^",K=".list",oa=Ce({__name:"AbnCmsSearch.async",props:{data:{},isFromSearchPage:{type:Boolean},isFromActivities:{type:Boolean},hideMap:{type:Boolean,default:!0},showRegions:{type:Boolean,default:!0}},setup(B){var ue,pe,ve,fe;const ke=Me(()=>je(()=>import("./DocHotSpotMap.async-CGW_k4Ql.js"),__vite__mapDeps([0,1,2,3]))),A=B,o=p(new Map),le=p(!0),F=p(!1),se=p(""),n=p(),$=p(),J=p(-1),b=Be(new Map),re=p(),g=p(),R=p(),D=p(),M=p(),H=p(),Q=p(),I=p(),C=p(),N=p(!1),Se=p(null),te=p(0),Pe=e=>He(()=>b.get(e)),de=()=>{J.value++,Z(!0)},$e=e=>{M.value=e,D.value.setSelectedValues([e]),ie(e,"regions"),Ve.close()},be=()=>{var e;(e=document.getElementById("RegionLightBox"))==null||e.click()},ie=(e,s)=>{var l,r;s==="regions"&&e&&e.id&&(o.value.set(`${w}_region-id_`,{epiFindPropertyName:(l=n.value)==null?void 0:l.regionEpiProperty,selectedValue:e.display,fieldId:e==null?void 0:e.id}),g.value=e.id,M.value=e,Re(e.id)),s==="places"&&e&&e.id&&(o.value.set(`${w}_place-id_`,{epiFindPropertyName:(r=n.value)==null?void 0:r.placeEpiProperty,selectedValue:e.display,fieldId:e==null?void 0:e.id}),R.value=e.id,I.value=e),X(o.value)},Y=(e,s)=>{var l;s==="regions"&&((l=Q.value)==null||l.reset(),C.value=[],I.value=null,o.value.forEach((r,i)=>{i.startsWith(`${w}_place-id_`)&&o.value.delete(i)}),o.value.forEach((r,i)=>{i.startsWith(`${w}_region-id_`)&&o.value.delete(i)})),s==="places"&&(I.value=null,o.value.forEach((r,i)=>{i.startsWith(`${w}_place-id_`)&&o.value.delete(i)})),X(o.value)},xe=()=>{var s,l,r;((s=n==null?void 0:n.value.fields)==null?void 0:s.filter(i=>i.isCheckbox)).forEach(i=>{i.selectableValues.forEach(d=>{if(d.epiFindPropertyName.toLowerCase().includes(K)){const u=document.querySelector(`[id='${d.epiFindPropertyName}-${d.value}']`);u&&(u.checked=!1)}document.querySelectorAll(`[id='${d.epiFindPropertyName}']`).forEach(u=>{u.checked=!1}),document.querySelectorAll(`[data-fieldid="${d.epiFindPropertyName}"]`).forEach(u=>{u.checked=!1})})}),b.clear(),(l=D.value)==null||l.reset(),M.value=null,g.value=null,(r=Q.value)==null||r.reset(),I.value=null,R.value=null,o.value.clear(),window.history.pushState({},"",window.location.pathname),Z(!1)},Ee=async e=>{var x,E,L,V,O,T,z,q;if(e.size===0)return;const s=(x=n==null?void 0:n.value.fields)==null?void 0:x.filter(a=>a.isCheckbox),l=(E=n==null?void 0:n.value.fields)==null?void 0:E.filter(a=>!a.isCheckbox);if(g.value=e.get("region-id"),R.value=e.get("place-id"),g.value){const a=(V=(L=H.value)==null?void 0:L.layers)==null?void 0:V.find(t=>t.id==g.value);if(M.value=a,D.value.setSelectedValues([a]),o.value.set(`${w}_region-id_`,{epiFindPropertyName:(O=n.value)==null?void 0:O.regionEpiProperty,selectedValue:a.display,fieldId:g.value}),R.value&&C.value){const t=(T=C.value)==null?void 0:T.find(c=>c.id==R.value);t&&(I.value=t,Q.value.setSelectedValues([t]),o.value.set(`${w}
2_place-id_`,{epiFindPropertyName:(z=n.value)==null?void 0:z.placeEpiProperty,selectedValue:t.display,fieldId:R.value}))}}const r=e.get("Options")?"Options":e.get("Checkbox options")?"Checkbox options":e.get("Check box options")?"Check box options":"";let i=(q=e.get(r))==null?void 0:q.split(",");const d=new Map;e.forEach((a,t)=>{if(t!==r)if(s.map(c=>c.fieldName).includes(t)&&(a!=null&&a.toLowerCase().includes(K))){const c=a.split(",");i||(i=[]),c.forEach(y=>{i==null||i.push(`${t}_${y}`)})}else d.set(t,a)});const u=new Map;l.forEach(a=>{a.selectableValues.forEach(t=>{u.set(t.value,t)})});const f=new Map;s.forEach(a=>{a.selectableValues.forEach(t=>{t.epiFindPropertyName.toLowerCase().includes(K)?f.set(`${t.epiFindPropertyName}_${t.value}`,t):f.set(t.epiFindPropertyName,t)})}),_e(()=>{i==null||i.forEach(a=>{var _,k;const[t,c]=a.split(";"),y=document.getElementById(t)||document.getElementById(t.split("_")[1])||document.querySelector(`[data-fieldid="${t}"]`);if(y)if(y.checked=!0,t!=null&&t.toLowerCase().includes(K)){const j=t.split("_")[1],ee=t.split("-")[0].split("_")[1];o.value.set(j,{epiFindPropertyName:ee,selectedValue:c,fieldId:(_=f.get(j.replace("-","_")))==null?void 0:_.fieldId})}else o.value.set(`${r}_${t}`,{epiFindPropertyName:t,selectedValue:c,fieldId:(k=f.get(t))==null?void 0:k.fieldId})}),d==null||d.forEach((a,t)=>{a.split(",").forEach(c=>{var ee;let y=[];const[_,k]=c.split(";"),j=document.getElementById(`${_}_${k}`);j&&(j.checked=!0,y.push({epiFindPropertyName:_,display:k,value:k,isSelected:!0}),b.set(t,y),o.value.set(`${t}_${_}_${k}`,{epiFindPropertyName:_,selectedValue:k,fieldId:(ee=u.get(k))==null?void 0:ee.fieldId}))})}),Z(!1)})},Z=async e=>{var d,u,f,x,E;F.value=!0;const s={lastPark:"",pageNumber:J.value,searchBlockId:n.value.searchBlockId,selectedFilters:Array.from(o.value.values()),sortBy:re.value,andLogic:(d=n.value)==null?void 0:d.andLogic},{data:l,isFetching:r,error:i}=await Oe("/search",s);if(l){if(le.value=!1,e){const L=$.value.sections[0].foundPages.concat(((f=(u=l.value)==null?void 0:u.sections[0])==null?void 0:f.foundPages)||[]);$.value.sections[0].foundPages=L}else $.value=l.value,J.value=-1;se.value=((x=l.value)==null?void 0:x.embeddedMapUrl)||"",te.value=((E=l.value)==null?void 0:E.actualTotalResults)||0,Ie(),F.value=!1}else $.value=null;i.value&&(console.error("Error fetching search items",i),F.value=!1)},Fe=(e,s)=>{var i;const l=(i=e.srcElement)==null?void 0:i._value,r={epiFindPropertyName:l==null?void 0:l.epiFindPropertyName,selectedValue:l.value,fieldId:l.fieldId,id:l.id};if(l!=null&&l.epiFindPropertyName.toLowerCase().includes(K)){const d=`${s}_${l==null?void 0:l.epiFindPropertyName}-${l.value}`,u=`${l==null?void 0:l.epiFindPropertyName}-${l.value}`;if(o.value.has(d))o.value.delete(d);else if(o.value.has(u))o.value.delete(u);else{const f=d.split("-")[0];o.value.has(f)?o.value.delete(f):o.value.set(d,r)}}else o.value.has(`${s}_${l==null?void 0:l.epiFindPropertyName}`)?o.value.delete(`${s}_${l==null?void 0:l.epiFindPropertyName}`):o.value.set(`${s}_${l==null?void 0:l.epiFindPropertyName}`,r);X(o.value)},Ne=(e,s,l)=>{o.value.set(`${s}_${e==null?void 0:e.epiFindPropertyName}_${e==null?void 0:e.value}`,{epiFindPropertyName:e.epiFindPropertyName,selectedValue:e.display,fieldId:e.fieldId});let r=b.get(s);r?r.push(e):r=[e],b.set(s,r),X(o.value)},Le=(e,s,l)=>{o.value.delete(`${s}_${e.epiFindPropertyName}_${e.value}`);const r=document.getElementById(`${e.epiFindPropertyName}_${e.value}`);r.checked=!1;let i=b.get(s);i=i==null?void 0:i.filter(d=>d.value!==e.value),i?b.set(s,i):b.delete(s),X(o.value)},we=async e=>{if(A.showRegions){const{data:s,isFetching:l,error:r}=await Te();if(F.value=l.value,H.value=s.value,g.value=e.get("region-id"),g.value){N.value=!0;const{data:i,isFetching:d,error:u}=await ye(g.value);C.value=i.value,N.value=!1}Ee(e)}},Re=async e=>{N.value=!0;const{data:s,isFetching:l,error:r}=await ye(e);N.value=l.value,s.value&&(C.value=s.value,_e(()=>{N.value=!1})),r&&(N.value=!0)};n.value=A.data?JSON.parse(A==null?void 0:A.data):null,se.value=(ue=n.value)==null?void 0:ue.map.embeddedMapUrl,re.value=(pe=n.value)==null?void 0:pe.sortByOptions[0].value;const ce=new URLSearchParams(window.location.search);we(ce),ce.size===0&&($.value=(ve=n.value)==null?void 0:ve.initialSearchResults,te.value=(fe=n.value)==null?void 0:fe.initialSearchResults.totalResults);const Ie=()=>{var e;window.location.hash==="#activitypanel"&&((e=document.getElementById("activitypanel"))==null||e.scrollIntoView())};
2return(e,s)=>{var l,r,i,d,u,f,x,E,L,V,O,T,z,q;return v(),m("div",Xe,[P("div",Ke,[(l=n.value)!=null&&l.header?(v(),m("h2",Je,U((r=n.value)==null?void 0:r.header),1)):S("",!0),(i=n.value)!=null&&i.isHunting?(v(),m("a",{key:1,class:"text-doc-link-700 underline",href:se.value,alt:"Open hunting map"}," Map view ",8,De)):S("",!0)]),Qe,(d=n.value)!=null&&d.fields?(v(),m(ae,{key:0},[P("div",Ye,[(u=n.value)!=null&&u.regionEpiProperty?(v(),W(h(ne),{key:0,ref_key:"regionSelectRef",ref:D,value:M.value,trackBy:"id",componentId:"region",componentAriaLabel:"Region","link-text":"Select region from map",linkAsButton:!0,name:"Region",values:(f=H.value)==null?void 0:f.layers,isSingleSelect:!0,placeholder:"Any",onSelect:s[0]||(s[0]=a=>ie(a,"regions")),onRemove:s[1]||(s[1]=a=>Y(a,"regions")),onInput:s[2]||(s[2]=a=>Y(a,"regions")),onLinkClick:s[3]||(s[3]=()=>be())},null,8,["value","values"])):S("",!0),(x=n.value)!=null&&x.placeEpiProperty?(v(),W(h(ne),{key:1,ref_key:"placeSelectRef",ref:Q,value:I.value,trackBy:"id",componentId:"place",componentAriaLabel:"Place",name:"Place",values:C.value,isSingleSelect:!0,placeholder:"Any",isLoading:N.value,onSelect:s[4]||(s[4]=a=>ie(a,"places")),onRemove:s[5]||(s[5]=a=>Y(a,"places")),onInput:s[6]||(s[6]=a=>Y(a,"places"))},null,8,["value","values","isLoading"])):S("",!0),(v(!0),m(ae,null,oe((L=(E=n.value)==null?void 0:E.fields)==null?void 0:L.filter(a=>!a.isCheckbox),(a,t)=>(v(),W(h(ne),{key:t,trackBy:"value",isSingleSelect:!1,value:Pe(a.fieldName),componentAriaLabel:a.fieldName,values:a.selectableValues,name:a.fieldName,linkUrl:a.linkUrl,linkText:a.linkText,"close-on-select":!0,"data-fieldId":a.fieldName,onSelect:c=>Ne(c,a.fieldName,a.fieldId),onRemove:c=>Le(c,a.fieldName,a.fieldId)},null,8,["value","componentAriaLabel","values","name","linkUrl","linkText","data-fieldId","onSelect","onRemove"]))),128))]),(v(!0),m(ae,null,oe((V=n.value.fields)==null?void 0:V.filter(a=>a.isCheckbox),(a,t)=>(v(),m("div",{key:t,class:"mb-3 flex flex-col items-start sm:flex-row sm:gap-2"},[(v(!0),m(ae,null,oe(a.selectableValues,(c,y)=>(v(),m("label",{key:y,class:"flex items-center"},[P("input",{id:`${c.epiFindPropertyName}-${c.display}`,class:"doc-cb mr-1",name:c.display,type:"checkbox",epiFindPropertyName:`${c.fieldId}-${c.display}`,value:c,checked:c.isSelected,"data-fieldId":`${c.epiFindPropertyName}`,onChange:_=>Fe(_,a.fieldName)},null,40,Ze),me(" "+U(c.display),1)]))),128))]))),128))],64)):S("",!0),P("div",ea,[G(h(he),{id:"search-button",text:"SEARCH",size:"default",theme:"primary",alt:"Search using selected criteria",onClick:s[7]||(s[7]=a=>Z(!1))}),G(h(he),{class:"border-b-0",text:"RESET",size:"default",theme:"quaternary",alt:"Clear search criteria",onClick:s[8]||(s[8]=a=>xe())})]),P("div",aa,[me(U(te.value)+" results for "+U((O=n.value)==null?void 0:O.resultsHeader)+" ",1),P("span",la,"Currently showing "+U((T=$.value)==null?void 0:T.sections[0].foundPages.length)+" results.",1)]),F.value&&J.value===-1?(v(),W(h(Ae),{key:1,class:"mt-1",standalone:!0,message:" "})):S("",!0),(z=n.value)!=null&&z.isHunting?S("",!0):(v(),m("div",sa,[G(h(ge),{searchResults:$.value,isinitialload:le.value,isfromsearchpage:!1,enableInfiniteScroll:!0,isLoading:F.value,"button-text":"LOAD MORE",onLoadMore:de},null,8,["searchResults","isinitialload","isLoading"])])),(q=n.value)!=null&&q.isHunting?(v(),m("div",ta,[G(h(ge),{searchResults:$.value,isinitialload:le.value,isfromsearchpage:!1,enableInfiniteScroll:!0,isLoading:F.value,"button-text":"Load more",onLoadMore:de},null,8,["searchResults","isinitialload","isLoading"])])):S("",!0),G(h(We),{id:"RegionLightBox",ref_key:"hotSpotRef",ref:Se,"data-src":"#region-map","data-fancybox-type":"inline"},null,512),P("div",ia,[P("div",null,[H.value?(v(),W(h(ke),{key:0,class:"mx-auto max-h-[550px] w-[calc(100vw-40px)] max-w-[640px]",mapConfiguration:H.value,disableLink:!0,onHotSpotClicked:$e},null,8,["mapConfiguration"])):S("",!0)])])])}}}),pa=Ue(oa,[["__scopeId","data-v-c88521f8"]]);export{pa as default};
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.