1import{s as e}from"./helpers-ePuekpbm.js";import{x as t}from"./reactivity.esm-bundler-DQcBDaMz.js";var n=new Map;function r(e,n=!1){let r=``,a=structuredClone(t(e));if(n)for(let[e,t]of Object.entries(n))a[e]=t;for(let[e,t]of Object.entries(a))if(e===`searchString`){if(t===``)continue;r+=t+`/`}else if(Array.isArray(t))for(let n of t)r+=e+`:`+i(n)+`/`;else r+=e+`:`+i(t)+`/`;return r}function i(e){return typeof e==`string`||e instanceof String?e.replaceAll(`/`,`__`):e}var a=1715955480,o=1715955485,s=1753970306,c=1753970313,l=1715955481,u=1780925800,d=`MetaGeojsonSearch`,f=`MetaCountSearch`,p=`MetaPdfDownload`,m=`MetaFacetsSearch`,h=`MetaAutocomplete`;async function g(e,t,n={}){let i=r(t,n),s=i.includes(`sort:random`)?o:a,c=e+`All/`+i+`?type=`+s,l;try{l=await fetch(c)}catch(e){console.log(`Fetching `+c+` failed`,e)}return l?.ok?l.text():(console.log(`Fetching `+c+` failed with status `+l?.status),!1)}async function _(e,t,n={}){let i=r(t,n),a=i.includes(`sort:random`)?c:s,o=e+`All/`+i+`?type=`+a,l;try{l=await fetch(o)}catch(e){console.log(`Fetching `+o+` failed`,e)}return l?.ok?l.text():(console.log(`Fetching `+o+` failed with status `+l?.status),!1)}async function v(e,n,r={}){let i=structuredClone(t(n));if(r)for(let[e,t]of Object.entries(r))i[e]=t;return y(e,i,d,l)}async function y(t,i,o,s=a,c=``,l=!0){let u=new URL(e.baseUrl);u.pathname=u.pathname.replace(`/$`,``)+`/`+o+`/`+r(i),u.searchParams.set(`type`,String(s));let d;!l&&n.has(c)&&n.get(c).abort();try{let e=new AbortController;n.set(c,e),d=await fetch(u,{signal:e.signal})}catch(e){e instanceof DOMException||console.log(`Fetching `+u+` failed`,e)}return d?.ok?d.json():(console.log(`Fetching `+u+` failed with status `+d?.status),!1)}async function b(e,t,n){let i=e+`MetaClusterSearch/`+r(t,{boundsQuery:n})+`?type=1715955480`,a;try{a=await fetch(i)}catch(e){console.log(`Fetching `+i+` failed`,e)}return a?.ok?a.json():(console.log(`Fetching `+i+` failed with status `+a?.status),!1)}async function x(e,t){return y(e,t,f,l)}async function S(e,t){return y(e,t,p,l)}async function C(e,t){return y(e,t,m,l)}async function w(e,t){return y(e,t,h,l,`autocomplete`,!1)}var T={hasApiKey:!1,hasAvailableCalls:!1};function E(e){let t=e?.data??{},n=t.hasApiKey===!0||e?.hasApiKey===!0;return typeof t.hasAvailableCalls==`boolean`?{hasApiKey:n,hasAvailableCalls:t.hasAvailableCalls}:Number.isFinite(Number(t.available))?{hasApiKey:n,hasAvailableCalls:Number(t.available)>0}:{hasApiKey:n,hasAvailableCalls:t.status===`ok`}}async function D(){let e=new URL(window.location.href);e.searchParams.set(`type`,String(u)),e.searchParams.set(`method`,`getApiCallsQuota`);let t;try{t=await fetch(e,{headers:{Accept:`application/json`}})}catch(e){console.log(`Fetching AI search availability failed`,e)}if(t?.ok)try{return E(await t.json())}catch(e){return console.log(`Parsing AI search status failed`,e),T}return console.log(`Fetching AI search status failed with status `+t?.status),T}function O(e,t){return e+`All/`+encodeURI(r(t))+`#result-list-app`}function k(e,t){let n=new URL(window.location.href),i=e.endsWith(`All`)||e.endsWith(`All/`)?e:e+`All/`;i+=r(t),i+=n.search;let a={...t};history.pushState(JSON.parse(JSON.stringify(a)),``,i)}function A(e){return e*.0174532925}function j(e){return e*57.2957795}function M(e,t,n=.1){let r=A(-90),i=A(90),a=A(-180),o=A(180),s=A(e),c=A(t),l=n/6371.01,u=s-l,d=s+l,f,p;if(u>r&&d<i){let e=Math.asin(Math.sin(l)/Math.cos(s));f=c-e,f<a&&(f+=2*Math.PI),p=c+e,p>o&&(p-=2*Math.PI)}else u=Math.max(u,r),d=Math.min(d,i),f=a,p=o;return{lat:e,lng:t,minLat:j(u),maxLat:j(d),minLng:j(f),maxLng:j(p)}}function N(e){let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`#js-results-ajax-map-geojson`);return n?JSON.parse(n.textContent):!1}function P(){if(!localStorage.getItem(`ndsbookmarks`))return!1;let e=JSON.parse(localStorage.getItem(`ndsbookmarks`));if(!e||!e.items||e.items.length===0)return!1;let t=[];return e.items.forEach(e=>{t.push(e.split(/_(.*)/)[1])}),t}export{C as a,x as c,P as d,M as f,k as h,b as i,g as l,O as m,D as n,v as o,N as p,w as r,S as s,r as t,_ 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.