From 4f275a6e3712dbec2f1ac701d16b4500e90f6a2a Mon Sep 17 00:00:00 2001 From: dabreegster Date: Thu, 3 Oct 2024 11:40:47 +0000 Subject: [PATCH] deploy: 83a90a31e92bcd50af5e6707aef03d48a3f6a2c5 --- browse_layout_v3/assets/About-32237c0d.js | 24 +++ browse_layout_v3/assets/About-4dc186c6.js | 24 --- browse_layout_v3/assets/Popup-00bc00d9.js | 1 + browse_layout_v3/assets/Popup-addc1aa5.js | 1 - ...Map-afe869ee.js => ZoomOutMap-9940a4a0.js} | 6 +- .../{index-12949150.js => index-980b667c.js} | 2 +- browse_layout_v3/assets/main-1f7adbfe.js | 1 - browse_layout_v3/assets/main-1f9b9707.js | 1 + ...{nested-35efa1b5.js => nested-e1f3a1bf.js} | 2 +- browse_layout_v3/assets/nested2-1a524c96.js | 177 ------------------ browse_layout_v3/assets/nested2-ba23dce0.js | 177 ++++++++++++++++++ browse_layout_v3/browse.html | 8 +- browse_layout_v3/index.html | 8 +- browse_layout_v3/scheme.html | 8 +- 14 files changed, 220 insertions(+), 220 deletions(-) create mode 100644 browse_layout_v3/assets/About-32237c0d.js delete mode 100644 browse_layout_v3/assets/About-4dc186c6.js create mode 100644 browse_layout_v3/assets/Popup-00bc00d9.js delete mode 100644 browse_layout_v3/assets/Popup-addc1aa5.js rename browse_layout_v3/assets/{ZoomOutMap-afe869ee.js => ZoomOutMap-9940a4a0.js} (65%) rename browse_layout_v3/assets/{index-12949150.js => index-980b667c.js} (99%) delete mode 100644 browse_layout_v3/assets/main-1f7adbfe.js create mode 100644 browse_layout_v3/assets/main-1f9b9707.js rename browse_layout_v3/assets/{nested-35efa1b5.js => nested-e1f3a1bf.js} (99%) delete mode 100644 browse_layout_v3/assets/nested2-1a524c96.js create mode 100644 browse_layout_v3/assets/nested2-ba23dce0.js diff --git a/browse_layout_v3/assets/About-32237c0d.js b/browse_layout_v3/assets/About-32237c0d.js new file mode 100644 index 00000000..e3fb5481 --- /dev/null +++ b/browse_layout_v3/assets/About-32237c0d.js @@ -0,0 +1,24 @@ +import{S as Ce,i as Ie,s as Pe,aT as Me,g as We,h as Le,j as u,o as p,r as je,t as c,p as m,u as g,b3 as d,e as k,x as r,a as x,b as Se,c as h,m as l,d as _}from"./index-980b667c.js";function Re(a){let e;return{c(){e=r("open source project")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Be(a){let e;return{c(){e=r(`Dustin Carlino + `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ee(a){let e;return{c(){e=r("Peter York")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ge(a){let e;return{c(){e=r("Madison Wang")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ue(a){let e;return{c(){e=r(`Stuart Lynn + `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ye(a){let e;return{c(){e=r("Ben Ritter")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function qe(a){let e;return{c(){e=r("OpenStreetMap")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function ze(a){let e;return{c(){e=r("MapLibre")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function De(a){let e;return{c(){e=r(`svelte-maplibre + `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function He(a){let e;return{c(){e=r("GeoRust")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Je(a){let e;return{c(){e=r(`osm2streets + `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Oe(a){let e;return{c(){e=r(`Material icons + `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Xe(a){let e;return{c(){e=r("start an issue on Github")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Fe(a){let e,t,s,b,w,$,i,v,T,J,O,q,S,X,A,F,C,K,I,N,P,Q,z,V,f,Z,M,y,W,ee,L,te,j,ne,R,se,B,le,ae,E,re,G,oe,U,$e,ie,fe,ue,D,pe,H,Y;return b=new d({props:{href:"https://github.com/acteng/atip",$$slots:{default:[Re]},$$scope:{ctx:a}}}),T=new d({props:{href:"https://www.turing.ac.uk/people/researchers/dustin-carlino",$$slots:{default:[Be]},$$scope:{ctx:a}}}),S=new d({props:{href:"https://github.com/Pete-Y-CS",$$slots:{default:[Ee]},$$scope:{ctx:a}}}),C=new d({props:{href:"https://www.linkedin.com/in/madison-wang-841977bb/",$$slots:{default:[Ge]},$$scope:{ctx:a}}}),I=new d({props:{href:"https://github.com/stuartlynn",$$slots:{default:[Ue]},$$scope:{ctx:a}}}),P=new d({props:{href:"https://github.com/BudgieInWA",$$slots:{default:[Ye]},$$scope:{ctx:a}}}),M=new d({props:{href:"https://www.openstreetmap.org/about",$$slots:{default:[qe]},$$scope:{ctx:a}}}),W=new d({props:{href:"https://maplibre.org/",$$slots:{default:[ze]},$$scope:{ctx:a}}}),L=new d({props:{href:"https://github.com/dimfeld/svelte-maplibre/",$$slots:{default:[De]},$$scope:{ctx:a}}}),j=new d({props:{href:"https://georust.org/",$$slots:{default:[He]},$$scope:{ctx:a}}}),R=new d({props:{href:"https://github.com/a-b-street/osm2streets",$$slots:{default:[Je]},$$scope:{ctx:a}}}),B=new d({props:{href:"https://material.io/resources/icons/",$$slots:{default:[Oe]},$$scope:{ctx:a}}}),G=new d({props:{href:"https://github.com/acteng/atip/issues/new",$$slots:{default:[Xe]},$$scope:{ctx:a}}}),{c(){e=k("div"),t=k("p"),s=r(`ATIP Scheme Sketcher v2 is an + `),u(b.$$.fragment),w=r(" supported by Active Travel England and developed by:"),$=x(),i=k("ul"),v=k("li"),u(T.$$.fragment),J=r(": lead developer, from The Alan Turing Institute"),O=x(),q=k("li"),u(S.$$.fragment),X=x(),A=k("li"),F=r(`With UX help from + `),u(C.$$.fragment),K=r(" and "),u(I.$$.fragment),N=r(`, and CSS help from + `),u(P.$$.fragment),Q=x(),z=k("li"),z.textContent=`With great thanks to ATIP's various users for feedback, testing, and + ideas`,V=x(),f=k("p"),Z=r(`ATIP builds on + `),u(M.$$.fragment),y=r(` + contributors, + `),u(W.$$.fragment),ee=r(`, + `),u(L.$$.fragment),te=r(`, + `),u(j.$$.fragment),ne=r(`, + `),u(R.$$.fragment),se=r(`, + `),u(B.$$.fragment),le=r(", and other open source projects."),ae=x(),E=k("p"),re=r("We want your feedback about ATIP! Please "),u(G.$$.fragment),oe=r(` + or email + `),U=k("a"),U.textContent="dcarlino@turing.ac.uk",$e=r(` + .`),ie=x(),fe=k("hr"),ue=x(),D=k("h2"),D.textContent="Recent changes",pe=x(),H=k("ul"),H.innerHTML=`
  • v2 + launched on 2 June 2023. Changes: a complete UI rewrite, new draw tools, + drawing areas snapped to roads, splitting routes, multiple data schemas, + speed limit layer, lane visualization layer
  • v1 + launched in March 2023
  • `,Se(U,"href","mailto: dcarlino@turing.ac.uk"),Se(e,"class","govuk-prose")},m(n,o){h(n,e,o),l(e,t),l(t,s),p(b,t,null),l(t,w),l(e,$),l(e,i),l(i,v),p(T,v,null),l(v,J),l(i,O),l(i,q),p(S,q,null),l(i,X),l(i,A),l(A,F),p(C,A,null),l(A,K),p(I,A,null),l(A,N),p(P,A,null),l(i,Q),l(i,z),l(e,V),l(e,f),l(f,Z),p(M,f,null),l(f,y),p(W,f,null),l(f,ee),p(L,f,null),l(f,te),p(j,f,null),l(f,ne),p(R,f,null),l(f,se),p(B,f,null),l(f,le),l(e,ae),l(e,E),l(E,re),p(G,E,null),l(E,oe),l(E,U),l(E,$e),l(e,ie),l(e,fe),l(e,ue),l(e,D),l(e,pe),l(e,H),Y=!0},p(n,o){const ce={};o&4&&(ce.$$scope={dirty:o,ctx:n}),b.$set(ce);const me={};o&4&&(me.$$scope={dirty:o,ctx:n}),T.$set(me);const ge={};o&4&&(ge.$$scope={dirty:o,ctx:n}),S.$set(ge);const he={};o&4&&(he.$$scope={dirty:o,ctx:n}),C.$set(he);const _e={};o&4&&(_e.$$scope={dirty:o,ctx:n}),I.$set(_e);const de={};o&4&&(de.$$scope={dirty:o,ctx:n}),P.$set(de);const ke={};o&4&&(ke.$$scope={dirty:o,ctx:n}),M.$set(ke);const be={};o&4&&(be.$$scope={dirty:o,ctx:n}),W.$set(be);const we={};o&4&&(we.$$scope={dirty:o,ctx:n}),L.$set(we);const xe={};o&4&&(xe.$$scope={dirty:o,ctx:n}),j.$set(xe);const ve={};o&4&&(ve.$$scope={dirty:o,ctx:n}),R.$set(ve);const Ae={};o&4&&(Ae.$$scope={dirty:o,ctx:n}),B.$set(Ae);const Te={};o&4&&(Te.$$scope={dirty:o,ctx:n}),G.$set(Te)},i(n){Y||(c(b.$$.fragment,n),c(T.$$.fragment,n),c(S.$$.fragment,n),c(C.$$.fragment,n),c(I.$$.fragment,n),c(P.$$.fragment,n),c(M.$$.fragment,n),c(W.$$.fragment,n),c(L.$$.fragment,n),c(j.$$.fragment,n),c(R.$$.fragment,n),c(B.$$.fragment,n),c(G.$$.fragment,n),Y=!0)},o(n){m(b.$$.fragment,n),m(T.$$.fragment,n),m(S.$$.fragment,n),m(C.$$.fragment,n),m(I.$$.fragment,n),m(P.$$.fragment,n),m(M.$$.fragment,n),m(W.$$.fragment,n),m(L.$$.fragment,n),m(j.$$.fragment,n),m(R.$$.fragment,n),m(B.$$.fragment,n),m(G.$$.fragment,n),Y=!1},d(n){n&&_(e),g(b),g(T),g(S),g(C),g(I),g(P),g(M),g(W),g(L),g(j),g(R),g(B),g(G)}}}function Ke(a){let e,t,s;function b($){a[1]($)}let w={title:"About the Active Travel Infrastructure Platform",$$slots:{default:[Fe]},$$scope:{ctx:a}};return a[0]!==void 0&&(w.open=a[0]),e=new Me({props:w}),We.push(()=>Le(e,"open",b)),{c(){u(e.$$.fragment)},m($,i){p(e,$,i),s=!0},p($,[i]){const v={};i&4&&(v.$$scope={dirty:i,ctx:$}),!t&&i&1&&(t=!0,v.open=$[0],je(()=>t=!1)),e.$set(v)},i($){s||(c(e.$$.fragment,$),s=!0)},o($){m(e.$$.fragment,$),s=!1},d($){g(e,$)}}}function Ne(a,e,t){let{open:s}=e;function b(w){s=w,t(0,s)}return a.$$set=w=>{"open"in w&&t(0,s=w.open)},[s,b]}class Ve extends Ce{constructor(e){super(),Ie(this,e,Ne,Ke,Pe,{open:0})}}export{Ve as A}; diff --git a/browse_layout_v3/assets/About-4dc186c6.js b/browse_layout_v3/assets/About-4dc186c6.js deleted file mode 100644 index 0f2794ac..00000000 --- a/browse_layout_v3/assets/About-4dc186c6.js +++ /dev/null @@ -1,24 +0,0 @@ -import{S as Ce,i as Ie,s as Pe,aT as Me,z as We,A as Le,c as u,m as p,H as Re,t as c,a as m,d as g,b3 as d,f as k,p as r,b as x,g as Se,h,q as l,k as _}from"./index-12949150.js";function je(a){let e;return{c(){e=r("open source project")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function qe(a){let e;return{c(){e=r(`Dustin Carlino - `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function ze(a){let e;return{c(){e=r("Peter York")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Be(a){let e;return{c(){e=r("Madison Wang")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ee(a){let e;return{c(){e=r(`Stuart Lynn - `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ge(a){let e;return{c(){e=r("Ben Ritter")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function He(a){let e;return{c(){e=r("OpenStreetMap")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ue(a){let e;return{c(){e=r("MapLibre")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Ye(a){let e;return{c(){e=r(`svelte-maplibre - `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function De(a){let e;return{c(){e=r("GeoRust")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Je(a){let e;return{c(){e=r(`osm2streets - `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Oe(a){let e;return{c(){e=r(`Material icons - `)},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Xe(a){let e;return{c(){e=r("start an issue on Github")},m(t,s){h(t,e,s)},d(t){t&&_(e)}}}function Fe(a){let e,t,s,b,w,$,f,v,T,J,O,H,S,X,A,F,C,K,I,N,P,Q,U,V,i,Z,M,y,W,ee,L,te,R,ne,j,se,q,le,ae,z,re,B,oe,E,$e,fe,ie,ue,Y,pe,D,G;return b=new d({props:{href:"https://github.com/acteng/atip",$$slots:{default:[je]},$$scope:{ctx:a}}}),T=new d({props:{href:"https://www.turing.ac.uk/people/researchers/dustin-carlino",$$slots:{default:[qe]},$$scope:{ctx:a}}}),S=new d({props:{href:"https://github.com/Pete-Y-CS",$$slots:{default:[ze]},$$scope:{ctx:a}}}),C=new d({props:{href:"https://www.linkedin.com/in/madison-wang-841977bb/",$$slots:{default:[Be]},$$scope:{ctx:a}}}),I=new d({props:{href:"https://github.com/stuartlynn",$$slots:{default:[Ee]},$$scope:{ctx:a}}}),P=new d({props:{href:"https://github.com/BudgieInWA",$$slots:{default:[Ge]},$$scope:{ctx:a}}}),M=new d({props:{href:"https://www.openstreetmap.org/about",$$slots:{default:[He]},$$scope:{ctx:a}}}),W=new d({props:{href:"https://maplibre.org/",$$slots:{default:[Ue]},$$scope:{ctx:a}}}),L=new d({props:{href:"https://github.com/dimfeld/svelte-maplibre/",$$slots:{default:[Ye]},$$scope:{ctx:a}}}),R=new d({props:{href:"https://georust.org/",$$slots:{default:[De]},$$scope:{ctx:a}}}),j=new d({props:{href:"https://github.com/a-b-street/osm2streets",$$slots:{default:[Je]},$$scope:{ctx:a}}}),q=new d({props:{href:"https://material.io/resources/icons/",$$slots:{default:[Oe]},$$scope:{ctx:a}}}),B=new d({props:{href:"https://github.com/acteng/atip/issues/new",$$slots:{default:[Xe]},$$scope:{ctx:a}}}),{c(){e=k("div"),t=k("p"),s=r(`ATIP Scheme Sketcher v2 is an - `),u(b.$$.fragment),w=r(" supported by Active Travel England and developed by:"),$=x(),f=k("ul"),v=k("li"),u(T.$$.fragment),J=r(": lead developer, from The Alan Turing Institute"),O=x(),H=k("li"),u(S.$$.fragment),X=x(),A=k("li"),F=r(`With UX help from - `),u(C.$$.fragment),K=r(" and "),u(I.$$.fragment),N=r(`, and CSS help from - `),u(P.$$.fragment),Q=x(),U=k("li"),U.textContent=`With great thanks to ATIP's various users for feedback, testing, and - ideas`,V=x(),i=k("p"),Z=r(`ATIP builds on - `),u(M.$$.fragment),y=r(` - contributors, - `),u(W.$$.fragment),ee=r(`, - `),u(L.$$.fragment),te=r(`, - `),u(R.$$.fragment),ne=r(`, - `),u(j.$$.fragment),se=r(`, - `),u(q.$$.fragment),le=r(", and other open source projects."),ae=x(),z=k("p"),re=r("We want your feedback about ATIP! Please "),u(B.$$.fragment),oe=r(` - or email - `),E=k("a"),E.textContent="dcarlino@turing.ac.uk",$e=r(` - .`),fe=x(),ie=k("hr"),ue=x(),Y=k("h2"),Y.textContent="Recent changes",pe=x(),D=k("ul"),D.innerHTML=`
  • v2 - launched on 2 June 2023. Changes: a complete UI rewrite, new draw tools, - drawing areas snapped to roads, splitting routes, multiple data schemas, - speed limit layer, lane visualization layer
  • v1 - launched in March 2023
  • `,Se(E,"href","mailto: dcarlino@turing.ac.uk"),Se(e,"class","govuk-prose")},m(n,o){h(n,e,o),l(e,t),l(t,s),p(b,t,null),l(t,w),l(e,$),l(e,f),l(f,v),p(T,v,null),l(v,J),l(f,O),l(f,H),p(S,H,null),l(f,X),l(f,A),l(A,F),p(C,A,null),l(A,K),p(I,A,null),l(A,N),p(P,A,null),l(f,Q),l(f,U),l(e,V),l(e,i),l(i,Z),p(M,i,null),l(i,y),p(W,i,null),l(i,ee),p(L,i,null),l(i,te),p(R,i,null),l(i,ne),p(j,i,null),l(i,se),p(q,i,null),l(i,le),l(e,ae),l(e,z),l(z,re),p(B,z,null),l(z,oe),l(z,E),l(z,$e),l(e,fe),l(e,ie),l(e,ue),l(e,Y),l(e,pe),l(e,D),G=!0},p(n,o){const ce={};o&4&&(ce.$$scope={dirty:o,ctx:n}),b.$set(ce);const me={};o&4&&(me.$$scope={dirty:o,ctx:n}),T.$set(me);const ge={};o&4&&(ge.$$scope={dirty:o,ctx:n}),S.$set(ge);const he={};o&4&&(he.$$scope={dirty:o,ctx:n}),C.$set(he);const _e={};o&4&&(_e.$$scope={dirty:o,ctx:n}),I.$set(_e);const de={};o&4&&(de.$$scope={dirty:o,ctx:n}),P.$set(de);const ke={};o&4&&(ke.$$scope={dirty:o,ctx:n}),M.$set(ke);const be={};o&4&&(be.$$scope={dirty:o,ctx:n}),W.$set(be);const we={};o&4&&(we.$$scope={dirty:o,ctx:n}),L.$set(we);const xe={};o&4&&(xe.$$scope={dirty:o,ctx:n}),R.$set(xe);const ve={};o&4&&(ve.$$scope={dirty:o,ctx:n}),j.$set(ve);const Ae={};o&4&&(Ae.$$scope={dirty:o,ctx:n}),q.$set(Ae);const Te={};o&4&&(Te.$$scope={dirty:o,ctx:n}),B.$set(Te)},i(n){G||(c(b.$$.fragment,n),c(T.$$.fragment,n),c(S.$$.fragment,n),c(C.$$.fragment,n),c(I.$$.fragment,n),c(P.$$.fragment,n),c(M.$$.fragment,n),c(W.$$.fragment,n),c(L.$$.fragment,n),c(R.$$.fragment,n),c(j.$$.fragment,n),c(q.$$.fragment,n),c(B.$$.fragment,n),G=!0)},o(n){m(b.$$.fragment,n),m(T.$$.fragment,n),m(S.$$.fragment,n),m(C.$$.fragment,n),m(I.$$.fragment,n),m(P.$$.fragment,n),m(M.$$.fragment,n),m(W.$$.fragment,n),m(L.$$.fragment,n),m(R.$$.fragment,n),m(j.$$.fragment,n),m(q.$$.fragment,n),m(B.$$.fragment,n),G=!1},d(n){n&&_(e),g(b),g(T),g(S),g(C),g(I),g(P),g(M),g(W),g(L),g(R),g(j),g(q),g(B)}}}function Ke(a){let e,t,s;function b($){a[1]($)}let w={title:"About the Active Travel Infrastructure Platform",$$slots:{default:[Fe]},$$scope:{ctx:a}};return a[0]!==void 0&&(w.open=a[0]),e=new Me({props:w}),We.push(()=>Le(e,"open",b)),{c(){u(e.$$.fragment)},m($,f){p(e,$,f),s=!0},p($,[f]){const v={};f&4&&(v.$$scope={dirty:f,ctx:$}),!t&&f&1&&(t=!0,v.open=$[0],Re(()=>t=!1)),e.$set(v)},i($){s||(c(e.$$.fragment,$),s=!0)},o($){m(e.$$.fragment,$),s=!1},d($){g(e,$)}}}function Ne(a,e,t){let{open:s}=e;function b(w){s=w,t(0,s)}return a.$$set=w=>{"open"in w&&t(0,s=w.open)},[s,b]}class Ve extends Ce{constructor(e){super(),Ie(this,e,Ne,Ke,Pe,{open:0})}}export{Ve as A}; diff --git a/browse_layout_v3/assets/Popup-00bc00d9.js b/browse_layout_v3/assets/Popup-00bc00d9.js new file mode 100644 index 00000000..0182de7b --- /dev/null +++ b/browse_layout_v3/assets/Popup-00bc00d9.js @@ -0,0 +1 @@ +import{S as I,i as N,s as S,V as M,j,o as q,t as v,p as b,u as E,W as Q,ak as C,a as O,e as h,b as c,c as m,X as g,Y as P,d,at as U,Z as V,U as W,x as X,m as Y,N as Z,aF as z,O as B,P as D,Q as G,T as H}from"./index-980b667c.js";function w(s,e,n){const t=s.slice();return t[0]=e[n][0],t[3]=e[n][1],t}function T(s){let e,n;return{c(){e=h("div"),n=X(s[2]),c(e,"class","govuk-hint")},m(t,l){m(t,e,l),Y(e,n)},p(t,l){l&4&&Z(n,t[2])},d(t){t&&d(e)}}}function A(s){let e,n,t;return{c(){e=h("option"),e.__value=n=s[0],g(e,e.__value),c(e,"label",t=s[3])},m(l,o){m(l,e,o)},p(l,o){o&2&&n!==(n=l[0])&&(e.__value=n,g(e,e.__value)),o&2&&t!==(t=l[3])&&c(e,"label",t)},d(l){l&&d(e)}}}function J(s){let e,n,t,l,o,_,i=s[2]&&T(s),r=C(s[1]),u=[];for(let a=0;a{"label"in a&&n(3,t=a.label),"value"in a&&n(0,l=a.value),"options"in a&&n(1,o=a.options),"hint"in a&&n(2,_=a.hint)},[l,o,_,t,i,r,u]}class ne extends I{constructor(e){super(),N(this,e,L,K,S,{label:3,value:0,options:1,hint:2})}}const R=s=>({props:s&16}),F=s=>({props:x(s[4])});function $(s){let e,n;const t=s[2].default,l=B(t,s,s[3],F);return{c(){e=h("div"),l&&l.c(),c(e,"class","govuk-prose")},m(o,_){m(o,e,_),l&&l.m(e,null),n=!0},p(o,_){l&&l.p&&(!n||_&24)&&D(l,t,o,o[3],n?H(t,o[3],_,R):G(o[3]),F)},i(o){n||(v(l,o),n=!0)},o(o){b(l,o),n=!1},d(o){o&&d(e),l&&l.d(o)}}}function y(s){let e,n;return e=new z({props:{openOn:s[0],popupClass:s[1],openIfTopMost:!0,$$slots:{default:[$,({features:t})=>({4:t}),({features:t})=>t?16:0]},$$scope:{ctx:s}}}),{c(){j(e.$$.fragment)},m(t,l){q(e,t,l),n=!0},p(t,[l]){const o={};l&1&&(o.openOn=t[0]),l&2&&(o.popupClass=t[1]),l&24&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(v(e.$$.fragment,t),n=!0)},o(t){b(e.$$.fragment,t),n=!1},d(t){E(e,t)}}}function x(s){return s?s[0].properties??{}:{}}function ee(s,e,n){let{$$slots:t={},$$scope:l}=e,{openOn:o="hover"}=e,{popupClass:_=void 0}=e;return s.$$set=i=>{"openOn"in i&&n(0,o=i.openOn),"popupClass"in i&&n(1,_=i.popupClass),"$$scope"in i&&n(3,l=i.$$scope)},[o,_,t,l]}class le extends I{constructor(e){super(),N(this,e,ee,y,S,{openOn:0,popupClass:1})}}export{ne as A,le as P}; diff --git a/browse_layout_v3/assets/Popup-addc1aa5.js b/browse_layout_v3/assets/Popup-addc1aa5.js deleted file mode 100644 index 8baa2299..00000000 --- a/browse_layout_v3/assets/Popup-addc1aa5.js +++ /dev/null @@ -1 +0,0 @@ -import{S as i,i as _,s as c,aF as m,c as g,m as d,t as r,a as f,d as C,Y as h,f as O,g as $,h as v,Z as P,_ as k,$ as S,k as b}from"./index-12949150.js";const q=n=>({props:n&16}),l=n=>({props:I(n[4])});function w(n){let o,a;const e=n[2].default,t=h(e,n,n[3],l);return{c(){o=O("div"),t&&t.c(),$(o,"class","govuk-prose")},m(s,p){v(s,o,p),t&&t.m(o,null),a=!0},p(s,p){t&&t.p&&(!a||p&24)&&P(t,e,s,s[3],a?S(e,s[3],p,q):k(s[3]),l)},i(s){a||(r(t,s),a=!0)},o(s){f(t,s),a=!1},d(s){s&&b(o),t&&t.d(s)}}}function F(n){let o,a;return o=new m({props:{openOn:n[0],popupClass:n[1],openIfTopMost:!0,$$slots:{default:[w,({features:e})=>({4:e}),({features:e})=>e?16:0]},$$scope:{ctx:n}}}),{c(){g(o.$$.fragment)},m(e,t){d(o,e,t),a=!0},p(e,[t]){const s={};t&1&&(s.openOn=e[0]),t&2&&(s.popupClass=e[1]),t&24&&(s.$$scope={dirty:t,ctx:e}),o.$set(s)},i(e){a||(r(o.$$.fragment,e),a=!0)},o(e){f(o.$$.fragment,e),a=!1},d(e){C(o,e)}}}function I(n){return n?n[0].properties??{}:{}}function M(n,o,a){let{$$slots:e={},$$scope:t}=o,{openOn:s="hover"}=o,{popupClass:p=void 0}=o;return n.$$set=u=>{"openOn"in u&&a(0,s=u.openOn),"popupClass"in u&&a(1,p=u.popupClass),"$$scope"in u&&a(3,t=u.$$scope)},[s,p,e,t]}class Y extends i{constructor(o){super(),_(this,o,M,F,c,{openOn:0,popupClass:1})}}export{Y as P}; diff --git a/browse_layout_v3/assets/ZoomOutMap-afe869ee.js b/browse_layout_v3/assets/ZoomOutMap-9940a4a0.js similarity index 65% rename from browse_layout_v3/assets/ZoomOutMap-afe869ee.js rename to browse_layout_v3/assets/ZoomOutMap-9940a4a0.js index ae1c8482..6ba9a8cd 100644 --- a/browse_layout_v3/assets/ZoomOutMap-afe869ee.js +++ b/browse_layout_v3/assets/ZoomOutMap-9940a4a0.js @@ -1,5 +1,5 @@ -import{S as Q,i as J,s as Y,Y as we,f as P,g as c,h as T,q as E,Z as ke,_ as pe,$ as Le,t as I,a as F,k as C,b as K,aw as Ce,l as V,r as Ge,bf as Pn,v as Zt,o as le,p as de,u as Me,F as Tn,c as x,m as $,d as ee,E as Cn,e as Qe,aa as Oe,bg as Sn,bh as yt,n as zn,bi as En,j as qe,a9 as Rn,aU as Bn,bj as In,bk as Fn,z as Ye,A as ft,H as ut,I as Se,aV as bt,bl as _e,x as N,bm as ve,aS as ne,b4 as Je,bn as An,N as ze,G as Ee,aj as qt,ad as Wt,bo as Gn,am as On,an as Un,b2 as Nt,J as Zn,bp as qn,b6 as Vt,w as Wn,av as vt,ao as Nn,y as ct,R as Vn,aG as wt,aH as Ke,aJ as Hn,aM as kt,aO as Ae,aP as Ht,aL as Fe,b5 as Dt,ab as Kt,bq as pt,br as st,bs as Dn,bt as Kn,af as Lt}from"./index-12949150.js";function Qn(n){let e,t,r;const i=n[3].default,l=we(i,n,n[2],null);return{c(){e=P("fieldset"),t=P("div"),l&&l.c(),c(t,"class",n[0]),c(t,"data-module","govuk-checkboxes"),c(e,"class","govuk-fieldset")},m(o,s){T(o,e,s),E(e,t),l&&l.m(t,null),r=!0},p(o,[s]){l&&l.p&&(!r||s&4)&&ke(l,i,o,o[2],r?Le(i,o[2],s,null):pe(o[2]),null)},i(o){r||(I(l,o),r=!0)},o(o){F(l,o),r=!1},d(o){o&&C(e),l&&l.d(o)}}}function Jn(n,e,t){let{$$slots:r={},$$scope:i}=e,{small:l=!1}=e,o=l?"govuk-checkboxes--small":"govuk-checkboxes";return n.$$set=s=>{"small"in s&&t(1,l=s.small),"$$scope"in s&&t(2,i=s.$$scope)},[o,l,i,r]}class Di extends Q{constructor(e){super(),J(this,e,Jn,Qn,Y,{small:1})}}const Yn=n=>({}),Mt=n=>({});function Xn(n){let e,t,r,i,l,o,s,a,f;const u=n[5].default,m=we(u,n,n[4],null),_=n[5].right,g=we(_,n,n[4],Mt);return{c(){e=P("div"),t=P("input"),r=K(),i=P("label"),m&&m.c(),l=K(),o=P("span"),g&&g.c(),c(t,"type","checkbox"),c(t,"class","govuk-checkboxes__input"),c(t,"id",n[3]),c(i,"class","govuk-label govuk-checkboxes__label"),c(i,"for",n[3]),c(i,"title",n[1]),Ce(o,"float","right"),c(e,"class","govuk-checkboxes__item"),c(e,"style",n[2])},m(y,M){T(y,e,M),E(e,t),t.checked=n[0],E(e,r),E(e,i),m&&m.m(i,null),E(e,l),E(e,o),g&&g.m(o,null),s=!0,a||(f=[V(t,"change",n[7]),V(t,"change",n[6])],a=!0)},p(y,[M]){M&1&&(t.checked=y[0]),m&&m.p&&(!s||M&16)&&ke(m,u,y,y[4],s?Le(u,y[4],M,null):pe(y[4]),null),(!s||M&2)&&c(i,"title",y[1]),g&&g.p&&(!s||M&16)&&ke(g,_,y,y[4],s?Le(_,y[4],M,Yn):pe(y[4]),Mt)},i(y){s||(I(m,y),I(g,y),s=!0)},o(y){F(m,y),F(g,y),s=!1},d(y){y&&C(e),m&&m.d(y),g&&g.d(y),a=!1,Ge(f)}}}function jn(n,e,t){let{$$slots:r={},$$scope:i}=e;const l=Pn(r);let{checked:o}=e,{hint:s=null}=e,f=l.right!==void 0?"float: none":"",u=Zt();function m(g){le.call(this,n,g)}function _(){o=this.checked,t(0,o)}return n.$$set=g=>{"checked"in g&&t(0,o=g.checked),"hint"in g&&t(1,s=g.hint),"$$scope"in g&&t(4,i=g.$$scope)},[o,s,f,u,i,r,m,_]}class Ki extends Q{constructor(e){super(),J(this,e,jn,Xn,Y,{checked:0,hint:1})}}function xn(n){let e,t,r,i,l,o,s;const a=n[3].default,f=we(a,n,n[2],null);return{c(){e=P("details"),t=P("summary"),r=P("span"),i=de(n[0]),l=K(),o=P("div"),f&&f.c(),c(r,"class","govuk-details__summary-text"),c(t,"class","govuk-details__summary"),c(o,"class","govuk-details__text"),e.open=n[1],c(e,"class","govuk-details"),c(e,"data-module","govuk-details")},m(u,m){T(u,e,m),E(e,t),E(t,r),E(r,i),E(e,l),E(e,o),f&&f.m(o,null),s=!0},p(u,[m]){(!s||m&1)&&Me(i,u[0]),f&&f.p&&(!s||m&4)&&ke(f,a,u,u[2],s?Le(a,u[2],m,null):pe(u[2]),null),(!s||m&2)&&(e.open=u[1])},i(u){s||(I(f,u),s=!0)},o(u){F(f,u),s=!1},d(u){u&&C(e),f&&f.d(u)}}}function $n(n,e,t){let{$$slots:r={},$$scope:i}=e,{label:l}=e,{open:o=!1}=e;return n.$$set=s=>{"label"in s&&t(0,l=s.label),"open"in s&&t(1,o=s.open),"$$scope"in s&&t(2,i=s.$$scope)},[l,o,i,r]}class er extends Q{constructor(e){super(),J(this,e,$n,xn,Y,{label:0,open:1})}}function Pt(n,e,t){const r=n.slice();return r[10]=e[t][0],r[11]=e[t][1],r}function Tt(n){let e,t;return{c(){e=P("div"),t=de(n[2]),c(e,"class","govuk-hint")},m(r,i){T(r,e,i),E(e,t)},p(r,i){i&4&&Me(t,r[2])},d(r){r&&C(e)}}}function Ct(n){let e;return{c(){e=P("option"),e.__value="",qe(e,e.__value)},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function St(n){let e,t=n[11]+"",r,i;return{c(){e=P("option"),r=de(t),e.__value=i=n[10],qe(e,e.__value)},m(l,o){T(l,e,o),E(e,r)},p(l,o){o&8&&t!==(t=l[11]+"")&&Me(r,t),o&8&&i!==(i=l[10])&&(e.__value=i,qe(e,e.__value))},d(l){l&&C(e)}}}function tr(n){let e,t,r,i,l,o,s,a;e=new Cn({props:{errorMessage:n[6]}});let f=n[2]&&Tt(n),u=n[4]&&Ct(),m=Qe(n[3]),_=[];for(let g=0;gn[9].call(i))},m(g,y){$(e,g,y),T(g,t,y),f&&f.m(g,y),T(g,r,y),T(g,i,y),u&&u.m(i,null),E(i,l);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(i,null);yt(i,n[0],!0),o=!0,s||(a=[V(i,"change",n[9]),V(i,"change",n[8])],s=!0)},p(g,y){const M={};if(y&64&&(M.errorMessage=g[6]),e.$set(M),g[2]?f?f.p(g,y):(f=Tt(g),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null),g[4]?u||(u=Ct(),u.c(),u.m(i,l)):u&&(u.d(1),u=null),y&8){m=Qe(g[3]);let b;for(b=0;b{"label"in g&&t(1,r=g.label),"hint"in g&&t(2,i=g.hint),"choices"in g&&t(3,l=g.choices),"emptyOption"in g&&t(4,o=g.emptyOption),"disabled"in g&&t(5,s=g.disabled),"errorMessage"in g&&t(6,a=g.errorMessage),"value"in g&&t(0,f=g.value)},[f,r,i,l,o,s,a,u,m,_]}class ir extends Q{constructor(e){super(),J(this,e,rr,nr,Y,{label:1,hint:2,choices:3,emptyOption:4,disabled:5,errorMessage:6,value:0})}}function Qi(n,e){let t=new Set(n.getStyle().layers.filter(r=>r.type=="line").map(r=>r.id));if(e=="dataviz")return["Road network","Path"].filter(r=>t.has(r));if(e=="hybrid")return["Path","Road","Tunnel"].filter(r=>t.has(r));if(e=="streets"){let r=[];for(let i of["road","bridge","tunnel"])for(let l of["link","minor","minor_construction","motorway","motorway_construction","motorway_link","path_pedestrian","secondary_tertiary","secondary_tertiary_construction","service_track","service_track_construction","street","trunk_primary","trunk_primary_construction","trunk_primary_link"])r.push(`${i}_${l}`);return r.filter(i=>t.has(i))}return e=="uk-openzoomstack-light"?n.getStyle().layers.filter(r=>r["source-layer"]=="roads"&&r.type=="line").map(r=>r.id):[]}let L=n=>n,te=n=>n,lr=n=>n,or=n=>n,sr=n=>n,ar=n=>n,fr=n=>n,ur=[fr("raster-basemap"),L("parliamentary_constituencies"),L("parliamentary_constituencies-outline"),L("wards"),L("wards-outline"),L("combined_authorities"),L("combined_authorities-outline"),L("local_authority_districts"),L("local_authority_districts-outline"),L("local_planning_authorities"),L("local_planning_authorities-outline"),L("census_output_areas"),L("census_output_areas-outline"),L("imd"),L("imd-outline"),L("pollution"),L("road_noise"),L("mrn"),L("srn"),L("bus_routes"),L("trams"),L("national_cycle_network"),L("cycle_paths"),L("pct_commute"),L("pct_school"),L("road_widths"),L("road_speeds"),L("pavement_widths"),L("gradient"),L("gradient_arrows"),L("education"),L("hospitals"),L("sports_spaces"),L("railway_stations"),L("cycle_parking"),L("crossings"),L("vehicle_counts"),L("stats19"),L("bus_stops"),te("interventions-coverage-polygons-outlines"),te("interventions-polygons"),te("interventions-polygons-outlines"),te("hover-polygons"),L("atf-interventions-polygons"),L("lcwip-interventions-polygons"),L("atf-interventions-polygons-outlines"),L("lcwip-interventions-polygons-outlines"),te("hover-lines"),te("interventions-lines"),te("interventions-lines-endpoints"),L("atf-interventions-lines"),L("lcwip-interventions-lines"),L("atf-interventions-lines-endpoints"),L("lcwip-interventions-lines-endpoints"),te("hover-points"),te("interventions-points"),L("atf-interventions-points"),L("lcwip-interventions-points"),L("problems"),te("edit-polygon-fill"),te("edit-polygon-lines"),te("edit-polygon-vertices"),te("draw-split-route"),te("route-points"),te("route-lines"),te("route-polygons"),lr("road_label"),ar(or(sr("Road labels"))),te("boundary"),L("measurement-line"),te("georeferenced-image"),L("cover-interactive-layers")],cr=Rn(null);function dr(n,e){return{id:e,beforeId:mr(n,e)}}function mr(n,e){let t=Bn(cr);if(!t){console.warn(`getBeforeId(${e}) called before map is ready. Z-ordering may be incorrect.`);return}let r,i=!1;for(let l=n.layerZorder.length-1;l>=0;l--){let o=n.layerZorder[l];if(o==e){i=!0;break}t.getLayer(o)&&(r=o)}if(!i)throw new Error(`Layer ID ${e} not defined in layerZorder`);return r}const Ji=["==",["geometry-type"],"Polygon"],Yi=["==",["geometry-type"],"LineString"],Xi=["==",["geometry-type"],"Point"];function ji(){return{type:"FeatureCollection",features:[]}}function xi(n,e,t){let r=["match",n];for(let[i,l]of Object.entries(e))r.push(i),r.push(l);return r.push(t),r}function gr(n){return In(n)}function $i(n){var t,r;let e={type:"FeatureCollection",features:[]};for(let i of n.features)if(e.features.push(i),i.geometry.type=="LineString"&&!((t=i.properties)!=null&&t.hide_while_editing))for(let l of[i.geometry.coordinates[0],i.geometry.coordinates[i.geometry.coordinates.length-1]])e.features.push({type:"Feature",properties:{endpoint:!0,scheme_reference:(r=i.properties)==null?void 0:r.scheme_reference},geometry:{type:"Point",coordinates:l}});return e}function el(n,e,t){let r=["step",n];for(let i=1;iTerms of Use +import{S as Q,i as J,s as X,O as we,e as P,b as c,c as T,m as E,P as ke,Q as pe,T as Le,t as I,p as F,d as C,a as K,aw as Ce,Y as V,Z as Ae,bf as Pn,W as Zt,U as le,x as de,N as Me,V as Tn,j as x,o as $,u as ee,E as Cn,ak as Qe,a8 as Ge,bg as Sn,bh as yt,at as zn,bi as En,X as We,a7 as Rn,aU as Bn,bj as In,bk as Fn,g as Xe,h as ft,r as ut,v as Se,aV as bt,bl as _e,n as N,bm as ve,aS as ne,b4 as Je,bn as On,y as ze,q as Ee,ah as Wt,ab as qt,bo as An,al as Gn,am as Un,b2 as Nt,w as Zn,bp as Wn,b6 as Vt,l as qn,av as vt,an as Nn,f as ct,R as Vn,aG as wt,aH as Ke,aJ as Hn,aM as kt,aO as Oe,aP as Ht,aL as Fe,b5 as Dt,a9 as Kt,bq as pt,br as st,bs as Dn,bt as Kn,ad as Lt}from"./index-980b667c.js";function Qn(n){let e,t,r;const i=n[3].default,l=we(i,n,n[2],null);return{c(){e=P("fieldset"),t=P("div"),l&&l.c(),c(t,"class",n[0]),c(t,"data-module","govuk-checkboxes"),c(e,"class","govuk-fieldset")},m(o,s){T(o,e,s),E(e,t),l&&l.m(t,null),r=!0},p(o,[s]){l&&l.p&&(!r||s&4)&&ke(l,i,o,o[2],r?Le(i,o[2],s,null):pe(o[2]),null)},i(o){r||(I(l,o),r=!0)},o(o){F(l,o),r=!1},d(o){o&&C(e),l&&l.d(o)}}}function Jn(n,e,t){let{$$slots:r={},$$scope:i}=e,{small:l=!1}=e,o=l?"govuk-checkboxes--small":"govuk-checkboxes";return n.$$set=s=>{"small"in s&&t(1,l=s.small),"$$scope"in s&&t(2,i=s.$$scope)},[o,l,i,r]}class Di extends Q{constructor(e){super(),J(this,e,Jn,Qn,X,{small:1})}}const Xn=n=>({}),Mt=n=>({});function Yn(n){let e,t,r,i,l,o,s,a,f;const u=n[5].default,m=we(u,n,n[4],null),_=n[5].right,g=we(_,n,n[4],Mt);return{c(){e=P("div"),t=P("input"),r=K(),i=P("label"),m&&m.c(),l=K(),o=P("span"),g&&g.c(),c(t,"type","checkbox"),c(t,"class","govuk-checkboxes__input"),c(t,"id",n[3]),c(i,"class","govuk-label govuk-checkboxes__label"),c(i,"for",n[3]),c(i,"title",n[1]),Ce(o,"float","right"),c(e,"class","govuk-checkboxes__item"),c(e,"style",n[2])},m(y,M){T(y,e,M),E(e,t),t.checked=n[0],E(e,r),E(e,i),m&&m.m(i,null),E(e,l),E(e,o),g&&g.m(o,null),s=!0,a||(f=[V(t,"change",n[7]),V(t,"change",n[6])],a=!0)},p(y,[M]){M&1&&(t.checked=y[0]),m&&m.p&&(!s||M&16)&&ke(m,u,y,y[4],s?Le(u,y[4],M,null):pe(y[4]),null),(!s||M&2)&&c(i,"title",y[1]),g&&g.p&&(!s||M&16)&&ke(g,_,y,y[4],s?Le(_,y[4],M,Xn):pe(y[4]),Mt)},i(y){s||(I(m,y),I(g,y),s=!0)},o(y){F(m,y),F(g,y),s=!1},d(y){y&&C(e),m&&m.d(y),g&&g.d(y),a=!1,Ae(f)}}}function jn(n,e,t){let{$$slots:r={},$$scope:i}=e;const l=Pn(r);let{checked:o}=e,{hint:s=null}=e,f=l.right!==void 0?"float: none":"",u=Zt();function m(g){le.call(this,n,g)}function _(){o=this.checked,t(0,o)}return n.$$set=g=>{"checked"in g&&t(0,o=g.checked),"hint"in g&&t(1,s=g.hint),"$$scope"in g&&t(4,i=g.$$scope)},[o,s,f,u,i,r,m,_]}class Ki extends Q{constructor(e){super(),J(this,e,jn,Yn,X,{checked:0,hint:1})}}function xn(n){let e,t,r,i,l,o,s;const a=n[3].default,f=we(a,n,n[2],null);return{c(){e=P("details"),t=P("summary"),r=P("span"),i=de(n[0]),l=K(),o=P("div"),f&&f.c(),c(r,"class","govuk-details__summary-text"),c(t,"class","govuk-details__summary"),c(o,"class","govuk-details__text"),e.open=n[1],c(e,"class","govuk-details"),c(e,"data-module","govuk-details")},m(u,m){T(u,e,m),E(e,t),E(t,r),E(r,i),E(e,l),E(e,o),f&&f.m(o,null),s=!0},p(u,[m]){(!s||m&1)&&Me(i,u[0]),f&&f.p&&(!s||m&4)&&ke(f,a,u,u[2],s?Le(a,u[2],m,null):pe(u[2]),null),(!s||m&2)&&(e.open=u[1])},i(u){s||(I(f,u),s=!0)},o(u){F(f,u),s=!1},d(u){u&&C(e),f&&f.d(u)}}}function $n(n,e,t){let{$$slots:r={},$$scope:i}=e,{label:l}=e,{open:o=!1}=e;return n.$$set=s=>{"label"in s&&t(0,l=s.label),"open"in s&&t(1,o=s.open),"$$scope"in s&&t(2,i=s.$$scope)},[l,o,i,r]}class er extends Q{constructor(e){super(),J(this,e,$n,xn,X,{label:0,open:1})}}function Pt(n,e,t){const r=n.slice();return r[10]=e[t][0],r[11]=e[t][1],r}function Tt(n){let e,t;return{c(){e=P("div"),t=de(n[2]),c(e,"class","govuk-hint")},m(r,i){T(r,e,i),E(e,t)},p(r,i){i&4&&Me(t,r[2])},d(r){r&&C(e)}}}function Ct(n){let e;return{c(){e=P("option"),e.__value="",We(e,e.__value)},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function St(n){let e,t=n[11]+"",r,i;return{c(){e=P("option"),r=de(t),e.__value=i=n[10],We(e,e.__value)},m(l,o){T(l,e,o),E(e,r)},p(l,o){o&8&&t!==(t=l[11]+"")&&Me(r,t),o&8&&i!==(i=l[10])&&(e.__value=i,We(e,e.__value))},d(l){l&&C(e)}}}function tr(n){let e,t,r,i,l,o,s,a;e=new Cn({props:{errorMessage:n[6]}});let f=n[2]&&Tt(n),u=n[4]&&Ct(),m=Qe(n[3]),_=[];for(let g=0;gn[9].call(i))},m(g,y){$(e,g,y),T(g,t,y),f&&f.m(g,y),T(g,r,y),T(g,i,y),u&&u.m(i,null),E(i,l);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(i,null);yt(i,n[0],!0),o=!0,s||(a=[V(i,"change",n[9]),V(i,"change",n[8])],s=!0)},p(g,y){const M={};if(y&64&&(M.errorMessage=g[6]),e.$set(M),g[2]?f?f.p(g,y):(f=Tt(g),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null),g[4]?u||(u=Ct(),u.c(),u.m(i,l)):u&&(u.d(1),u=null),y&8){m=Qe(g[3]);let b;for(b=0;b{"label"in g&&t(1,r=g.label),"hint"in g&&t(2,i=g.hint),"choices"in g&&t(3,l=g.choices),"emptyOption"in g&&t(4,o=g.emptyOption),"disabled"in g&&t(5,s=g.disabled),"errorMessage"in g&&t(6,a=g.errorMessage),"value"in g&&t(0,f=g.value)},[f,r,i,l,o,s,a,u,m,_]}class ir extends Q{constructor(e){super(),J(this,e,rr,nr,X,{label:1,hint:2,choices:3,emptyOption:4,disabled:5,errorMessage:6,value:0})}}function Qi(n,e){let t=new Set(n.getStyle().layers.filter(r=>r.type=="line").map(r=>r.id));if(e=="dataviz")return["Road network","Path"].filter(r=>t.has(r));if(e=="hybrid")return["Path","Road","Tunnel"].filter(r=>t.has(r));if(e=="streets"){let r=[];for(let i of["road","bridge","tunnel"])for(let l of["link","minor","minor_construction","motorway","motorway_construction","motorway_link","path_pedestrian","secondary_tertiary","secondary_tertiary_construction","service_track","service_track_construction","street","trunk_primary","trunk_primary_construction","trunk_primary_link"])r.push(`${i}_${l}`);return r.filter(i=>t.has(i))}return e=="uk-openzoomstack-light"?n.getStyle().layers.filter(r=>r["source-layer"]=="roads"&&r.type=="line").map(r=>r.id):[]}let L=n=>n,te=n=>n,lr=n=>n,or=n=>n,sr=n=>n,ar=n=>n,fr=n=>n,ur=[fr("raster-basemap"),L("parliamentary_constituencies"),L("parliamentary_constituencies-outline"),L("wards"),L("wards-outline"),L("combined_authorities"),L("combined_authorities-outline"),L("local_authority_districts"),L("local_authority_districts-outline"),L("local_planning_authorities"),L("local_planning_authorities-outline"),L("census_output_areas"),L("census_output_areas-outline"),L("imd"),L("imd-outline"),L("pollution"),L("road_noise"),L("mrn"),L("srn"),L("bus_routes"),L("trams"),L("national_cycle_network"),L("cycle_paths"),L("pct_commute"),L("pct_school"),L("road_widths"),L("road_speeds"),L("pavement_widths"),L("gradient"),L("gradient_arrows"),L("education"),L("hospitals"),L("sports_spaces"),L("railway_stations"),L("cycle_parking"),L("crossings"),L("vehicle_counts"),L("stats19"),L("bus_stops"),te("interventions-coverage-polygons-outlines"),te("interventions-polygons"),te("interventions-polygons-outlines"),te("hover-polygons"),L("atf-interventions-polygons"),L("lcwip-interventions-polygons"),L("atf-interventions-polygons-outlines"),L("lcwip-interventions-polygons-outlines"),te("hover-lines"),te("interventions-lines"),te("interventions-lines-endpoints"),L("atf-interventions-lines"),L("lcwip-interventions-lines"),L("atf-interventions-lines-endpoints"),L("lcwip-interventions-lines-endpoints"),te("hover-points"),te("interventions-points"),L("atf-interventions-points"),L("lcwip-interventions-points"),L("problems"),te("edit-polygon-fill"),te("edit-polygon-lines"),te("edit-polygon-vertices"),te("draw-split-route"),te("route-points"),te("route-lines"),te("route-polygons"),lr("road_label"),ar(or(sr("Road labels"))),te("boundary"),L("measurement-line"),te("georeferenced-image"),L("cover-interactive-layers")],cr=Rn(null);function dr(n,e){return{id:e,beforeId:mr(n,e)}}function mr(n,e){let t=Bn(cr);if(!t){console.warn(`getBeforeId(${e}) called before map is ready. Z-ordering may be incorrect.`);return}let r,i=!1;for(let l=n.layerZorder.length-1;l>=0;l--){let o=n.layerZorder[l];if(o==e){i=!0;break}t.getLayer(o)&&(r=o)}if(!i)throw new Error(`Layer ID ${e} not defined in layerZorder`);return r}const Ji=["==",["geometry-type"],"Polygon"],Xi=["==",["geometry-type"],"LineString"],Yi=["==",["geometry-type"],"Point"];function ji(){return{type:"FeatureCollection",features:[]}}function xi(n,e,t){let r=["match",n];for(let[i,l]of Object.entries(e))r.push(i),r.push(l);return r.push(t),r}function gr(n){return In(n)}function $i(n){var t,r;let e={type:"FeatureCollection",features:[]};for(let i of n.features)if(e.features.push(i),i.geometry.type=="LineString"&&!((t=i.properties)!=null&&t.hide_while_editing))for(let l of[i.geometry.coordinates[0],i.geometry.coordinates[i.geometry.coordinates.length-1]])e.features.push({type:"Feature",properties:{endpoint:!0,scheme_reference:(r=i.properties)==null?void 0:r.scheme_reference},geometry:{type:"Point",coordinates:l}});return e}function el(n,e,t){let r=["step",n];for(let i=1;iTerms of Use and - Privacy Policy`},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function hr(n){let e,t,r,i,l;function o(f){n[2](f)}let s={label:"Basemap",choices:Fn(),disabled:n[0]};n[1]!==void 0&&(s.value=n[1]),e=new ir({props:s}),Ye.push(()=>ft(e,"value",o));let a=n[1]=="google"&&zt();return{c(){x(e.$$.fragment),r=K(),a&&a.c(),i=Oe()},m(f,u){$(e,f,u),T(f,r,u),a&&a.m(f,u),T(f,i,u),l=!0},p(f,[u]){const m={};u&1&&(m.disabled=f[0]),!t&&u&2&&(t=!0,m.value=f[1],ut(()=>t=!1)),e.$set(m),f[1]=="google"?a||(a=zt(),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null)},i(f){l||(I(e.$$.fragment,f),l=!0)},o(f){F(e.$$.fragment,f),l=!1},d(f){f&&(C(r),C(i)),ee(e,f),a&&a.d(f)}}}function _r(n,e,t){let r;Se(n,bt,o=>t(1,r=o));let{disabled:i=!1}=e;function l(o){r=o,bt.set(r)}return n.$$set=o=>{"disabled"in o&&t(0,i=o.disabled)},[i,r,l]}class rl extends Q{constructor(e){super(),J(this,e,_r,hr,Y,{disabled:0})}}function yr(n){let e,t;return{c(){e=_e("svg"),t=_e("path"),c(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),c(e,"viewBox","0 0 14 14"),c(e,"width","13"),c(e,"height","13"),c(e,"class","svelte-en2qvf")},m(r,i){T(r,e,i),E(e,t)},p:N,i:N,o:N,d(r){r&&C(e)}}}class Qt extends Q{constructor(e){super(),J(this,e,null,yr,Y,{})}}function br(n){let e,t;return{c(){e=_e("svg"),t=_e("path"),c(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),c(e,"viewBox","0 0 30 30"),c(e,"fill","none"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"class","svelte-d2loi5")},m(r,i){T(r,e,i),E(e,t)},p:N,i:N,o:N,d(r){r&&C(e)}}}class Jt extends Q{constructor(e){super(),J(this,e,null,br,Y,{})}}function vr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"area.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"area.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function wr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"reverse.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"reverse.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function kr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"poi.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"poi.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function pr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"postal_code.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"postal_code.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Lr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"street.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"street.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Mr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"road.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"road.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Pr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"housenumber.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"housenumber.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Tr(n){let e,t,r,i;return{c(){e=P("img"),ne(e.src,t=n[5])||c(e,"src",t),c(e,"alt",n[4]),c(e,"class","svelte-ltkwvy")},m(l,o){T(l,e,o),r||(i=V(e,"error",n[14]),r=!0)},p(l,o){o&32&&!ne(e.src,t=l[5])&&c(e,"src",t),o&16&&c(e,"alt",l[4])},d(l){l&&C(e),r=!1,i()}}}function Et(n){let e,t;return{c(){e=P("span"),t=de(n[6]),c(e,"class","secondary svelte-ltkwvy")},m(r,i){T(r,e,i),E(e,t)},p(r,i){i&64&&Me(t,r[6])},d(r){r&&C(e)}}}function Cr(n){var q,W;let e,t,r,i,l,o,s,a,f=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",u,m,_=n[2]==="always"||n[2]&&!n[0].address&&((q=n[0].properties)==null?void 0:q.kind)!=="road"&&((W=n[0].properties)==null?void 0:W.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],g,y,M=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",b,p,U;function v(R,S){var oe,h;return S&1&&(t=null),S&1&&(r=null),S&1&&(i=null),R[5]?Tr:R[0].address?Pr:((oe=R[0].properties)==null?void 0:oe.kind)==="road"||((h=R[0].properties)==null?void 0:h.kind)==="road_relation"?Mr:(t==null&&(t=!!R[0].id.startsWith("address.")),t?Lr:(r==null&&(r=!!R[0].id.startsWith("postal_code.")),r?pr:(i==null&&(i=!!R[0].id.startsWith("poi.")),i?kr:R[7]?wr:vr)))}let z=v(n,-1),w=z(n),Z=_&&Et(n);return{c(){e=P("li"),w.c(),l=K(),o=P("span"),s=P("span"),a=P("span"),u=de(f),m=K(),Z&&Z.c(),g=K(),y=P("span"),b=de(M),c(a,"class","primary svelte-ltkwvy"),c(s,"class","svelte-ltkwvy"),c(y,"class","line2 svelte-ltkwvy"),c(o,"class","texts svelte-ltkwvy"),c(e,"tabindex","0"),c(e,"data-selected",n[1]),c(e,"class","svelte-ltkwvy"),ve(e,"selected",n[1])},m(R,S){T(R,e,S),w.m(e,null),E(e,l),E(e,o),E(o,s),E(s,a),E(a,u),E(s,m),Z&&Z.m(s,null),E(o,g),E(o,y),E(y,b),p||(U=[V(e,"mouseenter",n[12]),V(e,"focus",n[13])],p=!0)},p(R,[S]){var oe,h;z===(z=v(R,S))&&w?w.p(R,S):(w.d(1),w=z(R),w&&(w.c(),w.m(e,l))),S&1&&f!==(f=(R[7]?R[0].place_name:R[0].place_name.replace(/,.*/,""))+"")&&Me(u,f),S&37&&(_=R[2]==="always"||R[2]&&!R[0].address&&((oe=R[0].properties)==null?void 0:oe.kind)!=="road"&&((h=R[0].properties)==null?void 0:h.kind)!=="road_relation"&&!R[0].id.startsWith("address.")&&!R[0].id.startsWith("postal_code.")&&(!R[0].id.startsWith("poi.")||!R[5])&&!R[7]),_?Z?Z.p(R,S):(Z=Et(R),Z.c(),Z.m(s,null)):Z&&(Z.d(1),Z=null),S&1&&M!==(M=(R[7]?"":R[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Me(b,M),S&2&&c(e,"data-selected",R[1]),S&2&&ve(e,"selected",R[1])},i:N,o:N,d(R){R&&C(e),w.d(),Z&&Z.d(),p=!1,Ge(U)}}}function Sr(n,e,t){var v;let r,i,{feature:l}=e,{selected:o=!1}=e,{showPlaceType:s}=e,{missingIconsCache:a}=e,{iconsBaseUrl:f}=e;const u=(v=l.properties)==null?void 0:v.categories;let m,_,g=0,y=l.place_type[0]==="reverse";function M(z){_&&a.add(_),t(10,g++,g)}function b(z){le.call(this,n,z)}function p(z){le.call(this,n,z)}const U=z=>M(z.currentTarget);return n.$$set=z=>{"feature"in z&&t(0,l=z.feature),"selected"in z&&t(1,o=z.selected),"showPlaceType"in z&&t(2,s=z.showPlaceType),"missingIconsCache"in z&&t(9,a=z.missingIconsCache),"iconsBaseUrl"in z&&t(3,f=z.iconsBaseUrl)},n.$$.update=()=>{var z,w,Z,q;if(n.$$.dirty&3640)do t(11,r--,r),t(4,m=u==null?void 0:u[r]),t(5,_=m?f+m.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!_||a.has(_)));n.$$.dirty&1&&t(6,i=l.id.startsWith("poi.")?(w=(z=l.properties)==null?void 0:z.categories)==null?void 0:w.join(", "):((q=(Z=l.properties)==null?void 0:Z.place_type_name)==null?void 0:q[0])??l.place_type[0])},t(11,r=(u==null?void 0:u.length)??0),[l,o,s,f,m,_,i,y,M,a,g,r,b,p,U]}class zr extends Q{constructor(e){super(),J(this,e,Sr,Cr,Y,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Er(n){let e;return{c(){e=P("div"),e.innerHTML='',c(e,"class","svelte-7cmwmc")},m(t,r){T(t,e,r)},p:N,i:N,o:N,d(t){t&&C(e)}}}class Rr extends Q{constructor(e){super(),J(this,e,null,Er,Y,{})}}function Br(n){let e,t;return{c(){e=_e("svg"),t=_e("path"),c(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),c(e,"viewBox","0 0 60.006 21.412"),c(e,"width","14"),c(e,"height","20"),c(e,"class","svelte-en2qvf")},m(r,i){T(r,e,i),E(e,t)},p:N,i:N,o:N,d(r){r&&C(e)}}}class Ir extends Q{constructor(e){super(),J(this,e,null,Br,Y,{})}}function Fr(n){let e,t,r;return{c(){e=_e("svg"),t=_e("circle"),r=_e("path"),c(t,"cx","4.789"),c(t,"cy","4.787"),c(t,"r","3.85"),Ce(t,"stroke-width","1.875"),Ce(t,"fill","none"),c(r,"d","M12.063 12.063 7.635 7.635"),Ce(r,"stroke-width","1.875"),Ce(r,"stroke-linecap","round"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"width","13"),c(e,"height","13"),c(e,"viewBox","0 0 13 13"),c(e,"class","svelte-1bpbt60")},m(i,l){T(i,e,l),E(e,t),E(e,r)},p:N,i:N,o:N,d(i){i&&C(e)}}}class Ar extends Q{constructor(e){super(),J(this,e,null,Fr,Y,{})}}function Gr(n,e,t){const r=e[1],i=e[0],l=r-i;return n===r&&t?n:((n-i)%l+l)%l+i}function Rt(n){const e=[...n];return e[2]r[0]||i.maxZoom!=null&&i.maxZoomDate.now()){if(!Ze.coords)break e;return Ze.coords}let l;try{return l=await new Promise((o,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(a=>{o([a.coords.longitude,a.coords.latitude].map(f=>f.toFixed(6)).join(","))},a=>{s(a)},i)}),l}catch{}finally{i.cachedLocationExpiry&&(Ze={time:Date.now(),coords:l})}if(t.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}function Bt(n,e,t){const r=n.slice();return r[81]=e[t],r[83]=t,r}function It(n){let e,t;return e=new Rr({}),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function Ft(n){let e,t,r,i,l;return t=new Ir({}),{c(){e=P("button"),x(t.$$.fragment),c(e,"type","button"),c(e,"title",n[9]),c(e,"class","svelte-zh3kmv"),ve(e,"active",n[0])},m(o,s){T(o,e,s),$(t,e,null),r=!0,i||(l=V(e,"click",n[67]),i=!0)},p(o,s){(!r||s[0]&512)&&c(e,"title",o[9]),(!r||s[0]&1)&&ve(e,"active",o[0])},i(o){r||(I(t.$$.fragment,o),r=!0)},o(o){F(t.$$.fragment,o),r=!1},d(o){o&&C(e),ee(t),i=!1,l()}}}function Ur(n){let e,t=[],r=new Map,i,l,o,s=Qe(n[14]);const a=f=>f[81].id+(f[81].address?","+f[81].address:"");for(let f=0;f{q=null}),Ee()),(!v||H[0]&2)&&ve(f,"displayable",B[1]!==""),B[5]===!0?W?(W.p(B,H),H[0]&32&&I(W,1)):(W=Ft(B),W.c(),I(W,1),W.m(r,y)):W&&(ze(),F(W,1,1,()=>{W=null}),Ee()),S&&S.p&&(!v||H[1]&134217728)&&ke(S,R,B,B[58],v?Le(R,B[58],H,null):pe(B[58]),null);let ie=b;b=ye(B),b===ie?~b&&h[b].p(B,H):(p&&(ze(),F(h[ie],1,1,()=>{h[ie]=null}),Ee()),~b?(p=h[b],p?p.p(B,H):(p=h[b]=oe[b](B),p.c()),I(p,1),p.m(t,null)):p=null),(!v||H[0]&4&&U!==(U=Je(B[2])+" svelte-zh3kmv"))&&c(t,"class",U),(!v||H[0]&22)&&ve(t,"can-collapse",B[4]&&B[1]==="")},i(B){v||(I(Z),I(l.$$.fragment,B),I(m.$$.fragment,B),I(q),I(W),I(S,B),I(p),v=!0)},o(B){F(Z),F(l.$$.fragment,B),F(m.$$.fragment,B),F(q),F(W),F(S,B),F(p),v=!1},d(B){B&&(C(e),C(t)),ee(l),n[61](null),ee(m),q&&q.d(),W&&W.d(),S&&S.d(B),~b&&h[b].d(),z=!1,Ge(w)}}}function Vr(n,e,t){let r,{$$slots:i={},$$scope:l}=e,{class:o=void 0}=e,{apiKey:s}=e,{bbox:a=void 0}=e,{clearButtonTitle:f="clear"}=e,{clearOnBlur:u=!1}=e,{collapsed:m=!1}=e,{country:_=void 0}=e,{debounceSearch:g=200}=e,{enableReverse:y=!1}=e,{errorMessage:M="Something went wrong…"}=e,{filter:b=()=>!0}=e,{flyTo:p=!0}=e,{fuzzyMatch:U=!0}=e,{language:v=void 0}=e,{limit:z=void 0}=e,{mapController:w=void 0}=e,{minLength:Z=2}=e,{noResultsMessage:q="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:W="Search"}=e,{proximity:R=[{type:"server-geolocation"}]}=e,{reverseActive:S=y==="always"}=e,{reverseButtonTitle:oe="toggle reverse geocoding"}=e,{searchValue:h=""}=e,{showFullGeometry:ye=!0}=e,{showPlaceType:B="ifNeeded"}=e,{showResultsWhileTyping:H=!0}=e,{selectFirst:ie=!0}=e,{flyToSelected:k=!1}=e,{markerOnSelected:ce=!0}=e,{types:se=void 0}=e,{excludeTypes:me=!1}=e,{zoom:Ue=16}=e,{maxZoom:Re=18}=e,{apiUrl:je="https://api.maptiler.com/geocoding"}=e,{fetchParameters:xe={}}=e,{iconsBaseUrl:mt="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.3/icons/"}=e,{adjustUrlQuery:$e=d=>{}}=e;function rn(){ge.focus()}function ln(){ge.blur()}function gt(d,j=!0,ae=!1){t(1,h=d),j?(t(15,D=-1),_t()):(rt(!ae,ae),setTimeout(()=>{ge.focus(),ge.select()}))}function on(){t(14,G=void 0),t(55,A=void 0),t(15,D=-1)}function sn(){t(54,X=[]),t(55,A=void 0)}let Be=!1,G,X,A,ht="",ge,D=-1,he,Ne=[],Te,Ie,Ve,et;const an=new Set,be=qt();Wt(()=>{w&&(w.setEventHandler(void 0),w.indicateReverse(!1),w.setSelectedMarker(-1),w.setMarkers(void 0,void 0))});function _t(d){if(Ie&&(clearTimeout(Ie),Ie=void 0),D>-1&&G)t(55,A=G[D]),t(1,h=A.place_type[0]==="reverse"?A.place_name:A.place_name.replace(/,.*/,"")),t(18,he=void 0),t(54,X=void 0),t(15,D=-1);else if(h){const j=d||!tt(h);nt(h,{exact:!0}).then(()=>{t(54,X=G),t(55,A=void 0),j&&fn()}).catch(ae=>t(18,he=ae))}}function tt(d){try{return Gn(d,6)}catch{return!1}}async function nt(d,{byId:j=!1,exact:ae=!1}={}){t(18,he=void 0),Te==null||Te.abort();const fe=new AbortController;t(19,Te=fe);try{const O=tt(d),ue=new URLSearchParams;if(v!==void 0&&ue.set("language",Array.isArray(v)?v.join(","):v??""),se&&ue.set("types",se.join(",")),me&&ue.set("excludeTypes",String(me)),a&&ue.set("bbox",a.map(De=>De.toFixed(6)).join(",")),_&&ue.set("country",Array.isArray(_)?_.join(","):_),!j&&!O){const De=await Or(w,R,fe);De&&ue.set("proximity",De),(ae||!H)&&ue.set("autocomplete","false"),ue.set("fuzzyMatch",String(U))}z!==void 0&&(!O||(se==null?void 0:se.length)===1)&&ue.set("limit",String(z)),ue.set("key",s),$e(ue);const He=je+"/"+encodeURIComponent(O?O.decimalLongitude+","+O.decimalLatitude:d)+".json?"+ue.toString();if(He===ht){j?(t(14,G=void 0),t(55,A=Ne[0])):t(14,G=Ne);return}ht=He;const lt=await fetch(He,{signal:fe.signal,...xe});if(!lt.ok)throw new Error(await lt.text());const ot=await lt.json();be("response",{url:He,featureCollection:ot}),j?(t(14,G=void 0),t(55,A=ot.features[0]),Ne=[A]):(t(14,G=ot.features.filter(b)),O&&G.unshift({type:"Feature",properties:{},id:"reverse_"+O.decimalLongitude+"_"+O.decimalLatitude,text:O.decimalLatitude+", "+O.decimalLongitude,place_name:O.decimalLatitude+", "+O.decimalLongitude,place_type:["reverse"],center:[O.decimalLongitude,O.decimalLatitude],bbox:[O.decimalLongitude,O.decimalLatitude,O.decimalLongitude,O.decimalLatitude],geometry:{type:"Point",coordinates:[O.decimalLongitude,O.decimalLatitude]}}),Ne=G,O&&ge.focus())}catch(O){if(O&&typeof O=="object"&&"name"in O&&O.name==="AbortError")return;throw O}finally{fe===Te&&t(19,Te=void 0)}}function fn(){var ae;if(!(X!=null&&X.length)||!p)return;const d=[180,90,-180,-90],j=!X.some(fe=>!fe.matching_text);for(const fe of X)if(j||!fe.matching_text)for(const O of[0,1,2,3])d[O]=Math[O<2?"min":"max"](d[O],((ae=fe.bbox)==null?void 0:ae[O])??fe.center[O%2]);w&&X.length>0&&(A&&d[0]===d[2]&&d[1]===d[3]?w.flyTo(A.center,Ue):w.fitBounds(Rt(d),50,Re))}function un(d){t(0,S=y==="always"),t(14,G=void 0),t(55,A=void 0),t(15,D=-1),gt(d[1].toFixed(6)+", "+Gr(d[0],[-180,180],!0).toFixed(6),!1,!0)}function cn(d){if(!G)return;let j=d.key==="ArrowDown"?1:d.key==="ArrowUp"?-1:0;j&&(D===(ie?0:-1)&&j===-1&&t(15,D=G.length),t(15,D+=j),D>=G.length&&t(15,D=-1),D<0&&ie&&t(15,D=0),d.preventDefault())}function rt(d=!0,j=!1){if(t(18,he=void 0),H||j){if(Ie&&clearTimeout(Ie),h.length{nt(ae).catch(fe=>t(18,he=fe))},d?g:0)}else t(14,G=void 0),t(18,he=void 0)}function it(d){t(55,A=d),t(1,h=d.place_name),t(15,D=-1)}const dn=()=>ge.focus();function mn(d){Ye[d?"unshift":"push"](()=>{ge=d,t(17,ge)})}function gn(){h=this.value,t(1,h),t(13,Be),t(27,u)}const hn=()=>t(13,Be=!0),_n=()=>t(13,Be=!1),yn=()=>rt(),bn=()=>{t(1,h=""),ge.focus()},vn=()=>t(0,S=!S),wn=()=>t(18,he=void 0),kn=d=>t(15,D=d),pn=d=>it(d),Ln=()=>{ie||t(15,D=-1)},Mn=()=>{};return n.$$set=d=>{"class"in d&&t(2,o=d.class),"apiKey"in d&&t(25,s=d.apiKey),"bbox"in d&&t(26,a=d.bbox),"clearButtonTitle"in d&&t(3,f=d.clearButtonTitle),"clearOnBlur"in d&&t(27,u=d.clearOnBlur),"collapsed"in d&&t(4,m=d.collapsed),"country"in d&&t(28,_=d.country),"debounceSearch"in d&&t(29,g=d.debounceSearch),"enableReverse"in d&&t(5,y=d.enableReverse),"errorMessage"in d&&t(6,M=d.errorMessage),"filter"in d&&t(30,b=d.filter),"flyTo"in d&&t(31,p=d.flyTo),"fuzzyMatch"in d&&t(32,U=d.fuzzyMatch),"language"in d&&t(33,v=d.language),"limit"in d&&t(34,z=d.limit),"mapController"in d&&t(35,w=d.mapController),"minLength"in d&&t(36,Z=d.minLength),"noResultsMessage"in d&&t(7,q=d.noResultsMessage),"placeholder"in d&&t(8,W=d.placeholder),"proximity"in d&&t(37,R=d.proximity),"reverseActive"in d&&t(0,S=d.reverseActive),"reverseButtonTitle"in d&&t(9,oe=d.reverseButtonTitle),"searchValue"in d&&t(1,h=d.searchValue),"showFullGeometry"in d&&t(38,ye=d.showFullGeometry),"showPlaceType"in d&&t(10,B=d.showPlaceType),"showResultsWhileTyping"in d&&t(39,H=d.showResultsWhileTyping),"selectFirst"in d&&t(11,ie=d.selectFirst),"flyToSelected"in d&&t(40,k=d.flyToSelected),"markerOnSelected"in d&&t(41,ce=d.markerOnSelected),"types"in d&&t(42,se=d.types),"excludeTypes"in d&&t(43,me=d.excludeTypes),"zoom"in d&&t(44,Ue=d.zoom),"maxZoom"in d&&t(45,Re=d.maxZoom),"apiUrl"in d&&t(46,je=d.apiUrl),"fetchParameters"in d&&t(47,xe=d.fetchParameters),"iconsBaseUrl"in d&&t(12,mt=d.iconsBaseUrl),"adjustUrlQuery"in d&&t(48,$e=d.adjustUrlQuery),"$$scope"in d&&t(58,l=d.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&134225920&&setTimeout(()=>{t(16,Ve=Be),u&&!Be&&t(1,h="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&32&&h.lengtht(18,he=d)),n.$$.dirty[1]&50356241&&(w&&A&&A.id!==et&&p&&(!A.bbox||A.bbox[0]===A.bbox[2]&&A.bbox[1]===A.bbox[3]?w.flyTo(A.center,A.id.startsWith("poi.")||A.id.startsWith("address.")?Re:Ue):w.fitBounds(Rt(A.bbox),50,Re),t(14,G=void 0),t(54,X=void 0),t(15,D=-1)),t(56,et=A==null?void 0:A.id)),n.$$.dirty[0]&18432&&ie&&G!=null&&G.length&&t(15,D=0),n.$$.dirty[0]&2050&&(ie||t(15,D=-1)),n.$$.dirty[0]&16384|n.$$.dirty[1]&8388608&&X!==G&&t(54,X=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&8388624&&w&&w.setEventHandler(d=>{switch(d.type){case"mapClick":S&&un(d.coordinates);break;case"markerClick":{const j=G==null?void 0:G.find(ae=>ae.id===d.id);j&&it(j)}break;case"markerMouseEnter":X&&t(15,D=Ve?(G==null?void 0:G.findIndex(j=>j.id===d.id))??-1:-1);break;case"markerMouseLeave":X&&t(15,D=-1);break}}),n.$$.dirty[0]&49152&&t(57,r=G==null?void 0:G[D]),n.$$.dirty[1]&67133969&&w&&r&&p&&k&&w.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Re:Ue),n.$$.dirty[1]&1040&&(ce||w==null||w.setMarkers(void 0,void 0)),n.$$.dirty[1]&75498512&&w&&ce&&!X&&(w.setMarkers(r?[r]:void 0,void 0),w.setSelectedMarker(r?0:-1)),n.$$.dirty[1]&25165840&&w&&w.setMarkers(X,A),n.$$.dirty[0]&32768|n.$$.dirty[1]&8388624&&X&&w&&w.setSelectedMarker(D),n.$$.dirty[0]&2|n.$$.dirty[1]&16&&w){const d=tt(h);w.setReverseMarker(d?[d.decimalLongitude,d.decimalLatitude]:void 0)}n.$$.dirty[1]&67108864&&be("select",r),n.$$.dirty[1]&16777216&&be("pick",A),n.$$.dirty[0]&81920&&be("optionsVisibilityChange",Ve&&!!G),n.$$.dirty[0]&16384&&be("featuresListed",G),n.$$.dirty[1]&8388608&&be("featuresMarked",X),n.$$.dirty[0]&1&&be("reverseToggle",S),n.$$.dirty[0]&2&&be("queryChange",h),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&w&&w.indicateReverse(S)},[S,h,o,f,m,y,M,q,W,oe,B,ie,mt,Be,G,D,Ve,ge,he,Te,an,_t,cn,rt,it,s,a,u,_,g,b,p,U,v,z,w,Z,R,ye,H,k,ce,se,me,Ue,Re,je,xe,$e,rn,ln,gt,on,sn,X,A,et,r,l,i,dn,mn,gn,hn,_n,yn,bn,vn,wn,kn,pn,Ln,Mn]}class Hr extends Q{constructor(e){super(),J(this,e,Vr,Nr,Y,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}}function Gt(n){let e,t,r,i;return t=new Hr({props:{mapController:n[1],apiKey:"MZEJTanw3WpxRvt7qDfo",country:"gb"}}),{c(){e=P("div"),x(t.$$.fragment),c(e,"class",r=Je(n[0])+" svelte-189syb7")},m(l,o){T(l,e,o),$(t,e,null),i=!0},p(l,o){const s={};o&2&&(s.mapController=l[1]),t.$set(s),(!i||o&1&&r!==(r=Je(l[0])+" svelte-189syb7"))&&c(e,"class",r)},i(l){i||(I(t.$$.fragment,l),i=!0)},o(l){F(t.$$.fragment,l),i=!1},d(l){l&&C(e),ee(t)}}}function Dr(n){let e,t,r=n[1]&&Gt(n);return{c(){r&&r.c(),e=Oe()},m(i,l){r&&r.m(i,l),T(i,e,l),t=!0},p(i,[l]){i[1]?r?(r.p(i,l),l&2&&I(r,1)):(r=Gt(i),r.c(),I(r,1),r.m(e.parentNode,e)):r&&(ze(),F(r,1,1,()=>{r=null}),Ee())},i(i){t||(I(r),t=!0)},o(i){F(r),t=!1},d(i){i&&C(e),r&&r.d(i)}}}function Kr(n,e,t){let r;Se(n,Nt,o=>t(2,r=o));let{position:i="top-left"}=e,l;return Zn(()=>{t(1,l=qn(r,Vt))}),n.$$set=o=>{"position"in o&&t(0,i=o.position)},[i,l]}class il extends Q{constructor(e){super(),J(this,e,Kr,Dr,Y,{position:0})}}function Qr(n){let e,t,r;return{c(){e=P("div"),e.innerHTML=`Active Travel England logo`,t=K(),r=P("div"),c(e,"class","black-bar svelte-19t777m"),c(r,"class","green-bar svelte-19t777m")},m(i,l){T(i,e,l),T(i,t,l),T(i,r,l)},p:N,i:N,o:N,d(i){i&&(C(e),C(t),C(r))}}}class ll extends Q{constructor(e){super(),J(this,e,null,Qr,Y,{})}}function Jr(n){let e;return{c(){e=P("ul"),e.innerHTML=`
  • Click + Privacy Policy`},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function hr(n){let e,t,r,i,l;function o(f){n[2](f)}let s={label:"Basemap",choices:Fn(),disabled:n[0]};n[1]!==void 0&&(s.value=n[1]),e=new ir({props:s}),Xe.push(()=>ft(e,"value",o));let a=n[1]=="google"&&zt();return{c(){x(e.$$.fragment),r=K(),a&&a.c(),i=Ge()},m(f,u){$(e,f,u),T(f,r,u),a&&a.m(f,u),T(f,i,u),l=!0},p(f,[u]){const m={};u&1&&(m.disabled=f[0]),!t&&u&2&&(t=!0,m.value=f[1],ut(()=>t=!1)),e.$set(m),f[1]=="google"?a||(a=zt(),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null)},i(f){l||(I(e.$$.fragment,f),l=!0)},o(f){F(e.$$.fragment,f),l=!1},d(f){f&&(C(r),C(i)),ee(e,f),a&&a.d(f)}}}function _r(n,e,t){let r;Se(n,bt,o=>t(1,r=o));let{disabled:i=!1}=e;function l(o){r=o,bt.set(r)}return n.$$set=o=>{"disabled"in o&&t(0,i=o.disabled)},[i,r,l]}class rl extends Q{constructor(e){super(),J(this,e,_r,hr,X,{disabled:0})}}function yr(n){let e,t;return{c(){e=_e("svg"),t=_e("path"),c(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),c(e,"viewBox","0 0 14 14"),c(e,"width","13"),c(e,"height","13"),c(e,"class","svelte-en2qvf")},m(r,i){T(r,e,i),E(e,t)},p:N,i:N,o:N,d(r){r&&C(e)}}}class Qt extends Q{constructor(e){super(),J(this,e,null,yr,X,{})}}function br(n){let e,t;return{c(){e=_e("svg"),t=_e("path"),c(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),c(e,"viewBox","0 0 30 30"),c(e,"fill","none"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"class","svelte-d2loi5")},m(r,i){T(r,e,i),E(e,t)},p:N,i:N,o:N,d(r){r&&C(e)}}}class Jt extends Q{constructor(e){super(),J(this,e,null,br,X,{})}}function vr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"area.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"area.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function wr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"reverse.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"reverse.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function kr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"poi.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"poi.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function pr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"postal_code.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"postal_code.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Lr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"street.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"street.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Mr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"road.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"road.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Pr(n){let e,t;return{c(){e=P("img"),ne(e.src,t=n[3]+"housenumber.svg")||c(e,"src",t),c(e,"alt",n[6]),c(e,"class","svelte-ltkwvy")},m(r,i){T(r,e,i)},p(r,i){i&8&&!ne(e.src,t=r[3]+"housenumber.svg")&&c(e,"src",t),i&64&&c(e,"alt",r[6])},d(r){r&&C(e)}}}function Tr(n){let e,t,r,i;return{c(){e=P("img"),ne(e.src,t=n[5])||c(e,"src",t),c(e,"alt",n[4]),c(e,"class","svelte-ltkwvy")},m(l,o){T(l,e,o),r||(i=V(e,"error",n[14]),r=!0)},p(l,o){o&32&&!ne(e.src,t=l[5])&&c(e,"src",t),o&16&&c(e,"alt",l[4])},d(l){l&&C(e),r=!1,i()}}}function Et(n){let e,t;return{c(){e=P("span"),t=de(n[6]),c(e,"class","secondary svelte-ltkwvy")},m(r,i){T(r,e,i),E(e,t)},p(r,i){i&64&&Me(t,r[6])},d(r){r&&C(e)}}}function Cr(n){var W,q;let e,t,r,i,l,o,s,a,f=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",u,m,_=n[2]==="always"||n[2]&&!n[0].address&&((W=n[0].properties)==null?void 0:W.kind)!=="road"&&((q=n[0].properties)==null?void 0:q.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],g,y,M=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",b,p,U;function v(R,S){var oe,h;return S&1&&(t=null),S&1&&(r=null),S&1&&(i=null),R[5]?Tr:R[0].address?Pr:((oe=R[0].properties)==null?void 0:oe.kind)==="road"||((h=R[0].properties)==null?void 0:h.kind)==="road_relation"?Mr:(t==null&&(t=!!R[0].id.startsWith("address.")),t?Lr:(r==null&&(r=!!R[0].id.startsWith("postal_code.")),r?pr:(i==null&&(i=!!R[0].id.startsWith("poi.")),i?kr:R[7]?wr:vr)))}let z=v(n,-1),w=z(n),Z=_&&Et(n);return{c(){e=P("li"),w.c(),l=K(),o=P("span"),s=P("span"),a=P("span"),u=de(f),m=K(),Z&&Z.c(),g=K(),y=P("span"),b=de(M),c(a,"class","primary svelte-ltkwvy"),c(s,"class","svelte-ltkwvy"),c(y,"class","line2 svelte-ltkwvy"),c(o,"class","texts svelte-ltkwvy"),c(e,"tabindex","0"),c(e,"data-selected",n[1]),c(e,"class","svelte-ltkwvy"),ve(e,"selected",n[1])},m(R,S){T(R,e,S),w.m(e,null),E(e,l),E(e,o),E(o,s),E(s,a),E(a,u),E(s,m),Z&&Z.m(s,null),E(o,g),E(o,y),E(y,b),p||(U=[V(e,"mouseenter",n[12]),V(e,"focus",n[13])],p=!0)},p(R,[S]){var oe,h;z===(z=v(R,S))&&w?w.p(R,S):(w.d(1),w=z(R),w&&(w.c(),w.m(e,l))),S&1&&f!==(f=(R[7]?R[0].place_name:R[0].place_name.replace(/,.*/,""))+"")&&Me(u,f),S&37&&(_=R[2]==="always"||R[2]&&!R[0].address&&((oe=R[0].properties)==null?void 0:oe.kind)!=="road"&&((h=R[0].properties)==null?void 0:h.kind)!=="road_relation"&&!R[0].id.startsWith("address.")&&!R[0].id.startsWith("postal_code.")&&(!R[0].id.startsWith("poi.")||!R[5])&&!R[7]),_?Z?Z.p(R,S):(Z=Et(R),Z.c(),Z.m(s,null)):Z&&(Z.d(1),Z=null),S&1&&M!==(M=(R[7]?"":R[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Me(b,M),S&2&&c(e,"data-selected",R[1]),S&2&&ve(e,"selected",R[1])},i:N,o:N,d(R){R&&C(e),w.d(),Z&&Z.d(),p=!1,Ae(U)}}}function Sr(n,e,t){var v;let r,i,{feature:l}=e,{selected:o=!1}=e,{showPlaceType:s}=e,{missingIconsCache:a}=e,{iconsBaseUrl:f}=e;const u=(v=l.properties)==null?void 0:v.categories;let m,_,g=0,y=l.place_type[0]==="reverse";function M(z){_&&a.add(_),t(10,g++,g)}function b(z){le.call(this,n,z)}function p(z){le.call(this,n,z)}const U=z=>M(z.currentTarget);return n.$$set=z=>{"feature"in z&&t(0,l=z.feature),"selected"in z&&t(1,o=z.selected),"showPlaceType"in z&&t(2,s=z.showPlaceType),"missingIconsCache"in z&&t(9,a=z.missingIconsCache),"iconsBaseUrl"in z&&t(3,f=z.iconsBaseUrl)},n.$$.update=()=>{var z,w,Z,W;if(n.$$.dirty&3640)do t(11,r--,r),t(4,m=u==null?void 0:u[r]),t(5,_=m?f+m.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!_||a.has(_)));n.$$.dirty&1&&t(6,i=l.id.startsWith("poi.")?(w=(z=l.properties)==null?void 0:z.categories)==null?void 0:w.join(", "):((W=(Z=l.properties)==null?void 0:Z.place_type_name)==null?void 0:W[0])??l.place_type[0])},t(11,r=(u==null?void 0:u.length)??0),[l,o,s,f,m,_,i,y,M,a,g,r,b,p,U]}class zr extends Q{constructor(e){super(),J(this,e,Sr,Cr,X,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Er(n){let e;return{c(){e=P("div"),e.innerHTML='',c(e,"class","svelte-7cmwmc")},m(t,r){T(t,e,r)},p:N,i:N,o:N,d(t){t&&C(e)}}}class Rr extends Q{constructor(e){super(),J(this,e,null,Er,X,{})}}function Br(n){let e,t;return{c(){e=_e("svg"),t=_e("path"),c(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),c(e,"viewBox","0 0 60.006 21.412"),c(e,"width","14"),c(e,"height","20"),c(e,"class","svelte-en2qvf")},m(r,i){T(r,e,i),E(e,t)},p:N,i:N,o:N,d(r){r&&C(e)}}}class Ir extends Q{constructor(e){super(),J(this,e,null,Br,X,{})}}function Fr(n){let e,t,r;return{c(){e=_e("svg"),t=_e("circle"),r=_e("path"),c(t,"cx","4.789"),c(t,"cy","4.787"),c(t,"r","3.85"),Ce(t,"stroke-width","1.875"),Ce(t,"fill","none"),c(r,"d","M12.063 12.063 7.635 7.635"),Ce(r,"stroke-width","1.875"),Ce(r,"stroke-linecap","round"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"width","13"),c(e,"height","13"),c(e,"viewBox","0 0 13 13"),c(e,"class","svelte-1bpbt60")},m(i,l){T(i,e,l),E(e,t),E(e,r)},p:N,i:N,o:N,d(i){i&&C(e)}}}class Or extends Q{constructor(e){super(),J(this,e,null,Fr,X,{})}}function Ar(n,e,t){const r=e[1],i=e[0],l=r-i;return n===r&&t?n:((n-i)%l+l)%l+i}function Rt(n){const e=[...n];return e[2]r[0]||i.maxZoom!=null&&i.maxZoomDate.now()){if(!Ze.coords)break e;return Ze.coords}let l;try{return l=await new Promise((o,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(a=>{o([a.coords.longitude,a.coords.latitude].map(f=>f.toFixed(6)).join(","))},a=>{s(a)},i)}),l}catch{}finally{i.cachedLocationExpiry&&(Ze={time:Date.now(),coords:l})}if(t.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}function Bt(n,e,t){const r=n.slice();return r[81]=e[t],r[83]=t,r}function It(n){let e,t;return e=new Rr({}),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function Ft(n){let e,t,r,i,l;return t=new Ir({}),{c(){e=P("button"),x(t.$$.fragment),c(e,"type","button"),c(e,"title",n[9]),c(e,"class","svelte-zh3kmv"),ve(e,"active",n[0])},m(o,s){T(o,e,s),$(t,e,null),r=!0,i||(l=V(e,"click",n[67]),i=!0)},p(o,s){(!r||s[0]&512)&&c(e,"title",o[9]),(!r||s[0]&1)&&ve(e,"active",o[0])},i(o){r||(I(t.$$.fragment,o),r=!0)},o(o){F(t.$$.fragment,o),r=!1},d(o){o&&C(e),ee(t),i=!1,l()}}}function Ur(n){let e,t=[],r=new Map,i,l,o,s=Qe(n[14]);const a=f=>f[81].id+(f[81].address?","+f[81].address:"");for(let f=0;f{W=null}),Ee()),(!v||H[0]&2)&&ve(f,"displayable",B[1]!==""),B[5]===!0?q?(q.p(B,H),H[0]&32&&I(q,1)):(q=Ft(B),q.c(),I(q,1),q.m(r,y)):q&&(ze(),F(q,1,1,()=>{q=null}),Ee()),S&&S.p&&(!v||H[1]&134217728)&&ke(S,R,B,B[58],v?Le(R,B[58],H,null):pe(B[58]),null);let ie=b;b=ye(B),b===ie?~b&&h[b].p(B,H):(p&&(ze(),F(h[ie],1,1,()=>{h[ie]=null}),Ee()),~b?(p=h[b],p?p.p(B,H):(p=h[b]=oe[b](B),p.c()),I(p,1),p.m(t,null)):p=null),(!v||H[0]&4&&U!==(U=Je(B[2])+" svelte-zh3kmv"))&&c(t,"class",U),(!v||H[0]&22)&&ve(t,"can-collapse",B[4]&&B[1]==="")},i(B){v||(I(Z),I(l.$$.fragment,B),I(m.$$.fragment,B),I(W),I(q),I(S,B),I(p),v=!0)},o(B){F(Z),F(l.$$.fragment,B),F(m.$$.fragment,B),F(W),F(q),F(S,B),F(p),v=!1},d(B){B&&(C(e),C(t)),ee(l),n[61](null),ee(m),W&&W.d(),q&&q.d(),S&&S.d(B),~b&&h[b].d(),z=!1,Ae(w)}}}function Vr(n,e,t){let r,{$$slots:i={},$$scope:l}=e,{class:o=void 0}=e,{apiKey:s}=e,{bbox:a=void 0}=e,{clearButtonTitle:f="clear"}=e,{clearOnBlur:u=!1}=e,{collapsed:m=!1}=e,{country:_=void 0}=e,{debounceSearch:g=200}=e,{enableReverse:y=!1}=e,{errorMessage:M="Something went wrong…"}=e,{filter:b=()=>!0}=e,{flyTo:p=!0}=e,{fuzzyMatch:U=!0}=e,{language:v=void 0}=e,{limit:z=void 0}=e,{mapController:w=void 0}=e,{minLength:Z=2}=e,{noResultsMessage:W="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:q="Search"}=e,{proximity:R=[{type:"server-geolocation"}]}=e,{reverseActive:S=y==="always"}=e,{reverseButtonTitle:oe="toggle reverse geocoding"}=e,{searchValue:h=""}=e,{showFullGeometry:ye=!0}=e,{showPlaceType:B="ifNeeded"}=e,{showResultsWhileTyping:H=!0}=e,{selectFirst:ie=!0}=e,{flyToSelected:k=!1}=e,{markerOnSelected:ce=!0}=e,{types:se=void 0}=e,{excludeTypes:me=!1}=e,{zoom:Ue=16}=e,{maxZoom:Re=18}=e,{apiUrl:je="https://api.maptiler.com/geocoding"}=e,{fetchParameters:xe={}}=e,{iconsBaseUrl:mt="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.3/icons/"}=e,{adjustUrlQuery:$e=d=>{}}=e;function rn(){ge.focus()}function ln(){ge.blur()}function gt(d,j=!0,ae=!1){t(1,h=d),j?(t(15,D=-1),_t()):(rt(!ae,ae),setTimeout(()=>{ge.focus(),ge.select()}))}function on(){t(14,A=void 0),t(55,O=void 0),t(15,D=-1)}function sn(){t(54,Y=[]),t(55,O=void 0)}let Be=!1,A,Y,O,ht="",ge,D=-1,he,Ne=[],Te,Ie,Ve,et;const an=new Set,be=Wt();qt(()=>{w&&(w.setEventHandler(void 0),w.indicateReverse(!1),w.setSelectedMarker(-1),w.setMarkers(void 0,void 0))});function _t(d){if(Ie&&(clearTimeout(Ie),Ie=void 0),D>-1&&A)t(55,O=A[D]),t(1,h=O.place_type[0]==="reverse"?O.place_name:O.place_name.replace(/,.*/,"")),t(18,he=void 0),t(54,Y=void 0),t(15,D=-1);else if(h){const j=d||!tt(h);nt(h,{exact:!0}).then(()=>{t(54,Y=A),t(55,O=void 0),j&&fn()}).catch(ae=>t(18,he=ae))}}function tt(d){try{return An(d,6)}catch{return!1}}async function nt(d,{byId:j=!1,exact:ae=!1}={}){t(18,he=void 0),Te==null||Te.abort();const fe=new AbortController;t(19,Te=fe);try{const G=tt(d),ue=new URLSearchParams;if(v!==void 0&&ue.set("language",Array.isArray(v)?v.join(","):v??""),se&&ue.set("types",se.join(",")),me&&ue.set("excludeTypes",String(me)),a&&ue.set("bbox",a.map(De=>De.toFixed(6)).join(",")),_&&ue.set("country",Array.isArray(_)?_.join(","):_),!j&&!G){const De=await Gr(w,R,fe);De&&ue.set("proximity",De),(ae||!H)&&ue.set("autocomplete","false"),ue.set("fuzzyMatch",String(U))}z!==void 0&&(!G||(se==null?void 0:se.length)===1)&&ue.set("limit",String(z)),ue.set("key",s),$e(ue);const He=je+"/"+encodeURIComponent(G?G.decimalLongitude+","+G.decimalLatitude:d)+".json?"+ue.toString();if(He===ht){j?(t(14,A=void 0),t(55,O=Ne[0])):t(14,A=Ne);return}ht=He;const lt=await fetch(He,{signal:fe.signal,...xe});if(!lt.ok)throw new Error(await lt.text());const ot=await lt.json();be("response",{url:He,featureCollection:ot}),j?(t(14,A=void 0),t(55,O=ot.features[0]),Ne=[O]):(t(14,A=ot.features.filter(b)),G&&A.unshift({type:"Feature",properties:{},id:"reverse_"+G.decimalLongitude+"_"+G.decimalLatitude,text:G.decimalLatitude+", "+G.decimalLongitude,place_name:G.decimalLatitude+", "+G.decimalLongitude,place_type:["reverse"],center:[G.decimalLongitude,G.decimalLatitude],bbox:[G.decimalLongitude,G.decimalLatitude,G.decimalLongitude,G.decimalLatitude],geometry:{type:"Point",coordinates:[G.decimalLongitude,G.decimalLatitude]}}),Ne=A,G&&ge.focus())}catch(G){if(G&&typeof G=="object"&&"name"in G&&G.name==="AbortError")return;throw G}finally{fe===Te&&t(19,Te=void 0)}}function fn(){var ae;if(!(Y!=null&&Y.length)||!p)return;const d=[180,90,-180,-90],j=!Y.some(fe=>!fe.matching_text);for(const fe of Y)if(j||!fe.matching_text)for(const G of[0,1,2,3])d[G]=Math[G<2?"min":"max"](d[G],((ae=fe.bbox)==null?void 0:ae[G])??fe.center[G%2]);w&&Y.length>0&&(O&&d[0]===d[2]&&d[1]===d[3]?w.flyTo(O.center,Ue):w.fitBounds(Rt(d),50,Re))}function un(d){t(0,S=y==="always"),t(14,A=void 0),t(55,O=void 0),t(15,D=-1),gt(d[1].toFixed(6)+", "+Ar(d[0],[-180,180],!0).toFixed(6),!1,!0)}function cn(d){if(!A)return;let j=d.key==="ArrowDown"?1:d.key==="ArrowUp"?-1:0;j&&(D===(ie?0:-1)&&j===-1&&t(15,D=A.length),t(15,D+=j),D>=A.length&&t(15,D=-1),D<0&&ie&&t(15,D=0),d.preventDefault())}function rt(d=!0,j=!1){if(t(18,he=void 0),H||j){if(Ie&&clearTimeout(Ie),h.length{nt(ae).catch(fe=>t(18,he=fe))},d?g:0)}else t(14,A=void 0),t(18,he=void 0)}function it(d){t(55,O=d),t(1,h=d.place_name),t(15,D=-1)}const dn=()=>ge.focus();function mn(d){Xe[d?"unshift":"push"](()=>{ge=d,t(17,ge)})}function gn(){h=this.value,t(1,h),t(13,Be),t(27,u)}const hn=()=>t(13,Be=!0),_n=()=>t(13,Be=!1),yn=()=>rt(),bn=()=>{t(1,h=""),ge.focus()},vn=()=>t(0,S=!S),wn=()=>t(18,he=void 0),kn=d=>t(15,D=d),pn=d=>it(d),Ln=()=>{ie||t(15,D=-1)},Mn=()=>{};return n.$$set=d=>{"class"in d&&t(2,o=d.class),"apiKey"in d&&t(25,s=d.apiKey),"bbox"in d&&t(26,a=d.bbox),"clearButtonTitle"in d&&t(3,f=d.clearButtonTitle),"clearOnBlur"in d&&t(27,u=d.clearOnBlur),"collapsed"in d&&t(4,m=d.collapsed),"country"in d&&t(28,_=d.country),"debounceSearch"in d&&t(29,g=d.debounceSearch),"enableReverse"in d&&t(5,y=d.enableReverse),"errorMessage"in d&&t(6,M=d.errorMessage),"filter"in d&&t(30,b=d.filter),"flyTo"in d&&t(31,p=d.flyTo),"fuzzyMatch"in d&&t(32,U=d.fuzzyMatch),"language"in d&&t(33,v=d.language),"limit"in d&&t(34,z=d.limit),"mapController"in d&&t(35,w=d.mapController),"minLength"in d&&t(36,Z=d.minLength),"noResultsMessage"in d&&t(7,W=d.noResultsMessage),"placeholder"in d&&t(8,q=d.placeholder),"proximity"in d&&t(37,R=d.proximity),"reverseActive"in d&&t(0,S=d.reverseActive),"reverseButtonTitle"in d&&t(9,oe=d.reverseButtonTitle),"searchValue"in d&&t(1,h=d.searchValue),"showFullGeometry"in d&&t(38,ye=d.showFullGeometry),"showPlaceType"in d&&t(10,B=d.showPlaceType),"showResultsWhileTyping"in d&&t(39,H=d.showResultsWhileTyping),"selectFirst"in d&&t(11,ie=d.selectFirst),"flyToSelected"in d&&t(40,k=d.flyToSelected),"markerOnSelected"in d&&t(41,ce=d.markerOnSelected),"types"in d&&t(42,se=d.types),"excludeTypes"in d&&t(43,me=d.excludeTypes),"zoom"in d&&t(44,Ue=d.zoom),"maxZoom"in d&&t(45,Re=d.maxZoom),"apiUrl"in d&&t(46,je=d.apiUrl),"fetchParameters"in d&&t(47,xe=d.fetchParameters),"iconsBaseUrl"in d&&t(12,mt=d.iconsBaseUrl),"adjustUrlQuery"in d&&t(48,$e=d.adjustUrlQuery),"$$scope"in d&&t(58,l=d.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&134225920&&setTimeout(()=>{t(16,Ve=Be),u&&!Be&&t(1,h="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&32&&h.lengtht(18,he=d)),n.$$.dirty[1]&50356241&&(w&&O&&O.id!==et&&p&&(!O.bbox||O.bbox[0]===O.bbox[2]&&O.bbox[1]===O.bbox[3]?w.flyTo(O.center,O.id.startsWith("poi.")||O.id.startsWith("address.")?Re:Ue):w.fitBounds(Rt(O.bbox),50,Re),t(14,A=void 0),t(54,Y=void 0),t(15,D=-1)),t(56,et=O==null?void 0:O.id)),n.$$.dirty[0]&18432&&ie&&A!=null&&A.length&&t(15,D=0),n.$$.dirty[0]&2050&&(ie||t(15,D=-1)),n.$$.dirty[0]&16384|n.$$.dirty[1]&8388608&&Y!==A&&t(54,Y=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&8388624&&w&&w.setEventHandler(d=>{switch(d.type){case"mapClick":S&&un(d.coordinates);break;case"markerClick":{const j=A==null?void 0:A.find(ae=>ae.id===d.id);j&&it(j)}break;case"markerMouseEnter":Y&&t(15,D=Ve?(A==null?void 0:A.findIndex(j=>j.id===d.id))??-1:-1);break;case"markerMouseLeave":Y&&t(15,D=-1);break}}),n.$$.dirty[0]&49152&&t(57,r=A==null?void 0:A[D]),n.$$.dirty[1]&67133969&&w&&r&&p&&k&&w.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Re:Ue),n.$$.dirty[1]&1040&&(ce||w==null||w.setMarkers(void 0,void 0)),n.$$.dirty[1]&75498512&&w&&ce&&!Y&&(w.setMarkers(r?[r]:void 0,void 0),w.setSelectedMarker(r?0:-1)),n.$$.dirty[1]&25165840&&w&&w.setMarkers(Y,O),n.$$.dirty[0]&32768|n.$$.dirty[1]&8388624&&Y&&w&&w.setSelectedMarker(D),n.$$.dirty[0]&2|n.$$.dirty[1]&16&&w){const d=tt(h);w.setReverseMarker(d?[d.decimalLongitude,d.decimalLatitude]:void 0)}n.$$.dirty[1]&67108864&&be("select",r),n.$$.dirty[1]&16777216&&be("pick",O),n.$$.dirty[0]&81920&&be("optionsVisibilityChange",Ve&&!!A),n.$$.dirty[0]&16384&&be("featuresListed",A),n.$$.dirty[1]&8388608&&be("featuresMarked",Y),n.$$.dirty[0]&1&&be("reverseToggle",S),n.$$.dirty[0]&2&&be("queryChange",h),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&w&&w.indicateReverse(S)},[S,h,o,f,m,y,M,W,q,oe,B,ie,mt,Be,A,D,Ve,ge,he,Te,an,_t,cn,rt,it,s,a,u,_,g,b,p,U,v,z,w,Z,R,ye,H,k,ce,se,me,Ue,Re,je,xe,$e,rn,ln,gt,on,sn,Y,O,et,r,l,i,dn,mn,gn,hn,_n,yn,bn,vn,wn,kn,pn,Ln,Mn]}class Hr extends Q{constructor(e){super(),J(this,e,Vr,Nr,X,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}}function At(n){let e,t,r,i;return t=new Hr({props:{mapController:n[1],apiKey:"MZEJTanw3WpxRvt7qDfo",country:"gb"}}),{c(){e=P("div"),x(t.$$.fragment),c(e,"class",r=Je(n[0])+" svelte-189syb7")},m(l,o){T(l,e,o),$(t,e,null),i=!0},p(l,o){const s={};o&2&&(s.mapController=l[1]),t.$set(s),(!i||o&1&&r!==(r=Je(l[0])+" svelte-189syb7"))&&c(e,"class",r)},i(l){i||(I(t.$$.fragment,l),i=!0)},o(l){F(t.$$.fragment,l),i=!1},d(l){l&&C(e),ee(t)}}}function Dr(n){let e,t,r=n[1]&&At(n);return{c(){r&&r.c(),e=Ge()},m(i,l){r&&r.m(i,l),T(i,e,l),t=!0},p(i,[l]){i[1]?r?(r.p(i,l),l&2&&I(r,1)):(r=At(i),r.c(),I(r,1),r.m(e.parentNode,e)):r&&(ze(),F(r,1,1,()=>{r=null}),Ee())},i(i){t||(I(r),t=!0)},o(i){F(r),t=!1},d(i){i&&C(e),r&&r.d(i)}}}function Kr(n,e,t){let r;Se(n,Nt,o=>t(2,r=o));let{position:i="top-left"}=e,l;return Zn(()=>{t(1,l=Wn(r,Vt))}),n.$$set=o=>{"position"in o&&t(0,i=o.position)},[i,l]}class il extends Q{constructor(e){super(),J(this,e,Kr,Dr,X,{position:0})}}function Qr(n){let e,t,r;return{c(){e=P("div"),e.innerHTML=`Active Travel England logo`,t=K(),r=P("div"),c(e,"class","black-bar svelte-19t777m"),c(r,"class","green-bar svelte-19t777m")},m(i,l){T(i,e,l),T(i,t,l),T(i,r,l)},p:N,i:N,o:N,d(i){i&&(C(e),C(t),C(r))}}}class ll extends Q{constructor(e){super(),J(this,e,null,Qr,X,{})}}function Jr(n){let e;return{c(){e=P("ul"),e.innerHTML=`
  • Click on the map to open a new tab with a 3rd-party imagery provider
  • Press Escape - to exit this mode
  • Cursor by Luc Chaissac
  • `},m(t,r){T(t,e,r)},p:N,i:N,o:N,d(t){t&&C(e)}}}class Yr extends Q{constructor(e){super(),J(this,e,null,Jr,Y,{})}}const Xr="/atip/browse_layout_v3/assets/camera_cursor-824d29b6.svg",{window:jr}=Nn;function Ot(n){let e,t,r,i;const l=[$r,xr],o=[];function s(a,f){return a[0]?0:1}return e=s(n),t=o[e]=l[e](n),{c(){t.c(),r=Oe()},m(a,f){o[e].m(a,f),T(a,r,f),i=!0},p(a,f){let u=e;e=s(a),e===u?o[e].p(a,f):(ze(),F(o[u],1,1,()=>{o[u]=null}),Ee(),t=o[e],t?t.p(a,f):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(r.parentNode,r))},i(a){i||(I(t),i=!0)},o(a){F(t),i=!1},d(a){a&&C(r),o[e].d(a)}}}function xr(n){let e,t;return e=new ct({props:{$$slots:{default:[ei]},$$scope:{ctx:n}}}),e.$on("click",n[8]),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},p(r,i){const l={};i&8192&&(l.$$scope={dirty:i,ctx:r}),e.$set(l)},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function $r(n){let e,t,r,i,l,o,s;e=new ct({props:{$$slots:{default:[ti]},$$scope:{ctx:n}}}),e.$on("click",n[6]);function a(u){n[7](u)}let f={label:"Source",choices:[["google","Google Street View"],["bing","Bing Streetside"]]};return n[2].streetViewImagery!==void 0&&(f.value=n[2].streetViewImagery),r=new Vn({props:f}),Ye.push(()=>ft(r,"value",a)),o=new er({props:{label:"Help",$$slots:{default:[ni]},$$scope:{ctx:n}}}),{c(){x(e.$$.fragment),t=K(),x(r.$$.fragment),l=K(),x(o.$$.fragment)},m(u,m){$(e,u,m),T(u,t,m),$(r,u,m),T(u,l,m),$(o,u,m),s=!0},p(u,m){const _={};m&8192&&(_.$$scope={dirty:m,ctx:u}),e.$set(_);const g={};!i&&m&4&&(i=!0,g.value=u[2].streetViewImagery,ut(()=>i=!1)),r.$set(g);const y={};m&8192&&(y.$$scope={dirty:m,ctx:u}),o.$set(y)},i(u){s||(I(e.$$.fragment,u),I(r.$$.fragment,u),I(o.$$.fragment,u),s=!0)},o(u){F(e.$$.fragment,u),F(r.$$.fragment,u),F(o.$$.fragment,u),s=!1},d(u){u&&(C(t),C(l)),ee(e,u),ee(r,u),ee(o,u)}}}function ei(n){let e;return{c(){e=de("Enable Street View")},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function ti(n){let e;return{c(){e=de("Disable Street View")},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function ni(n){let e,t;return e=new Yr({}),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function ri(n){let e,t,r,i,l=n[1]&&Ot(n);return{c(){l&&l.c(),e=Oe()},m(o,s){l&&l.m(o,s),T(o,e,s),t=!0,r||(i=V(jr,"keydown",n[3]),r=!0)},p(o,[s]){o[1]?l?(l.p(o,s),s&2&&I(l,1)):(l=Ot(o),l.c(),I(l,1),l.m(e.parentNode,e)):l&&(ze(),F(l,1,1,()=>{l=null}),Ee())},i(o){t||(I(l),t=!0)},o(o){F(l),t=!1},d(o){o&&C(e),l&&l.d(o),r=!1,i()}}}function ii(n,e,t){let r;Se(n,vt,b=>t(2,r=b));let{cfg:i}=e,{map:l}=e,{enabled:o}=e,{showControls:s=!0}=e,a=[];function f(){if(l){l.on("click",m),l.getCanvas().style.cursor=`url(${Xr}), auto`;for(let b of i.getStreetViewRoadLayerNames(l))a.push([b,l.getPaintProperty(b,"line-color")]),l.setPaintProperty(b,"line-color","cyan")}}function u(){if(l){l.off("click",m),l.getCanvas().style.cursor="inherit";for(let[b,p]of a)l.setPaintProperty(b,"line-color",p);a=[]}}Wt(u);function m(b){if(!o)return;let p=b.lngLat.lng,U=b.lngLat.lat;r.streetViewImagery=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${U},${p}&cbp=11,0,0,0,0`,"_blank"):r.streetViewImagery=="bing"&&window.open(`https://www.bing.com/maps?cp=${U}~${p}&style=x`,"_blank")}function _(b){o&&b.key=="Escape"&&(b.stopPropagation(),t(0,o=!1))}const g=()=>t(0,o=!1);function y(b){n.$$.not_equal(r.streetViewImagery,b)&&(r.streetViewImagery=b,vt.set(r))}const M=()=>t(0,o=!0);return n.$$set=b=>{"cfg"in b&&t(4,i=b.cfg),"map"in b&&t(5,l=b.map),"enabled"in b&&t(0,o=b.enabled),"showControls"in b&&t(1,s=b.showControls)},n.$$.update=()=>{n.$$.dirty&1&&(o?f():u())},[o,s,r,_,i,l,g,y,M]}class ol extends Q{constructor(e){super(),J(this,e,ii,ri,Y,{cfg:4,map:5,enabled:0,showControls:1})}}const li="/atip/browse_layout_v3/assets/warning-81bba3f6.svg";function oi(n){let e,t;return{c(){e=P("img"),ne(e.src,t=li)||c(e,"src",t),c(e,"title",n[0]),c(e,"alt",n[0])},m(r,i){T(r,e,i)},p(r,[i]){i&1&&c(e,"title",r[0]),i&1&&c(e,"alt",r[0])},i:N,o:N,d(r){r&&C(e)}}}function si(n,e,t){let{text:r}=e;return n.$$set=i=>{"text"in i&&t(0,r=i.text)},[r]}class sl extends Q{constructor(e){super(),J(this,e,si,oi,Y,{text:0})}}var ai=Object.defineProperty,Pe=(n,e)=>ai(n,"name",{value:e,configurable:!0});function at(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}Pe(at,"getCoord");function fi(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}Pe(fi,"getCoords");function Yt(n){if(n.length>1&&wt(n[0])&&wt(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return Yt(n[0]);throw new Error("coordinates must only contain numbers")}Pe(Yt,"containsNumber");function ui(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}Pe(ui,"geojsonType");function ci(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}Pe(ci,"featureOf");function di(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const r of n.features){if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.geometry.type)}}Pe(di,"collectionOf");function mi(n){return n.type==="Feature"?n.geometry:n}Pe(mi,"getGeom");function gi(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}Pe(gi,"getType");var hi=Object.defineProperty,_i=(n,e)=>hi(n,"name",{value:e,configurable:!0});function Xt(n,e,t={}){var r=at(n),i=at(e),l=Ke(i[1]-r[1]),o=Ke(i[0]-r[0]),s=Ke(r[1]),a=Ke(i[1]),f=Math.pow(Math.sin(l/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(s)*Math.cos(a);return Hn(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),t.units)}_i(Xt,"distance");var yi=Object.defineProperty,re=(n,e)=>yi(n,"name",{value:e,configurable:!0});function We(n,e,t){if(n!==null)for(var r,i,l,o,s,a,f,u=0,m=0,_,g=n.type,y=g==="FeatureCollection",M=g==="Feature",b=y?n.features.length:1,p=0;pa||y>f||M>u){s=m,a=r,f=y,u=M,l=0;return}var b=Ae([s,m],t.properties);if(e(b,r,i,M,l)===!1)return!1;l++,s=m})===!1)return!1}}})}re($t,"segmentEach");function en(n,e,t){var r=t,i=!1;return $t(n,function(l,o,s,a,f){i===!1&&t===void 0?r=l:r=e(r,l,o,s,a,f),i=!0}),r}re(en,"segmentReduce");function tn(n,e){if(!n)throw new Error("geojson is required");Xe(n,function(t,r,i){if(t.geometry!==null){var l=t.geometry.type,o=t.geometry.coordinates;switch(l){case"LineString":if(e(t,r,i,0,0)===!1)return!1;break;case"Polygon":for(var s=0;sCi(n,"name",{value:e,configurable:!0});function nn(n,e={}){return en(n,(t,r)=>{const i=r.geometry.coordinates;return t+Xt(i[0],i[1],e)},0)}Si(nn,"length");var al=nn;const fl={area:"#D94324",route:"#555F5E",crossing:"#4daf4a",other:"#984ea3",hovering:"black",lineEndpointColor:"black",streetview:"blue",measuringLine:"cyan"},ul=10,cl=10;function dl(){return zi(["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"])}function zi(n){return n[Math.floor(Math.random()*n.length)]}function Ei(n){let e;const t=n[16].default,r=we(t,n,n[24],null);return{c(){r&&r.c()},m(i,l){r&&r.m(i,l),e=!0},p(i,l){r&&r.p&&(!e||l&16777216)&&ke(r,t,i,i[24],e?Le(t,i[24],l,null):pe(i[24]),null)},i(i){e||(I(r,i),e=!0)},o(i){F(r,i),e=!1},d(i){r&&r.d(i)}}}function Ri(n){let e,t,r;function i(o){n[17](o)}let l={id:n[1],type:"circle",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],applyToClusters:n[9],minzoom:n[10],maxzoom:n[11],hoverCursor:n[12],manageHoverState:n[13],eventsIfTopMost:n[14],interactive:n[15],$$slots:{default:[Ei]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.hovered=n[0]),e=new Dt({props:l}),Ye.push(()=>ft(e,"hovered",i)),e.$on("click",n[18]),e.$on("dblclick",n[19]),e.$on("contextmenu",n[20]),e.$on("mouseenter",n[21]),e.$on("mousemove",n[22]),e.$on("mouseleave",n[23]),{c(){x(e.$$.fragment)},m(o,s){$(e,o,s),r=!0},p(o,[s]){const a={};s&2&&(a.id=o[1]),s&4&&(a.source=o[2]),s&8&&(a.sourceLayer=o[3]),s&16&&(a.beforeId=o[4]),s&32&&(a.beforeLayerType=o[5]),s&64&&(a.paint=o[6]),s&128&&(a.layout=o[7]),s&256&&(a.filter=o[8]),s&512&&(a.applyToClusters=o[9]),s&1024&&(a.minzoom=o[10]),s&2048&&(a.maxzoom=o[11]),s&4096&&(a.hoverCursor=o[12]),s&8192&&(a.manageHoverState=o[13]),s&16384&&(a.eventsIfTopMost=o[14]),s&32768&&(a.interactive=o[15]),s&16777216&&(a.$$scope={dirty:s,ctx:o}),!t&&s&1&&(t=!0,a.hovered=o[0],ut(()=>t=!1)),e.$set(a)},i(o){r||(I(e.$$.fragment,o),r=!0)},o(o){F(e.$$.fragment,o),r=!1},d(o){ee(e,o)}}}function Bi(n,e,t){let{$$slots:r={},$$scope:i}=e,{id:l=Kt("circle")}=e,{source:o=void 0}=e,{sourceLayer:s=void 0}=e,{beforeId:a=void 0}=e,{beforeLayerType:f=void 0}=e,{paint:u}=e,{layout:m=void 0}=e,{filter:_=void 0}=e,{applyToClusters:g=void 0}=e,{minzoom:y=void 0}=e,{maxzoom:M=void 0}=e,{hoverCursor:b=void 0}=e,{manageHoverState:p=!1}=e,{hovered:U=null}=e,{eventsIfTopMost:v=!1}=e,{interactive:z=!0}=e;function w(h){U=h,t(0,U)}function Z(h){le.call(this,n,h)}function q(h){le.call(this,n,h)}function W(h){le.call(this,n,h)}function R(h){le.call(this,n,h)}function S(h){le.call(this,n,h)}function oe(h){le.call(this,n,h)}return n.$$set=h=>{"id"in h&&t(1,l=h.id),"source"in h&&t(2,o=h.source),"sourceLayer"in h&&t(3,s=h.sourceLayer),"beforeId"in h&&t(4,a=h.beforeId),"beforeLayerType"in h&&t(5,f=h.beforeLayerType),"paint"in h&&t(6,u=h.paint),"layout"in h&&t(7,m=h.layout),"filter"in h&&t(8,_=h.filter),"applyToClusters"in h&&t(9,g=h.applyToClusters),"minzoom"in h&&t(10,y=h.minzoom),"maxzoom"in h&&t(11,M=h.maxzoom),"hoverCursor"in h&&t(12,b=h.hoverCursor),"manageHoverState"in h&&t(13,p=h.manageHoverState),"hovered"in h&&t(0,U=h.hovered),"eventsIfTopMost"in h&&t(14,v=h.eventsIfTopMost),"interactive"in h&&t(15,z=h.interactive),"$$scope"in h&&t(24,i=h.$$scope)},[U,l,o,s,a,f,u,m,_,g,y,M,b,p,v,z,r,w,Z,q,W,R,S,oe,i]}class ml extends Q{constructor(e){super(),J(this,e,Bi,Ri,Y,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}const Ii=n=>({marker:n&8}),Ut=n=>({marker:n[3]});function Fi(n){let e,t,r,i,l,o,s;const a=n[19].default,f=we(a,n,n[18],Ut);return{c(){e=P("div"),f&&f.c(),c(e,"tabindex",t=n[1]?0:void 0),c(e,"role",r=n[1]?"button":void 0),Ce(e,"z-index",n[2])},m(u,m){T(u,e,m),f&&f.m(e,null),l=!0,o||(s=[pt(n[7].call(null,e)),pt(i=Ai.call(null,e,n[0])),V(e,"click",st(n[20])),V(e,"dblclick",st(n[21])),V(e,"contextmenu",st(n[22])),V(e,"mouseenter",n[23]),V(e,"mouseleave",n[24]),V(e,"mousemove",n[25]),V(e,"keydown",n[8])],o=!0)},p(u,[m]){f&&f.p&&(!l||m&262152)&&ke(f,a,u,u[18],l?Le(a,u[18],m,Ii):pe(u[18]),Ut),(!l||m&2&&t!==(t=u[1]?0:void 0))&&c(e,"tabindex",t),(!l||m&2&&r!==(r=u[1]?"button":void 0))&&c(e,"role",r),i&&Dn(i.update)&&m&1&&i.update.call(null,u[0]),m&4&&Ce(e,"z-index",u[2])},i(u){l||(I(f,u),l=!0)},o(u){F(f,u),l=!1},d(u){u&&C(e),f&&f.d(u),o=!1,Ge(s)}}}function Ai(n,e){const t=n.className;function r(i){i?n.className=`${t} ${i}`:n.className=t}return r(e),{update:r}}function Gi(n,e,t){let r,i,l,{$$slots:o={},$$scope:s}=e,{marker:a=void 0}=e,{lngLat:f}=e,{class:u=void 0}=e,{interactive:m=!0}=e,{asButton:_=!1}=e,{draggable:g=!1}=e,{feature:y=null}=e,{offset:M=void 0}=e,{zIndex:b=void 0}=e,{rotation:p=0}=e,{opacity:U=1}=e;const v=qt(),{map:z,layerEvent:w,self:Z}=Kn();Se(n,z,k=>t(27,l=k)),Se(n,w,k=>t(26,r=k)),Se(n,Z,k=>t(3,i=k));function q(k){Lt(Z,i=new Vt.Marker({element:k,rotation:p,draggable:g,offset:M,opacity:U.toString()}).setLngLat(f).addTo(l),i),t(11,a=i);const ce=()=>S("dragstart"),se=()=>{W(),S("drag")},me=()=>{W(),S("dragend")};return g&&(i.on("dragstart",ce),i.on("drag",se),i.on("dragend",me)),{destroy(){g&&(i==null||i.off("dragstart",ce),i==null||i.off("drag",se),i==null||i.off("dragend",me)),t(11,a=void 0),i==null||i.remove()}}}function W(){let k=i==null?void 0:i.getLngLat();k&&(Array.isArray(f)?t(10,f=[k.lng,k.lat]):f&&"lon"in f?t(10,f={lon:k.lng,lat:k.lat}):t(10,f=k))}function R(k){k.key===" "&&(k.preventDefault(),k.stopPropagation(),S("click"))}function S(k){if(!m)return;let ce=i==null?void 0:i.getLngLat();if(!ce)return;const se=[ce.lng,ce.lat];let me={map:l,marker:i,lngLat:se,features:[{type:"Feature",properties:(y==null?void 0:y.properties)??{},geometry:{type:"Point",coordinates:se}}]};Lt(w,r={...me,layerType:"marker",type:k},r),v(k,me)}const oe=()=>S("click"),h=()=>S("dblclick"),ye=()=>S("contextmenu"),B=k=>{S("mouseenter")},H=()=>{S("mouseleave")},ie=()=>S("mousemove");return n.$$set=k=>{"marker"in k&&t(11,a=k.marker),"lngLat"in k&&t(10,f=k.lngLat),"class"in k&&t(0,u=k.class),"interactive"in k&&t(12,m=k.interactive),"asButton"in k&&t(1,_=k.asButton),"draggable"in k&&t(13,g=k.draggable),"feature"in k&&t(14,y=k.feature),"offset"in k&&t(15,M=k.offset),"zIndex"in k&&t(2,b=k.zIndex),"rotation"in k&&t(16,p=k.rotation),"opacity"in k&&t(17,U=k.opacity),"$$scope"in k&&t(18,s=k.$$scope)},n.$$.update=()=>{n.$$.dirty&1032&&(i==null||i.setLngLat(f)),n.$$.dirty&32776&&(i==null||i.setOffset(M??[0,0])),n.$$.dirty&65544&&(i==null||i.setRotation(p)),n.$$.dirty&131080&&(i==null||i.setOpacity(U.toString()))},[u,_,b,i,z,w,Z,q,R,S,f,a,m,g,y,M,p,U,s,o,oe,h,ye,B,H,ie]}class gl extends Q{constructor(e){super(),J(this,e,Gi,Fi,Y,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}function Oi(n){let e;const t=n[8].default,r=we(t,n,n[15],null);return{c(){r&&r.c()},m(i,l){r&&r.m(i,l),e=!0},p(i,l){r&&r.p&&(!e||l&32768)&&ke(r,t,i,i[15],e?Le(t,i[15],l,null):pe(i[15]),null)},i(i){e||(I(r,i),e=!0)},o(i){F(r,i),e=!1},d(i){r&&r.d(i)}}}function Ui(n){let e,t;return e=new Dt({props:{id:n[0],type:"raster",source:n[1],beforeId:n[2],beforeLayerType:n[3],paint:n[4],layout:n[5],minzoom:n[6],maxzoom:n[7],$$slots:{default:[Oi]},$$scope:{ctx:n}}}),e.$on("click",n[9]),e.$on("dblclick",n[10]),e.$on("contextmenu",n[11]),e.$on("mouseenter",n[12]),e.$on("mousemove",n[13]),e.$on("mouseleave",n[14]),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},p(r,[i]){const l={};i&1&&(l.id=r[0]),i&2&&(l.source=r[1]),i&4&&(l.beforeId=r[2]),i&8&&(l.beforeLayerType=r[3]),i&16&&(l.paint=r[4]),i&32&&(l.layout=r[5]),i&64&&(l.minzoom=r[6]),i&128&&(l.maxzoom=r[7]),i&32768&&(l.$$scope={dirty:i,ctx:r}),e.$set(l)},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function Zi(n,e,t){let{$$slots:r={},$$scope:i}=e,{id:l=Kt("raster-layer")}=e,{source:o=void 0}=e,{beforeId:s=void 0}=e,{beforeLayerType:a=void 0}=e,{paint:f}=e,{layout:u=void 0}=e,{minzoom:m=void 0}=e,{maxzoom:_=void 0}=e;function g(v){le.call(this,n,v)}function y(v){le.call(this,n,v)}function M(v){le.call(this,n,v)}function b(v){le.call(this,n,v)}function p(v){le.call(this,n,v)}function U(v){le.call(this,n,v)}return n.$$set=v=>{"id"in v&&t(0,l=v.id),"source"in v&&t(1,o=v.source),"beforeId"in v&&t(2,s=v.beforeId),"beforeLayerType"in v&&t(3,a=v.beforeLayerType),"paint"in v&&t(4,f=v.paint),"layout"in v&&t(5,u=v.layout),"minzoom"in v&&t(6,m=v.minzoom),"maxzoom"in v&&t(7,_=v.maxzoom),"$$scope"in v&&t(15,i=v.$$scope)},[l,o,s,a,f,u,m,_,r,g,y,M,b,p,U,i]}class hl extends Q{constructor(e){super(),J(this,e,Zi,Ui,Y,{id:0,source:1,beforeId:2,beforeLayerType:3,paint:4,layout:5,minzoom:6,maxzoom:7})}}const qi="/atip/browse_layout_v3/assets/zoom_out_map-b2e1091a.svg";function Wi(n){let e,t;return{c(){e=P("img"),ne(e.src,t=qi)||c(e,"src",t),c(e,"alt","Zoom to show entire boundary")},m(r,i){T(r,e,i)},p:N,d(r){r&&C(e)}}}function Ni(n){let e,t;return e=new ct({props:{title:"Zoom to show entire boundary",$$slots:{default:[Wi]},$$scope:{ctx:n}}}),e.$on("click",n[0]),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},p(r,[i]){const l={};i&8&&(l.$$scope={dirty:i,ctx:r}),e.$set(l)},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function Vi(n,e,t){let r;Se(n,Nt,o=>t(2,r=o));let{boundaryGeojson:i}=e;function l(){let o=gr(i);Number.isFinite(o[0])&&r.fitBounds(o,{padding:20,animate:!0,duration:500})}return n.$$set=o=>{"boundaryGeojson"in o&&t(1,i=o.boundaryGeojson)},[l,i]}class _l extends Q{constructor(e){super(),J(this,e,Vi,Ni,Y,{boundaryGeojson:1})}}export{rl as B,Di as C,il as G,ll as H,gl as M,hl as R,ol as S,sl as W,_l as Z,Ki as a,gr as b,Yi as c,Xi as d,ji as e,ml as f,$i as g,xi as h,Ji as i,Yr as j,ir as k,dr as l,cr as m,Qi as n,ur as o,tl as p,er as q,dl as r,nl as s,al as t,fl as u,el as v,ul as w,cl as x}; + to exit this mode
  • Cursor by Luc Chaissac
  • `},m(t,r){T(t,e,r)},p:N,i:N,o:N,d(t){t&&C(e)}}}class Xr extends Q{constructor(e){super(),J(this,e,null,Jr,X,{})}}const Yr="/atip/browse_layout_v3/assets/camera_cursor-824d29b6.svg",{window:jr}=Nn;function Gt(n){let e,t,r,i;const l=[$r,xr],o=[];function s(a,f){return a[0]?0:1}return e=s(n),t=o[e]=l[e](n),{c(){t.c(),r=Ge()},m(a,f){o[e].m(a,f),T(a,r,f),i=!0},p(a,f){let u=e;e=s(a),e===u?o[e].p(a,f):(ze(),F(o[u],1,1,()=>{o[u]=null}),Ee(),t=o[e],t?t.p(a,f):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(r.parentNode,r))},i(a){i||(I(t),i=!0)},o(a){F(t),i=!1},d(a){a&&C(r),o[e].d(a)}}}function xr(n){let e,t;return e=new ct({props:{$$slots:{default:[ei]},$$scope:{ctx:n}}}),e.$on("click",n[8]),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},p(r,i){const l={};i&8192&&(l.$$scope={dirty:i,ctx:r}),e.$set(l)},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function $r(n){let e,t,r,i,l,o,s;e=new ct({props:{$$slots:{default:[ti]},$$scope:{ctx:n}}}),e.$on("click",n[6]);function a(u){n[7](u)}let f={label:"Source",choices:[["google","Google Street View"],["bing","Bing Streetside"]]};return n[2].streetViewImagery!==void 0&&(f.value=n[2].streetViewImagery),r=new Vn({props:f}),Xe.push(()=>ft(r,"value",a)),o=new er({props:{label:"Help",$$slots:{default:[ni]},$$scope:{ctx:n}}}),{c(){x(e.$$.fragment),t=K(),x(r.$$.fragment),l=K(),x(o.$$.fragment)},m(u,m){$(e,u,m),T(u,t,m),$(r,u,m),T(u,l,m),$(o,u,m),s=!0},p(u,m){const _={};m&8192&&(_.$$scope={dirty:m,ctx:u}),e.$set(_);const g={};!i&&m&4&&(i=!0,g.value=u[2].streetViewImagery,ut(()=>i=!1)),r.$set(g);const y={};m&8192&&(y.$$scope={dirty:m,ctx:u}),o.$set(y)},i(u){s||(I(e.$$.fragment,u),I(r.$$.fragment,u),I(o.$$.fragment,u),s=!0)},o(u){F(e.$$.fragment,u),F(r.$$.fragment,u),F(o.$$.fragment,u),s=!1},d(u){u&&(C(t),C(l)),ee(e,u),ee(r,u),ee(o,u)}}}function ei(n){let e;return{c(){e=de("Enable Street View")},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function ti(n){let e;return{c(){e=de("Disable Street View")},m(t,r){T(t,e,r)},d(t){t&&C(e)}}}function ni(n){let e,t;return e=new Xr({}),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function ri(n){let e,t,r,i,l=n[1]&&Gt(n);return{c(){l&&l.c(),e=Ge()},m(o,s){l&&l.m(o,s),T(o,e,s),t=!0,r||(i=V(jr,"keydown",n[3]),r=!0)},p(o,[s]){o[1]?l?(l.p(o,s),s&2&&I(l,1)):(l=Gt(o),l.c(),I(l,1),l.m(e.parentNode,e)):l&&(ze(),F(l,1,1,()=>{l=null}),Ee())},i(o){t||(I(l),t=!0)},o(o){F(l),t=!1},d(o){o&&C(e),l&&l.d(o),r=!1,i()}}}function ii(n,e,t){let r;Se(n,vt,b=>t(2,r=b));let{cfg:i}=e,{map:l}=e,{enabled:o}=e,{showControls:s=!0}=e,a=[];function f(){if(l){l.on("click",m),l.getCanvas().style.cursor=`url(${Yr}), auto`;for(let b of i.getStreetViewRoadLayerNames(l))a.push([b,l.getPaintProperty(b,"line-color")]),l.setPaintProperty(b,"line-color","cyan")}}function u(){if(l){l.off("click",m),l.getCanvas().style.cursor="inherit";for(let[b,p]of a)l.setPaintProperty(b,"line-color",p);a=[]}}qt(u);function m(b){if(!o)return;let p=b.lngLat.lng,U=b.lngLat.lat;r.streetViewImagery=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${U},${p}&cbp=11,0,0,0,0`,"_blank"):r.streetViewImagery=="bing"&&window.open(`https://www.bing.com/maps?cp=${U}~${p}&style=x`,"_blank")}function _(b){o&&b.key=="Escape"&&(b.stopPropagation(),t(0,o=!1))}const g=()=>t(0,o=!1);function y(b){n.$$.not_equal(r.streetViewImagery,b)&&(r.streetViewImagery=b,vt.set(r))}const M=()=>t(0,o=!0);return n.$$set=b=>{"cfg"in b&&t(4,i=b.cfg),"map"in b&&t(5,l=b.map),"enabled"in b&&t(0,o=b.enabled),"showControls"in b&&t(1,s=b.showControls)},n.$$.update=()=>{n.$$.dirty&1&&(o?f():u())},[o,s,r,_,i,l,g,y,M]}class ol extends Q{constructor(e){super(),J(this,e,ii,ri,X,{cfg:4,map:5,enabled:0,showControls:1})}}const li="/atip/browse_layout_v3/assets/warning-81bba3f6.svg";function oi(n){let e,t;return{c(){e=P("img"),ne(e.src,t=li)||c(e,"src",t),c(e,"title",n[0]),c(e,"alt",n[0])},m(r,i){T(r,e,i)},p(r,[i]){i&1&&c(e,"title",r[0]),i&1&&c(e,"alt",r[0])},i:N,o:N,d(r){r&&C(e)}}}function si(n,e,t){let{text:r}=e;return n.$$set=i=>{"text"in i&&t(0,r=i.text)},[r]}class sl extends Q{constructor(e){super(),J(this,e,si,oi,X,{text:0})}}var ai=Object.defineProperty,Pe=(n,e)=>ai(n,"name",{value:e,configurable:!0});function at(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}Pe(at,"getCoord");function fi(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}Pe(fi,"getCoords");function Xt(n){if(n.length>1&&wt(n[0])&&wt(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return Xt(n[0]);throw new Error("coordinates must only contain numbers")}Pe(Xt,"containsNumber");function ui(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}Pe(ui,"geojsonType");function ci(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}Pe(ci,"featureOf");function di(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const r of n.features){if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.geometry.type)}}Pe(di,"collectionOf");function mi(n){return n.type==="Feature"?n.geometry:n}Pe(mi,"getGeom");function gi(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}Pe(gi,"getType");var hi=Object.defineProperty,_i=(n,e)=>hi(n,"name",{value:e,configurable:!0});function Yt(n,e,t={}){var r=at(n),i=at(e),l=Ke(i[1]-r[1]),o=Ke(i[0]-r[0]),s=Ke(r[1]),a=Ke(i[1]),f=Math.pow(Math.sin(l/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(s)*Math.cos(a);return Hn(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),t.units)}_i(Yt,"distance");var yi=Object.defineProperty,re=(n,e)=>yi(n,"name",{value:e,configurable:!0});function qe(n,e,t){if(n!==null)for(var r,i,l,o,s,a,f,u=0,m=0,_,g=n.type,y=g==="FeatureCollection",M=g==="Feature",b=y?n.features.length:1,p=0;pa||y>f||M>u){s=m,a=r,f=y,u=M,l=0;return}var b=Oe([s,m],t.properties);if(e(b,r,i,M,l)===!1)return!1;l++,s=m})===!1)return!1}}})}re($t,"segmentEach");function en(n,e,t){var r=t,i=!1;return $t(n,function(l,o,s,a,f){i===!1&&t===void 0?r=l:r=e(r,l,o,s,a,f),i=!0}),r}re(en,"segmentReduce");function tn(n,e){if(!n)throw new Error("geojson is required");Ye(n,function(t,r,i){if(t.geometry!==null){var l=t.geometry.type,o=t.geometry.coordinates;switch(l){case"LineString":if(e(t,r,i,0,0)===!1)return!1;break;case"Polygon":for(var s=0;sCi(n,"name",{value:e,configurable:!0});function nn(n,e={}){return en(n,(t,r)=>{const i=r.geometry.coordinates;return t+Yt(i[0],i[1],e)},0)}Si(nn,"length");var al=nn;const fl={area:"#D94324",route:"#555F5E",crossing:"#4daf4a",other:"#984ea3",hovering:"black",lineEndpointColor:"black",streetview:"blue",measuringLine:"cyan"},ul=10,cl=10;function dl(){return zi(["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"])}function zi(n){return n[Math.floor(Math.random()*n.length)]}function Ei(n){let e;const t=n[16].default,r=we(t,n,n[24],null);return{c(){r&&r.c()},m(i,l){r&&r.m(i,l),e=!0},p(i,l){r&&r.p&&(!e||l&16777216)&&ke(r,t,i,i[24],e?Le(t,i[24],l,null):pe(i[24]),null)},i(i){e||(I(r,i),e=!0)},o(i){F(r,i),e=!1},d(i){r&&r.d(i)}}}function Ri(n){let e,t,r;function i(o){n[17](o)}let l={id:n[1],type:"circle",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],applyToClusters:n[9],minzoom:n[10],maxzoom:n[11],hoverCursor:n[12],manageHoverState:n[13],eventsIfTopMost:n[14],interactive:n[15],$$slots:{default:[Ei]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.hovered=n[0]),e=new Dt({props:l}),Xe.push(()=>ft(e,"hovered",i)),e.$on("click",n[18]),e.$on("dblclick",n[19]),e.$on("contextmenu",n[20]),e.$on("mouseenter",n[21]),e.$on("mousemove",n[22]),e.$on("mouseleave",n[23]),{c(){x(e.$$.fragment)},m(o,s){$(e,o,s),r=!0},p(o,[s]){const a={};s&2&&(a.id=o[1]),s&4&&(a.source=o[2]),s&8&&(a.sourceLayer=o[3]),s&16&&(a.beforeId=o[4]),s&32&&(a.beforeLayerType=o[5]),s&64&&(a.paint=o[6]),s&128&&(a.layout=o[7]),s&256&&(a.filter=o[8]),s&512&&(a.applyToClusters=o[9]),s&1024&&(a.minzoom=o[10]),s&2048&&(a.maxzoom=o[11]),s&4096&&(a.hoverCursor=o[12]),s&8192&&(a.manageHoverState=o[13]),s&16384&&(a.eventsIfTopMost=o[14]),s&32768&&(a.interactive=o[15]),s&16777216&&(a.$$scope={dirty:s,ctx:o}),!t&&s&1&&(t=!0,a.hovered=o[0],ut(()=>t=!1)),e.$set(a)},i(o){r||(I(e.$$.fragment,o),r=!0)},o(o){F(e.$$.fragment,o),r=!1},d(o){ee(e,o)}}}function Bi(n,e,t){let{$$slots:r={},$$scope:i}=e,{id:l=Kt("circle")}=e,{source:o=void 0}=e,{sourceLayer:s=void 0}=e,{beforeId:a=void 0}=e,{beforeLayerType:f=void 0}=e,{paint:u}=e,{layout:m=void 0}=e,{filter:_=void 0}=e,{applyToClusters:g=void 0}=e,{minzoom:y=void 0}=e,{maxzoom:M=void 0}=e,{hoverCursor:b=void 0}=e,{manageHoverState:p=!1}=e,{hovered:U=null}=e,{eventsIfTopMost:v=!1}=e,{interactive:z=!0}=e;function w(h){U=h,t(0,U)}function Z(h){le.call(this,n,h)}function W(h){le.call(this,n,h)}function q(h){le.call(this,n,h)}function R(h){le.call(this,n,h)}function S(h){le.call(this,n,h)}function oe(h){le.call(this,n,h)}return n.$$set=h=>{"id"in h&&t(1,l=h.id),"source"in h&&t(2,o=h.source),"sourceLayer"in h&&t(3,s=h.sourceLayer),"beforeId"in h&&t(4,a=h.beforeId),"beforeLayerType"in h&&t(5,f=h.beforeLayerType),"paint"in h&&t(6,u=h.paint),"layout"in h&&t(7,m=h.layout),"filter"in h&&t(8,_=h.filter),"applyToClusters"in h&&t(9,g=h.applyToClusters),"minzoom"in h&&t(10,y=h.minzoom),"maxzoom"in h&&t(11,M=h.maxzoom),"hoverCursor"in h&&t(12,b=h.hoverCursor),"manageHoverState"in h&&t(13,p=h.manageHoverState),"hovered"in h&&t(0,U=h.hovered),"eventsIfTopMost"in h&&t(14,v=h.eventsIfTopMost),"interactive"in h&&t(15,z=h.interactive),"$$scope"in h&&t(24,i=h.$$scope)},[U,l,o,s,a,f,u,m,_,g,y,M,b,p,v,z,r,w,Z,W,q,R,S,oe,i]}class ml extends Q{constructor(e){super(),J(this,e,Bi,Ri,X,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}const Ii=n=>({marker:n&8}),Ut=n=>({marker:n[3]});function Fi(n){let e,t,r,i,l,o,s;const a=n[19].default,f=we(a,n,n[18],Ut);return{c(){e=P("div"),f&&f.c(),c(e,"tabindex",t=n[1]?0:void 0),c(e,"role",r=n[1]?"button":void 0),Ce(e,"z-index",n[2])},m(u,m){T(u,e,m),f&&f.m(e,null),l=!0,o||(s=[pt(n[7].call(null,e)),pt(i=Oi.call(null,e,n[0])),V(e,"click",st(n[20])),V(e,"dblclick",st(n[21])),V(e,"contextmenu",st(n[22])),V(e,"mouseenter",n[23]),V(e,"mouseleave",n[24]),V(e,"mousemove",n[25]),V(e,"keydown",n[8])],o=!0)},p(u,[m]){f&&f.p&&(!l||m&262152)&&ke(f,a,u,u[18],l?Le(a,u[18],m,Ii):pe(u[18]),Ut),(!l||m&2&&t!==(t=u[1]?0:void 0))&&c(e,"tabindex",t),(!l||m&2&&r!==(r=u[1]?"button":void 0))&&c(e,"role",r),i&&Dn(i.update)&&m&1&&i.update.call(null,u[0]),m&4&&Ce(e,"z-index",u[2])},i(u){l||(I(f,u),l=!0)},o(u){F(f,u),l=!1},d(u){u&&C(e),f&&f.d(u),o=!1,Ae(s)}}}function Oi(n,e){const t=n.className;function r(i){i?n.className=`${t} ${i}`:n.className=t}return r(e),{update:r}}function Ai(n,e,t){let r,i,l,{$$slots:o={},$$scope:s}=e,{marker:a=void 0}=e,{lngLat:f}=e,{class:u=void 0}=e,{interactive:m=!0}=e,{asButton:_=!1}=e,{draggable:g=!1}=e,{feature:y=null}=e,{offset:M=void 0}=e,{zIndex:b=void 0}=e,{rotation:p=0}=e,{opacity:U=1}=e;const v=Wt(),{map:z,layerEvent:w,self:Z}=Kn();Se(n,z,k=>t(27,l=k)),Se(n,w,k=>t(26,r=k)),Se(n,Z,k=>t(3,i=k));function W(k){Lt(Z,i=new Vt.Marker({element:k,rotation:p,draggable:g,offset:M,opacity:U.toString()}).setLngLat(f).addTo(l),i),t(11,a=i);const ce=()=>S("dragstart"),se=()=>{q(),S("drag")},me=()=>{q(),S("dragend")};return g&&(i.on("dragstart",ce),i.on("drag",se),i.on("dragend",me)),{destroy(){g&&(i==null||i.off("dragstart",ce),i==null||i.off("drag",se),i==null||i.off("dragend",me)),t(11,a=void 0),i==null||i.remove()}}}function q(){let k=i==null?void 0:i.getLngLat();k&&(Array.isArray(f)?t(10,f=[k.lng,k.lat]):f&&"lon"in f?t(10,f={lon:k.lng,lat:k.lat}):t(10,f=k))}function R(k){k.key===" "&&(k.preventDefault(),k.stopPropagation(),S("click"))}function S(k){if(!m)return;let ce=i==null?void 0:i.getLngLat();if(!ce)return;const se=[ce.lng,ce.lat];let me={map:l,marker:i,lngLat:se,features:[{type:"Feature",properties:(y==null?void 0:y.properties)??{},geometry:{type:"Point",coordinates:se}}]};Lt(w,r={...me,layerType:"marker",type:k},r),v(k,me)}const oe=()=>S("click"),h=()=>S("dblclick"),ye=()=>S("contextmenu"),B=k=>{S("mouseenter")},H=()=>{S("mouseleave")},ie=()=>S("mousemove");return n.$$set=k=>{"marker"in k&&t(11,a=k.marker),"lngLat"in k&&t(10,f=k.lngLat),"class"in k&&t(0,u=k.class),"interactive"in k&&t(12,m=k.interactive),"asButton"in k&&t(1,_=k.asButton),"draggable"in k&&t(13,g=k.draggable),"feature"in k&&t(14,y=k.feature),"offset"in k&&t(15,M=k.offset),"zIndex"in k&&t(2,b=k.zIndex),"rotation"in k&&t(16,p=k.rotation),"opacity"in k&&t(17,U=k.opacity),"$$scope"in k&&t(18,s=k.$$scope)},n.$$.update=()=>{n.$$.dirty&1032&&(i==null||i.setLngLat(f)),n.$$.dirty&32776&&(i==null||i.setOffset(M??[0,0])),n.$$.dirty&65544&&(i==null||i.setRotation(p)),n.$$.dirty&131080&&(i==null||i.setOpacity(U.toString()))},[u,_,b,i,z,w,Z,W,R,S,f,a,m,g,y,M,p,U,s,o,oe,h,ye,B,H,ie]}class gl extends Q{constructor(e){super(),J(this,e,Ai,Fi,X,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}function Gi(n){let e;const t=n[8].default,r=we(t,n,n[15],null);return{c(){r&&r.c()},m(i,l){r&&r.m(i,l),e=!0},p(i,l){r&&r.p&&(!e||l&32768)&&ke(r,t,i,i[15],e?Le(t,i[15],l,null):pe(i[15]),null)},i(i){e||(I(r,i),e=!0)},o(i){F(r,i),e=!1},d(i){r&&r.d(i)}}}function Ui(n){let e,t;return e=new Dt({props:{id:n[0],type:"raster",source:n[1],beforeId:n[2],beforeLayerType:n[3],paint:n[4],layout:n[5],minzoom:n[6],maxzoom:n[7],$$slots:{default:[Gi]},$$scope:{ctx:n}}}),e.$on("click",n[9]),e.$on("dblclick",n[10]),e.$on("contextmenu",n[11]),e.$on("mouseenter",n[12]),e.$on("mousemove",n[13]),e.$on("mouseleave",n[14]),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},p(r,[i]){const l={};i&1&&(l.id=r[0]),i&2&&(l.source=r[1]),i&4&&(l.beforeId=r[2]),i&8&&(l.beforeLayerType=r[3]),i&16&&(l.paint=r[4]),i&32&&(l.layout=r[5]),i&64&&(l.minzoom=r[6]),i&128&&(l.maxzoom=r[7]),i&32768&&(l.$$scope={dirty:i,ctx:r}),e.$set(l)},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function Zi(n,e,t){let{$$slots:r={},$$scope:i}=e,{id:l=Kt("raster-layer")}=e,{source:o=void 0}=e,{beforeId:s=void 0}=e,{beforeLayerType:a=void 0}=e,{paint:f}=e,{layout:u=void 0}=e,{minzoom:m=void 0}=e,{maxzoom:_=void 0}=e;function g(v){le.call(this,n,v)}function y(v){le.call(this,n,v)}function M(v){le.call(this,n,v)}function b(v){le.call(this,n,v)}function p(v){le.call(this,n,v)}function U(v){le.call(this,n,v)}return n.$$set=v=>{"id"in v&&t(0,l=v.id),"source"in v&&t(1,o=v.source),"beforeId"in v&&t(2,s=v.beforeId),"beforeLayerType"in v&&t(3,a=v.beforeLayerType),"paint"in v&&t(4,f=v.paint),"layout"in v&&t(5,u=v.layout),"minzoom"in v&&t(6,m=v.minzoom),"maxzoom"in v&&t(7,_=v.maxzoom),"$$scope"in v&&t(15,i=v.$$scope)},[l,o,s,a,f,u,m,_,r,g,y,M,b,p,U,i]}class hl extends Q{constructor(e){super(),J(this,e,Zi,Ui,X,{id:0,source:1,beforeId:2,beforeLayerType:3,paint:4,layout:5,minzoom:6,maxzoom:7})}}const Wi="/atip/browse_layout_v3/assets/zoom_out_map-b2e1091a.svg";function qi(n){let e,t;return{c(){e=P("img"),ne(e.src,t=Wi)||c(e,"src",t),c(e,"alt","Zoom to show entire boundary")},m(r,i){T(r,e,i)},p:N,d(r){r&&C(e)}}}function Ni(n){let e,t;return e=new ct({props:{title:"Zoom to show entire boundary",$$slots:{default:[qi]},$$scope:{ctx:n}}}),e.$on("click",n[0]),{c(){x(e.$$.fragment)},m(r,i){$(e,r,i),t=!0},p(r,[i]){const l={};i&8&&(l.$$scope={dirty:i,ctx:r}),e.$set(l)},i(r){t||(I(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ee(e,r)}}}function Vi(n,e,t){let r;Se(n,Nt,o=>t(2,r=o));let{boundaryGeojson:i}=e;function l(){let o=gr(i);Number.isFinite(o[0])&&r.fitBounds(o,{padding:20,animate:!0,duration:500})}return n.$$set=o=>{"boundaryGeojson"in o&&t(1,i=o.boundaryGeojson)},[l,i]}class _l extends Q{constructor(e){super(),J(this,e,Vi,Ni,X,{boundaryGeojson:1})}}export{rl as B,Di as C,il as G,ll as H,gl as M,hl as R,ol as S,sl as W,_l as Z,Ki as a,gr as b,Xi as c,Yi as d,ji as e,ml as f,$i as g,xi as h,Ji as i,Xr as j,ir as k,dr as l,cr as m,Qi as n,ur as o,tl as p,er as q,dl as r,nl as s,al as t,fl as u,el as v,ul as w,cl as x}; diff --git a/browse_layout_v3/assets/index-12949150.js b/browse_layout_v3/assets/index-980b667c.js similarity index 99% rename from browse_layout_v3/assets/index-12949150.js rename to browse_layout_v3/assets/index-980b667c.js index 1c6e2d12..1dd437a5 100644 --- a/browse_layout_v3/assets/index-12949150.js +++ b/browse_layout_v3/assets/index-980b667c.js @@ -675,4 +675,4 @@ and limitations under the License. `}[t]};var es=function t(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var s=arguments[0],u=arguments[1];this.x=s.y*u.w-u.y*s.w,this.y=u.x*s.w-s.x*u.w,this.w=s.x*u.y-u.x*s.y}else if(arguments[0]instanceof yt&&arguments[1]instanceof yt){var p=arguments[0],c=arguments[1];this.x=p.y-c.y,this.y=c.x-p.x,this.w=p.x*c.y-c.x*p.y}}else if(arguments.length===3){var b=arguments[0],S=arguments[1],T=arguments[2];this.x=b,this.y=S,this.w=T}else if(arguments.length===4){var L=arguments[0],M=arguments[1],B=arguments[2],R=arguments[3],W=L.y-M.y,et=M.x-L.x,st=L.x*M.y-M.x*L.y,ut=B.y-R.y,gt=R.x-B.x,St=B.x*R.y-R.x*B.y;this.x=et*St-gt*st,this.y=ut*st-W*St,this.w=W*gt-ut*et}};es.prototype.getY=function(){var t=this.y/this.w;if(Pe.isNaN(t)||Pe.isInfinite(t))throw new Pp;return t};es.prototype.getX=function(){var t=this.x/this.w;if(Pe.isNaN(t)||Pe.isInfinite(t))throw new Pp;return t};es.prototype.getCoordinate=function(){var t=new yt;return t.x=this.getX(),t.y=this.getY(),t};es.prototype.interfaces_=function(){return[]};es.prototype.getClass=function(){return es};es.intersection=function(t,e,n,r){var s=t.y-e.y,u=e.x-t.x,p=t.x*e.y-e.x*t.y,c=n.y-r.y,b=r.x-n.x,S=n.x*r.y-r.x*n.y,T=u*S-b*p,L=c*p-s*S,M=s*b-c*u,B=T/M,R=L/M;if(Pe.isNaN(B)||Pe.isInfinite(B)||Pe.isNaN(R)||Pe.isInfinite(R))throw new Pp;return new yt(B,R)};var de=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof yt){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.init(r.x,s.x,r.y,s.y)}else if(arguments.length===4){var u=arguments[0],p=arguments[1],c=arguments[2],b=arguments[3];this.init(u,p,c,b)}},PE={serialVersionUID:{configurable:!0}};de.prototype.getArea=function(){return this.getWidth()*this.getHeight()};de.prototype.equals=function(t){if(!(t instanceof de))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()};de.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new de;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}};de.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof de){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}};de.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0};de.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)};de.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};de.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};de.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};de.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e};de.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};de.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof de){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof yt){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}};de.prototype.centre=function(){return this.isNull()?null:new yt((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};de.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof yt){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof de){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var s=arguments[0],u=arguments[1],p=arguments[2],c=arguments[3];st._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)};de.prototype.hashCode=function(){var t=17;return t=37*t+yt.hashCode(this._minx),t=37*t+yt.hashCode(this._maxx),t=37*t+yt.hashCode(this._miny),t=37*t+yt.hashCode(this._maxy),t};de.prototype.interfaces_=function(){return[jo,Ho]};de.prototype.getClass=function(){return de};de.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],u=arguments[2],p=arguments[3],c=Math.min(u.x,p.x),b=Math.max(u.x,p.x),S=Math.min(r.x,s.x),T=Math.max(r.x,s.x);return!(S>b||Tb)||Tn?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}};qn.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};qn.prototype.setPrecisionModel=function(t){this._precisionModel=t};qn.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;ns?u=r:u=s;else{var p=Math.abs(t.x-e.x),c=Math.abs(t.y-e.y);r>s?u=p:u=c,u===0&&!t.equals(e)&&(u=Math.max(p,c))}return Ne.isTrue(!(u===0&&!t.equals(e)),"Bad distance calculation"),u};qn.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,u=Math.sqrt(r*r+s*s);return Ne.isTrue(!(u===0&&!t.equals(e)),"Invalid distance calculation"),u};zc.DONT_INTERSECT.get=function(){return 0};zc.DO_INTERSECT.get=function(){return 1};zc.COLLINEAR.get=function(){return 2};zc.NO_INTERSECTION.get=function(){return 0};zc.POINT_INTERSECTION.get=function(){return 1};zc.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(qn,zc);var Ru=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var r=new de(this._inputLines[0][0],this._inputLines[0][1]),s=new de(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&s.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];if(this._isProper=!1,de.intersects(r,s,n)&&ee.orientationIndex(r,s,n)===0&&ee.orientationIndex(s,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(s))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION}else return t.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,r,s,u,p){p.x=this.smallestInAbsValue(n.x,r.x,s.x,u.x),p.y=this.smallestInAbsValue(n.y,r.y,s.y,u.y),n.x-=p.x,n.y-=p.y,r.x-=p.x,r.y-=p.y,s.x-=p.x,s.y-=p.y,u.x-=p.x,u.y-=p.y},e.prototype.safeHCoordinateIntersection=function(n,r,s,u){var p=null;try{p=es.intersection(n,r,s,u)}catch(c){if(c instanceof Pp)p=e.nearestEndpoint(n,r,s,u);else throw c}finally{}return p},e.prototype.intersection=function(n,r,s,u){var p=this.intersectionWithNormalization(n,r,s,u);return this.isInSegmentEnvelopes(p)||(p=new yt(e.nearestEndpoint(n,r,s,u))),this._precisionModel!==null&&this._precisionModel.makePrecise(p),p},e.prototype.smallestInAbsValue=function(n,r,s,u){var p=n,c=Math.abs(p);return Math.abs(r)1e-4&&$r.out.println("Distance = "+p.distance(c))},e.prototype.intersectionWithNormalization=function(n,r,s,u){var p=new yt(n),c=new yt(r),b=new yt(s),S=new yt(u),T=new yt;this.normalizeToEnvCentre(p,c,b,S,T);var L=this.safeHCoordinateIntersection(p,c,b,S);return L.x+=T.x,L.y+=T.y,L},e.prototype.computeCollinearIntersection=function(n,r,s,u){var p=de.intersects(n,r,s),c=de.intersects(n,r,u),b=de.intersects(s,u,n),S=de.intersects(s,u,r);return p&&c?(this._intPt[0]=s,this._intPt[1]=u,t.COLLINEAR_INTERSECTION):b&&S?(this._intPt[0]=n,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):p&&b?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!c&&!S?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):p&&S?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!c&&!b?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):c&&b?(this._intPt[0]=u,this._intPt[1]=n,u.equals(n)&&!p&&!S?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):c&&S?(this._intPt[0]=u,this._intPt[1]=r,u.equals(r)&&!p&&!b?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,r,s,u,p){var c=n.xr.x?n.x:r.x,T=n.y>r.y?n.y:r.y,L=s.xu.x?s.x:u.x,R=s.y>u.y?s.y:u.y,W=c>L?c:L,et=SM?b:M,ut=T0&&c>0||p<0&&c<0)return t.NO_INTERSECTION;var b=ee.orientationIndex(s,u,n),S=ee.orientationIndex(s,u,r);if(b>0&&S>0||b<0&&S<0)return t.NO_INTERSECTION;var T=p===0&&c===0&&b===0&&S===0;return T?this.computeCollinearIntersection(n,r,s,u):(p===0||c===0||b===0||S===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(u)?this._intPt[0]=n:r.equals2D(s)||r.equals2D(u)?this._intPt[0]=r:p===0?this._intPt[0]=new yt(s):c===0?this._intPt[0]=new yt(u):b===0?this._intPt[0]=new yt(n):S===0&&(this._intPt[0]=new yt(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,s,u)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,r,s,u){var p=n,c=ee.distancePointLine(n,s,u),b=ee.distancePointLine(r,s,u);return b0?n>0?-s:s:n>0?s:-s;if(e===0||n===0)return r>0?t>0?s:-s:t>0?-s:s;if(e>0?r>0?e<=r||(s=-s,u=t,t=n,n=u,u=e,e=r,r=u):e<=-r?(s=-s,n=-n,r=-r):(u=t,t=-n,n=u,u=e,e=-r,r=u):r>0?-e<=r?(s=-s,t=-t,e=-e):(u=-t,t=n,n=u,u=-e,e=r,r=u):e>=r?(t=-t,e=-e,n=-n,r=-r):(s=-s,u=-t,t=-n,n=u,u=-e,e=-r,r=u),t>0)if(n>0){if(!(t<=n))return s}else return s;else{if(n>0)return-s;if(t>=n)s=-s,t=-t,n=-n;else return-s}for(;;){if(p=Math.floor(n/t),n=n-p*t,r=r-p*e,r<0)return-s;if(r>e)return s;if(t>n+n){if(er+r)return-s;n=t-n,r=e-r,s=-s}if(r===0)return n===0?0:-s;if(n===0||(p=Math.floor(t/n),t=t-p*n,e=e-p*r,e<0))return s;if(e>r)return-s;if(n>t+t){if(re+e)return s;t=n-t,e=r-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var Es=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Es.prototype.countSegment=function(t,e){if(t.xr&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,u=t.y-this._p.y,p=e.x-this._p.x,c=e.y-this._p.y,b=bc.signOfDet2x2(s,u,p,c);if(b===0)return this._isPointOnSegment=!0,null;c0&&this._crossingCount++}};Es.prototype.isPointInPolygon=function(){return this.getLocation()!==xt.EXTERIOR};Es.prototype.getLocation=function(){return this._isPointOnSegment?xt.BOUNDARY:this._crossingCount%2===1?xt.INTERIOR:xt.EXTERIOR};Es.prototype.isOnSegment=function(){return this._isPointOnSegment};Es.prototype.interfaces_=function(){return[]};Es.prototype.getClass=function(){return Es};Es.locatePointInRing=function(){if(arguments[0]instanceof yt&&Ie(arguments[1],Qe)){for(var t=arguments[0],e=arguments[1],n=new Es(t),r=new yt,s=new yt,u=1;u1||b<0||b>1)&&(s=!0)}}return s?Lo.min(ee.distancePointLine(t,n,r),ee.distancePointLine(e,n,r),ee.distancePointLine(n,t,e),ee.distancePointLine(r,t,e)):0};ee.isPointInRing=function(t,e){return ee.locatePointInRing(t,e)!==xt.EXTERIOR};ee.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new yt;t.getCoordinate(0,r);for(var s=r.x,u=r.y,p=1;pn.y&&(n=u,r=s)}var p=r;do p=p-1,p<0&&(p=e);while(t[p].equals2D(n)&&p!==r);var c=r;do c=(c+1)%e;while(t[c].equals2D(n)&&c!==r);var b=t[p],S=t[c];if(b.equals2D(n)||S.equals2D(n)||b.equals2D(S))return!1;var T=ee.computeOrientation(b,n,S),L=!1;return T===0?L=b.x>S.x:L=T>0,L};ee.locatePointInRing=function(t,e){return Es.locatePointInRing(t,e)};ee.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),s=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(s)*Math.sqrt(r)};ee.computeOrientation=function(t,e,n){return ee.orientationIndex(t,e,n)};ee.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new Fn("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r=1)return u.distance(c);var T=((p.y-u.y)*(c.x-p.x)-(p.x-u.x)*(c.y-p.y))/b;return Math.abs(T)*Math.sqrt(b)}};ee.isOnLine=function(t,e){for(var n=new Ru,r=1;r0};ap.prototype.interfaces_=function(){return[Vo]};ap.prototype.getClass=function(){return ap};var lp=function(){};lp.prototype.isInBoundary=function(t){return t>1};lp.prototype.interfaces_=function(){return[Vo]};lp.prototype.getClass=function(){return lp};var up=function(){};up.prototype.isInBoundary=function(t){return t===1};up.prototype.interfaces_=function(){return[Vo]};up.prototype.getClass=function(){return up};var gr=function(){};gr.prototype.add=function(){};gr.prototype.addAll=function(){};gr.prototype.isEmpty=function(){};gr.prototype.iterator=function(){};gr.prototype.size=function(){};gr.prototype.toArray=function(){};gr.prototype.remove=function(){};function _0(t){this.message=t||""}_0.prototype=new Error;_0.prototype.name="IndexOutOfBoundsException";var Mp=function(){};Mp.prototype.hasNext=function(){};Mp.prototype.next=function(){};Mp.prototype.remove=function(){};var ns=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(gr);function kp(t){this.message=t||""}kp.prototype=new Error;kp.prototype.name="NoSuchElementException";var Xt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof gr&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,gr]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var r=this,s=n.iterator();s.hasNext();)r.add(s.next());return!0},e.prototype.set=function(n,r){var s=this.array_[n];return this.array_[n]=r,s},e.prototype.iterator=function(){return new TN(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new _0;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,r=[],s=0,u=this.array_.length;s=1){var S=this.get(this.size()-1);if(S.equals2D(c))return null}t.prototype.add.call(this,c)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var T=arguments[0],L=arguments[1];return this.add(T,L),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var M=arguments[0],B=arguments[1],R=arguments[2];if(R)for(var W=0;W=0;et--)r.add(M[et],B);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof yt){var st=arguments[0],ut=arguments[1],gt=arguments[2];if(!gt){var St=this.size();if(St>0){if(st>0){var Bt=this.get(st-1);if(Bt.equals2D(ut))return null}if(stie&&(wt=-1);for(var se=Ut;se!==ie;se+=wt)r.add(Dt[se],Lt);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new yt(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Xt),Ge=function(){},ny={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ny.ForwardComparator.get=function(){return ad};ny.BidirectionalComparator.get=function(){return cp};ny.coordArrayType.get=function(){return new Array(0).fill(null)};Ge.prototype.interfaces_=function(){return[]};Ge.prototype.getClass=function(){return Ge};Ge.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))};Ge.ptNotInList=function(t,e){for(var n=0;n=t?e:[]};Ge.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e};Ge.extract=function(t,e,n){e=Lo.clamp(e,0,t.length),n=Lo.clamp(n,-1,t.length);var r=n-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(n.length===0)return 0;var s=Ge.compare(n,r),u=Ge.isEqualReversed(n,r);return u?0:s};cp.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(n.length===0)return 0;for(var s=Ge.increasingDirection(n),u=Ge.increasingDirection(r),p=s>0?0:n.length-1,c=u>0?0:n.length-1,b=0;b0)e=e.right;else return e.value}return null};oi.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Na,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,r,s;do if(r=n,s=t.compareTo(n.key),s<0)n=n.left;else if(s>0)n=n.right;else{var u=n.value;return n.value=e,u}while(n!==null);var p={key:t,left:null,right:null,value:e,parent:r,color:Na,getValue:function(){return this.value},getKey:function(){return this.key}};return s<0?r.left=p:r.right=p,this.fixAfterInsertion(p),this.size_++,null};oi.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=lu;t!=null&&t!==this.root_&&t.parent.color===lu;)if(In(t)===q_(In(In(t)))){var n=fw(In(In(t)));pw(n)===lu?(Ma(In(t),Na),Ma(n,Na),Ma(In(In(t)),lu),t=In(In(t))):(t===fw(In(t))&&(t=In(t),e.rotateLeft(t)),Ma(In(t),Na),Ma(In(In(t)),lu),e.rotateRight(In(In(t))))}else{var r=q_(In(In(t)));pw(r)===lu?(Ma(In(t),Na),Ma(r,Na),Ma(In(In(t)),lu),t=In(In(t))):(t===q_(In(t))&&(t=In(t),e.rotateRight(t)),Ma(In(t),Na),Ma(In(In(t)),lu),e.rotateLeft(In(In(t))))}this.root_.color=Na};oi.prototype.values=function(){var t=new Xt,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=oi.successor(e))!==null;)t.add(e.value);return t};oi.prototype.entrySet=function(){var t=new v0,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=oi.successor(e))!==null;)t.add(e);return t};oi.prototype.rotateLeft=function(t){if(t!=null){var e=t.right;t.right=e.left,e.left!=null&&(e.left.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}};oi.prototype.rotateRight=function(t){if(t!=null){var e=t.left;t.left=e.right,e.right!=null&&(e.right.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}};oi.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t};oi.successor=function(t){if(t===null)return null;if(t.right!==null){for(var e=t.right;e.left!==null;)e=e.left;return e}else{for(var n=t.parent,r=t;n!==null&&r===n.right;)r=n,n=n.parent;return n}};oi.prototype.size=function(){return this.size_};var ld=function(){};ld.prototype.interfaces_=function(){return[]};ld.prototype.getClass=function(){return ld};function ME(){}ME.prototype=new ry;function Ls(){this.array_=[],arguments[0]instanceof gr&&this.addAll(arguments[0])}Ls.prototype=new ME;Ls.prototype.contains=function(t){for(var e=this,n=0,r=this.array_.length;n=0;){var p=s.substring(0,u);r.add(p),s=s.substring(u+n),u=s.indexOf(e)}s.length>0&&r.add(s);for(var c=new Array(r.size()).fill(null),b=0;b0)for(var u=s;u0&&r.append(" ");for(var u=0;u0&&r.append(","),r.append(Bo.toString(t.getOrdinate(s,u)))}return r.append(")"),r.toString()}};ir.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return ir.createClosedRing(t,e,4);var r=e.getOrdinate(0,Qe.X)===e.getOrdinate(n-1,Qe.X)&&e.getOrdinate(0,Qe.Y)===e.getOrdinate(n-1,Qe.Y);return r?e:ir.createClosedRing(t,e,n+1)};ir.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),s=e.size();ir.copy(e,0,r,0,s);for(var u=s;u0&&ir.reverse(r._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?sn.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return ee.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var r=this._points.copy();ir.reverse(r);var s=this.getFactory().createLineString(r);return s},e.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var s=arguments[0],u=s,p=0,c=0;p= 2)");this._points=r},e.prototype.isCoordinate=function(r){for(var s=this,u=0;u=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Zn),aa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Ee.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?t.prototype.equalsExact.call(this,r,s):!1}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var r=this,s=this._geometries.length,u=new Array(s).fill(null),p=0;p0?e.createPoint(n[0]):e.createPoint():t};hd.prototype.interfaces_=function(){return[Go.GeometryEditorOperation]};hd.prototype.getClass=function(){return hd};var pd=function(){};pd.prototype.edit=function(t,e){return t instanceof ca?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Zn?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof lo?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t};pd.prototype.interfaces_=function(){return[Go.GeometryEditorOperation]};pd.prototype.getClass=function(){return pd};var nr=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n0){var e=new Hs(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n3&&(r=3),r<2?new nr(n):new nr(n,r)}};ha.prototype.interfaces_=function(){return[op,Ho]};ha.prototype.getClass=function(){return ha};ha.instance=function(){return ha.instanceObject};b0.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};b0.instanceObject.get=function(){return new ha};Object.defineProperties(ha,b0);var DE=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,r){return this.map_.set(n,r),r},e.prototype.values=function(){for(var n=new Xt,r=this.map_.values(),s=r.next();!s.done;)n.add(s.value),s=r.next();return n},e.prototype.entrySet=function(){var n=new v0;return this.map_.entries().forEach(function(r){return n.add(r)}),n},e.prototype.size=function(){return this.map_.size()},e}(Bc),un=function t(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=t.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Ps){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},w0={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};un.prototype.equals=function(t){if(!(t instanceof un))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale};un.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new Ts(n).compareTo(new Ts(r))};un.prototype.getScale=function(){return this._scale};un.prototype.isFloating=function(){return this._modelType===un.FLOATING||this._modelType===un.FLOATING_SINGLE};un.prototype.getType=function(){return this._modelType};un.prototype.toString=function(){var t="UNKNOWN";return this._modelType===un.FLOATING?t="Floating":this._modelType===un.FLOATING_SINGLE?t="Floating-Single":this._modelType===un.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t};un.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Pe.isNaN(t))return t;if(this._modelType===un.FLOATING_SINGLE){var e=t;return e}return this._modelType===un.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof yt){var n=arguments[0];if(this._modelType===un.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};un.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===un.FLOATING?t=16:this._modelType===un.FLOATING_SINGLE?t=6:this._modelType===un.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t};un.prototype.setScale=function(t){this._scale=Math.abs(t)};un.prototype.interfaces_=function(){return[Ho,jo]};un.prototype.getClass=function(){return un};un.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e};w0.serialVersionUID.get=function(){return 7777263578777804e3};w0.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(un,w0);var Ps=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},S0={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Ps.prototype.readResolve=function(){return Ps.nameToTypeMap.get(this._name)};Ps.prototype.toString=function(){return this._name};Ps.prototype.interfaces_=function(){return[Ho]};Ps.prototype.getClass=function(){return Ps};S0.serialVersionUID.get=function(){return-552860263173159e4};S0.nameToTypeMap.get=function(){return new DE};Object.defineProperties(Ps,S0);un.Type=Ps;un.FIXED=new Ps("FIXED");un.FLOATING=new Ps("FLOATING");un.FLOATING_SINGLE=new Ps("FLOATING SINGLE");var Ve=function t(){this._precisionModel=new un,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?Ie(arguments[0],op)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof un&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},RE={serialVersionUID:{configurable:!0}};Ve.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new yt(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new yt(t.getMinX(),t.getMinY()),new yt(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new yt(t.getMinX(),t.getMinY()),new yt(t.getMinX(),t.getMaxY()),new yt(t.getMaxX(),t.getMaxY()),new yt(t.getMaxX(),t.getMinY()),new yt(t.getMinX(),t.getMinY())]),null)};Ve.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new Zn(this.getCoordinateSequenceFactory().create(t),this);if(Ie(t,Qe))return new Zn(t,this)}else return new Zn(this.getCoordinateSequenceFactory().create([]),this)};Ve.prototype.createMultiLineString=function(){if(arguments.length===0)return new _u(null,this);if(arguments.length===1){var t=arguments[0];return new _u(t,this)}};Ve.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,s=t.iterator();s.hasNext();){var u=s.next(),p=u.getClass();e===null&&(e=p),p!==e&&(n=!0),u.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(Ve.toGeometryArray(t));var c=t.iterator().next(),b=t.size()>1;if(b){if(c instanceof xr)return this.createMultiPolygon(Ve.toPolygonArray(t));if(c instanceof Zn)return this.createMultiLineString(Ve.toLineStringArray(t));if(c instanceof lo)return this.createMultiPoint(Ve.toPointArray(t));Ne.shouldNeverReachHere("Unhandled class: "+c.getClass().getName())}return c};Ve.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)};Ve.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof yt){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(Ie(arguments[0],Qe)){var e=arguments[0];return new lo(e,this)}}};Ve.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};Ve.prototype.createPolygon=function(){if(arguments.length===0)return new xr(null,null,this);if(arguments.length===1){if(Ie(arguments[0],Qe)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof ca){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];return new xr(r,s,this)}};Ve.prototype.getSRID=function(){return this._SRID};Ve.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Si(null,this);if(arguments.length===1){var t=arguments[0];return new Si(t,this)}};Ve.prototype.createGeometry=function(t){var e=new Go(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};Ve.prototype.getPrecisionModel=function(){return this._precisionModel};Ve.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(Ie(arguments[0],Qe)){var e=arguments[0];return new ca(e,this)}}};Ve.prototype.createMultiPolygon=function(){if(arguments.length===0)return new aa(null,this);if(arguments.length===1){var t=arguments[0];return new aa(t,this)}};Ve.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new hp(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new hp(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(Ie(arguments[0],Qe)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(r.size()).fill(null),u=0;u=this.size())throw new Error;return this.array_[t]};Ws.prototype.push=function(t){return this.array_.push(t),t};Ws.prototype.pop=function(t){if(this.array_.length===0)throw new ly;return this.array_.pop()};Ws.prototype.peek=function(){if(this.array_.length===0)throw new ly;return this.array_[this.array_.length-1]};Ws.prototype.empty=function(){return this.array_.length===0};Ws.prototype.isEmpty=function(){return this.empty()};Ws.prototype.search=function(t){return this.array_.indexOf(t)};Ws.prototype.size=function(){return this.array_.length};Ws.prototype.toArray=function(){for(var t=this,e=[],n=0,r=this.array_.length;n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===ee.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)};Ms.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),r=n.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var s=jt.LEFT;return r[e].ye._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])};Ms.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};Ms.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();r.isForward()&&e.checkForRightmostCoordinate(r)}Ne.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===jt.LEFT&&(this._orientedDe=this._minDe.getSym())};Ms.prototype.interfaces_=function(){return[]};Ms.prototype.getClass=function(){return Ms};var Ha=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new yt(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},e}(qa),uy=function(){this.array_=[]};uy.prototype.addLast=function(t){this.array_.push(t)};uy.prototype.removeFirst=function(){return this.array_.shift()};uy.prototype.isEmpty=function(){return this.array_.length===0};var Ei=function(){this._finder=null,this._dirEdgeList=new Xt,this._nodes=new Xt,this._rightMostCoord=null,this._env=null,this._finder=new Ms};Ei.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}};Ei.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};Ei.prototype.computeNodeDepth=function(t){for(var e=this,n=null,r=t.getEdges().iterator();r.hasNext();){var s=r.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Ha("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var u=t.getEdges().iterator();u.hasNext();){var p=u.next();p.setVisited(!0),e.copySymDepths(p)}};Ei.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(jt.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)};Ei.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};Ei.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(jt.RIGHT)>=1&&e.getDepth(jt.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}};Ei.prototype.computeDepths=function(t){var e=this,n=new v0,r=new uy,s=t.getNode();for(r.addLast(s),n.add(s),t.setVisited(!0);!r.isEmpty();){var u=r.removeFirst();n.add(u),e.computeNodeDepth(u);for(var p=u.getEdges().iterator();p.hasNext();){var c=p.next(),b=c.getSym();if(!b.isVisited()){var S=b.getNode();n.contains(S)||(r.addLast(S),n.add(S))}}}};Ei.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0};Ei.prototype.getEnvelope=function(){if(this._env===null){for(var t=new de,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),r=n.getEdge().getCoordinates(),s=0;sthis.location.length){var n=new Array(3).fill(null);n[jt.ON]=this.location[jt.ON],n[jt.LEFT]=xt.NONE,n[jt.RIGHT]=xt.NONE,this.location=n}for(var r=0;r1&&t.append(xt.toLocationSymbol(this.location[jt.LEFT])),t.append(xt.toLocationSymbol(this.location[jt.ON])),this.location.length>1&&t.append(xt.toLocationSymbol(this.location[jt.RIGHT])),t.toString()};Cn.prototype.setLocations=function(t,e,n){this.location[jt.ON]=t,this.location[jt.LEFT]=e,this.location[jt.RIGHT]=n};Cn.prototype.get=function(t){return t1};Cn.prototype.isAnyNull=function(){for(var t=this,e=0;et._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2};ur.prototype.addPoints=function(t,e,n){var r=this,s=t.getCoordinates();if(e){var u=1;n&&(u=0);for(var p=u;p=0;b--)r._pts.add(s[b])}};ur.prototype.isHole=function(){return this._isHole};ur.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)};ur.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!ee.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var s=r.next();if(s.containsPoint(t))return!1}return!0};ur.prototype.addHole=function(t){this._holes.add(t)};ur.prototype.isShell=function(){return this._shell===null};ur.prototype.getLabel=function(){return this._label};ur.prototype.getEdges=function(){return this._edges};ur.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};ur.prototype.getShell=function(){return this._shell};ur.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=e.getLocation(n,jt.RIGHT);if(r===xt.NONE)return null;if(this._label.getLocation(n)===xt.NONE)return this._label.setLocation(n,r),null}};ur.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)};ur.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(t)};Ao.prototype.isInResult=function(){return this._isInResult};Ao.prototype.isVisited=function(){return this._isVisited};Ao.prototype.interfaces_=function(){return[]};Ao.prototype.getClass=function(){return Ao};var cy=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var n=arguments[0],r=arguments[1];this._coord=n,this._edges=r,this._label=new mn(0,xt.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,r){var s=xt.NONE;if(s=this._label.getLocation(r),!n.isNull(r)){var u=n.getLocation(r);s!==xt.BOUNDARY&&(s=u)}return s},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new mn(n,r):this._label.setLocation(n,r)}else return t.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof mn)for(var s=arguments[0],u=0;u<2;u++){var p=n.computeMergedLocation(s,u),c=n._label.getLocation(u);c===xt.NONE&&n._label.setLocation(u,p)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=xt.NONE;this._label!==null&&(r=this._label.getLocation(n));var s=null;switch(r){case xt.BOUNDARY:s=xt.INTERIOR;break;case xt.INTERIOR:s=xt.BOUNDARY;break;default:s=xt.BOUNDARY;break}this._label.setLocation(n,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ao),ks=function(){this.nodeMap=new oi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};ks.prototype.find=function(t){return this.nodeMap.get(t)};ks.prototype.addNode=function(){if(arguments[0]instanceof yt){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof cy){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}};ks.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};ks.prototype.iterator=function(){return this.nodeMap.values().iterator()};ks.prototype.values=function(){return this.nodeMap.values()};ks.prototype.getBoundaryNodes=function(t){for(var e=new Xt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===xt.BOUNDARY&&e.add(r)}return e};ks.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)};ks.prototype.interfaces_=function(){return[]};ks.prototype.getClass=function(){return ks};var yn=function(){},Ld={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};yn.prototype.interfaces_=function(){return[]};yn.prototype.getClass=function(){return yn};yn.isNorthern=function(t){return t===yn.NE||t===yn.NW};yn.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2};yn.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var r=te?t:e;return r===0&&s===3?3:r};yn.isInHalfPlane=function(t,e){return e===yn.SE?t===yn.SE||t===yn.SW:t===e||t===e+1};yn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new Fn("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?yn.NE:yn.SE:e>=0?yn.NW:yn.SW}else if(arguments[0]instanceof yt&&arguments[1]instanceof yt){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new Fn("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?yn.NE:yn.SE:r.y>=n.y?yn.NW:yn.SW}};Ld.NE.get=function(){return 0};Ld.NW.get=function(){return 1};Ld.SW.get=function(){return 2};Ld.SE.get=function(){return 3};Object.defineProperties(yn,Ld);var si=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],s=null;this._edge=e,this.init(n,r),this._label=s}else if(arguments.length===4){var u=arguments[0],p=arguments[1],c=arguments[2],b=arguments[3];this._edge=u,this.init(p,c),this._label=b}};si.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){p.linkDirectedEdgesForMinimalEdgeRings();var c=p.buildMinimalRings(),b=r.findShell(c);b!==null?(r.placePolygonHoles(b,c),e.add(b)):n.addAll(c)}else s.add(p)}return s};uo.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1};uo.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new Xt,r=t.iterator();r.hasNext();){var s=r.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var u=new FN(s,e._geometryFactory);n.add(u),u.setInResult()}}return n};uo.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}};uo.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t};uo.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),s=n.getCoordinateN(0),u=null,p=null,c=e.iterator();c.hasNext();){var b=c.next(),S=b.getLinearRing(),T=S.getEnvelopeInternal();u!==null&&(p=u.getLinearRing().getEnvelopeInternal());var L=!1;T.contains(r)&&ee.isPointInRing(s,S.getCoordinates())&&(L=!0),L&&(u===null||p.contains(T))&&(u=b)}return u};uo.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var s=r.next();s.isHole()||(n=s,e++)}return Ne.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n};uo.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];jn.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),s=new Xt,u=this.buildMinimalEdgeRings(r,this._shellList,s);this.sortShellsAndHoles(u,this._shellList,s),this.placeFreeHoles(this._shellList,s)}};uo.prototype.interfaces_=function(){return[]};uo.prototype.getClass=function(){return uo};var fp=function(){};fp.prototype.getBounds=function(){};fp.prototype.interfaces_=function(){return[]};fp.prototype.getClass=function(){return fp};var os=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};os.prototype.getItem=function(){return this._item};os.prototype.getBounds=function(){return this._bounds};os.prototype.interfaces_=function(){return[fp,Ho]};os.prototype.getClass=function(){return os};var Wa=function(){this._size=null,this._items=null,this._size=0,this._items=new Xt,this._items.add(null)};Wa.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t};Wa.prototype.size=function(){return this._size};Wa.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)};Wa.prototype.clear=function(){this._size=0,this._items.clear()};Wa.prototype.isEmpty=function(){return this._size===0};Wa.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)};Wa.prototype.interfaces_=function(){return[]};Wa.prototype.getClass=function(){return Wa};var Pl=function(){};Pl.prototype.visitItem=function(t){};Pl.prototype.interfaces_=function(){return[]};Pl.prototype.getClass=function(){return Pl};var wc=function(){};wc.prototype.insert=function(t,e){};wc.prototype.remove=function(t,e){};wc.prototype.query=function(){};wc.prototype.interfaces_=function(){return[]};wc.prototype.getClass=function(){return wc};var vr=function(){if(this._childBoundables=new Xt,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var t=arguments[0];this._level=t}},OE={serialVersionUID:{configurable:!0}};vr.prototype.getLevel=function(){return this._level};vr.prototype.size=function(){return this._childBoundables.size()};vr.prototype.getChildBoundables=function(){return this._childBoundables};vr.prototype.addChildBoundable=function(t){Ne.isTrue(this._bounds===null),this._childBoundables.add(t)};vr.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};vr.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};vr.prototype.interfaces_=function(){return[fp,Ho]};vr.prototype.getClass=function(){return vr};OE.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(vr,OE);var ss=function(){};ss.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}};ss.min=function(t){return ss.sort(t),t.get(0)};ss.sort=function(t,e){var n=t.toArray();e?mu.sort(n,e):mu.sort(n);for(var r=t.iterator(),s=0,u=n.length;sar.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new Fn("neither boundable is composite")};ar.prototype.isLeaves=function(){return!(ar.isComposite(this._boundable1)||ar.isComposite(this._boundable2))};ar.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0};ar.prototype.expand=function(t,e,n,r){for(var s=this,u=t.getChildBoundables(),p=u.iterator();p.hasNext();){var c=p.next(),b=new ar(c,e,s._itemDistance);b.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},hy={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Vr.prototype.getNodeCapacity=function(){return this._nodeCapacity};Vr.prototype.lastNode=function(t){return t.get(t.size()-1)};Vr.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof vr?n+=t.size(s):s instanceof os&&(n+=1)}return n}};Vr.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof os&&s.getItem()===e&&(n=s)}return n!==null?(t.getChildBoundables().remove(n),!0):!1};Vr.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new Xt:e}else if(arguments.length===1){for(var n=arguments[0],r=new Xt,s=n.getChildBoundables().iterator();s.hasNext();){var u=s.next();if(u instanceof vr){var p=t.itemsTree(u);p!==null&&r.add(p)}else u instanceof os?r.add(u.getItem()):Ne.shouldNeverReachHere()}return r.size()<=0?null:r}};Vr.prototype.insert=function(t,e){Ne.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new os(t,e))};Vr.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new Xt;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],u=arguments[2];if(Ne.isTrue(r>-2),s.getLevel()===r)return u.add(s),null;for(var p=s.getChildBoundables().iterator();p.hasNext();){var c=p.next();c instanceof vr?t.boundablesAtLevel(r,c,u):(Ne.isTrue(c instanceof os),r===-1&&u.add(c))}return null}};Vr.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new Xt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var r=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,s)}else if(arguments.length===3){if(Ie(arguments[2],Pl)&&arguments[0]instanceof Object&&arguments[1]instanceof vr)for(var u=arguments[0],p=arguments[1],c=arguments[2],b=p.getChildBoundables(),S=0;Sn&&(n=u)}}return n+1}};Vr.prototype.createParentBoundables=function(t,e){var n=this;Ne.isTrue(!t.isEmpty());var r=new Xt;r.add(this.createNode(e));var s=new Xt(t);ss.sort(s,this.getComparator());for(var u=s.iterator();u.hasNext();){var p=u.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(p)}return r};Vr.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};Vr.prototype.interfaces_=function(){return[Ho]};Vr.prototype.getClass=function(){return Vr};Vr.compareDoubles=function(t,e){return t>e?1:t0);for(var p=new Xt,c=0;c0;){var R=B.poll(),W=R.getDistance();if(W>=L)break;R.isLeaves()?(L=W,M=R):R.expandToQueue(B,L)}return[M.getBoundable(0).getItem(),M.getBoundable(1).getItem()]}}else if(arguments.length===3){var et=arguments[0],st=arguments[1],ut=arguments[2],gt=new os(et,st),St=new ar(this.getRoot(),gt,ut);return this.nearestNeighbour(St)[0]}},e.prototype.interfaces_=function(){return[wc,Ho]},e.prototype.getClass=function(){return e},e.centreX=function(r){return e.avg(r.getMinX(),r.getMaxX())},e.avg=function(r,s){return(r+s)/2},e.centreY=function(r){return e.avg(r.getMinY(),r.getMaxY())},n.STRtreeNode.get=function(){return dw},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[ip]},compare:function(r,s){return t.compareDoubles(e.centreX(r.getBounds()),e.centreX(s.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[ip]},compare:function(r,s){return t.compareDoubles(e.centreY(r.getBounds()),e.centreY(s.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(r,s){return r.intersects(s)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(Vr),dw=function(t){function e(){var n=arguments[0];t.call(this,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var s=r.next();n===null?n=new de(s.getBounds()):n.expandToInclude(s.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vr),Bi=function(){};Bi.prototype.interfaces_=function(){return[]};Bi.prototype.getClass=function(){return Bi};Bi.relativeSign=function(t,e){return te?1:0};Bi.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=Bi.relativeSign(e.x,n.x),s=Bi.relativeSign(e.y,n.y);switch(t){case 0:return Bi.compareValue(r,s);case 1:return Bi.compareValue(s,r);case 2:return Bi.compareValue(s,-r);case 3:return Bi.compareValue(-r,s);case 4:return Bi.compareValue(-r,-s);case 5:return Bi.compareValue(-s,-r);case 6:return Bi.compareValue(-s,r);case 7:return Bi.compareValue(r,-s)}return Ne.shouldNeverReachHere("invalid octant value"),0};Bi.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Ml=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new yt(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};Ml.prototype.getCoordinate=function(){return this.coord};Ml.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)};Ml.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Bi.compare(this._segmentOctant,this.coord,e.coord)};Ml.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t};Ml.prototype.isInterior=function(){return this._isInterior};Ml.prototype.interfaces_=function(){return[jo]};Ml.prototype.getClass=function(){return Ml};var Ii=function(){this._nodeMap=new oi,this._edge=null;var t=arguments[0];this._edge=t};Ii.prototype.getSplitCoordinates=function(){var t=this,e=new Cd;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next();t.addEdgeCoordinates(r,s,e),r=s}return e.toCoordinateArray()};Ii.prototype.addCollapsedNodes=function(){var t=this,e=new Xt;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var r=n.next().intValue();t.add(t._edge.getCoordinate(r),r)}};Ii.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};Ii.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof yt&&arguments[1]instanceof yt){var s=arguments[0],u=arguments[1],p=u.x-s.x,c=u.y-s.y;if(p===0&&c===0)throw new Fn("Cannot compute the octant for two identical points "+s);return Sc.octant(p,c)}};var pa=function(){};pa.prototype.getCoordinates=function(){};pa.prototype.size=function(){};pa.prototype.getCoordinate=function(t){};pa.prototype.isClosed=function(){};pa.prototype.setData=function(t){};pa.prototype.getData=function(){};pa.prototype.interfaces_=function(){return[]};pa.prototype.getClass=function(){return pa};var fd=function(){};fd.prototype.addIntersection=function(t,e){};fd.prototype.interfaces_=function(){return[pa]};fd.prototype.getClass=function(){return fd};var or=function(){this._nodeList=new Ii(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};or.prototype.getCoordinates=function(){return this._pts};or.prototype.size=function(){return this._pts.length};or.prototype.getCoordinate=function(t){return this._pts[t]};or.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};or.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))};or.prototype.setData=function(t){this._data=t};or.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Sc.octant(t,e)};or.prototype.getData=function(){return this._data};or.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[3],u=new yt(n.getIntersection(s));this.addIntersection(u,r)}};or.prototype.toString=function(){return rs.toLineString(new nr(this._pts))};or.prototype.getNodeList=function(){return this._nodeList};or.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof yt){var r=arguments[0];return ee.orientationIndex(this.p0,this.p1,r)}};me.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])};me.prototype.isVertical=function(){return this.p0.x===this.p1.x};me.prototype.equals=function(t){if(!(t instanceof me))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)};me.prototype.intersection=function(t){var e=new Ru;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null};me.prototype.project=function(){if(arguments[0]instanceof yt){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new yt(t);var e=this.projectionFactor(t),n=new yt;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof me){var r=arguments[0],s=this.projectionFactor(r.p0),u=this.projectionFactor(r.p1);if(s>=1&&u>=1||s<=0&&u<=0)return null;var p=this.project(r.p0);s<0&&(p=this.p0),s>1&&(p=this.p1);var c=this.project(r.p1);return u<0&&(c=this.p0),u>1&&(c=this.p1),new me(p,c)}};me.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};me.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};me.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1};me.prototype.distancePerpendicular=function(t){return ee.distancePointLinePerpendicular(t,this.p0,this.p1)};me.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};me.prototype.midPoint=function(){return me.midPoint(this.p0,this.p1)};me.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;if(r<=0)return Pe.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r;return s};me.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),r=Pe.MAX_VALUE,s=null,u=this.closestPoint(t.p0);r=u.distance(t.p0),n[0]=u,n[1]=t.p0;var p=this.closestPoint(t.p1);s=p.distance(t.p1),s0&&e<1)return this.project(t);var n=this.p0.distance(t),r=this.p1.distance(t);return n1||Pe.isNaN(e))&&(e=1),e};me.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};me.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};me.prototype.distance=function(){if(arguments[0]instanceof me){var t=arguments[0];return ee.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof yt){var e=arguments[0];return ee.distancePointLine(e,this.p0,this.p1)}};me.prototype.pointAlong=function(t){var e=new yt;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e};me.prototype.hashCode=function(){var t=Pe.doubleToLongBits(this.p0.x);t^=Pe.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=Pe.doubleToLongBits(this.p1.x);n^=Pe.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return e^r};me.prototype.interfaces_=function(){return[jo,Ho]};me.prototype.getClass=function(){return me};me.midPoint=function(t,e){return new yt((t.x+e.x)/2,(t.y+e.y)/2)};FE.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(me,FE);var dd=function(){this.tempEnv1=new de,this.tempEnv2=new de,this._overlapSeg1=new me,this._overlapSeg2=new me};dd.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}};dd.prototype.interfaces_=function(){return[]};dd.prototype.getClass=function(){return dd};var co=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};co.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]};co.prototype.computeSelect=function(t,e,n,r){var s=this._pts[e],u=this._pts[n];if(r.tempEnv1.init(s,u),n-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var p=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=yn.quadrant(t[n],t[n+1]),s=e+1;sp.getId()&&(p.computeOverlaps(S,s),r._nOverlaps++),r._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return mw},Object.defineProperties(e,n),e}(md),mw=function(t){function e(){t.call(this),this._si=null;var n=arguments[0];this._si=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[2],u=arguments[3],p=n.getContext(),c=s.getContext();this._si.processIntersections(p,r,c,u)}else return t.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(dd),ln=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(arguments.length===4){var s=arguments[0],u=arguments[1],p=arguments[2],c=arguments[3];this.setQuadrantSegments(s),this.setEndCapStyle(u),this.setJoinStyle(p),this.setMitreLimit(c)}}},tl={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};ln.prototype.getEndCapStyle=function(){return this._endCapStyle};ln.prototype.isSingleSided=function(){return this._isSingleSided};ln.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=ln.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=ln.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==ln.JOIN_ROUND&&(this._quadrantSegments=ln.DEFAULT_QUADRANT_SEGMENTS)};ln.prototype.getJoinStyle=function(){return this._joinStyle};ln.prototype.setJoinStyle=function(t){this._joinStyle=t};ln.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t};ln.prototype.getSimplifyFactor=function(){return this._simplifyFactor};ln.prototype.getQuadrantSegments=function(){return this._quadrantSegments};ln.prototype.setEndCapStyle=function(t){this._endCapStyle=t};ln.prototype.getMitreLimit=function(){return this._mitreLimit};ln.prototype.setMitreLimit=function(t){this._mitreLimit=t};ln.prototype.setSingleSided=function(t){this._isSingleSided=t};ln.prototype.interfaces_=function(){return[]};ln.prototype.getClass=function(){return ln};ln.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)};tl.CAP_ROUND.get=function(){return 1};tl.CAP_FLAT.get=function(){return 2};tl.CAP_SQUARE.get=function(){return 3};tl.JOIN_ROUND.get=function(){return 1};tl.JOIN_MITRE.get=function(){return 2};tl.JOIN_BEVEL.get=function(){return 3};tl.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};tl.DEFAULT_MITRE_LIMIT.get=function(){return 5};tl.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(ln,tl);var Xn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ee.COUNTERCLOCKWISE,this._inputLine=t||null},Ad={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Xn.prototype.isDeletable=function(t,e,n,r){var s=this._inputLine[t],u=this._inputLine[e],p=this._inputLine[n];return!this.isConcave(s,u,p)||!this.isShallow(s,u,p,r)?!1:this.isShallowSampled(s,u,t,n,r)};Xn.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),s=!1;r=0;s--)n.addPt(t[s])};Po.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return nMath.PI;)t-=Ye.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ye.PI_TIMES_2;return t};Ye.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=n.x-e.x,s=n.y-e.y;return Math.atan2(s,r)}};Ye.isAcute=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,u=n.x-e.x,p=n.y-e.y,c=r*u+s*p;return c>0};Ye.isObtuse=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,u=n.x-e.x,p=n.y-e.y,c=r*u+s*p;return c<0};Ye.interiorAngle=function(t,e,n){var r=Ye.angle(e,t),s=Ye.angle(e,n);return Math.abs(s-r)};Ye.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ye.PI_TIMES_2;t>=Ye.PI_TIMES_2&&(t=0)}else{for(;t>=Ye.PI_TIMES_2;)t-=Ye.PI_TIMES_2;t<0&&(t=0)}return t};Ye.angleBetween=function(t,e,n){var r=Ye.angle(e,t),s=Ye.angle(e,n);return Ye.diff(r,s)};Ye.diff=function(t,e){var n=null;return tMath.PI&&(n=2*Math.PI-n),n};Ye.toRadians=function(t){return t*Math.PI/180};Ye.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ye.COUNTERCLOCKWISE:n<0?Ye.CLOCKWISE:Ye.NONE};Ye.angleBetweenOriented=function(t,e,n){var r=Ye.angle(e,t),s=Ye.angle(e,n),u=s-r;return u<=-Math.PI?u+Ye.PI_TIMES_2:u>Math.PI?u-Ye.PI_TIMES_2:u};Uc.PI_TIMES_2.get=function(){return 2*Math.PI};Uc.PI_OVER_2.get=function(){return Math.PI/2};Uc.PI_OVER_4.get=function(){return Math.PI/4};Uc.COUNTERCLOCKWISE.get=function(){return ee.COUNTERCLOCKWISE};Uc.CLOCKWISE.get=function(){return ee.CLOCKWISE};Uc.NONE.get=function(){return ee.COLLINEAR};Object.defineProperties(Ye,Uc);var Pn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new me,this._seg1=new me,this._offset0=new me,this._offset1=new me,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new Ru,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===ln.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Pd={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Pn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=ee.computeOrientation(this._s0,this._s1,this._s2),r=n===ee.CLOCKWISE&&this._side===jt.LEFT||n===ee.COUNTERCLOCKWISE&&this._side===jt.RIGHT;n===0?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)};Pn.prototype.addLineEndCap=function(t,e){var n=new me(t,e),r=new me;this.computeOffsetSegment(n,jt.LEFT,this._distance,r);var s=new me;this.computeOffsetSegment(n,jt.RIGHT,this._distance,s);var u=e.x-t.x,p=e.y-t.y,c=Math.atan2(p,u);switch(this._bufParams.getEndCapStyle()){case ln.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,c+Math.PI/2,c-Math.PI/2,ee.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case ln.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(s.p1);break;case ln.CAP_SQUARE:var b=new yt;b.x=Math.abs(this._distance)*Math.cos(c),b.y=Math.abs(this._distance)*Math.sin(c);var S=new yt(r.p1.x+b.x,r.p1.y+b.y),T=new yt(s.p1.x+b.x,s.p1.y+b.y);this._segList.addPt(S),this._segList.addPt(T);break}};Pn.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t};Pn.prototype.addMitreJoin=function(t,e,n,r){var s=!0,u=null;try{u=es.intersection(e.p0,e.p1,n.p0,n.p1);var p=r<=0?1:u.distance(t)/Math.abs(r);p>this._bufParams.getMitreLimit()&&(s=!1)}catch(c){if(c instanceof Pp)u=new yt(0,0),s=!1;else throw c}finally{}s?this._segList.addPt(u):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())};Pn.prototype.addFilletCorner=function(t,e,n,r,s){var u=e.x-t.x,p=e.y-t.y,c=Math.atan2(p,u),b=n.x-t.x,S=n.y-t.y,T=Math.atan2(S,b);r===ee.CLOCKWISE?c<=T&&(c+=2*Math.PI):c>=T&&(c-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,c,T,r,s),this._segList.addPt(n)};Pn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new yt((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new yt((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};Pn.prototype.createCircle=function(t){var e=new yt(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};Pn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)};Pn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Po,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Pn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};Pn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===ln.JOIN_BEVEL||this._bufParams.getJoinStyle()===ln.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,ee.CLOCKWISE,this._distance))};Pn.prototype.closeRing=function(){this._segList.closeRing()};Pn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};Pn.prototype.interfaces_=function(){return[]};Pn.prototype.getClass=function(){return Pn};Pd.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};Pd.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};Pd.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};Pd.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(Pn,Pd);var ji=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};ji.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,r=Math.abs(e),s=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,n,s);var u=s.getCoordinates();return n&&Ge.reverse(u),u};ji.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var s=Xn.simplify(t,-r),u=s.length-1;n.initSideSegments(s[u],s[u-1],jt.LEFT),n.addFirstSegment();for(var p=u-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{n.addSegments(t,!1);var c=Xn.simplify(t,r),b=c.length-1;n.initSideSegments(c[0],c[1],jt.LEFT),n.addFirstSegment();for(var S=2;S<=b;S++)n.addNextSegment(c[S],!0)}n.addLastSegment(),n.closeRing()};ji.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===jt.RIGHT&&(r=-r);var s=Xn.simplify(t,r),u=s.length-1;n.initSideSegments(s[u-1],s[0],e);for(var p=1;p<=u;p++){var c=p!==1;n.addNextSegment(s[p],c)}n.closeRing()};ji.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Xn.simplify(t,n),s=r.length-1;e.initSideSegments(r[0],r[1],jt.LEFT);for(var u=2;u<=s;u++)e.addNextSegment(r[u],!0);e.addLastSegment(),e.addLineEndCap(r[s-1],r[s]);var p=Xn.simplify(t,-n),c=p.length-1;e.initSideSegments(p[c],p[c-1],jt.LEFT);for(var b=c-2;b>=0;b--)e.addNextSegment(p[b],!0);e.addLastSegment(),e.addLineEndCap(p[1],p[0]),e.closeRing()};ji.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case ln.CAP_ROUND:e.createCircle(t);break;case ln.CAP_SQUARE:e.createSquare(t);break}};ji.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,r)}else this.computeLineBufferCurve(t,r);var u=r.getCoordinates();return u};ji.prototype.getBufferParameters=function(){return this._bufParams};ji.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()};ji.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return ji.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()};ji.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var s=Xn.simplify(t,-r),u=s.length-1;n.initSideSegments(s[u],s[u-1],jt.LEFT),n.addFirstSegment();for(var p=u-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{var c=Xn.simplify(t,r),b=c.length-1;n.initSideSegments(c[0],c[1],jt.LEFT),n.addFirstSegment();for(var S=2;S<=b;S++)n.addNextSegment(c[S],!0)}n.addLastSegment()};ji.prototype.getSegGen=function(t){return new Pn(this._precisionModel,this._bufParams,t)};ji.prototype.interfaces_=function(){return[]};ji.prototype.getClass=function(){return ji};ji.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;nu.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(Ie(arguments[2],ns)&&arguments[0]instanceof yt&&arguments[1]instanceof Dv)for(var p=arguments[0],c=arguments[1],b=arguments[2],S=c.getEdge().getCoordinates(),T=0;Tt._seg.p1.y&&t._seg.reverse();var L=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(Lt._seg.p1.y)&&ee.computeOrientation(t._seg.p0,t._seg.p1,p)!==ee.RIGHT){var M=c.getDepth(jt.LEFT);t._seg.p0.equals(S[T])||(M=c.getDepth(jt.RIGHT));var B=new xu(t._seg,M);b.add(B)}}else if(Ie(arguments[2],ns)&&arguments[0]instanceof yt&&Ie(arguments[1],ns))for(var R=arguments[0],W=arguments[1],et=arguments[2],st=W.iterator();st.hasNext();){var ut=st.next();ut.isForward()&&t.findStabbedSegments(R,ut,et)}}};Ec.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=ss.min(e);return n._leftDepth};Ec.prototype.interfaces_=function(){return[]};Ec.prototype.getClass=function(){return Ec};UE.DepthSegment.get=function(){return xu};Object.defineProperties(Ec,UE);var xu=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new me(t),this._leftDepth=e};xu.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)};xu.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)};xu.prototype.toString=function(){return this._upwardSeg.toString()};xu.prototype.interfaces_=function(){return[jo]};xu.prototype.getClass=function(){return xu};var cn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};cn.prototype.area=function(){return cn.area(this.p0,this.p1,this.p2)};cn.prototype.signedArea=function(){return cn.signedArea(this.p0,this.p1,this.p2)};cn.prototype.interpolateZ=function(t){if(t===null)throw new Fn("Supplied point is null.");return cn.interpolateZ(t,this.p0,this.p1,this.p2)};cn.prototype.longestSideLength=function(){return cn.longestSideLength(this.p0,this.p1,this.p2)};cn.prototype.isAcute=function(){return cn.isAcute(this.p0,this.p1,this.p2)};cn.prototype.circumcentre=function(){return cn.circumcentre(this.p0,this.p1,this.p2)};cn.prototype.area3D=function(){return cn.area3D(this.p0,this.p1,this.p2)};cn.prototype.centroid=function(){return cn.centroid(this.p0,this.p1,this.p2)};cn.prototype.inCentre=function(){return cn.inCentre(this.p0,this.p1,this.p2)};cn.prototype.interfaces_=function(){return[]};cn.prototype.getClass=function(){return cn};cn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)};cn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2};cn.det=function(t,e,n,r){return t*r-e*n};cn.interpolateZ=function(t,e,n,r){var s=e.x,u=e.y,p=n.x-s,c=r.x-s,b=n.y-u,S=r.y-u,T=p*S-c*b,L=t.x-s,M=t.y-u,B=(S*L-c*M)/T,R=(-b*L+p*M)/T,W=e.z+B*(n.z-e.z)+R*(r.z-e.z);return W};cn.longestSideLength=function(t,e,n){var r=t.distance(e),s=e.distance(n),u=n.distance(t),p=r;return s>p&&(p=s),u>p&&(p=u),p};cn.isAcute=function(t,e,n){return!(!Ye.isAcute(t,e,n)||!Ye.isAcute(e,n,t)||!Ye.isAcute(n,t,e))};cn.circumcentre=function(t,e,n){var r=n.x,s=n.y,u=t.x-r,p=t.y-s,c=e.x-r,b=e.y-s,S=2*cn.det(u,p,c,b),T=cn.det(p,u*u+p*p,b,c*c+b*b),L=cn.det(u,u*u+p*p,c,c*c+b*b),M=r-T/S,B=s+L/S;return new yt(M,B)};cn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,s=new es(t.x+n/2,t.y+r/2,1),u=new es(t.x-r+n/2,t.y+n+r/2,1);return new es(s,u)};cn.angleBisector=function(t,e,n){var r=e.distance(t),s=e.distance(n),u=r/(r+s),p=n.x-t.x,c=n.y-t.y,b=new yt(t.x+u*p,t.y+u*c);return b};cn.area3D=function(t,e,n){var r=e.x-t.x,s=e.y-t.y,u=e.z-t.z,p=n.x-t.x,c=n.y-t.y,b=n.z-t.z,S=s*b-u*c,T=u*p-r*b,L=r*c-s*p,M=S*S+T*T+L*L,B=Math.sqrt(M)/2;return B};cn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,s=(t.y+e.y+n.y)/3;return new yt(r,s)};cn.inCentre=function(t,e,n){var r=e.distance(n),s=t.distance(n),u=t.distance(e),p=r+s+u,c=(r*t.x+s*e.x+u*n.x)/p,b=(r*t.y+s*e.y+u*n.y)/p;return new yt(c,b)};var qo=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Xt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};qo.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,xt.EXTERIOR,xt.INTERIOR)};qo.prototype.addPolygon=function(t){var e=this,n=this._distance,r=jt.LEFT;this._distance<0&&(n=-this._distance,r=jt.RIGHT);var s=t.getExteriorRing(),u=Ge.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&u.length<3)return null;this.addPolygonRing(u,n,r,xt.EXTERIOR,xt.INTERIOR);for(var p=0;p0&&e.isErodedCompletely(c,-e._distance)||e.addPolygonRing(b,n,jt.opposite(r),xt.INTERIOR,xt.EXTERIOR)}};qo.prototype.isTriangleErodedCompletely=function(t,e){var n=new cn(t[0],t[1],t[2]),r=n.inCentre(),s=ee.distancePointLine(r,n.p0,n.p1);return s=ca.MINIMUM_VALID_SIZE&&ee.isCCW(t)&&(u=s,p=r,n=jt.opposite(n));var c=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(c,u,p)};qo.prototype.add=function(t){if(t.isEmpty())return null;t instanceof xr?this.addPolygon(t):t instanceof Zn?this.addLineString(t):t instanceof lo?this.addPoint(t):t instanceof hp?this.addCollection(t):t instanceof _u?this.addCollection(t):t instanceof aa?this.addCollection(t):t instanceof Si&&this.addCollection(t)};qo.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),s=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>s};qo.prototype.addCollection=function(t){for(var e=this,n=0;n=this._max)throw new kp;var t=this._parent.getGeometryN(this._index++);return t instanceof Si?(this._subcollectionIterator=new la(t),this._subcollectionIterator.next()):t};la.prototype.remove=function(){throw new Error(this.getClass().getName())};la.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};la.prototype.interfaces_=function(){return[Mp]};la.prototype.getClass=function(){return la};la.isAtomic=function(t){return!(t instanceof Si)};var Co=function(){this._geom=null;var t=arguments[0];this._geom=t};Co.prototype.locate=function(t){return Co.locate(t,this._geom)};Co.prototype.interfaces_=function(){return[mp]};Co.prototype.getClass=function(){return Co};Co.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?ee.isPointInRing(t,e.getCoordinates()):!1};Co.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Co.isPointInRing(t,n))return!1;for(var r=0;r=0;u--){var p=n._edgeList.get(u),c=p.getSym();s===null&&(s=c),r!==null&&c.setNext(r),r=p}s.setNext(r)},e.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],s=this.findIndex(r),u=r.getDepth(jt.LEFT),p=r.getDepth(jt.RIGHT),c=this.computeDepths(s+1,this._edgeList.size(),u),b=this.computeDepths(0,s,c);if(b!==p)throw new Ha("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var S=arguments[0],T=arguments[1],L=arguments[2],M=L,B=S;B=0;c--){var b=r._resultAreaEdgeList.get(c),S=b.getSym();switch(s===null&&b.getEdgeRing()===n&&(s=b),p){case r._SCANNING_FOR_INCOMING:if(S.getEdgeRing()!==n)continue;u=S,p=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(b.getEdgeRing()!==n)continue;u.setNextMin(b),p=r._SCANNING_FOR_INCOMING;break}}p===this._LINKING_TO_OUTGOING&&(Ne.isTrue(s!==null,"found null for first outgoing dirEdge"),Ne.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),u.setNextMin(s))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var s=r.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var u=arguments[0],p=0,c=this.iterator();c.hasNext();){var b=c.next();b.getEdgeRing()===u&&p++}return p}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=xt.NONE,r=this.iterator();r.hasNext();){var s=r.next(),u=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=xt.INTERIOR;break}if(u.isInResult()){n=xt.EXTERIOR;break}}}if(n===xt.NONE)return null;for(var p=n,c=this.iterator();c.hasNext();){var b=c.next(),S=b.getSym();b.isLineEdge()?b.getEdge().setCovered(p===xt.INTERIOR):(b.isInResult()&&(p=xt.EXTERIOR),S.isInResult()&&(p=xt.INTERIOR))}},e.prototype.computeLabelling=function(n){var r=this;t.prototype.computeLabelling.call(this,n),this._label=new mn(xt.NONE);for(var s=this.iterator();s.hasNext();)for(var u=s.next(),p=u.getEdge(),c=p.getLabel(),b=0;b<2;b++){var S=c.getLocation(b);(S===xt.INTERIOR||S===xt.BOUNDARY)&&r._label.setLocation(b,xt.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ai),VE=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(n){return new cy(n,new UN)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pp),kl=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};kl.prototype.compareTo=function(t){var e=t,n=kl.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n};kl.prototype.interfaces_=function(){return[jo]};kl.prototype.getClass=function(){return kl};kl.orientation=function(t){return Ge.increasingDirection(t)===1};kl.compareOriented=function(t,e,n,r){for(var s=e?1:-1,u=r?1:-1,p=e?t.length:-1,c=r?n.length:-1,b=e?0:t.length-1,S=r?0:n.length-1;;){var T=t[b].compareTo(n[S]);if(T!==0)return T;b+=s,S+=u;var L=b===p,M=S===c;if(L&&!M)return-1;if(!L&&M)return 1;if(L&&M)return 0}};var as=function(){this._edges=new Xt,this._ocaMap=new oi};as.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n0&&t.print(","),t.print("(");for(var s=r.getCoordinates(),u=0;u0&&t.print(","),t.print(s[u].x+" "+s[u].y);t.println(")")}t.print(") ")};as.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())};as.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n0||!e.coord.equals2D(s);u||r--;var p=new Array(r).fill(null),c=0;p[c++]=new yt(t.coord);for(var b=t.segmentIndex+1;b<=e.segmentIndex;b++)p[c++]=n.edge.pts[b];return u&&(p[c]=e.coord),new Rg(p,new mn(this.edge._label))};fa.prototype.add=function(t,e,n){var r=new Ds(t,e,n),s=this._nodeMap.get(r);return s!==null?s:(this._nodeMap.put(r,r),r)};fa.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1};fa.prototype.interfaces_=function(){return[]};fa.prototype.getClass=function(){return fa};var wu=function(){};wu.prototype.getChainStartIndices=function(t){var e=this,n=0,r=new Xt;r.add(new Ts(n));do{var s=e.findChainEnd(t,n);r.add(new Ts(s)),n=s}while(nn?e:n};Za.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return en&&(s=1),t._depth[e][r]=s}}};Kr.prototype.getDelta=function(t){return this._depth[t][jt.RIGHT]-this._depth[t][jt.LEFT]};Kr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?xt.EXTERIOR:xt.INTERIOR};Kr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};Kr.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var s=e.getLocation(n,r);(s===xt.EXTERIOR||s===xt.INTERIOR)&&(t.isNull(n,r)?t._depth[n][r]=Kr.depthAtLocation(s):t._depth[n][r]+=Kr.depthAtLocation(s))}else if(arguments.length===3){var u=arguments[0],p=arguments[1],c=arguments[2];c===xt.INTERIOR&&this._depth[u][p]++}};Kr.prototype.interfaces_=function(){return[]};Kr.prototype.getClass=function(){return Kr};Kr.depthAtLocation=function(t){return t===xt.EXTERIOR?0:t===xt.INTERIOR?1:Kr.NULL_VALUE};GE.NULL_VALUE.get=function(){return-1};Object.defineProperties(Kr,GE);var Rg=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new fa(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Kr,this._depthDelta=0,arguments.length===1){var n=arguments[0];e.call(this,n,null)}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.pts=r,this._label=s}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new e(n,mn.toLineLabel(this._label));return r},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(n){this._isIsolated=n},e.prototype.setName=function(n){this._name=n},e.prototype.equals=function(n){var r=this;if(!(n instanceof e))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var u=!0,p=!0,c=this.pts.length,b=0;b0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},e.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s0&&n.print(","),n.print(r.pts[s].x+" "+r.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(n){e.updateIM(this._label,n)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(r.pts[s]+" ");n.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Za(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new de;for(var r=0;r0&&r.append(","),r.append(n.pts[s].x+" "+n.pts[s].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},e.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;sr||this._maxyu;if(p)return!1;var c=this.intersectsToleranceSquare(t,e);return Ne.isTrue(!(p&&c),"Found bad envelope test"),c};Hi.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new yt(this._maxx,this._maxy),this._corner[1]=new yt(this._minx,this._maxy),this._corner[2]=new yt(this._minx,this._miny),this._corner[3]=new yt(this._maxx,this._miny)};Hi.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};Hi.prototype.scale=function(t){return Math.round(t*this._scaleFactor)};Hi.prototype.getCoordinate=function(){return this._originalPt};Hi.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)};Hi.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Hi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new de(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv};Hi.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))};Hi.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||t.equals(this._pt)||e.equals(this._pt))};Hi.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return this.intersects(n,r)?(t.addIntersection(this.getCoordinate(),e),!0):!1};Hi.prototype.interfaces_=function(){return[]};Hi.prototype.getClass=function(){return Hi};jE.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(Hi,jE);var gd=function(){this.tempEnv1=new de,this.selectedSegment=new me};gd.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}};gd.prototype.interfaces_=function(){return[]};gd.prototype.getClass=function(){return gd};var gp=function(){this._index=null;var t=arguments[0];this._index=t},HE={HotPixelSnapAction:{configurable:!0}};gp.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],s=e.getSafeEnvelope(),u=new WE(e,n,r);return this._index.query(s,{interfaces_:function(){return[Pl]},visitItem:function(p){var c=p;c.select(s,u)}}),u.isNodeAdded()}};gp.prototype.interfaces_=function(){return[]};gp.prototype.getClass=function(){return gp};HE.HotPixelSnapAction.get=function(){return WE};Object.defineProperties(gp,HE);var WE=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],r=arguments[1],s=arguments[2];this._hotPixel=n,this._parentEdge=r,this._hotPixelVertexIndex=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,r)}else return t.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gd),Ic=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Xt};Ic.prototype.processIntersections=function(t,e,n,r){var s=this;if(t===n&&e===r)return null;var u=t.getCoordinates()[e],p=t.getCoordinates()[e+1],c=n.getCoordinates()[r],b=n.getCoordinates()[r+1];if(this._li.computeIntersection(u,p,c,b),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var S=0;S=0;e--){try{t.bufferReducedPrecision(e)}catch(u){if(u instanceof Ha)t._saveException=u;else throw u}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=Yr.precisionScaleFactor(this._argGeom,this._distance,n),s=new un(r);this.bufferFixedPrecision(s)}};Yr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===un.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()};Yr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)};Yr.prototype.bufferOriginalPrecision=function(){try{var t=new wi(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof qa)this._saveException=e;else throw e}finally{}};Yr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry};Yr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)};Yr.prototype.interfaces_=function(){return[]};Yr.prototype.getClass=function(){return Yr};Yr.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Yr(t),r=n.getResultGeometry(e);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Ee&&typeof arguments[1]=="number"){var s=arguments[0],u=arguments[1],p=arguments[2],c=new Yr(s);c.setQuadrantSegments(p);var b=c.getResultGeometry(u);return b}else if(arguments[2]instanceof ln&&arguments[0]instanceof Ee&&typeof arguments[1]=="number"){var S=arguments[0],T=arguments[1],L=arguments[2],M=new Yr(S,L),B=M.getResultGeometry(T);return B}}else if(arguments.length===4){var R=arguments[0],W=arguments[1],et=arguments[2],st=arguments[3],ut=new Yr(R);ut.setQuadrantSegments(et),ut.setEndCapStyle(st);var gt=ut.getResultGeometry(W);return gt}};Yr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),s=Lo.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),u=e>0?e:0,p=s+2*u,c=Math.trunc(Math.log(p)/Math.log(10)+1),b=n-c,S=Math.pow(10,b);return S};Dp.CAP_ROUND.get=function(){return ln.CAP_ROUND};Dp.CAP_BUTT.get=function(){return ln.CAP_FLAT};Dp.CAP_FLAT.get=function(){return ln.CAP_FLAT};Dp.CAP_SQUARE.get=function(){return ln.CAP_SQUARE};Dp.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(Yr,Dp);var vi=function(){this._pt=[new yt,new yt],this._distance=Pe.NaN,this._isNull=!0};vi.prototype.getCoordinates=function(){return this._pt};vi.prototype.getCoordinate=function(t){return this._pt[t]};vi.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);rthis._distance&&this.initialize(e,n,r)}};vi.prototype.interfaces_=function(){return[]};vi.prototype.getClass=function(){return vi};var ra=function(){};ra.prototype.interfaces_=function(){return[]};ra.prototype.getClass=function(){return ra};ra.computeDistance=function(){if(arguments[2]instanceof vi&&arguments[0]instanceof Zn&&arguments[1]instanceof yt)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),s=new me,u=0;u0||this._isIn?xt.INTERIOR:xt.EXTERIOR)};ls.prototype.interfaces_=function(){return[]};ls.prototype.getClass=function(){return ls};var xi=function t(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(arguments.length===3){var r=arguments[0],s=arguments[1],u=arguments[2];this._component=r,this._segIndex=s,this._pt=u}},ZE={INSIDE_AREA:{configurable:!0}};xi.prototype.isInsideArea=function(){return this._segIndex===xi.INSIDE_AREA};xi.prototype.getCoordinate=function(){return this._pt};xi.prototype.getGeometryComponent=function(){return this._component};xi.prototype.getSegmentIndex=function(){return this._segIndex};xi.prototype.interfaces_=function(){return[]};xi.prototype.getClass=function(){return xi};ZE.INSIDE_AREA.get=function(){return-1};Object.defineProperties(xi,ZE);var Il=function(t){this._pts=t||null};Il.prototype.filter=function(t){t instanceof lo&&this._pts.add(t)};Il.prototype.interfaces_=function(){return[As]};Il.prototype.getClass=function(){return Il};Il.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof lo?ss.singletonList(t):Il.getPoints(t,new Xt)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof lo?n.add(e):e instanceof Si&&e.apply(new Il(n)),n}};var Tc=function(){this._locations=null;var t=arguments[0];this._locations=t};Tc.prototype.filter=function(t){(t instanceof lo||t instanceof Zn||t instanceof xr)&&this._locations.add(new xi(t,0,t.getCoordinate()))};Tc.prototype.interfaces_=function(){return[As]};Tc.prototype.getClass=function(){return Tc};Tc.getLocations=function(t){var e=new Xt;return t.apply(new Tc(e)),e};var Jr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new ls,this._minDistanceLocation=null,this._minDistance=Pe.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=s}};Jr.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=1-n,u=Va.getPolygons(this._geom[n]);if(u.size()>0){var p=Tc.getLocations(this._geom[s]);if(this.computeContainmentDistance(p,u,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&Ie(arguments[0],ns)&&Ie(arguments[1],ns)){for(var c=arguments[0],b=arguments[1],S=arguments[2],T=0;Tthis._minDistance)return null;for(var s=e.getCoordinates(),u=n.getCoordinate(),p=0;pthis._minDistance)return null;for(var B=T.getCoordinates(),R=L.getCoordinates(),W=0;Wthis._distance&&this.initialize(e,n,r)}};ii.prototype.interfaces_=function(){return[]};ii.prototype.getClass=function(){return ii};var Ss=function(){};Ss.prototype.interfaces_=function(){return[]};Ss.prototype.getClass=function(){return Ss};Ss.computeDistance=function(){if(arguments[2]instanceof ii&&arguments[0]instanceof Zn&&arguments[1]instanceof yt)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new me,s=t.getCoordinates(),u=0;u1||t<=0)throw new Fn("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t};Uo.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)};Uo.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Uo.prototype.computeOrientedDistance=function(t,e,n){var r=new Lc(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var s=new Nl(e,this._densifyFrac);t.apply(s),n.setMaximum(s.getMaxPointDistance())}};Uo.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Uo.prototype.interfaces_=function(){return[]};Uo.prototype.getClass=function(){return Uo};Uo.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Uo(t,e);return n.distance()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],u=arguments[2],p=new Uo(r,s);return p.setDensifyFraction(u),p.distance()}};T0.MaxPointDistanceFilter.get=function(){return Lc};T0.MaxDensifiedByFractionDistanceFilter.get=function(){return Nl};Object.defineProperties(Uo,T0);var Lc=function(){this._maxPtDist=new ii,this._minPtDist=new ii,this._euclideanDist=new Ss,this._geom=null;var t=arguments[0];this._geom=t};Lc.prototype.filter=function(t){this._minPtDist.initialize(),Ss.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};Lc.prototype.getMaxPointDistance=function(){return this._maxPtDist};Lc.prototype.interfaces_=function(){return[ua]};Lc.prototype.getClass=function(){return Lc};var Nl=function(){this._maxPtDist=new ii,this._minPtDist=new ii,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Nl.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var r=t.getCoordinate(e-1),s=t.getCoordinate(e),u=(s.x-r.x)/this._numSubSegs,p=(s.y-r.y)/this._numSubSegs,c=0;cn){this._isValid=!1;var s=r.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+rs.toLineString(s[0],s[1])+")"}};so.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=so.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),so.VERBOSE&&$r.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};so.prototype.checkNegativeValid=function(){if(!(this._input instanceof xr||this._input instanceof aa||this._input instanceof Si))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)};so.prototype.getErrorIndicator=function(){return this._errorIndicator};so.prototype.checkMinimumDistance=function(t,e,n){var r=new Jr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};Qr.prototype.report=function(t){if(!Qr.VERBOSE)return null;$r.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))};Qr.prototype.getErrorMessage=function(){return this._errorMsg};Qr.prototype.interfaces_=function(){return[]};Qr.prototype.getClass=function(){return Qr};Qr.isValidMsg=function(t,e,n){var r=new Qr(t,e,n);return r.isValid()?null:r.getErrorMessage()};Qr.isValid=function(t,e,n){var r=new Qr(t,e,n);return!!r.isValid()};A0.VERBOSE.get=function(){return!1};A0.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(Qr,A0);var Ns=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ns.prototype.getCoordinates=function(){return this._pts};Ns.prototype.size=function(){return this._pts.length};Ns.prototype.getCoordinate=function(t){return this._pts[t]};Ns.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Ns.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Sc.octant(this.getCoordinate(t),this.getCoordinate(t+1))};Ns.prototype.setData=function(t){this._data=t};Ns.prototype.getData=function(){return this._data};Ns.prototype.toString=function(){return rs.toLineString(new nr(this._pts))};Ns.prototype.interfaces_=function(){return[pa]};Ns.prototype.getClass=function(){return Ns};var Gr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Xt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Gr.prototype.getInteriorIntersection=function(){return this._interiorIntersection};Gr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t};Gr.prototype.getIntersectionSegments=function(){return this._intSegments};Gr.prototype.count=function(){return this._intersectionCount};Gr.prototype.getIntersections=function(){return this._intersections};Gr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};Gr.prototype.setKeepIntersections=function(t){this._keepIntersections=t};Gr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(n,r);if(!s)return null}var u=t.getCoordinates()[e],p=t.getCoordinates()[e+1],c=n.getCoordinates()[r],b=n.getCoordinates()[r+1];this._li.computeIntersection(u,p,c,b),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=u,this._intSegments[1]=p,this._intSegments[2]=c,this._intSegments[3]=b,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};Gr.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2};Gr.prototype.hasIntersection=function(){return this._interiorIntersection!==null};Gr.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};Gr.prototype.interfaces_=function(){return[bu]};Gr.prototype.getClass=function(){return Gr};Gr.createAllIntersectionsFinder=function(t){var e=new Gr(t);return e.setFindAllIntersections(!0),e};Gr.createAnyIntersectionFinder=function(t){return new Gr(t)};Gr.createIntersectionCounter=function(t){var e=new Gr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var us=function(){this._li=new Ru,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};us.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};us.prototype.getIntersections=function(){return this._segInt.getIntersections()};us.prototype.isValid=function(){return this.execute(),this._isValid};us.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};us.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Gr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new I0;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};us.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ha(this.getErrorMessage(),this._segInt.getInteriorIntersection())};us.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+rs.toLineString(t[0],t[1])+" and "+rs.toLineString(t[2],t[3])};us.prototype.interfaces_=function(){return[]};us.prototype.getClass=function(){return us};us.computeIntersections=function(t){var e=new us(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Eu=function t(){this._nv=null;var e=arguments[0];this._nv=new us(t.toSegmentStrings(e))};Eu.prototype.checkValid=function(){this._nv.checkValid()};Eu.prototype.interfaces_=function(){return[]};Eu.prototype.getClass=function(){return Eu};Eu.toSegmentStrings=function(t){for(var e=new Xt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Ns(r.getCoordinates(),r))}return e};Eu.checkValid=function(t){var e=new Eu(t);e.checkValid()};var Ac=function(t){this._mapOp=t};Ac.prototype.map=function(t){for(var e=this,n=new Xt,r=0;r0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};Wi.prototype.interfaces_=function(){return[]};Wi.prototype.getClass=function(){return Wi};var ma=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new me,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Zn&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],s=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=s}};ma.prototype.snapVertices=function(t,e){for(var n=this,r=this._isClosed?t.size()-1:t.size(),s=0;s=0&&t.add(p+1,new yt(u),!1)}};ma.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=Pe.MAX_VALUE,s=-1,u=0;ue&&(e=r)}return e}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return Math.min(rr.computeOverlaySnapTolerance(s),rr.computeOverlaySnapTolerance(u))}};rr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),r=n*rr.SNAP_PRECISION_FACTOR;return r};rr.snapToSelf=function(t,e,n){var r=new rr(t);return r.snapToSelf(e,n)};XE.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(rr,XE);var YE=function(t){function e(n,r,s){t.call(this),this._snapTolerance=n||null,this._snapPts=r||null,this._isSelfSnap=s!==void 0?s:!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(n,r){var s=new ma(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(r)},e.prototype.transformCoordinates=function(n,r){var s=n.toCoordinateArray(),u=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(u)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wi),_i=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};_i.prototype.getCommon=function(){return Pe.longBitsToDouble(this._commonBits)};_i.prototype.add=function(t){var e=Pe.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=_i.signExpBits(this._commonBits),this._isFirst=!1,null;var n=_i.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=_i.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=_i.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};_i.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=Pe.longBitsToDouble(t),n=Pe.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+n,s=r.substring(r.length-64),u=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return u}};_i.prototype.interfaces_=function(){return[]};_i.prototype.getClass=function(){return _i};_i.getBit=function(t,e){var n=1<>52};_i.zeroLowerBits=function(t,e){var n=(1<=0;r--){if(_i.getBit(t,r)!==_i.getBit(e,r))return n;n++}return 52};var Ol=function(){this._commonCoord=null,this._ccFilter=new Mc},P0={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Ol.prototype.addCommonBits=function(t){var e=new zl(this._commonCoord);t.apply(e),t.geometryChanged()};Ol.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new yt(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new zl(e);return t.apply(n),t.geometryChanged(),t};Ol.prototype.getCommonCoordinate=function(){return this._commonCoord};Ol.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};Ol.prototype.interfaces_=function(){return[]};Ol.prototype.getClass=function(){return Ol};P0.CommonCoordinateFilter.get=function(){return Mc};P0.Translater.get=function(){return zl};Object.defineProperties(Ol,P0);var Mc=function(){this._commonBitsX=new _i,this._commonBitsY=new _i};Mc.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)};Mc.prototype.getCommonCoordinate=function(){return new yt(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};Mc.prototype.interfaces_=function(){return[ua]};Mc.prototype.getClass=function(){return Mc};var zl=function(){this.trans=null;var t=arguments[0];this.trans=t};zl.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)};zl.prototype.isDone=function(){return!1};zl.prototype.isGeometryChanged=function(){return!0};zl.prototype.interfaces_=function(){return[is]};zl.prototype.getClass=function(){return zl};var qr=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};qr.prototype.selfSnap=function(t){var e=new rr(t),n=e.snapTo(t,this._snapTolerance);return n};qr.prototype.removeCommonBits=function(t){this._cbr=new Ol,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e};qr.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t};qr.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=ke.overlayOp(e[0],e[1],t);return this.prepareResult(n)};qr.prototype.checkValid=function(t){t.isValid()||$r.out.println("Snapped geometry is invalid")};qr.prototype.computeSnapTolerance=function(){this._snapTolerance=rr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};qr.prototype.snap=function(t){var e=this.removeCommonBits(t),n=rr.snap(e[0],e[1],this._snapTolerance);return n};qr.prototype.interfaces_=function(){return[]};qr.prototype.getClass=function(){return qr};qr.overlayOp=function(t,e,n){var r=new qr(t,e);return r.getResultGeometry(n)};qr.union=function(t,e){return qr.overlayOp(t,e,ke.UNION)};qr.intersection=function(t,e){return qr.overlayOp(t,e,ke.INTERSECTION)};qr.symDifference=function(t,e){return qr.overlayOp(t,e,ke.SYMDIFFERENCE)};qr.difference=function(t,e){return qr.overlayOp(t,e,ke.DIFFERENCE)};var Ci=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Ci.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=ke.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(n=!0)}catch(u){if(u instanceof qa)r=u;else throw u}finally{}if(!n)try{e=qr.overlayOp(this._geom[0],this._geom[1],t)}catch(u){throw u instanceof qa?r:u}finally{}return e};Ci.prototype.interfaces_=function(){return[]};Ci.prototype.getClass=function(){return Ci};Ci.overlayOp=function(t,e,n){var r=new Ci(t,e);return r.getResultGeometry(n)};Ci.union=function(t,e){return Ci.overlayOp(t,e,ke.UNION)};Ci.intersection=function(t,e){return Ci.overlayOp(t,e,ke.INTERSECTION)};Ci.symDifference=function(t,e){return Ci.overlayOp(t,e,ke.SYMDIFFERENCE)};Ci.difference=function(t,e){return Ci.overlayOp(t,e,ke.DIFFERENCE)};var yd=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};yd.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)};yd.prototype.interfaces_=function(){return[]};yd.prototype.getClass=function(){return yd};var ho=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],u=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=s,this._obj=u}},M0={INSERT:{configurable:!0},DELETE:{configurable:!0}};ho.prototype.isDelete=function(){return this._eventType===ho.DELETE};ho.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t};ho.prototype.getObject=function(){return this._obj};ho.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0};ho.prototype.getInsertEvent=function(){return this._insertEvent};ho.prototype.isInsert=function(){return this._eventType===ho.INSERT};ho.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label};ho.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};ho.prototype.interfaces_=function(){return[jo]};ho.prototype.getClass=function(){return ho};M0.INSERT.get=function(){return 1};M0.DELETE.get=function(){return 2};Object.defineProperties(ho,M0);var Ng=function(){};Ng.prototype.interfaces_=function(){return[]};Ng.prototype.getClass=function(){return Ng};var ti=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};ti.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(ti.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&r===s||r===0&&e===s)return!0}}return!1};ti.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};ti.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t};ti.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};ti.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next(),s=r.getCoordinate();if(t.isIntersection(s))return!0}return!1};ti.prototype.hasProperIntersection=function(){return this._hasProper};ti.prototype.hasIntersection=function(){return this._hasIntersection};ti.prototype.isDone=function(){return this._isDone};ti.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))};ti.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e};ti.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var s=t.getCoordinates()[e],u=t.getCoordinates()[e+1],p=n.getCoordinates()[r],c=n.getCoordinates()[r+1];this._li.computeIntersection(s,u,p,c),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};ti.prototype.interfaces_=function(){return[]};ti.prototype.getClass=function(){return ti};ti.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var VN=function(t){function e(){t.call(this),this.events=new Xt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var n=this;ss.sort(this.events);for(var r=0;re||this._maxu?1:0};_d.prototype.interfaces_=function(){return[ip]};_d.prototype.getClass=function(){return _d};var GN=function(t){function e(){t.call(this),this._item=null;var n=arguments[0],r=arguments[1],s=arguments[2];this._min=n,this._max=r,this._item=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;s.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ga),qN=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var n=arguments[0],r=arguments[1];this._node1=n,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},e.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,s),this._node2!==null&&this._node2.query(n,r,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ga),ya=function(){this._leaves=new Xt,this._root=null,this._level=0};ya.prototype.buildTree=function(){var t=this;ss.sort(this._leaves,new ga.NodeComparator);for(var e=this._leaves,n=null,r=new Xt;;){if(t.buildLevel(e,r),r.size()===1)return r.get(0);n=e,e=r,r=n}};ya.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new GN(t,e,n))};ya.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)};ya.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};ya.prototype.printNode=function(t){$r.out.println(rs.toLineString(new yt(t._min,this._level),new yt(t._max,this._level)))};ya.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};ya.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),s=0,u=n.iterator();u.hasNext();){var p=u.next();r[s++]=p.getCoordinate().copy()}return r},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(n,r,s){if(this.isBoundaryNode(n,r))return null;s===xt.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,s)},e.prototype.addPolygonRing=function(n,r,s){if(n.isEmpty())return null;var u=Ge.removeRepeatedPoints(n.getCoordinates());if(u.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=u[0],null;var p=r,c=s;ee.isCCW(u)&&(p=s,c=r);var b=new Rg(u,new mn(this._argIndex,xt.BOUNDARY,p,c));this._lineEdgeMap.put(n,b),this.insertEdge(b),this.insertPoint(this._argIndex,u[0],xt.BOUNDARY)},e.prototype.insertPoint=function(n,r,s){var u=this._nodes.addNode(r),p=u.getLabel();p===null?u._label=new mn(n,s):p.setLocation(n,s)},e.prototype.createEdgeSetIntersector=function(){return new VN},e.prototype.addSelfIntersectionNodes=function(n){for(var r=this,s=this._edges.iterator();s.hasNext();)for(var u=s.next(),p=u.getLabel().getLocation(n),c=u.eiList.iterator();c.hasNext();){var b=c.next();r.addSelfIntersectionNode(n,b.coord,p)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof aa&&(this._useBoundaryDeterminationRule=!1),n instanceof xr)this.addPolygon(n);else if(n instanceof Zn)this.addLineString(n);else if(n instanceof lo)this.addPoint(n);else if(n instanceof hp)this.addCollection(n);else if(n instanceof _u)this.addCollection(n);else if(n instanceof aa)this.addCollection(n);else if(n instanceof Si)this.addCollection(n);else throw new Error(n.getClass().getName())}else return t.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(n){for(var r=this,s=0;s50?(this._areaPtLocator===null&&(this._areaPtLocator=new _p(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(n,r){return n.isInBoundary(r)?xt.BOUNDARY:xt.INTERIOR},e}(jn),xp=function(){if(this._li=new Ru,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Vf(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=Vo.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vf(0,e,r),this._arg[1]=new Vf(1,n,r)}else if(arguments.length===3){var s=arguments[0],u=arguments[1],p=arguments[2];s.getPrecisionModel().compareTo(u.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(u.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vf(0,s,p),this._arg[1]=new Vf(1,u,p)}};xp.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()};xp.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)};xp.prototype.interfaces_=function(){return[]};xp.prototype.getClass=function(){return xp};var gu=function(){};gu.prototype.interfaces_=function(){return[]};gu.prototype.getClass=function(){return gu};gu.map=function(){if(arguments[0]instanceof Ee&&Ie(arguments[1],gu.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Xt,r=0;r=t.size()?null:t.get(e)};lr.union=function(t){var e=new lr(t);return e.union()};JE.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(lr,JE);var Og=function(){};Og.prototype.interfaces_=function(){return[]};Og.prototype.getClass=function(){return Og};Og.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return ke.createEmptyResult(ke.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ci.overlayOp(t,e,ke.UNION)};function Nu(){return new zg}function zg(){this.reset()}zg.prototype={constructor:zg,reset:function(){this.s=this.t=0},add:function(t){gw(jm,t,this.t),gw(this,jm.s,this.s),this.s?this.t+=jm.t:this.s=jm.t},valueOf:function(){return this.s}};var jm=new zg;function gw(t,e,n){var r=t.s=e+n,s=r-e,u=r-s;t.t=e-u+(n-s)}var Wn=1e-6,xn=Math.PI,Fa=xn/2,yw=xn/4,Xa=xn*2,uu=180/xn,bs=xn/180,bi=Math.abs,jN=Math.atan,wp=Math.atan2,yr=Math.cos,_r=Math.sin,Rp=Math.sqrt;function QE(t){return t>1?0:t<-1?xn:Math.acos(t)}function kc(t){return t>1?Fa:t<-1?-Fa:Math.asin(t)}function Wf(){}function Fg(t,e){t&&vw.hasOwnProperty(t.type)&&vw[t.type](t,e)}var _w={Feature:function(t,e){Fg(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,s=n.length;++rxn?t-Xa:t<-xn?t+Xa:t,e]}zv.invert=zv;function WN(t,e,n){return(t%=Xa)?e||n?tI(ww(t),Sw(e,n)):ww(t):e||n?Sw(e,n):zv}function bw(t){return function(e,n){return e+=t,[e>xn?e-Xa:e<-xn?e+Xa:e,n]}}function ww(t){var e=bw(t);return e.invert=bw(-t),e}function Sw(t,e){var n=yr(t),r=_r(t),s=yr(e),u=_r(e);function p(c,b){var S=yr(b),T=yr(c)*S,L=_r(c)*S,M=_r(b),B=M*n+T*r;return[wp(L*s-B*u,T*n-M*r),kc(B*s+L*u)]}return p.invert=function(c,b){var S=yr(b),T=yr(c)*S,L=_r(c)*S,M=_r(b),B=M*s-L*u;return[wp(L*s+M*u,T*n+B*r),kc(B*n-T*r)]},p}function ZN(t,e,n,r,s,u){if(n){var p=yr(e),c=_r(e),b=r*n;s==null?(s=e+r*Xa,u=e-b/2):(s=Ew(p,s),u=Ew(p,u),(r>0?su)&&(s+=r*Xa));for(var S,T=s;r>0?T>u:T1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function XN(t,e,n,r,s,u){var p=t[0],c=t[1],b=e[0],S=e[1],T=0,L=1,M=b-p,B=S-c,R;if(R=n-p,!(!M&&R>0)){if(R/=M,M<0){if(R0){if(R>L)return;R>T&&(T=R)}if(R=s-p,!(!M&&R<0)){if(R/=M,M<0){if(R>L)return;R>T&&(T=R)}else if(M>0){if(R0)){if(R/=B,B<0){if(R0){if(R>L)return;R>T&&(T=R)}if(R=u-c,!(!B&&R<0)){if(R/=B,B<0){if(R>L)return;R>T&&(T=R)}else if(B>0){if(R0&&(t[0]=p+T*M,t[1]=c+T*B),L<1&&(e[0]=p+L*M,e[1]=c+L*B),!0}}}}}function sg(t,e){return bi(t[0]-e[0])=0;--c)s.point((L=T[c])[0],L[1]);else r(M.x,M.p.x,-1,s);M=M.p}M=M.o,T=M.z,B=!B}while(!M.v);s.lineEnd()}}}function Iw(t){if(e=t.length){for(var e,n=0,r=t[0],s;++ne?1:t>=e?0:NaN}function YN(t){return t.length===1&&(t=KN(t)),{left:function(e,n,r,s){for(r==null&&(r=0),s==null&&(s=e.length);r>>1;t(e[u],n)<0?r=u+1:s=u}return r},right:function(e,n,r,s){for(r==null&&(r=0),s==null&&(s=e.length);r>>1;t(e[u],n)>0?s=u:r=u+1}return r}}}function KN(t){return function(e,n){return rI(t(e),n)}}YN(rI);function iI(t){for(var e=t.length,n,r=-1,s=0,u,p;++r=0;)for(p=t[e],n=p.length;--n>=0;)u[--s]=p[n];return u}var Zf=1e9,Xm=-Zf;function $N(t,e,n,r){function s(S,T){return t<=S&&S<=n&&e<=T&&T<=r}function u(S,T,L,M){var B=0,R=0;if(S==null||(B=p(S,L))!==(R=p(T,L))||b(S,T)<0^L>0)do M.point(B===0||B===3?t:n,B>1?r:e);while((B=(B+L+4)%4)!==R);else M.point(T[0],T[1])}function p(S,T){return bi(S[0]-t)0?0:3:bi(S[0]-n)0?2:1:bi(S[1]-e)0?1:0:T>0?3:2}function c(S,T){return b(S.x,T.x)}function b(S,T){var L=p(S,1),M=p(T,1);return L!==M?L-M:L===0?T[1]-S[1]:L===1?S[0]-T[0]:L===2?S[1]-T[1]:T[0]-S[0]}return function(S){var T=S,L=eI(),M,B,R,W,et,st,ut,gt,St,Bt,zt,Dt={point:Lt,lineStart:se,lineEnd:ge,polygonStart:ie,polygonEnd:wt};function Lt(pe,be){s(pe,be)&&T.point(pe,be)}function Ut(){for(var pe=0,be=0,ae=B.length;ber&&(en-Me)*(r-Ze)>(pn-Ze)*(t-Me)&&++pe:pn<=r&&(en-Me)*(r-Ze)<(pn-Ze)*(t-Me)&&--pe;return pe}function ie(){T=L,M=[],B=[],zt=!0}function wt(){var pe=Ut(),be=zt&&pe,ae=(M=iI(M)).length;(be||ae)&&(S.polygonStart(),be&&(S.lineStart(),u(null,null,1,S),S.lineEnd()),ae&&nI(M,c,pe,u,S),S.polygonEnd()),T=S,M=B=R=null}function se(){Dt.point=Vt,B&&B.push(R=[]),Bt=!0,St=!1,ut=gt=NaN}function ge(){M&&(Vt(W,et),st&&St&&L.rejoin(),M.push(L.result())),Dt.point=Lt,St&&T.lineEnd()}function Vt(pe,be){var ae=s(pe,be);if(B&&R.push([pe,be]),Bt)W=pe,et=be,st=ae,Bt=!1,ae&&(T.lineStart(),T.point(pe,be));else if(ae&&St)T.point(pe,be);else{var Te=[ut=Math.max(Xm,Math.min(Zf,ut)),gt=Math.max(Xm,Math.min(Zf,gt))],tn=[pe=Math.max(Xm,Math.min(Zf,pe)),be=Math.max(Xm,Math.min(Zf,be))];XN(Te,tn,t,e,n,r)?(St||(T.lineStart(),T.point(Te[0],Te[1])),T.point(tn[0],tn[1]),ae||T.lineEnd(),zt=!1):ae&&(T.lineStart(),T.point(pe,be),zt=!1)}ut=pe,gt=be,St=ae}return Dt}}var H_=Nu();function JN(t,e){var n=e[0],r=e[1],s=[_r(n),-yr(n),0],u=0,p=0;H_.reset();for(var c=0,b=t.length;c=0?1:-1,Lt=Dt*zt,Ut=Lt>xn,ie=R*St;if(H_.add(wp(ie*Dt*_r(Lt),W*Bt+ie*yr(Lt))),u+=Ut?zt+Dt*Xa:zt,Ut^M>=n^ut>=n){var wt=Bg(Sp(L),Sp(st));Ov(wt);var se=Bg(s,wt);Ov(se);var ge=(Ut^zt>=0?-1:1)*kc(se[2]);(r>ge||r===ge&&(wt[0]||wt[1]))&&(p+=Ut^zt>=0?1:-1)}}return(u<-Wn||uvd&&(vd=t),eVg&&(Vg=e)}Nu();function oI(t,e,n,r){return function(s,u){var p=e(u),c=s.invert(r[0],r[1]),b=eI(),S=e(b),T=!1,L,M,B,R={point:W,lineStart:st,lineEnd:ut,polygonStart:function(){R.point=gt,R.lineStart=St,R.lineEnd=Bt,M=[],L=[]},polygonEnd:function(){R.point=W,R.lineStart=st,R.lineEnd=ut,M=iI(M);var zt=JN(L,c);M.length?(T||(u.polygonStart(),T=!0),nI(M,eO,zt,n,u)):zt&&(T||(u.polygonStart(),T=!0),u.lineStart(),n(null,null,1,u),u.lineEnd()),T&&(u.polygonEnd(),T=!1),M=L=null},sphere:function(){u.polygonStart(),u.lineStart(),n(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function W(zt,Dt){var Lt=s(zt,Dt);t(zt=Lt[0],Dt=Lt[1])&&u.point(zt,Dt)}function et(zt,Dt){var Lt=s(zt,Dt);p.point(Lt[0],Lt[1])}function st(){R.point=et,p.lineStart()}function ut(){R.point=W,p.lineEnd()}function gt(zt,Dt){B.push([zt,Dt]);var Lt=s(zt,Dt);S.point(Lt[0],Lt[1])}function St(){S.lineStart(),B=[]}function Bt(){gt(B[0][0],B[0][1]),S.lineEnd();var zt=S.clean(),Dt=b.result(),Lt,Ut=Dt.length,ie,wt,se;if(B.pop(),L.push(B),B=null,!!Ut){if(zt&1){if(wt=Dt[0],(ie=wt.length-1)>0){for(T||(u.polygonStart(),T=!0),u.lineStart(),Lt=0;Lt1&&zt&2&&Dt.push(Dt.pop().concat(Dt.shift())),M.push(Dt.filter(tO))}}return R}}function tO(t){return t.length>1}function eO(t,e){return((t=t.x)[0]<0?t[1]-Fa-Wn:Fa-t[1])-((e=e.x)[0]<0?e[1]-Fa-Wn:Fa-e[1])}const Lw=oI(function(){return!0},nO,iO,[-xn,-Fa]);function nO(t){var e=NaN,n=NaN,r=NaN,s;return{lineStart:function(){t.lineStart(),s=1},point:function(u,p){var c=u>0?xn:-xn,b=bi(u-e);bi(b-xn)0?Fa:-Fa),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(c,n),t.point(u,n),s=0):r!==c&&b>=xn&&(bi(e-r)Wn?jN((_r(e)*(u=yr(r))*_r(n)-_r(r)*(s=yr(e))*_r(t))/(s*u*p)):(e+r)/2}function iO(t,e,n,r){var s;if(t==null)s=n*Fa,r.point(-xn,s),r.point(0,s),r.point(xn,s),r.point(xn,0),r.point(xn,-s),r.point(0,-s),r.point(-xn,-s),r.point(-xn,0),r.point(-xn,s);else if(bi(t[0]-e[0])>Wn){var u=t[0]0,s=bi(n)>Wn;function u(T,L,M,B){ZN(B,t,e,M,T,L)}function p(T,L){return yr(T)*yr(L)>n}function c(T){var L,M,B,R,W;return{lineStart:function(){R=B=!1,W=1},point:function(et,st){var ut=[et,st],gt,St=p(et,st),Bt=r?St?0:S(et,st):St?S(et+(et<0?xn:-xn),st):0;if(!L&&(R=B=St)&&T.lineStart(),St!==B&&(gt=b(L,ut),(!gt||sg(L,gt)||sg(ut,gt))&&(ut[0]+=Wn,ut[1]+=Wn,St=p(ut[0],ut[1]))),St!==B)W=0,St?(T.lineStart(),gt=b(ut,L),T.point(gt[0],gt[1])):(gt=b(L,ut),T.point(gt[0],gt[1]),T.lineEnd()),L=gt;else if(s&&L&&r^St){var zt;!(Bt&M)&&(zt=b(ut,L,!0))&&(W=0,r?(T.lineStart(),T.point(zt[0][0],zt[0][1]),T.point(zt[1][0],zt[1][1]),T.lineEnd()):(T.point(zt[1][0],zt[1][1]),T.lineEnd(),T.lineStart(),T.point(zt[0][0],zt[0][1])))}St&&(!L||!sg(L,ut))&&T.point(ut[0],ut[1]),L=ut,B=St,M=Bt},lineEnd:function(){B&&T.lineEnd(),L=null},clean:function(){return W|(R&&B)<<1}}}function b(T,L,M){var B=Sp(T),R=Sp(L),W=[1,0,0],et=Bg(B,R),st=Hm(et,et),ut=et[0],gt=st-ut*ut;if(!gt)return!M&&T;var St=n*st/gt,Bt=-n*ut/gt,zt=Bg(W,et),Dt=Wm(W,St),Lt=Wm(et,Bt);j_(Dt,Lt);var Ut=zt,ie=Hm(Dt,Ut),wt=Hm(Ut,Ut),se=ie*ie-wt*(Hm(Dt,Dt)-1);if(!(se<0)){var ge=Rp(se),Vt=Wm(Ut,(-ie-ge)/wt);if(j_(Vt,Dt),Vt=Nv(Vt),!M)return Vt;var pe=T[0],be=L[0],ae=T[1],Te=L[1],tn;be0^Vt[1]<(bi(Vt[0]-pe)xn^(pe<=Vt[0]&&Vt[0]<=be)){var Ze=Wm(Ut,(-ie+ge)/wt);return j_(Ze,Dt),[Vt,Nv(Ze)]}}}function S(T,L){var M=r?t:xn-t,B=0;return T<-M?B|=1:T>M&&(B|=2),L<-M?B|=4:L>M&&(B|=8),B}return oI(p,c,u,r?[0,-t]:[-xn,t-xn])}function sI(t){return function(e){var n=new Fv;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Fv(){}Fv.prototype={constructor:Fv,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function aI(t,e,n){var r=e[1][0]-e[0][0],s=e[1][1]-e[0][1],u=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),u!=null&&t.clipExtent(null),HN(n,t.stream(Tw));var p=Tw.result(),c=Math.min(r/(p[1][0]-p[0][0]),s/(p[1][1]-p[0][1])),b=+e[0][0]+(r-c*(p[1][0]+p[0][0]))/2,S=+e[0][1]+(s-c*(p[1][1]+p[0][1]))/2;return u!=null&&t.clipExtent(u),t.scale(c*150).translate([b,S])}function sO(t,e,n){return aI(t,[[0,0],e],n)}var Aw=16,aO=yr(30*bs);function Pw(t,e){return+e?uO(t,e):lO(t)}function lO(t){return sI({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function uO(t,e){function n(r,s,u,p,c,b,S,T,L,M,B,R,W,et){var st=S-r,ut=T-s,gt=st*st+ut*ut;if(gt>4*e&&W--){var St=p+M,Bt=c+B,zt=b+R,Dt=Rp(St*St+Bt*Bt+zt*zt),Lt=kc(zt/=Dt),Ut=bi(bi(zt)-1)e||bi((st*ge+ut*Vt)/gt-.5)>.3||p*M+c*B+b*R2?Vt[2]%360*bs:0,se()):[S*uu,T*uu,L*uu]},Ut.precision=function(Vt){return arguments.length?(zt=Pw(wt,Bt=Vt*Vt),ge()):Rp(Bt)},Ut.fitExtent=function(Vt,pe){return aI(Ut,Vt,pe)},Ut.fitSize=function(Vt,pe){return sO(Ut,Vt,pe)};function se(){B=tI(M=WN(S,T,L),e);var Vt=e(c,b);return u=r-Vt[0]*n,p=s+Vt[1]*n,ge()}function ge(){return Dt=Lt=null,Ut}return function(){return e=t.apply(this,arguments),Ut.invert=e.invert&&ie,se()}}function lI(t){return function(e,n){var r=yr(e),s=yr(n),u=t(r*s);return[u*s*_r(e),u*_r(n)]}}function uI(t){return function(e,n){var r=Rp(e*e+n*n),s=t(r),u=_r(s),p=yr(s);return[wp(e*u,r*p),kc(r&&n*u/r)]}}var fO=lI(function(t){return Rp(2/(1+t))});fO.invert=uI(function(t){return 2*kc(t/2)});var cI=lI(function(t){return(t=QE(t))&&t/_r(t)});cI.invert=uI(function(t){return t});function dO(){return hO(cI).scale(79.4188).clipAngle(180-.001)}function Mw(t,e){return[t,e]}Mw.invert=Mw;function mO(t,e,n){n=n||{};var r=n.units||"kilometers",s=n.steps||8;if(!t)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof s!="number")throw new Error("steps must be an number");if(s<=0)throw new Error("steps must be greater than 0");var u=[];switch(t.type){case"GeometryCollection":return IE(t,function(p){var c=ag(p,e,r,s);c&&u.push(c)}),Mv(u);case"FeatureCollection":return hw(t,function(p){var c=ag(p,e,r,s);c&&hw(c,function(b){b&&u.push(b)})}),Mv(u)}return ag(t,e,r,s)}function ag(t,e,n,r){var s=t.properties||{},u=t.type==="Feature"?t.geometry:t;if(u.type==="GeometryCollection"){var p=[];return IE(t,function(W){var et=ag(W,e,n,r);et&&p.push(et)}),Mv(p)}var c=gO(u),b={type:u.type,coordinates:pI(u.coordinates,c)},S=new E0,T=S.read(b),L=SN(EN(e,n),"meters"),M=Yr.bufferOp(T,L,r),B=new NE;if(M=B.write(M),!hI(M.coordinates)){var R={type:M.type,coordinates:fI(M.coordinates,c)};return Qg(R,s)}}function hI(t){return Array.isArray(t[0])?hI(t[0]):isNaN(t[0])}function pI(t,e){return typeof t[0]!="object"?e(t):t.map(function(n){return pI(n,e)})}function fI(t,e){return typeof t[0]!="object"?e.invert(t):t.map(function(n){return fI(n,e)})}function gO(t){var e=CN(t).geometry.coordinates,n=[-e[0],-e[1]];return dO().rotate(n).scale(bo)}function yO(t,e){var n=Mg(t),r=Mg(e),s=t.properties||{},u=xE.difference(n.coordinates,r.coordinates);return u.length===0?null:u.length===1?wE(u[0],s):SE(u,s)}function kw(t){let e;for(const n of t)e&&n[0]-e[0]>=180?n[0]-=360:e&&n[0]-e[0]<-180&&(n[0]+=360),e=n}function Dw(t,e){const n=yO({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},t);if(!n)return;n.properties={isMask:"y"};const r=mO(t,0);if(r.geometry.type==="Polygon")for(const s of r.geometry.coordinates)kw(s);else for(const s of r.geometry.coordinates)for(const u of s)kw(u);e({type:"FeatureCollection",features:[r,n]})}let Rw={type:"FeatureCollection",features:[]};function sz(t,e,n=!0,r=!0,s={},u={},p={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let c,b=[],S,T;function L(){(p!=null&&p.fill||p!=null&&p.line)&&t.addSource("full-geom",{type:"geojson",data:Rw}),p!=null&&p.fill&&t.addLayer({...p==null?void 0:p.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),p!=null&&p.line&&t.addLayer({...p==null?void 0:p.line,id:"full-geom-line",type:"line",source:"full-geom"})}t.loaded()?L():t.once("load",()=>{L()});const M=R=>{c==null||c({type:"mapClick",coordinates:[R.lngLat.lng,R.lngLat.lat]})};function B(R=!1){if(!e)throw new Error;const W=document.createElement("div");return R&&W.classList.add("marker-interactive"),new ZR({props:{displayIn:"maplibre"},target:W}),new e.Marker({element:W,offset:[1,-13]})}return{setEventHandler(R){R?(c=R,t.on("click",M)):(c=void 0,t.off("click",M))},flyTo(R,W){t.flyTo({center:R,zoom:W,...s})},fitBounds(R,W,et){t.fitBounds([[R[0],R[1]],[R[2],R[3]]],{padding:W,maxZoom:et,...u})},indicateReverse(R){t.getCanvasContainer().style.cursor=R?"crosshair":""},setReverseMarker(R){!e||!n||(T?R?T.setLngLat(R):(T.remove(),T=void 0):R&&(T=(typeof n=="object"?new e.Marker(n):B()).setLngLat(R).addTo(t),T.getElement().classList.add("marker-reverse")))},setMarkers(R,W){if(!n)return;function et(st){var ut;(ut=t.getSource("full-geom"))==null||ut.setData(st)}for(const st of b)st.remove();if(b.length=0,et(Rw),!!e){if(W){let st=!1;if(W.geometry.type==="GeometryCollection"){const ut=W.geometry.geometries.filter(gt=>gt.type==="Polygon"||gt.type==="MultiPolygon");if(ut.length>0){let gt=ut.pop();for(const St of ut)gt=IN(gt,St);Dw({...W,geometry:gt},et),st=!0}else{const gt=W.geometry.geometries.filter(St=>St.type==="LineString"||St.type==="MultiLineString");gt.length>0&&(et({...W,geometry:{type:"GeometryCollection",geometries:gt}}),st=!0)}}if(!st){if(W.geometry.type==="Polygon"||W.geometry.type==="MultiPolygon")Dw(W,et);else if(W.geometry.type==="LineString"||W.geometry.type==="MultiLineString"){et(W);return}}n&&b.push((typeof n=="object"?new e.Marker(n):B()).setLngLat(W.center).addTo(t))}if(r)for(const st of R??[]){if(st===W)continue;const ut=(typeof r=="object"?new e.Marker(r):B(!0)).setLngLat(st.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(st.place_type[0]==="reverse"?st.place_name:st.place_name.replace(/,.*/,""))).addTo(t),gt=ut.getElement();gt.addEventListener("click",St=>{St.stopPropagation(),c==null||c({type:"markerClick",id:st.id})}),gt.addEventListener("mouseenter",()=>{c==null||c({type:"markerMouseEnter",id:st.id}),ut.togglePopup()}),gt.addEventListener("mouseleave",()=>{c==null||c({type:"markerMouseLeave",id:st.id}),ut.togglePopup()}),b.push(ut)}}},setSelectedMarker(R){S&&S.getElement().classList.toggle("marker-selected",!1),S=R>-1?b[R]:void 0,S==null||S.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const R=t.getCenter();return[t.getZoom(),R.lng,R.lat]}}}const _O=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,Nw=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,Ow=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,zw=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,Fw=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,Bw=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function vO(t){if(!["DMS","DM","DD"].includes(t))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(B=>Number(B.trim())),n=Number(e[0]),r=Number(e[1]),s=Math.abs(n),u=Math.abs(r),p=n>0?"N":"S",c=r>0?"E":"W";let b;t=="DD"&&(b=`${s}° ${p}, ${u}° ${c}`);const S=Math.floor(s),T=Math.floor(u),L=(s-S)*60,M=(u-T)*60;if(t=="DM"){let B=Uw(L,3).toFixed(3).padStart(6,"0"),R=Uw(M,3).toFixed(3).padStart(6,"0");B.endsWith(".000")&&R.endsWith(".000")&&(B=B.replace(/\.000$/,""),R=R.replace(/\.000$/,"")),b=`${S}° ${B}' ${p}, ${T}° ${R}' ${c}`}if(t=="DMS"){const B=Math.floor(L),R=Math.floor(M);let W=((L-B)*60).toFixed(1).padStart(4,"0"),et=((M-R)*60).toFixed(1).padStart(4,"0");const st=B.toString().padStart(2,"0"),ut=R.toString().padStart(2,"0");W.endsWith(".0")&&et.endsWith(".0")&&(W=W.replace(/\.0$/,""),et=et.replace(/\.0$/,"")),b=`${S}° ${st}' ${W}" ${p}, ${T}° ${ut}' ${et}" ${c}`}return b}else throw new Error("no decimal coordinates to convert")}function Uw(t,e){const n=Math.pow(10,e);return Math.round((t+Number.EPSILON)*n)/n}function D0(t,e){e||(e=5),t=t.replace(/\s+/g," ").trim();let n=null,r=null,s="",u="",p=null,c=[],b=!1;if(_O.test(t))throw new Error("invalid coordinate value");if(Nw.test(t))if(c=Nw.exec(t),b=Gf(c),b)n=Math.abs(c[1])+c[2]/60,Number(c[1])<0&&(n*=-1),r=Math.abs(c[3])+c[4]/60,Number(c[3])<0&&(r*=-1),p="DM";else throw new Error("invalid coordinate format");else if(Ow.test(t))if(c=Ow.exec(t),b=Gf(c),b){if(n=c[2],r=c[6],n.includes(",")&&(n=n.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),p="DD",Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");c[1]?(s=c[1],u=c[5]):c[4]&&(s=c[4],u=c[8])}else throw new Error("invalid decimal coordinate format");else if(zw.test(t))if(c=zw.exec(t),b=Gf(c),b)n=Math.abs(parseInt(c[2])),c[4]&&(n+=c[4]/60,p="DM"),c[6]&&(n+=c[6].replace(",",".")/3600,p="DMS"),parseInt(c[2])<0&&(n=-1*n),r=Math.abs(parseInt(c[9])),c[11]&&(r+=c[11]/60),c[13]&&(r+=c[13].replace(",",".")/3600),parseInt(c[9])<0&&(r=-1*r),c[1]?(s=c[1],u=c[8]):c[7]&&(s=c[7],u=c[14]);else throw new Error("invalid DMS coordinates format");else if(Fw.test(t))if(c=Fw.exec(t),b=Gf(c),b)n=Math.abs(parseInt(c[2])),c[4]&&(n+=c[4]/60,p="DM"),c[6]&&(n+=c[6]/3600,p="DMS"),parseInt(c[2])<0&&(n=-1*n),r=Math.abs(parseInt(c[10])),c[12]&&(r+=c[12]/60),c[14]&&(r+=c[14]/3600),parseInt(c[10])<0&&(r=-1*r),c[1]?(s=c[1],u=c[9]):c[8]&&(s=c[8],u=c[16]);else throw new Error("invalid DMS coordinates format");else if(Bw.test(t)){if(c=Bw.exec(t),b=Gf(c),c.filter(S=>S).length<=5)throw new Error("invalid coordinates format");if(b)n=Math.abs(parseInt(c[2])),c[4]&&(n+=c[4].replace(",",".")/60,p="DM"),c[6]&&(n+=c[6].replace(",",".")/3600,p="DMS"),parseInt(c[2])<0&&(n=-1*n),r=Math.abs(parseInt(c[10])),c[12]&&(r+=c[12].replace(",",".")/60),c[14]&&(r+=c[14].replace(",",".")/3600),parseInt(c[10])<0&&(r=-1*r),c[1]?(s=c[1],u=c[9]):c[8]&&(s=c[8],u=c[16]);else throw new Error("invalid coordinates format")}if(b){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(n)>=90)throw new Error("invalid latitude value");if(s&&!u||!s&&u)throw new Error("invalid coordinates value");if(s&&s==u)throw new Error("invalid coordinates format");n.toString().includes(",")&&(n=n.replace(",",".")),r.toString().includes(",")&&(r=r.replace(",","."));let S=/S|SOUTH/i;S.test(s)&&n>0&&(n=-1*n),S=/W|WEST/i,S.test(u)&&r>0&&(r=-1*r);const T=c[0].trim();let L,M;const B=/[,/;\u0020]/g,R=T.match(B);if(R==null){const st=Math.floor(t.length/2);L=T.substring(0,st).trim(),M=T.substring(st).trim()}else{let st;R.length%2==1?st=Math.floor(R.length/2):st=R.length/2-1;let ut=0;if(st==0)ut=T.indexOf(R[0]),L=T.substring(0,ut).trim(),M=T.substring(ut+1).trim();else{let gt=0,St=0;for(;gt<=st;)ut=T.indexOf(R[gt],St),St=ut+1,gt++;L=T.substring(0,ut).trim(),M=T.substring(ut+1).trim()}}const W=L.split(".");if(W.length==2&&W[1]==0&&W[1].length!=2)throw new Error("invalid coordinates format");const et=M.split(".");if(et.length==2&&et[1]==0&&et[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(L)||/^\d+$/.test(M))throw new Error("degree only coordinate/s provided");return n=Number(Number(n).toFixed(e)),r=Number(Number(r).toFixed(e)),Object.freeze({verbatimCoordinates:T,verbatimLatitude:L,verbatimLongitude:M,decimalLatitude:n,decimalLongitude:r,decimalCoordinates:`${n},${r}`,originalFormat:p,closeEnough:xO,toCoordinateFormat:vO})}else throw new Error("coordinates pattern match failed")}function Gf(t){if(!isNaN(t[0]))return!1;const e=[...t];if(e.shift(),e.length%2>0)return!1;const n=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,s=e.length/2;for(let u=0;u{e.decimalLatitude?t.push(e):t.push({...e,...SO})}),[...t,...EO,...IO]}const TO=CO();D0.formats=TO.map(t=>t.verbatimCoordinates);const az=D0;const lz="/atip/browse_layout_v3/assets/ate_logo-5c8f1b25.png";function Gw(t){let e,n;return e=new dL({props:{$$slots:{default:[LO]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){oo(e.$$.fragment)},m(r,s){Gi(e,r,s),n=!0},p(r,s){const u={};s&128&&(u.$$scope={dirty:s,ctx:r}),e.$set(u)},i(r){n||(_e(e.$$.fragment,r),n=!0)},o(r){Le(e.$$.fragment,r),n=!1},d(r){qi(e,r)}}}function LO(t){let e;return{c(){e=Ka("X")},m(n,r){an(n,e,r)},d(n){n&&on(e)}}}function AO(t){let e,n,r,s,u,p,c,b,S,T,L=t[2]&&Gw(t);const M=t[4].default,B=zs(M,t,t[7],null);return{c(){e=An("div"),n=An("div"),r=An("div"),s=An("h1"),u=Ka(t[1]),p=ri(),L&&L.c(),c=ri(),B&&B.c(),We(s,"class","govuk-heading-l"),gx(r,"display","flex"),gx(r,"justify-content","space-between"),We(n,"class","content centered-fullscreen svelte-1st8ub0"),We(e,"class","background svelte-1st8ub0"),za(e,"open",t[0]),za(e,"closed",!t[0])},m(R,W){an(R,e,W),Gn(e,n),Gn(n,r),Gn(r,s),Gn(s,u),Gn(r,p),L&&L.m(r,null),Gn(n,c),B&&B.m(n,null),b=!0,S||(T=[Ba(n,"click",kT(PO)),Ba(e,"click",t[6])],S=!0)},p(R,[W]){(!b||W&2)&&Ip(u,R[1]),R[2]?L?(L.p(R,W),W&4&&_e(L,1)):(L=Gw(R),L.c(),_e(L,1),L.m(r,null)):L&&(_a(),Le(L,1,1,()=>{L=null}),va()),B&&B.p&&(!b||W&128)&&Bs(B,M,R,R[7],b?Fs(M,R[7],W,null):Us(R[7]),null),(!b||W&1)&&za(e,"open",R[0]),(!b||W&1)&&za(e,"closed",!R[0])},i(R){b||(_e(L),_e(B,R),b=!0)},o(R){Le(L),Le(B,R),b=!1},d(R){R&&on(e),L&&L.d(),B&&B.d(R),S=!1,Ya(T)}}}const PO=()=>null;function MO(t,e,n){let{$$slots:r={},$$scope:s}=e,{title:u}=e,{open:p=!1}=e,{displayEscapeButton:c=!0}=e,{canCloseByClickingBackground:b=!0}=e;const S=()=>n(0,p=!1),T=()=>{b&&n(0,p=!1)};return t.$$set=L=>{"title"in L&&n(1,u=L.title),"open"in L&&n(0,p=L.open),"displayEscapeButton"in L&&n(2,c=L.displayEscapeButton),"canCloseByClickingBackground"in L&&n(3,b=L.canCloseByClickingBackground),"$$scope"in L&&n(7,s=L.$$scope)},[p,u,c,b,r,S,T,s]}class uz extends wr{constructor(e){super(),br(this,e,MO,AO,Yn,{title:1,open:0,displayEscapeButton:2,canCloseByClickingBackground:3})}}var Gg=kO;function kO(t){var e,n,r;if(t){if(Array.isArray(t)){for(e=[],n=t.length,r=0;rnew Promise((r,s)=>{var u=b=>{try{c(n.next(b))}catch(S){s(S)}},p=b=>{try{c(n.throw(b))}catch(S){s(S)}},c=b=>b.done?r(b.value):Promise.resolve(b.value).then(u,p);c((n=n.apply(t,e)).next())}),ts=Uint8Array,Yh=Uint16Array,NO=Int32Array,dI=new ts([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mI=new ts([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),OO=new ts([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gI=function(t,e){for(var n=new Yh(31),r=0;r<31;++r)n[r]=e+=1<>1|(Tn&21845)<<1,wl=(wl&52428)>>2|(wl&13107)<<2,wl=(wl&61680)>>4|(wl&3855)<<4,Bv[Tn]=((wl&65280)>>8|(wl&255)<<8)>>1;var wl,Tn,td=function(t,e,n){for(var r=t.length,s=0,u=new Yh(e);s>b]=S}else for(c=new Yh(r),s=0;s>15-t[s]);return c},Md=new ts(288);for(Tn=0;Tn<144;++Tn)Md[Tn]=8;var Tn;for(Tn=144;Tn<256;++Tn)Md[Tn]=9;var Tn;for(Tn=256;Tn<280;++Tn)Md[Tn]=7;var Tn;for(Tn=280;Tn<288;++Tn)Md[Tn]=8;var Tn,vI=new ts(32);for(Tn=0;Tn<32;++Tn)vI[Tn]=5;var Tn,UO=td(Md,9,1),VO=td(vI,5,1),W_=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},ea=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},Z_=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},GO=function(t){return(t+7)/8|0},qO=function(t,e,n){(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length);var r=new ts(n-e);return r.set(t.subarray(e,n)),r},jO=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Qo=function(t,e,n){var r=new Error(e||jO[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Qo),!n)throw r;return r},N0=function(t,e,n,r){var s=t.length,u=r?r.length:0;if(!s||e.f&&!e.l)return n||new ts(0);var p=!n||e.i!=2,c=e.i;n||(n=new ts(s*3));var b=function(Kn){var cr=n.length;if(Kn>cr){var jr=new ts(Math.max(cr*2,Kn));jr.set(n),n=jr}},S=e.f||0,T=e.p||0,L=e.b||0,M=e.l,B=e.d,R=e.m,W=e.n,et=s*8;do{if(!M){S=ea(t,T,1);var st=ea(t,T+1,3);if(T+=3,st)if(st==1)M=UO,B=VO,R=9,W=5;else if(st==2){var Bt=ea(t,T,31)+257,zt=ea(t,T+10,15)+4,Dt=Bt+ea(t,T+5,31)+1;T+=14;for(var Lt=new ts(Dt),Ut=new ts(19),ie=0;ie>4;if(ut<16)Lt[ie++]=ut;else{var pe=0,be=0;for(ut==16?(be=3+ea(t,T,3),T+=2,pe=Lt[ie-1]):ut==17?(be=3+ea(t,T,7),T+=3):ut==18&&(be=11+ea(t,T,127),T+=7);be--;)Lt[ie++]=pe}}var ae=Lt.subarray(0,Bt),Te=Lt.subarray(Bt);R=W_(ae),W=W_(Te),M=td(ae,R,1),B=td(Te,W,1)}else Qo(1);else{var ut=GO(T)+4,gt=t[ut-4]|t[ut-3]<<8,St=ut+gt;if(St>s){c&&Qo(0);break}p&&b(L+gt),n.set(t.subarray(ut,St),L),e.b=L+=gt,e.p=T=St*8,e.f=S;continue}if(T>et){c&&Qo(0);break}}p&&b(L+131072);for(var tn=(1<>4;if(T+=pe&15,T>et){c&&Qo(0);break}if(pe||Qo(2),Me<256)n[L++]=Me;else if(Me==256){He=T,M=null;break}else{var Ze=Me-254;if(Me>264){var ie=Me-257,en=dI[ie];Ze=ea(t,T,(1<>4;pn||Qo(3),T+=pn&15;var Te=BO[gn];if(gn>3){var en=mI[gn];Te+=Z_(t,T)&(1<et){c&&Qo(0);break}p&&b(L+131072);var bn=L+Ze;if(L>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},ZO=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},XO=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&Qo(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&Qo(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2};function YO(t,e){return N0(t,{i:2},e&&e.out,e&&e.dictionary)}function KO(t,e){var n=WO(t);return n+8>t.length&&Qo(6,"invalid gzip data"),N0(t.subarray(n,-8),{i:2},e&&e.out||new ts(ZO(t)),e&&e.dictionary)}function $O(t,e){return N0(t.subarray(XO(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function Uv(t,e){return t[0]==31&&t[1]==139&&t[2]==8?KO(t,e):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?YO(t,e):$O(t,e)}var JO=typeof TextDecoder<"u"&&new TextDecoder,QO=0;try{JO.decode(HO,{stream:!0}),QO=1}catch{}var xI=(t,e)=>t*Qh(2,e),qf=(t,e)=>Math.floor(t/Qh(2,e)),qg=(t,e)=>xI(t.getUint16(e+1,!0),8)+t.getUint8(e),bI=(t,e)=>xI(t.getUint32(e+2,!0),16)+t.getUint16(e,!0),t3=(t,e,n,r,s)=>{if(t!==r.getUint8(s))return t-r.getUint8(s);const u=qg(r,s+1);if(e!==u)return e-u;const p=qg(r,s+4);return n!==p?n-p:0},e3=(t,e,n,r)=>{const s=wI(t,e|128,n,r);return s?{z:e,x:n,y:r,offset:s[0],length:s[1],isDir:!0}:null},jw=(t,e,n,r)=>{const s=wI(t,e,n,r);return s?{z:e,x:n,y:r,offset:s[0],length:s[1],isDir:!1}:null},wI=(t,e,n,r)=>{let s=0,u=t.byteLength/17-1;for(;s<=u;){const p=u+s>>1,c=t3(e,n,r,t,p*17);if(c>0)s=p+1;else if(c<0)u=p-1;else return[bI(t,p*17+7),t.getUint32(p*17+13,!0)]}return null},n3=(t,e)=>t.isDir&&!e.isDir?1:!t.isDir&&e.isDir?-1:t.z!==e.z?t.z-e.z:t.x!==e.x?t.x-e.x:t.y-e.y,SI=(t,e)=>{const n=t.getUint8(e*17);return{z:n&127,x:qg(t,e*17+1),y:qg(t,e*17+4),offset:bI(t,e*17+7),length:t.getUint32(e*17+13,!0),isDir:n>>7===1}},Hw=t=>{const e=[],n=new DataView(t);for(let r=0;r{t.sort(n3);const e=new ArrayBuffer(17*t.length),n=new Uint8Array(e);for(let r=0;r>8&255,n[r*17+3]=s.x>>16&255,n[r*17+4]=s.y&255,n[r*17+5]=s.y>>8&255,n[r*17+6]=s.y>>16&255,n[r*17+7]=s.offset&255,n[r*17+8]=qf(s.offset,8)&255,n[r*17+9]=qf(s.offset,16)&255,n[r*17+10]=qf(s.offset,24)&255,n[r*17+11]=qf(s.offset,32)&255,n[r*17+12]=qf(s.offset,48)&255,n[r*17+13]=s.length&255,n[r*17+14]=s.length>>8&255,n[r*17+15]=s.length>>16&255,n[r*17+16]=s.length>>24&255}return e},i3=(t,e)=>{if(t.byteLength<17)return null;const n=t.byteLength/17,r=SI(t,n-1);if(r.isDir){const s=r.z,u=e.z-s,p=Math.trunc(e.x/(1<(e,n)=>{if(n instanceof AbortController)return t(e,n);const r=new AbortController;return t(e,r).then(s=>n(void 0,s.data,s.cacheControl||"",s.expires||""),s=>n(s)).catch(s=>n(s)),{cancel:()=>r.abort()}},cz=class{constructor(){this.tilev4=(t,e)=>io(this,null,function*(){if(t.type==="json"){const L=t.url.substr(10);let M=this.tiles.get(L);M||(M=new Ww(L),this.tiles.set(L,M));const B=yield M.getHeader();return{data:{tiles:[`${t.url}/{z}/{x}/{y}`],minzoom:B.minZoom,maxzoom:B.maxZoom,bounds:[B.minLon,B.minLat,B.maxLon,B.maxLat]}}}const n=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),r=t.url.match(n);if(!r)throw new Error("Invalid PMTiles protocol URL");const s=r[1];let u=this.tiles.get(s);u||(u=new Ww(s),this.tiles.set(s,u));const p=r[2],c=r[3],b=r[4],S=yield u.getHeader(),T=yield u==null?void 0:u.getZxy(+p,+c,+b,e.signal);return T?{data:new Uint8Array(T.data),cacheControl:T.cacheControl,expires:T.expires}:S.tileType===1?{data:new Uint8Array}:{data:null}}),this.tile=a3(this.tilev4),this.tiles=new Map}add(t){this.tiles.set(t.source.getKey(),t)}get(t){return this.tiles.get(t)}};function qh(t,e){return(e>>>0)*4294967296+(t>>>0)}function l3(t,e){const n=e.buf;let r=n[e.pos++],s=(r&112)>>4;if(r<128||(r=n[e.pos++],s|=(r&127)<<3,r<128)||(r=n[e.pos++],s|=(r&127)<<10,r<128)||(r=n[e.pos++],s|=(r&127)<<17,r<128)||(r=n[e.pos++],s|=(r&127)<<24,r<128)||(r=n[e.pos++],s|=(r&1)<<31,r<128))return qh(t,s);throw new Error("Expected varint not more than 10 bytes")}function jf(t){const e=t.buf;let n=e[t.pos++],r=n&127;return n<128||(n=e[t.pos++],r|=(n&127)<<7,n<128)||(n=e[t.pos++],r|=(n&127)<<14,n<128)||(n=e[t.pos++],r|=(n&127)<<21,n<128)?r:(n=e[t.pos],r|=(n&15)<<28,l3(r,t))}function u3(t,e,n,r){if(r===0){n===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);const s=e[0];e[0]=e[1],e[1]=s}}var c3=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function h3(t,e,n){if(t>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(e>Qh(2,t)-1||n>Qh(2,t)-1)throw Error("tile x/y outside zoom level bounds");const r=c3[t],s=Qh(2,t);let u=0,p=0,c=0;const b=[e,n];let S=s/2;for(;S>0;)u=(b[0]&S)>0?1:0,p=(b[1]&S)>0?1:0,c+=S*S*(3*u^p),u3(S,b,u,p),S=S/2;return r+c}function II(t,e){return io(this,null,function*(){if(e===1||e===0)return t;if(e===2){if(typeof globalThis.DecompressionStream>"u")return Uv(new Uint8Array(t));const n=new Response(t).body;if(!n)throw Error("Failed to read response stream");const r=n.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(r).arrayBuffer()}throw Error("Compression method not supported")})}var p3=127;function f3(t,e){let n=0,r=t.length-1;for(;n<=r;){const s=r+n>>1,u=e-t[s].tileId;if(u>0)n=s+1;else if(u<0)r=s-1;else return t[s]}return r>=0&&(t[r].runLength===0||e-t[r].tileId=300)throw Error(`Bad response code: ${b.status}`);const T=b.headers.get("Content-Length");if(b.status===200&&(!T||+T>e))throw s&&s.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield b.arrayBuffer(),etag:S||void 0,cacheControl:b.headers.get("Cache-Control")||void 0,expires:b.headers.get("Expires")||void 0}})}};function na(t,e){const n=t.getUint32(e+4,!0),r=t.getUint32(e+0,!0);return n*Qh(2,32)+r}function m3(t,e){const n=new DataView(t),r=n.getUint8(7);if(r>3)throw Error(`Archive is spec version ${r} but this library supports up to spec version 3`);return{specVersion:r,rootDirectoryOffset:na(n,8),rootDirectoryLength:na(n,16),jsonMetadataOffset:na(n,24),jsonMetadataLength:na(n,32),leafDirectoryOffset:na(n,40),leafDirectoryLength:na(n,48),tileDataOffset:na(n,56),tileDataLength:na(n,64),numAddressedTiles:na(n,72),numTileEntries:na(n,80),numTileContents:na(n,88),clustered:n.getUint8(96)===1,internalCompression:n.getUint8(97),tileCompression:n.getUint8(98),tileType:n.getUint8(99),minZoom:n.getUint8(100),maxZoom:n.getUint8(101),minLon:n.getInt32(102,!0)/1e7,minLat:n.getInt32(106,!0)/1e7,maxLon:n.getInt32(110,!0)/1e7,maxLat:n.getInt32(114,!0)/1e7,centerZoom:n.getUint8(118),centerLon:n.getInt32(119,!0)/1e7,centerLat:n.getInt32(123,!0)/1e7,etag:e}}function CI(t){const e={buf:new Uint8Array(t),pos:0},n=jf(e),r=[];let s=0;for(let u=0;u0?r[u].offset=r[u-1].offset+r[u-1].length:r[u].offset=p-1}return r}function g3(t){const e=new DataView(t);return e.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):e.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var Vv=class extends Error{};function y3(t,e){return io(this,null,function*(){const n=yield t.getBytes(0,16384);if(new DataView(n.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(g3(n.data)<3)return[yield EI.getHeader(t)];const s=n.data.slice(0,p3),u=m3(s,n.etag),p=n.data.slice(u.rootDirectoryOffset,u.rootDirectoryOffset+u.rootDirectoryLength),c=`${t.getKey()}|${u.etag||""}|${u.rootDirectoryOffset}|${u.rootDirectoryLength}`,b=CI(yield e(p,u.internalCompression));return[u,[c,b.length,b]]})}function _3(t,e,n,r,s){return io(this,null,function*(){const u=yield t.getBytes(n,r,void 0,s.etag),p=yield e(u.data,s.internalCompression),c=CI(p);if(c.length===0)throw new Error("Empty directory is invalid");return c})}var v3=class{constructor(t=100,e=!0,n=II){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=t,this.counter=1,this.decompress=n}getHeader(t){return io(this,null,function*(){const e=t.getKey(),n=this.cache.get(e);if(n)return n.lastUsed=this.counter++,yield n.data;const r=new Promise((s,u)=>{y3(t,this.decompress).then(p=>{p[1]&&this.cache.set(p[1][0],{lastUsed:this.counter++,data:Promise.resolve(p[1][2])}),s(p[0]),this.prune()}).catch(p=>{u(p)})});return this.cache.set(e,{lastUsed:this.counter++,data:r}),r})}getDirectory(t,e,n,r){return io(this,null,function*(){const s=`${t.getKey()}|${r.etag||""}|${e}|${n}`,u=this.cache.get(s);if(u)return u.lastUsed=this.counter++,yield u.data;const p=new Promise((c,b)=>{_3(t,this.decompress,e,n,r).then(S=>{c(S),this.prune()}).catch(S=>{b(S)})});return this.cache.set(s,{lastUsed:this.counter++,data:p}),p})}getArrayBuffer(t,e,n,r){return io(this,null,function*(){const s=`${t.getKey()}|${r.etag||""}|${e}|${n}`,u=this.cache.get(s);if(u)return u.lastUsed=this.counter++,yield u.data;const p=new Promise((c,b)=>{t.getBytes(e,n,void 0,r.etag).then(S=>{c(S.data),this.cache.has(s),this.prune()}).catch(S=>{b(S)})});return this.cache.set(s,{lastUsed:this.counter++,data:p}),p})}prune(){if(this.cache.size>=this.maxCacheEntries){let t=1/0,e;this.cache.forEach((n,r)=>{n.lastUsed{this.getHeader(t).then(u=>{r(),this.invalidations.delete(e)}).catch(u=>{s(u)})});this.invalidations.set(e,n)})}},Ww=class{constructor(t,e,n){typeof t=="string"?this.source=new d3(t):this.source=t,n?this.decompress=n:this.decompress=II,e?this.cache=e:this.cache=new v3}getHeader(){return io(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(t,e,n,r){return io(this,null,function*(){const s=h3(t,e,n),u=yield this.cache.getHeader(this.source);if(u.specVersion<3)return EI.getZxy(u,this.source,this.cache,t,e,n,r);if(tu.maxZoom)return;let p=u.rootDirectoryOffset,c=u.rootDirectoryLength;for(let b=0;b<=3;b++){const S=yield this.cache.getDirectory(this.source,p,c,u),T=f3(S,s);if(T){if(T.runLength>0){const L=yield this.source.getBytes(u.tileDataOffset+T.offset,T.length,r,u.etag);return{data:yield this.decompress(L.data,u.tileCompression),cacheControl:L.cacheControl,expires:L.expires}}p=u.leafDirectoryOffset+T.offset,c=T.length}else return}throw Error("Maximum directory depth exceeded")})}getZxy(t,e,n,r){return io(this,null,function*(){try{return yield this.getZxyAttempt(t,e,n,r)}catch(s){if(s instanceof Vv)return this.cache.invalidate(this.source),yield this.getZxyAttempt(t,e,n,r);throw s}})}getMetadataAttempt(){return io(this,null,function*(){const t=yield this.cache.getHeader(this.source),e=yield this.source.getBytes(t.jsonMetadataOffset,t.jsonMetadataLength,void 0,t.etag),n=yield this.decompress(e.data,t.internalCompression),r=new TextDecoder("utf-8");return JSON.parse(r.decode(n))})}getMetadata(){return io(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(t){if(t instanceof Vv)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw t}})}};function x3(t){return t=="google"||t=="bing"}var Fi=[];for(var X_=0;X_<256;++X_)Fi.push((X_+256).toString(16).slice(1));function b3(t,e=0){return(Fi[t[e+0]]+Fi[t[e+1]]+Fi[t[e+2]]+Fi[t[e+3]]+"-"+Fi[t[e+4]]+Fi[t[e+5]]+"-"+Fi[t[e+6]]+Fi[t[e+7]]+"-"+Fi[t[e+8]]+Fi[t[e+9]]+"-"+Fi[t[e+10]]+Fi[t[e+11]]+Fi[t[e+12]]+Fi[t[e+13]]+Fi[t[e+14]]+Fi[t[e+15]]).toLowerCase()}var Ym,w3=new Uint8Array(16);function S3(){if(!Ym&&(Ym=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ym))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ym(w3)}var E3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Zw={randomUUID:E3};function I3(t,e,n){if(Zw.randomUUID&&!e&&!t)return Zw.randomUUID();t=t||{};var r=t.random||(t.rng||S3)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var s=0;s<16;++s)e[n+s]=r[s];return e}return b3(r)}const hz={hovering:"black",lineEndpointColor:"black"},pz=10,fz=10;function C3(){return T3(["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"])}function T3(t){return t[Math.floor(Math.random()*t.length)]}const dz=Tr(null),mz=Tr(null),gz=Tr(null),yz=Tr(new Set),L3=Tr(null),A3=Tr({mode:"list"});function _z(t){let e=new Set;for(let r of t.features)e.add(r.id);let n=e.size+1;for(;e.has(n);)n++;return n}function vz(t,e){console.log(`Deleting intervention ${e}`),t.update(n=>(n.features=n.features.filter(r=>r.id!=e),n)),L3.set(null),A3.set({mode:"list"})}function xz(t){return Object.values(t.schemes)[0].scheme_reference}function bz(t){return[Math.round(t[0]*1e7)/1e7,Math.round(t[1]*1e7)/1e7]}const P3=Tr(M3());P3.subscribe(t=>window.localStorage.setItem("userSettings",JSON.stringify(t)));function M3(){let t={streetViewImagery:"google",avoidDoublingBack:!1};try{let e=JSON.parse(window.localStorage.getItem("userSettings")||"{}");x3(e.streetViewImagery)&&(t.streetViewImagery=e.streetViewImagery),typeof e.avoidDoublingBack=="boolean"&&(t.avoidDoublingBack=e.avoidDoublingBack)}catch(e){console.log(`Couldn't parse userSettings from local storage: ${e}`)}return t}function wz(t){let e={type:"FeatureCollection",features:[],schemes:{}};return k3(t,e),e}function k3(t,e){let n=I3(),r=t.initializeEmptyScheme({scheme_reference:n,color:C3()});e.schemes[n]=r}let D3=Date.now();function py(t){return`${t}-${D3++}`}const O0=Symbol.for("svelte-maplibre");function Vc(){return FT(O0)}function R3(t){let e=new WeakMap;return n=>{var p;let r=e.get(n.originalEvent);if(r!==void 0)return r;let u=(p=n.target.queryRenderedFeatures(n.point).find(c=>{var b;return(b=t.get(c.layer.id))==null?void 0:b.interactive}))==null?void 0:p.layer.id;return e.set(n.originalEvent,u),u}}function N3(){let t=new Map;return jv(O0,{map:Tr(null),source:U_(null),layer:U_(null),popupTarget:U_(null),cluster:Tr(),loadedImages:Tr(new Set),minzoom:Tr(0),maxzoom:Tr(24),layerEvent:Tr(null),layerInfo:t,eventTopMost:R3(t)})}function Xw(t){return{subscribe:t.subscribe}}function z0({key:t,setPopupTarget:e=!1,setCluster:n=!1,setMouseEvent:r=!1}){let s=Vc(),u=Tr(null),p=Xw(u),c={...s,[t]:Xw(u)};if(e&&(c.popupTarget=p),r){let b=Tr(null);c.layerEvent=b,s.layerEvent=b}return n&&(c.cluster=Tr()),jv(O0,c),{...s,self:u}}function O3(){return z0({key:"source",setCluster:!0})}function z3(t=!0){return z0({key:"layer",setPopupTarget:t,setMouseEvent:t})}function Sz(){return z0({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function F3(t){return"layerType"in t&&t.layerType==="deckgl"}function Yw(t){let e;return n=>{if(n)for(let r in n){let s=e==null?void 0:e[r],u=n[r];s!==u&&t(r,u,s)}else if(e)for(let r in e)t(r,void 0,e[r]);e=n}}function B3(t,...e){let n=[t];for(let r of e)if(r)Array.isArray(r)&&r[0]===t?n.push(...r.slice(1)):n.push(r);else continue;if(n.length!==1)return n.length===2?n[1]:n}function U3(t){return t===!0?["has","point_count"]:t===!1?["!",["has","point_count"]]:void 0}function Ez(t,e){return["case",["boolean",["feature-state","hover"],!1],e,t]}function Kw(t){let e=t[0],n,r,s=$w(t);return{c(){s.c(),n=Tu()},m(u,p){s.m(u,p),an(u,n,p),r=!0},p(u,p){p[0]&1&&Yn(e,e=u[0])?(_a(),Le(s,1,1,Ur),va(),s=$w(u),s.c(),_e(s,1),s.m(n.parentNode,n)):s.p(u,p)},i(u){r||(_e(s),r=!0)},o(u){Le(s),r=!1},d(u){u&&on(n),s.d(u)}}}function $w(t){let e;const n=t[36].default,r=zs(n,t,t[35],null);return{c(){r&&r.c()},m(s,u){r&&r.m(s,u),e=!0},p(s,u){r&&r.p&&(!e||u[1]&16)&&Bs(r,n,s,s[35],e?Fs(n,s[35],u,null):Us(s[35]),null)},i(s){e||(_e(r,s),e=!0)},o(s){Le(r,s),e=!1},d(s){r&&r.d(s)}}}function V3(t){let e,n,r=t[0]&&Kw(t);return{c(){r&&r.c(),e=Tu()},m(s,u){r&&r.m(s,u),an(s,e,u),n=!0},p(s,u){s[0]?r?(r.p(s,u),u[0]&1&&_e(r,1)):(r=Kw(s),r.c(),_e(r,1),r.m(e.parentNode,e)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d(s)}}}function G3(t,e,n){let r,s,u,p,c,b,S,T,L,M,B,R,{$$slots:W={},$$scope:et}=e,{id:st=py("layer")}=e,{source:ut=void 0}=e,{sourceLayer:gt=void 0}=e,{beforeId:St=void 0}=e,{beforeLayerType:Bt=void 0}=e,{type:zt}=e,{paint:Dt=void 0}=e,{layout:Lt=void 0}=e,{filter:Ut=void 0}=e,{applyToClusters:ie=void 0}=e,{minzoom:wt=void 0}=e,{maxzoom:se=void 0}=e,{manageHoverState:ge=!1}=e,{hovered:Vt=null}=e,{interactive:pe=!0}=e,{hoverCursor:be=void 0}=e,{eventsIfTopMost:ae=!1}=e;const Te=jg(),{map:tn,source:hn,self:He,minzoom:Me,maxzoom:Ze,eventTopMost:en,layerInfo:pn}=z3();Br(t,tn,ft=>n(31,L=ft)),Br(t,hn,ft=>n(32,M=ft)),Br(t,He,ft=>n(0,T=ft)),Br(t,Me,ft=>n(34,R=ft)),Br(t,Ze,ft=>n(33,B=ft)),Tl(()=>{T&&L&&(pn.delete(T),L==null||L.removeLayer(T))});let gn;function bn(ft){var Tt,ui;if(!pe||!T||!L||ae&&en(ft)!==T)return;let Ct=ft.features??[],Ce=(ui=(Tt=Ct[0])==null?void 0:Tt.properties)==null?void 0:ui.cluster_id,kn={event:ft,map:L,clusterId:Ce,layer:T,source:c,features:Ct};Te(ft.type,kn)}function Bn(ft){var Tt,ui;if(!pe||!T||!L||ae&&en(ft)!==T)return;be&&(L.getCanvas().style.cursor=be);let Ct=ft.features??[];n(6,Vt=Ct[0]??null);let Ce=(ui=(Tt=Ct[0])==null?void 0:Tt.properties)==null?void 0:ui.cluster_id;Te("mouseenter",{event:ft,map:L,clusterId:Ce,layer:T,source:c,features:Ct})}function li(ft){var Tt,ui,ba;if(!pe||!L)return;if(ae&&en(ft)!==T){n(6,Vt=null),ge&&gn!==void 0&&(L==null||L.setFeatureState({source:c,sourceLayer:gt,id:gn},{hover:!1}),gn=void 0);return}L.getCanvas().style.cursor=be;let Ct=ft.features??[],Ce=(ui=(Tt=Ct[0])==null?void 0:Tt.properties)==null?void 0:ui.cluster_id,kn=(ba=Ct[0])==null?void 0:ba.id;kn!==gn&&(ge&&(gn!==void 0&&(L==null||L.setFeatureState({source:c,id:gn,sourceLayer:gt},{hover:!1})),L==null||L.setFeatureState({source:c,id:kn,sourceLayer:gt},{hover:!0})),gn=kn,n(6,Vt=Ct[0]??null)),Te("mousemove",{event:ft,map:L,clusterId:Ce,layer:T,source:c,features:Ct})}function Kn(ft){if(!(!pe||!T||!L)){if(be&&(L.getCanvas().style.cursor=""),n(6,Vt=null),ge&&gn!==void 0){const Ct={source:c,id:gn,sourceLayer:gt};L==null||L.setFeatureState(Ct,{hover:!1}),gn=void 0}Te("mouseleave",{map:L,layer:T,source:c})}}let cr=!0;function jr(ft){L&&(L.off("click",ft,bn),L.off("dblclick",ft,bn),L.off("contextmenu",ft,bn),L.off("mouseenter",ft,Bn),L.off("mousemove",ft,li),L.off("mouseleave",ft,Kn))}return Tl(()=>{L&&T&&jr(T)}),t.$$set=ft=>{"id"in ft&&n(7,st=ft.id),"source"in ft&&n(8,ut=ft.source),"sourceLayer"in ft&&n(9,gt=ft.sourceLayer),"beforeId"in ft&&n(10,St=ft.beforeId),"beforeLayerType"in ft&&n(11,Bt=ft.beforeLayerType),"type"in ft&&n(12,zt=ft.type),"paint"in ft&&n(13,Dt=ft.paint),"layout"in ft&&n(14,Lt=ft.layout),"filter"in ft&&n(15,Ut=ft.filter),"applyToClusters"in ft&&n(16,ie=ft.applyToClusters),"minzoom"in ft&&n(17,wt=ft.minzoom),"maxzoom"in ft&&n(18,se=ft.maxzoom),"manageHoverState"in ft&&n(19,ge=ft.manageHoverState),"hovered"in ft&&n(6,Vt=ft.hovered),"interactive"in ft&&n(20,pe=ft.interactive),"hoverCursor"in ft&&n(21,be=ft.hoverCursor),"eventsIfTopMost"in ft&&n(22,ae=ft.eventsIfTopMost),"$$scope"in ft&&n(35,et=ft.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&65536&&n(30,r=U3(ie)),t.$$.dirty[0]&1073774592&&n(24,s=B3("all",r,Ut)),t.$$.dirty[0]&131072|t.$$.dirty[1]&8&&n(26,u=wt??R),t.$$.dirty[0]&262144|t.$$.dirty[1]&4&&n(25,p=se??B),t.$$.dirty[0]&256|t.$$.dirty[1]&2&&n(29,c=ut||M),t.$$.dirty[0]&654343809|t.$$.dirty[1]&1&&L&&T!==st&&c){T&&(jr(T),pn.delete(T));let ft=St;if(!St&&Bt){let Ct=L.getStyle().layers,Ce=typeof Bt=="function"?Bt:Tt=>Tt.type===Bt,kn=Ct==null?void 0:Ct.find(Ce);kn&&(ft=kn.id)}El(He,T=st,T),L.addLayer(Gg({id:T,type:zt,source:c,"source-layer":gt,filter:s,paint:Dt,layout:Lt,minzoom:u,maxzoom:p}),ft),n(23,cr=!0),L.on("click",T,bn),L.on("dblclick",T,bn),L.on("contextmenu",T,bn),L.on("mouseenter",T,Bn),L.on("mousemove",T,li),L.on("mouseleave",T,Kn)}t.$$.dirty[0]&1048577&&T&&pn.set(T,{interactive:pe}),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(28,b=T?Yw((ft,Ct)=>L==null?void 0:L.setPaintProperty(T,ft,Ct)):void 0),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(27,S=T?Yw((ft,Ct)=>L==null?void 0:L.setLayoutProperty(T,ft,Ct)):void 0),t.$$.dirty[0]&268443648&&(b==null||b(Dt)),t.$$.dirty[0]&134234112&&(S==null||S(Lt)),t.$$.dirty[0]&100663297|t.$$.dirty[1]&1&&T&&(L==null||L.setLayerZoomRange(T,u,p)),t.$$.dirty[0]&25165825|t.$$.dirty[1]&1&&T&&(cr?n(23,cr=!1):L==null||L.setFilter(T,s))},[T,tn,hn,He,Me,Ze,Vt,st,ut,gt,St,Bt,zt,Dt,Lt,Ut,ie,wt,se,ge,pe,be,ae,cr,s,p,u,S,b,c,r,L,M,B,R,et,W]}class TI extends wr{constructor(e){super(),br(this,e,G3,V3,Yn,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function q3(t){let e;const n=t[15].default,r=zs(n,t,t[23],null);return{c(){r&&r.c()},m(s,u){r&&r.m(s,u),e=!0},p(s,u){r&&r.p&&(!e||u&8388608)&&Bs(r,n,s,s[23],e?Fs(n,s[23],u,null):Us(s[23]),null)},i(s){e||(_e(r,s),e=!0)},o(s){Le(r,s),e=!1},d(s){r&&r.d(s)}}}function j3(t){let e,n,r;function s(p){t[16](p)}let u={id:t[1],type:"fill",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[q3]},$$scope:{ctx:t}};return t[0]!==void 0&&(u.hovered=t[0]),e=new TI({props:u}),Ll.push(()=>hg(e,"hovered",s)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){oo(e.$$.fragment)},m(p,c){Gi(e,p,c),r=!0},p(p,[c]){const b={};c&2&&(b.id=p[1]),c&4&&(b.source=p[2]),c&8&&(b.sourceLayer=p[3]),c&16&&(b.beforeId=p[4]),c&32&&(b.beforeLayerType=p[5]),c&64&&(b.paint=p[6]),c&128&&(b.layout=p[7]),c&256&&(b.filter=p[8]),c&512&&(b.minzoom=p[9]),c&1024&&(b.maxzoom=p[10]),c&2048&&(b.hoverCursor=p[11]),c&4096&&(b.manageHoverState=p[12]),c&8192&&(b.eventsIfTopMost=p[13]),c&16384&&(b.interactive=p[14]),c&8388608&&(b.$$scope={dirty:c,ctx:p}),!n&&c&1&&(n=!0,b.hovered=p[0],cg(()=>n=!1)),e.$set(b)},i(p){r||(_e(e.$$.fragment,p),r=!0)},o(p){Le(e.$$.fragment,p),r=!1},d(p){qi(e,p)}}}function H3(t,e,n){let{$$slots:r={},$$scope:s}=e,{id:u=py("fill")}=e,{source:p=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:b=void 0}=e,{beforeLayerType:S=void 0}=e,{paint:T}=e,{layout:L=void 0}=e,{filter:M=void 0}=e,{minzoom:B=void 0}=e,{maxzoom:R=void 0}=e,{hoverCursor:W=void 0}=e,{manageHoverState:et=!1}=e,{hovered:st=null}=e,{eventsIfTopMost:ut=!1}=e,{interactive:gt=!0}=e;function St(wt){st=wt,n(0,st)}function Bt(wt){Ui.call(this,t,wt)}function zt(wt){Ui.call(this,t,wt)}function Dt(wt){Ui.call(this,t,wt)}function Lt(wt){Ui.call(this,t,wt)}function Ut(wt){Ui.call(this,t,wt)}function ie(wt){Ui.call(this,t,wt)}return t.$$set=wt=>{"id"in wt&&n(1,u=wt.id),"source"in wt&&n(2,p=wt.source),"sourceLayer"in wt&&n(3,c=wt.sourceLayer),"beforeId"in wt&&n(4,b=wt.beforeId),"beforeLayerType"in wt&&n(5,S=wt.beforeLayerType),"paint"in wt&&n(6,T=wt.paint),"layout"in wt&&n(7,L=wt.layout),"filter"in wt&&n(8,M=wt.filter),"minzoom"in wt&&n(9,B=wt.minzoom),"maxzoom"in wt&&n(10,R=wt.maxzoom),"hoverCursor"in wt&&n(11,W=wt.hoverCursor),"manageHoverState"in wt&&n(12,et=wt.manageHoverState),"hovered"in wt&&n(0,st=wt.hovered),"eventsIfTopMost"in wt&&n(13,ut=wt.eventsIfTopMost),"interactive"in wt&&n(14,gt=wt.interactive),"$$scope"in wt&&n(23,s=wt.$$scope)},[st,u,p,c,b,S,T,L,M,B,R,W,et,ut,gt,r,St,Bt,zt,Dt,Lt,Ut,ie,s]}class Iz extends wr{constructor(e){super(),br(this,e,H3,j3,Yn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function W3(t,e,n){let r;const{map:s}=Vc();Br(t,s,b=>n(4,r=b));let{position:u="top-left"}=e,{container:p=void 0}=e,c=null;return Tl(()=>{r!=null&&r.loaded()&&c&&r.removeControl(c)}),t.$$set=b=>{"position"in b&&n(1,u=b.position),"container"in b&&n(2,p=b.container)},t.$$.update=()=>{if(t.$$.dirty&30&&r&&!c){let b;typeof p=="string"?b=document.querySelector(p)??void 0:b=p,n(3,c=new ia.FullscreenControl({container:b})),r.addControl(c,u)}},[s,u,p,c,r]}class Z3 extends wr{constructor(e){super(),br(this,e,W3,null,Yn,{position:1,container:2})}}function X3(t,e,n,r,s){let u=!1;t.getSource(e)&&(u=!0,t.removeSource(e));const p=()=>{r(e)&&(t.addSource(e,n),s())};if(u){const c=()=>{e&&(t.getSource(e)?setTimeout(c,1):p())};c()}else p()}function Y3(t,e,n){BT().then(()=>{let r=h2(t);if(!r)return;r.getSource(e)===n&&r.removeSource(e)})}function Jw(t){let e=t[0],n,r,s=Qw(t);return{c(){s.c(),n=Tu()},m(u,p){s.m(u,p),an(u,n,p),r=!0},p(u,p){p&1&&Yn(e,e=u[0])?(_a(),Le(s,1,1,Ur),va(),s=Qw(u),s.c(),_e(s,1),s.m(n.parentNode,n)):s.p(u,p)},i(u){r||(_e(s),r=!0)},o(u){Le(s),r=!1},d(u){u&&on(n),s.d(u)}}}function Qw(t){let e;const n=t[19].default,r=zs(n,t,t[18],null);return{c(){r&&r.c()},m(s,u){r&&r.m(s,u),e=!0},p(s,u){r&&r.p&&(!e||u&262144)&&Bs(r,n,s,s[18],e?Fs(n,s[18],u,null):Us(s[18]),null)},i(s){e||(_e(r,s),e=!0)},o(s){Le(r,s),e=!1},d(s){r&&r.d(s)}}}function K3(t){let e,n,r=t[0]&&Jw(t);return{c(){r&&r.c(),e=Tu()},m(s,u){r&&r.m(s,u),an(s,e,u),n=!0},p(s,[u]){s[0]?r?(r.p(s,u),u&1&&_e(r,1)):(r=Jw(s),r.c(),_e(r,1),r.m(e.parentNode,e)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d(s)}}}function $3(t,e,n){let r,s,u,{$$slots:p={},$$scope:c}=e,{id:b=py("geojson")}=e,{data:S}=e,{generateId:T=!1}=e,{promoteId:L=void 0}=e,{filter:M=void 0}=e,{lineMetrics:B=void 0}=e,{cluster:R=void 0}=e,{maxzoom:W=void 0}=e,{attribution:et=void 0}=e,{buffer:st=void 0}=e,{tolerance:ut=void 0}=e;const{map:gt,cluster:St,self:Bt}=O3();Br(t,gt,Lt=>n(17,s=Lt)),Br(t,St,Lt=>n(20,u=Lt)),Br(t,Bt,Lt=>n(0,r=Lt));let zt,Dt=!0;return Tl(()=>{r&&zt&&s&&(Y3(gt,r,zt),El(Bt,r=null,r),n(15,zt=void 0))}),t.$$set=Lt=>{"id"in Lt&&n(4,b=Lt.id),"data"in Lt&&n(5,S=Lt.data),"generateId"in Lt&&n(6,T=Lt.generateId),"promoteId"in Lt&&n(7,L=Lt.promoteId),"filter"in Lt&&n(8,M=Lt.filter),"lineMetrics"in Lt&&n(9,B=Lt.lineMetrics),"cluster"in Lt&&n(10,R=Lt.cluster),"maxzoom"in Lt&&n(11,W=Lt.maxzoom),"attribution"in Lt&&n(12,et=Lt.attribution),"buffer"in Lt&&n(13,st=Lt.buffer),"tolerance"in Lt&&n(14,ut=Lt.tolerance),"$$scope"in Lt&&n(18,c=Lt.$$scope)},t.$$.update=()=>{t.$$.dirty&1024&&El(St,u=R,u),t.$$.dirty&196593&&s&&r!==b&&(El(Bt,r=b,r),X3(s,r,Gg({type:"geojson",data:S,filter:M,lineMetrics:B,generateId:T,promoteId:L,cluster:!!R,clusterMinPoints:R==null?void 0:R.minPoints,clusterMaxZoom:R==null?void 0:R.maxZoom,clusterRadius:R==null?void 0:R.radius,clusterProperties:R==null?void 0:R.properties,maxzoom:W,attribution:et,buffer:st,tolerance:ut}),Lt=>s&&Lt===r,()=>{r&&(n(15,zt=s==null?void 0:s.getSource(r)),n(16,Dt=!0))})),t.$$.dirty&131088&&(s==null||s.on("style.load",()=>{n(15,zt=s==null?void 0:s.getSource(b))})),t.$$.dirty&98336&&zt&&(Dt?n(16,Dt=!1):zt.setData(S)),t.$$.dirty&33792&&(zt==null||zt.setClusterOptions(Gg({cluster:!!R,clusterMaxZoom:R==null?void 0:R.maxZoom,clusterRadius:R==null?void 0:R.radius})))},[r,gt,St,Bt,b,S,T,L,M,B,R,W,et,st,ut,zt,Dt,s,c,p]}class Cz extends wr{constructor(e){super(),br(this,e,$3,K3,Yn,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10,maxzoom:11,attribution:12,buffer:13,tolerance:14})}}function J3(t,e,n){let r;const{map:s}=Vc();Br(t,s,M=>n(8,r=M));let{position:u="top-left"}=e,{positionOptions:p=void 0}=e,{fitBoundsOptions:c=void 0}=e,{trackUserLocation:b=!1}=e,{showAccuracyCircle:S=!0}=e,{showUserLocation:T=!0}=e,{control:L=null}=e;return Tl(()=>{r!=null&&r.loaded()&&L&&r.removeControl(L)}),t.$$set=M=>{"position"in M&&n(2,u=M.position),"positionOptions"in M&&n(3,p=M.positionOptions),"fitBoundsOptions"in M&&n(4,c=M.fitBoundsOptions),"trackUserLocation"in M&&n(5,b=M.trackUserLocation),"showAccuracyCircle"in M&&n(6,S=M.showAccuracyCircle),"showUserLocation"in M&&n(7,T=M.showUserLocation),"control"in M&&n(1,L=M.control)},t.$$.update=()=>{t.$$.dirty&510&&r&&!L&&(n(1,L=new ia.GeolocateControl({positionOptions:p,fitBoundsOptions:c,trackUserLocation:b,showAccuracyCircle:S,showUserLocation:T})),r.addControl(L,u))},[s,L,u,p,c,b,S,T,r]}class Q3 extends wr{constructor(e){super(),br(this,e,J3,null,Yn,{position:2,positionOptions:3,fitBoundsOptions:4,trackUserLocation:5,showAccuracyCircle:6,showUserLocation:7,control:1})}}function t4(t){let e;const n=t[15].default,r=zs(n,t,t[23],null);return{c(){r&&r.c()},m(s,u){r&&r.m(s,u),e=!0},p(s,u){r&&r.p&&(!e||u&8388608)&&Bs(r,n,s,s[23],e?Fs(n,s[23],u,null):Us(s[23]),null)},i(s){e||(_e(r,s),e=!0)},o(s){Le(r,s),e=!1},d(s){r&&r.d(s)}}}function e4(t){let e,n,r;function s(p){t[16](p)}let u={id:t[1],type:"line",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[t4]},$$scope:{ctx:t}};return t[0]!==void 0&&(u.hovered=t[0]),e=new TI({props:u}),Ll.push(()=>hg(e,"hovered",s)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){oo(e.$$.fragment)},m(p,c){Gi(e,p,c),r=!0},p(p,[c]){const b={};c&2&&(b.id=p[1]),c&4&&(b.source=p[2]),c&8&&(b.sourceLayer=p[3]),c&16&&(b.beforeId=p[4]),c&32&&(b.beforeLayerType=p[5]),c&64&&(b.paint=p[6]),c&128&&(b.layout=p[7]),c&256&&(b.filter=p[8]),c&512&&(b.minzoom=p[9]),c&1024&&(b.maxzoom=p[10]),c&2048&&(b.hoverCursor=p[11]),c&4096&&(b.manageHoverState=p[12]),c&8192&&(b.eventsIfTopMost=p[13]),c&16384&&(b.interactive=p[14]),c&8388608&&(b.$$scope={dirty:c,ctx:p}),!n&&c&1&&(n=!0,b.hovered=p[0],cg(()=>n=!1)),e.$set(b)},i(p){r||(_e(e.$$.fragment,p),r=!0)},o(p){Le(e.$$.fragment,p),r=!1},d(p){qi(e,p)}}}function n4(t,e,n){let{$$slots:r={},$$scope:s}=e,{id:u=py("line")}=e,{source:p=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:b=void 0}=e,{beforeLayerType:S=void 0}=e,{paint:T}=e,{layout:L=void 0}=e,{filter:M=void 0}=e,{minzoom:B=void 0}=e,{maxzoom:R=void 0}=e,{hoverCursor:W=void 0}=e,{manageHoverState:et=!1}=e,{hovered:st=null}=e,{eventsIfTopMost:ut=!1}=e,{interactive:gt=!0}=e;function St(wt){st=wt,n(0,st)}function Bt(wt){Ui.call(this,t,wt)}function zt(wt){Ui.call(this,t,wt)}function Dt(wt){Ui.call(this,t,wt)}function Lt(wt){Ui.call(this,t,wt)}function Ut(wt){Ui.call(this,t,wt)}function ie(wt){Ui.call(this,t,wt)}return t.$$set=wt=>{"id"in wt&&n(1,u=wt.id),"source"in wt&&n(2,p=wt.source),"sourceLayer"in wt&&n(3,c=wt.sourceLayer),"beforeId"in wt&&n(4,b=wt.beforeId),"beforeLayerType"in wt&&n(5,S=wt.beforeLayerType),"paint"in wt&&n(6,T=wt.paint),"layout"in wt&&n(7,L=wt.layout),"filter"in wt&&n(8,M=wt.filter),"minzoom"in wt&&n(9,B=wt.minzoom),"maxzoom"in wt&&n(10,R=wt.maxzoom),"hoverCursor"in wt&&n(11,W=wt.hoverCursor),"manageHoverState"in wt&&n(12,et=wt.manageHoverState),"hovered"in wt&&n(0,st=wt.hovered),"eventsIfTopMost"in wt&&n(13,ut=wt.eventsIfTopMost),"interactive"in wt&&n(14,gt=wt.interactive),"$$scope"in wt&&n(23,s=wt.$$scope)},[st,u,p,c,b,S,T,L,M,B,R,W,et,ut,gt,r,St,Bt,zt,Dt,Lt,Ut,ie,s]}class Tz extends wr{constructor(e){super(),br(this,e,n4,e4,Yn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function r4(t,e,n){let r;const s=jg();let{layer:u=void 0}=e;const{map:p}=Vc();Br(t,p,T=>n(2,r=T));function c(T){s(T.type,{...T,map:p})}const b=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","contextmenu","mouseover","mouseout"],S=["click","dblclick","contextmenu","mousemove","movestart","moveend","zoomstart","zoom","zoomend"];return Tl(()=>{if(r)if(u)for(const T of b)r.off(T,u,c);else for(const T of S)r.off(T,c)}),t.$$set=T=>{"layer"in T&&n(1,u=T.layer)},t.$$.update=()=>{if(t.$$.dirty&6&&r)if(u)for(const T of b)r.on(T,u,c);else for(const T of S)r.on(T,c)},[p,u,r]}class i4 extends wr{constructor(e){super(),br(this,e,r4,null,Yn,{layer:1})}}function o4(t){let e=t.getCenter(),n=Math.round(t.getZoom()*100)/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),s=Math.pow(10,r),u=Math.round(e.lat*s)/s,p=Math.round(e.lng*s)/s,c=`${n}/${u}/${p}`,b=t.getBearing(),S=t.getPitch();return(b||S)&&(c+=`/${Math.round(b*10)/10}`),S&&(c+=`/${Math.round(S)}`),`#${c}`}function s4(t){return t.replace("#","").split("/").map(parseFloat)}function a4(t,e,n){let r;const{map:s}=Vc();Br(t,s,T=>n(6,r=T));let{position:u="top-left"}=e,{showCompass:p=!0}=e,{showZoom:c=!0}=e,{visualizePitch:b=!1}=e,S=null;return Tl(()=>{r!=null&&r.loaded()&&S&&r.removeControl(S)}),t.$$set=T=>{"position"in T&&n(1,u=T.position),"showCompass"in T&&n(2,p=T.showCompass),"showZoom"in T&&n(3,c=T.showZoom),"visualizePitch"in T&&n(4,b=T.visualizePitch)},t.$$.update=()=>{t.$$.dirty&126&&r&&!S&&(n(5,S=new ia.NavigationControl({showCompass:p,showZoom:c,visualizePitch:b})),r.addControl(S,u))},[s,u,p,c,b,S,r]}class LI extends wr{constructor(e){super(),br(this,e,a4,null,Yn,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function l4(t,e,n){let r;const{map:s}=Vc();Br(t,s,S=>n(5,r=S));let{position:u="bottom-left"}=e,{maxWidth:p=void 0}=e,{unit:c="metric"}=e,b=null;return Tl(()=>{r!=null&&r.loaded()&&b&&r.removeControl(b)}),t.$$set=S=>{"position"in S&&n(1,u=S.position),"maxWidth"in S&&n(2,p=S.maxWidth),"unit"in S&&n(3,c=S.unit)},t.$$.update=()=>{t.$$.dirty&62&&r&&!b&&(n(4,b=new ia.ScaleControl({maxWidth:p,unit:c})),r.addControl(b,u))},[s,u,p,c,b,r]}class AI extends wr{constructor(e){super(),br(this,e,l4,null,Yn,{position:1,maxWidth:2,unit:3})}}const{window:u4}=AT,c4=t=>({map:t[0]&16,loadedImages:t[0]&32,allImagesLoaded:t[0]&64}),t2=t=>({map:t[4],loadedImages:t[5],allImagesLoaded:t[6]});function e2(t){let e,n,r=t[3]&&n2(t);const s=t[40].default,u=zs(s,t,t[39],t2);return{c(){r&&r.c(),e=ri(),u&&u.c()},m(p,c){r&&r.m(p,c),an(p,e,c),u&&u.m(p,c),n=!0},p(p,c){p[3]?r?(r.p(p,c),c[0]&8&&_e(r,1)):(r=n2(p),r.c(),_e(r,1),r.m(e.parentNode,e)):r&&(_a(),Le(r,1,1,()=>{r=null}),va()),u&&u.p&&(!n||c[0]&112|c[1]&256)&&Bs(u,s,p,p[39],n?Fs(s,p[39],c,c4):Us(p[39]),t2)},i(p){n||(_e(r),_e(u,p),n=!0)},o(p){Le(r),Le(u,p),n=!1},d(p){p&&on(e),r&&r.d(p),u&&u.d(p)}}}function n2(t){let e,n,r,s,u,p,c,b;return e=new LI({props:{position:t[7]}}),r=new Q3({props:{position:t[7],fitBoundsOptions:{maxZoom:12}}}),u=new Z3({props:{position:t[7]}}),c=new AI({props:{position:t[7]}}),{c(){oo(e.$$.fragment),n=ri(),oo(r.$$.fragment),s=ri(),oo(u.$$.fragment),p=ri(),oo(c.$$.fragment)},m(S,T){Gi(e,S,T),an(S,n,T),Gi(r,S,T),an(S,s,T),Gi(u,S,T),an(S,p,T),Gi(c,S,T),b=!0},p(S,T){const L={};T[0]&128&&(L.position=S[7]),e.$set(L);const M={};T[0]&128&&(M.position=S[7]),r.$set(M);const B={};T[0]&128&&(B.position=S[7]),u.$set(B);const R={};T[0]&128&&(R.position=S[7]),c.$set(R)},i(S){b||(_e(e.$$.fragment,S),_e(r.$$.fragment,S),_e(u.$$.fragment,S),_e(c.$$.fragment,S),b=!0)},o(S){Le(e.$$.fragment,S),Le(r.$$.fragment,S),Le(u.$$.fragment,S),Le(c.$$.fragment,S),b=!1},d(S){S&&(on(n),on(s),on(p)),qi(e,S),qi(r,S),qi(u,S),qi(c,S)}}}function h4(t){let e,n,r,s,u,p=t[4]&&t[0]&&e2(t);return{c(){e=An("div"),p&&p.c(),We(e,"class",n=dx(t[2])+" svelte-p00lfq"),We(e,"data-testid","map-container"),za(e,"expand-map",!t[2])},m(c,b){an(c,e,b),p&&p.m(e,null),t[41](e),r=!0,s||(u=[Ba(u4,"hashchange",t[11]),LT(t[10].call(null,e))],s=!0)},p(c,b){c[4]&&c[0]?p?(p.p(c,b),b[0]&17&&_e(p,1)):(p=e2(c),p.c(),_e(p,1),p.m(e,null)):p&&(_a(),Le(p,1,1,()=>{p=null}),va()),(!r||b[0]&4&&n!==(n=dx(c[2])+" svelte-p00lfq"))&&We(e,"class",n),(!r||b[0]&4)&&za(e,"expand-map",!c[2])},i(c){r||(_e(p),r=!0)},o(c){Le(p),r=!1},d(c){c&&on(e),p&&p.d(),t[41](null),s=!1,Ya(u)}}}function p4(t,e,n){let r,s,u,p,{$$slots:c={},$$scope:b}=e,{map:S=null}=e,{mapContainer:T=void 0}=e,{class:L=void 0}=e,{style:M}=e,{diffStyleUpdates:B=!1}=e,{center:R=void 0}=e,{zoom:W=void 0}=e,{pitch:et=0}=e,{bearing:st=0}=e,{bounds:ut=void 0}=e,{hash:gt=!1}=e,{updateHash:St=ft=>{window.history.replaceState(window.history.state,"",ft)}}=e,{loaded:Bt=!1}=e,{minZoom:zt=0}=e,{maxZoom:Dt=22}=e,{antialias:Lt=void 0}=e,{zoomOnDoubleClick:Ut=!0}=e,{locale:ie=void 0}=e,{interactive:wt=!0}=e,{attributionControl:se=!0}=e,{cooperativeGestures:ge=!1}=e,{preserveDrawingBuffer:Vt=!1}=e,{maxBounds:pe=void 0}=e,{images:be=[]}=e,{standardControls:ae=!1}=e,{filterLayers:Te=void 0}=e,{transformRequest:tn=void 0}=e;const hn=jg(),{map:He,loadedImages:Me}=N3();Br(t,He,ft=>n(4,u=ft)),Br(t,Me,ft=>n(5,p=ft));let Ze=new Set;async function en(ft,Ct=!1){if(u&&!(!u.loaded()&&!Ct))if("url"in ft){Ze.add(ft.id);try{let Ce=await u.loadImage(ft.url);u==null||u.addImage(ft.id,Ce.data,ft.options),p.add(ft.id),Me.set(p)}catch(Ce){hn("error",Ce)}finally{Ze.delete(ft.id)}}else u.addImage(ft.id,ft.data,ft.options),p.add(ft.id),Me.set(p)}let pn,gn,bn,Bn;function li(ft){return cr(),El(He,u=new ia.Map(Gg({container:ft,style:M,locale:ie,center:R,zoom:W,pitch:et,bearing:st,minZoom:zt,maxZoom:Dt,antialias:Lt,interactive:wt,preserveDrawingBuffer:Vt,maxBounds:pe,bounds:ut,attributionControl:se,transformRequest:tn,cooperativeGestures:ge})),u),u.on("load",Ct=>{Ct.target.getContainer().setAttribute("data-testid","map"),Ct.target.getCanvas().setAttribute("data-testid","map-canvas"),n(0,Bt=!0),hn("load",u)}),u.on("error",Ct=>hn("error",{...Ct,map:u})),u.on("movestart",Ct=>hn("movestart",{...Ct,map:u})),u.on("moveend",Ct=>{if(n(12,R=Ct.target.getCenter()),n(13,W=Ct.target.getZoom()),n(14,et=Ct.target.getPitch()),n(15,st=Ct.target.getBearing()),n(16,ut=Ct.target.getBounds()),hn("moveend",{...Ct,map:u}),gt){let Ce=new URL(window.location.href.replace(/(#.+)?$/,o4(u)));St(Ce)}}),u.on("click",Ct=>hn("click",{...Ct,map:u})),u.on("dblclick",Ct=>hn("dblclick",{...Ct,map:u})),u.on("contextmenu",Ct=>hn("contextmenu",{...Ct,map:u})),u.on("zoomstart",Ct=>hn("zoomstart",{...Ct,map:u})),u.on("zoom",Ct=>{hn("zoom",{...Ct,map:u})}),u.on("zoomend",Ct=>{hn("zoomend",{...Ct,map:u})}),u.on("style.load",()=>{if(u){const Ct=u.getStyle();if(n(36,pn=Ct.layers.map(Ce=>Ce.id)),n(37,gn=Object.keys(Ct.sources)),Bn)for(const[Ce,kn]of Object.entries(Bn))u.addSource(Ce,kn);if(bn)for(const Ce of bn)u.addLayer(Ce);for(const Ce of be)en(Ce,!0)}}),u.on("styledata",Ct=>{if(u&&Te){const Ce=u.getStyle().layers;if(Ce)for(let kn of Ce)Te(kn)||u.setLayoutProperty(kn.id,"visibility","none")}hn("styledata",{...Ct,map:u})}),{destroy(){n(0,Bt=!1),u==null||u.remove(),El(He,u=null,u)}}}let Kn=M;function cr(){if(gt){let ft=s4(window.location.hash);ft.length>=3&&(n(13,W=ft[0]),n(12,R=[ft[2],ft[1]])),ft.length==5&&(n(15,st=ft[3]),n(14,et=ft[4]))}}function jr(ft){Ll[ft?"unshift":"push"](()=>{T=ft,n(1,T)})}return t.$$set=ft=>{"map"in ft&&n(17,S=ft.map),"mapContainer"in ft&&n(1,T=ft.mapContainer),"class"in ft&&n(2,L=ft.class),"style"in ft&&n(18,M=ft.style),"diffStyleUpdates"in ft&&n(19,B=ft.diffStyleUpdates),"center"in ft&&n(12,R=ft.center),"zoom"in ft&&n(13,W=ft.zoom),"pitch"in ft&&n(14,et=ft.pitch),"bearing"in ft&&n(15,st=ft.bearing),"bounds"in ft&&n(16,ut=ft.bounds),"hash"in ft&&n(20,gt=ft.hash),"updateHash"in ft&&n(21,St=ft.updateHash),"loaded"in ft&&n(0,Bt=ft.loaded),"minZoom"in ft&&n(22,zt=ft.minZoom),"maxZoom"in ft&&n(23,Dt=ft.maxZoom),"antialias"in ft&&n(24,Lt=ft.antialias),"zoomOnDoubleClick"in ft&&n(25,Ut=ft.zoomOnDoubleClick),"locale"in ft&&n(26,ie=ft.locale),"interactive"in ft&&n(27,wt=ft.interactive),"attributionControl"in ft&&n(28,se=ft.attributionControl),"cooperativeGestures"in ft&&n(29,ge=ft.cooperativeGestures),"preserveDrawingBuffer"in ft&&n(30,Vt=ft.preserveDrawingBuffer),"maxBounds"in ft&&n(31,pe=ft.maxBounds),"images"in ft&&n(32,be=ft.images),"standardControls"in ft&&n(3,ae=ft.standardControls),"filterLayers"in ft&&n(33,Te=ft.filterLayers),"transformRequest"in ft&&n(34,tn=ft.transformRequest),"$$scope"in ft&&n(39,b=ft.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&8&&n(7,r=typeof ae=="boolean"?void 0:ae),t.$$.dirty[0]&16&&n(17,S=u),t.$$.dirty[0]&786448|t.$$.dirty[1]&224&&u&&!Gh(M,Kn)){const ft=u.getStyle();if(pn&&(bn=ft.layers.filter(Ct=>!pn.includes(Ct.id))),gn){const Ct=Object.keys(ft.sources).filter(Ce=>!gn.includes(Ce));Bn={};for(const Ce of Ct)Bn[Ce]=ft.sources[Ce]}n(38,Kn=M),u.setStyle(M,{diff:B}),El(Me,p=new Set,p),n(35,Ze=new Set)}if(t.$$.dirty[0]&49|t.$$.dirty[1]&18&&Bt&&u!=null&&u.loaded())for(let ft of be)!p.has(ft.id)&&!Ze.has(ft.id)&&!u.hasImage(ft.id)&&en(ft);if(t.$$.dirty[0]&32|t.$$.dirty[1]&2&&n(6,s=be.every(ft=>p.has(ft.id))),t.$$.dirty[0]&61456&&u){let ft={};R!=null&&!Gh(R,u==null?void 0:u.getCenter())&&(ft.center=R),W!=null&&!Gh(W,u==null?void 0:u.getZoom())&&(ft.zoom=W),st!=null&&!Gh(st,u==null?void 0:u.getBearing())&&(ft.bearing=st),et!=null&&!Gh(et,u==null?void 0:u.getPitch())&&(ft.pitch=et),Object.keys(ft).length&&u.easeTo(ft)}t.$$.dirty[0]&65552&&ut&&!Gh(ut,u==null?void 0:u.getBounds())&&(u==null||u.fitBounds(ut)),t.$$.dirty[0]&33554448&&(Ut?u==null||u.doubleClickZoom.enable():u==null||u.doubleClickZoom.disable())},[Bt,T,L,ae,u,p,s,r,He,Me,li,cr,R,W,et,st,ut,S,M,B,gt,St,zt,Dt,Lt,Ut,ie,wt,se,ge,Vt,pe,be,Te,tn,Ze,pn,gn,Kn,b,c,jr]}class f4 extends wr{constructor(e){super(),br(this,e,p4,h4,Yn,{map:17,mapContainer:1,class:2,style:18,diffStyleUpdates:19,center:12,zoom:13,pitch:14,bearing:15,bounds:16,hash:20,updateHash:21,loaded:0,minZoom:22,maxZoom:23,antialias:24,zoomOnDoubleClick:25,locale:26,interactive:27,attributionControl:28,cooperativeGestures:29,preserveDrawingBuffer:30,maxBounds:31,images:32,standardControls:3,filterLayers:33,transformRequest:34},null,[-1,-1])}}const d4=t=>({features:t[0]&16,data:t[0]&16,map:t[0]&4,close:t[0]&1}),r2=t=>{var e;return{features:t[4],data:(e=t[4])==null?void 0:e[0],map:t[2],close:t[31]}};function i2(t){let e,n,r=(t[4]||t[3]instanceof ia.Marker)&&o2(t);return{c(){e=An("div"),r&&r.c()},m(s,u){an(s,e,u),r&&r.m(e,null),t[32](e),n=!0},p(s,u){s[4]||s[3]instanceof ia.Marker?r?(r.p(s,u),u[0]&24&&_e(r,1)):(r=o2(s),r.c(),_e(r,1),r.m(e,null)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d(),t[32](null)}}}function o2(t){let e;const n=t[30].default,r=zs(n,t,t[29],r2);return{c(){r&&r.c()},m(s,u){r&&r.m(s,u),e=!0},p(s,u){r&&r.p&&(!e||u[0]&536870933)&&Bs(r,n,s,s[29],e?Fs(n,s[29],u,d4):Us(s[29]),r2)},i(s){e||(_e(r,s),e=!0)},o(s){Le(r,s),e=!1},d(s){r&&r.d(s)}}}function m4(t){let e,n,r=t[9].default&&i2(t);return{c(){r&&r.c(),e=Tu()},m(s,u){r&&r.m(s,u),an(s,e,u),n=!0},p(s,u){s[9].default?r?(r.p(s,u),u[0]&512&&_e(r,1)):(r=i2(s),r.c(),_e(r,1),r.m(e.parentNode,e)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d(s)}}}function g4(t,e,n){let r,s,u,p,c,b,{$$slots:S={},$$scope:T}=e;const L=TT(S);let{closeButton:M=void 0}=e,{closeOnClickOutside:B=!0}=e,{closeOnClickInside:R=!1}=e,{closeOnMove:W=!1}=e,{openOn:et="click"}=e,{openIfTopMost:st=!0}=e,{focusAfterOpen:ut=!0}=e,{anchor:gt=void 0}=e,{offset:St=void 0}=e,{popupClass:Bt=void 0}=e,{maxWidth:zt=void 0}=e,{lngLat:Dt=void 0}=e,{html:Lt=void 0}=e,{open:Ut=!1}=e;const ie=jg(),{map:wt,popupTarget:se,layerEvent:ge,layer:Vt,eventTopMost:pe}=Vc();Br(t,wt,Ct=>n(2,u=Ct)),Br(t,se,Ct=>n(3,c=Ct)),Br(t,ge,Ct=>n(28,p=Ct)),Br(t,Vt,Ct=>n(35,b=Ct));const be=["click","dblclick","contextmenu"];let ae,Te=!1,tn;function hn(){if(!ae)return;let Ct=ae.getElement();!Ct||Ct===tn||(tn=Ct,et==="hover"&&(tn.style.pointerEvents="none"),tn.addEventListener("mouseenter",()=>{n(24,Te=!0)},{passive:!0}),tn.addEventListener("mouseleave",()=>{n(24,Te=!1)},{passive:!0}),tn.addEventListener("click",()=>{R&&n(0,Ut=!1)},{passive:!0}))}f2(()=>{if(u)return u.on("click",Kn),u.on("contextmenu",Kn),typeof c=="string"&&(u.on("click",c,en),u.on("dblclick",c,en),u.on("contextmenu",c,en),u.on("mousemove",c,li),u.on("mouseleave",c,Bn),u.on("touchstart",c,gn),u.on("touchend",c,bn)),()=>{u!=null&&u.loaded()&&(ae==null||ae.remove(),u.off("click",Kn),u.off("contextmenu",Kn),c instanceof ia.Marker?c.getPopup()===ae&&c.setPopup(void 0):typeof c=="string"&&(u.off("click",c,en),u.off("dblclick",c,en),u.off("contextmenu",c,en),u.off("mousemove",c,li),u.off("mouseleave",c,Bn),u.off("touchstart",c,gn),u.off("touchend",c,bn)))}});function He(Ct){return st?!("marker"in Ct)&&!F3(Ct)&&pe(Ct)!==b:!1}let Me=null,Ze="normal";function en(Ct){Ct.type===et&&(He(Ct)||("layerType"in Ct?Ct.layerType==="deckgl"?(n(10,Dt=Ct.coordinate),n(4,Me=Ct.object?[Ct.object]:null)):(n(10,Dt=Ct.lngLat),n(4,Me=Ct.features??[])):(n(10,Dt=Ct.lngLat),n(4,Me=Ct.features??[])),setTimeout(()=>n(0,Ut=!0))))}let pn=null;function gn(Ct){pn=Ct.point}function bn(Ct){if(!pn||et!=="hover")return;let Ce=pn.dist(Ct.point);pn=null,Ce<3&&(n(10,Dt=Ct.lngLat),n(4,Me=Ct.features??[]),ae.isOpen()?n(25,Ze="justOpened"):(n(25,Ze="opening"),n(0,Ut=!0)))}function Bn(Ct){et!=="hover"||pn||Ze!=="normal"||(n(0,Ut=!1),n(4,Me=null))}function li(Ct){if(!(et!=="hover"||pn||Ze!=="normal")){if(He(Ct)){n(0,Ut=!1),n(4,Me=null);return}n(0,Ut=!0),n(4,Me=Ct.features??[]),n(10,Dt=Ct.lngLat)}}function Kn(Ct){if(Ze==="justOpened"){n(25,Ze="normal");return}if(!B)return;let Ce=[tn,c instanceof ia.Marker?c==null?void 0:c.getElement():null];Ut&&ae.isOpen()&&!Ce.some(kn=>kn==null?void 0:kn.contains(Ct.originalEvent.target))&&(Ct.type==="contextmenu"&&et==="contextmenu"||Ct.type!=="contextmenu")&&n(0,Ut=!1)}Tl(()=>{u&&(ae!=null&&ae.isOpen())&&ae.remove()});let cr;const jr=()=>n(0,Ut=!1);function ft(Ct){Ll[Ct?"unshift":"push"](()=>{cr=Ct,n(1,cr)})}return t.$$set=Ct=>{"closeButton"in Ct&&n(11,M=Ct.closeButton),"closeOnClickOutside"in Ct&&n(12,B=Ct.closeOnClickOutside),"closeOnClickInside"in Ct&&n(13,R=Ct.closeOnClickInside),"closeOnMove"in Ct&&n(14,W=Ct.closeOnMove),"openOn"in Ct&&n(15,et=Ct.openOn),"openIfTopMost"in Ct&&n(16,st=Ct.openIfTopMost),"focusAfterOpen"in Ct&&n(17,ut=Ct.focusAfterOpen),"anchor"in Ct&&n(18,gt=Ct.anchor),"offset"in Ct&&n(19,St=Ct.offset),"popupClass"in Ct&&n(20,Bt=Ct.popupClass),"maxWidth"in Ct&&n(21,zt=Ct.maxWidth),"lngLat"in Ct&&n(10,Dt=Ct.lngLat),"html"in Ct&&n(22,Lt=Ct.html),"open"in Ct&&n(0,Ut=Ct.open),"$$scope"in Ct&&n(29,T=Ct.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&14336&&n(27,r=M??(!B&&!R)),t.$$.dirty[0]&146685952&&(ae||(n(23,ae=new ia.Popup({closeButton:r,closeOnClick:!1,closeOnMove:W,focusAfterOpen:ut,maxWidth:zt,className:Bt,anchor:gt,offset:St})),tn=ae.getElement(),ae.on("open",()=>{n(0,Ut=!0),hn(),ie("open",ae)}),ae.on("close",()=>{n(0,Ut=!1),ie("close",ae)}),ae.on("hover",()=>{ie("hover",ae)}))),t.$$.dirty[0]&8421384&&ae&&c instanceof ia.Marker&&(et==="click"?c.setPopup(ae):c.getPopup()===ae&&c.setPopup(void 0)),t.$$.dirty[0]&268468224&&be.includes(et)&&(p==null?void 0:p.type)===et&&(en(p),El(ge,p=null,p)),t.$$.dirty[0]&268468224&&n(26,s=et==="hover"&&((p==null?void 0:p.type)==="mousemove"||(p==null?void 0:p.type)==="mouseenter")),t.$$.dirty[0]&352354304&&et==="hover"&&ge&&(s&&p&&(p.layerType==="deckgl"?(n(10,Dt=p.coordinate),n(4,Me=p.object?[p.object]:null)):(n(10,Dt=p.lngLat),n(4,Me=p.features??[]))),n(0,Ut=(s||Te)??!1)),t.$$.dirty[0]&12582914&&(cr?ae.setDOMContent(cr):Lt&&ae.setHTML(Lt)),t.$$.dirty[0]&8389632&&Dt&&ae.setLngLat(Dt),t.$$.dirty[0]&41943045&&u){let Ct=ae.isOpen();Ut&&!Ct?(ae.addTo(u),Ze==="opening"&&n(25,Ze="justOpened")):!Ut&&Ct&&ae.remove()}},[Ut,cr,u,c,Me,wt,se,ge,Vt,L,Dt,M,B,R,W,et,st,ut,gt,St,Bt,zt,Lt,ae,Te,Ze,s,r,p,T,S,jr,ft]}class Lz extends wr{constructor(e){super(),br(this,e,g4,m4,Yn,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}/*! js-cookie v3.0.5 | MIT */function Km(t){for(var e=1;e"u")){p=Km({},e,p),typeof p.expires=="number"&&(p.expires=new Date(Date.now()+p.expires*864e5)),p.expires&&(p.expires=p.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var b in p)p[b]&&(c+="; "+b,p[b]!==!0&&(c+="="+p[b].split(";")[0]));return document.cookie=s+"="+t.write(u,s)+c}}function r(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var u=document.cookie?document.cookie.split("; "):[],p={},c=0;c{"attribution"in s&&n(0,r=s.attribution)},[r]}class P4 extends wr{constructor(e){super(),br(this,e,A4,L4,Yn,{attribution:0})}}function s2(t){let e,n,r,s;function u(b){t[9](b)}function p(b){t[10](b)}let c={style:t[4],bounds:t[0],hash:!0,images:[{id:"chevron",url:I4},{id:"cycle_parking",url:E4},{id:"railway_station",url:C4}],attributionControl:!1,$$slots:{default:[M4]},$$scope:{ctx:t}};return t[3]!==void 0&&(c.loaded=t[3]),t[2]!==void 0&&(c.map=t[2]),e=new f4({props:c}),Ll.push(()=>hg(e,"loaded",u)),Ll.push(()=>hg(e,"map",p)),e.$on("error",D4),{c(){oo(e.$$.fragment)},m(b,S){Gi(e,b,S),s=!0},p(b,S){const T={};S&16&&(T.style=b[4]),S&1&&(T.bounds=b[0]),S&2146&&(T.$$scope={dirty:S,ctx:b}),!n&&S&8&&(n=!0,T.loaded=b[3],cg(()=>n=!1)),!r&&S&4&&(r=!0,T.map=b[2],cg(()=>r=!1)),e.$set(T)},i(b){s||(_e(e.$$.fragment,b),s=!0)},o(b){Le(e.$$.fragment,b),s=!1},d(b){qi(e,b)}}}function a2(t){let e,n,r,s,u,p,c,b,S,T;e=new i4({}),e.$on("zoomend",t[7]),e.$on("moveend",t[7]),r=new P4({props:{attribution:t[6]}}),u=new AI({}),c=new LI({props:{position:"bottom-left",visualizePitch:!0}});let L=t[1]=="google"&&l2();const M=t[8].default,B=zs(M,t,t[11],null);return{c(){oo(e.$$.fragment),n=ri(),oo(r.$$.fragment),s=ri(),oo(u.$$.fragment),p=ri(),oo(c.$$.fragment),b=ri(),L&&L.c(),S=ri(),B&&B.c()},m(R,W){Gi(e,R,W),an(R,n,W),Gi(r,R,W),an(R,s,W),Gi(u,R,W),an(R,p,W),Gi(c,R,W),an(R,b,W),L&&L.m(R,W),an(R,S,W),B&&B.m(R,W),T=!0},p(R,W){const et={};W&64&&(et.attribution=R[6]),r.$set(et),R[1]=="google"?L||(L=l2(),L.c(),L.m(S.parentNode,S)):L&&(L.d(1),L=null),B&&B.p&&(!T||W&2048)&&Bs(B,M,R,R[11],T?Fs(M,R[11],W,null):Us(R[11]),null)},i(R){T||(_e(e.$$.fragment,R),_e(r.$$.fragment,R),_e(u.$$.fragment,R),_e(c.$$.fragment,R),_e(B,R),T=!0)},o(R){Le(e.$$.fragment,R),Le(r.$$.fragment,R),Le(u.$$.fragment,R),Le(c.$$.fragment,R),Le(B,R),T=!1},d(R){R&&(on(n),on(s),on(p),on(b),on(S)),qi(e,R),qi(r,R),qi(u,R),qi(c,R),L&&L.d(R),B&&B.d(R)}}}function l2(t){let e,n;return{c(){e=An("img"),IT(e.src,n=T4)||We(e,"src",n),We(e,"alt","Google logo"),We(e,"class","svelte-81xaz8")},m(r,s){an(r,e,s)},d(r){r&&on(e)}}}function M4(t){let e,n,r=t[5]&&a2(t);return{c(){r&&r.c(),e=Tu()},m(s,u){r&&r.m(s,u),an(s,e,u),n=!0},p(s,u){s[5]?r?(r.p(s,u),u&32&&_e(r,1)):(r=a2(s),r.c(),_e(r,1),r.m(e.parentNode,e)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d(s)}}}function k4(t){let e,n,r=t[4]&&s2(t);return{c(){e=An("div"),r&&r.c(),We(e,"class","map svelte-81xaz8")},m(s,u){an(s,e,u),r&&r.m(e,null),n=!0},p(s,[u]){s[4]?r?(r.p(s,u),u&16&&_e(r,1)):(r=s2(s),r.c(),_e(r,1),r.m(e,null)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d()}}}function D4(t){console.error(`MapLibre error: ${t.detail.error}`)}function R4(t,e,n){let r,s;Br(t,Xb,et=>n(5,r=et)),Br(t,Lg,et=>n(6,s=et));let{$$slots:u={},$$scope:p}=e,{style:c}=e,{startBounds:b=void 0}=e,S=null,T,L=!1;jv("setCamera",!window.location.hash),window.location.hash&&(b=void 0),f2(async()=>{n(4,S=await Zb(c))});async function M(et){n(4,S=await Zb(c));let st=new URL(window.location.href);st.searchParams.set("style",et),window.history.replaceState(null,"",st.toString())}async function B(){c=="google"&&r&&El(Lg,s=await xR(r),s)}function R(et){L=et,n(3,L)}function W(et){T=et,n(2,T)}return t.$$set=et=>{"style"in et&&n(1,c=et.style),"startBounds"in et&&n(0,b=et.startBounds),"$$scope"in et&&n(11,p=et.$$scope)},t.$$.update=()=>{t.$$.dirty&12&&L&&Xb.set(T),t.$$.dirty&2&&M(c)},[b,c,T,L,S,r,s,B,u,R,W,p]}class Pz extends wr{constructor(e){super(),br(this,e,R4,k4,Yn,{style:1,startBounds:0})}}const N4="Unable to save because the local storage quota has been exceeded: you may need to clear out your web browser's local storage for this app, or run in private mode before you can save again. Specific error here: ";function O4(){return{isQuotaError:!1,message:"",storedStrings:[]}}function Mz(t,e){try{return window.localStorage.setItem(t,e),O4()}catch(n){return{isQuotaError:!0,message:N4+n,storedStrings:PI()}}}function PI(){let t=[];for(let e=0;en.storageUsedInMB-e.storageUsedInMB),t}function z4(t){return t.length/(1024*1024)}function kz(){window.localStorage.clear()}function Dz(t){return window.localStorage.removeItem(t),PI()}async function Rz(){let e=await(await fetch(yR)).json();return mR(e)}function MI(){if(window.location.hostname=="localhost")return"Local development";if(window.location.hostname=="acteng.github.io"){let t=window.location.pathname.split("/");if(t.length==3&&t[0]==""&&t[1]=="atip")return"Public (development)";if(t.length==4&&t[0]==""&&t[1]=="atip")return`Public (dev branch: ${t[2]})`}else if(window.location.hostname.endsWith(".appspot.com"))return"Private (development)";return"Unknown"}async function Nz(t,e){let n=await fetch(t),r=n.body.getReader(),s=n.headers.get("Content-Length");if(!s)throw new Error(`No Content-Length header from ${t}`);let u=parseInt(s),p=0,c=[];for(;;){let{done:T,value:L}=await r.read();if(T)break;L&&(c.push(L),p+=L.length,e(100*p/u))}let b=new Uint8Array(p),S=0;for(let T of c)b.set(T,S),S+=T.length;return b}function Oz(){return"https://atip.uk/layers"}function F4(){return"https://atip.uk/private_layers"}export{Fs as $,hg as A,$4 as B,MI as C,K4 as D,A2 as E,uL as F,va as G,cg as H,Br as I,f2 as J,Cz as K,Az as L,Pz as M,_a as N,Y4 as O,Rz as P,ez as Q,J4 as R,wr as S,Mz as T,Iz as U,Ez as V,Tz as W,rz as X,zs as Y,Bs as Z,Us as _,Le as a,k3 as a$,pc as a0,ug as a1,y2 as a2,lg as a3,bz as a4,nd as a5,mL as a6,tz as a7,P2 as a8,Tr as a9,hz as aA,fz as aB,pz as aC,c2 as aD,yz as aE,Lz as aF,Ga as aG,mD as aH,NS as aI,RS as aJ,c0 as aK,So as aL,Cs as aM,Zg as aN,Io as aO,bd as aP,i4 as aQ,_z as aR,IT as aS,uz as aT,h2 as aU,iz as aV,Dz as aW,kz as aX,wz as aY,j4 as aZ,vz as a_,Tu as aa,py as ab,O3 as ac,Tl as ad,Y3 as ae,El as af,X3 as ag,Gg as ah,Vc as ai,jg as aj,B3 as ak,U3 as al,Z4 as am,W4 as an,AT as ao,DS as ap,u0 as aq,FT as ar,X4 as as,mz as at,gz as au,P3 as av,gx as aw,dz as ax,A3 as ay,L3 as az,ri as b,V4 as b0,xz as b1,Xb as b2,oz as b3,dx as b4,TI as b5,ia as b6,cz as b7,Oz as b8,F4 as b9,zT as ba,E4 as bb,C4 as bc,Nz as bd,H4 as be,TT as bf,$_ as bg,G4 as bh,q4 as bi,HD as bj,nz as bk,MT as bl,za as bm,U4 as bn,az as bo,sz as bp,LT as bq,kT as br,qv as bs,Sz as bt,oo as c,qi as d,yx as e,An as f,We as g,an as h,br as i,mx as j,on as k,Ba as l,Gi as m,PT as n,Ui as o,Ka as p,Gn as q,Ya as r,Yn as s,_e as t,Ip as u,L2 as v,lz as w,Ur as x,dL as y,Ll as z}; + `),s=An("a"),s.textContent="MapLibre",n.a=r,We(s,"href","https://maplibre.org/"),We(s,"target","_blank"),We(e,"class","svelte-1yeu1m4")},m(u,p){an(u,e,p),n.m(t[0],e),Gn(e,r),Gn(e,s)},p(u,[p]){p&1&&n.p(u[0])},i:Ur,o:Ur,d(u){u&&on(e)}}}function A4(t,e,n){let{attribution:r}=e;return t.$$set=s=>{"attribution"in s&&n(0,r=s.attribution)},[r]}class P4 extends wr{constructor(e){super(),br(this,e,A4,L4,Yn,{attribution:0})}}function s2(t){let e,n,r,s;function u(b){t[9](b)}function p(b){t[10](b)}let c={style:t[4],bounds:t[0],hash:!0,images:[{id:"chevron",url:I4},{id:"cycle_parking",url:E4},{id:"railway_station",url:C4}],attributionControl:!1,$$slots:{default:[M4]},$$scope:{ctx:t}};return t[3]!==void 0&&(c.loaded=t[3]),t[2]!==void 0&&(c.map=t[2]),e=new f4({props:c}),Ll.push(()=>hg(e,"loaded",u)),Ll.push(()=>hg(e,"map",p)),e.$on("error",D4),{c(){oo(e.$$.fragment)},m(b,S){Gi(e,b,S),s=!0},p(b,S){const T={};S&16&&(T.style=b[4]),S&1&&(T.bounds=b[0]),S&2146&&(T.$$scope={dirty:S,ctx:b}),!n&&S&8&&(n=!0,T.loaded=b[3],cg(()=>n=!1)),!r&&S&4&&(r=!0,T.map=b[2],cg(()=>r=!1)),e.$set(T)},i(b){s||(_e(e.$$.fragment,b),s=!0)},o(b){Le(e.$$.fragment,b),s=!1},d(b){qi(e,b)}}}function a2(t){let e,n,r,s,u,p,c,b,S,T;e=new i4({}),e.$on("zoomend",t[7]),e.$on("moveend",t[7]),r=new P4({props:{attribution:t[6]}}),u=new AI({}),c=new LI({props:{position:"bottom-left",visualizePitch:!0}});let L=t[1]=="google"&&l2();const M=t[8].default,B=zs(M,t,t[11],null);return{c(){oo(e.$$.fragment),n=ri(),oo(r.$$.fragment),s=ri(),oo(u.$$.fragment),p=ri(),oo(c.$$.fragment),b=ri(),L&&L.c(),S=ri(),B&&B.c()},m(R,W){Gi(e,R,W),an(R,n,W),Gi(r,R,W),an(R,s,W),Gi(u,R,W),an(R,p,W),Gi(c,R,W),an(R,b,W),L&&L.m(R,W),an(R,S,W),B&&B.m(R,W),T=!0},p(R,W){const et={};W&64&&(et.attribution=R[6]),r.$set(et),R[1]=="google"?L||(L=l2(),L.c(),L.m(S.parentNode,S)):L&&(L.d(1),L=null),B&&B.p&&(!T||W&2048)&&Bs(B,M,R,R[11],T?Fs(M,R[11],W,null):Us(R[11]),null)},i(R){T||(_e(e.$$.fragment,R),_e(r.$$.fragment,R),_e(u.$$.fragment,R),_e(c.$$.fragment,R),_e(B,R),T=!0)},o(R){Le(e.$$.fragment,R),Le(r.$$.fragment,R),Le(u.$$.fragment,R),Le(c.$$.fragment,R),Le(B,R),T=!1},d(R){R&&(on(n),on(s),on(p),on(b),on(S)),qi(e,R),qi(r,R),qi(u,R),qi(c,R),L&&L.d(R),B&&B.d(R)}}}function l2(t){let e,n;return{c(){e=An("img"),IT(e.src,n=T4)||We(e,"src",n),We(e,"alt","Google logo"),We(e,"class","svelte-81xaz8")},m(r,s){an(r,e,s)},d(r){r&&on(e)}}}function M4(t){let e,n,r=t[5]&&a2(t);return{c(){r&&r.c(),e=Tu()},m(s,u){r&&r.m(s,u),an(s,e,u),n=!0},p(s,u){s[5]?r?(r.p(s,u),u&32&&_e(r,1)):(r=a2(s),r.c(),_e(r,1),r.m(e.parentNode,e)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d(s)}}}function k4(t){let e,n,r=t[4]&&s2(t);return{c(){e=An("div"),r&&r.c(),We(e,"class","map svelte-81xaz8")},m(s,u){an(s,e,u),r&&r.m(e,null),n=!0},p(s,[u]){s[4]?r?(r.p(s,u),u&16&&_e(r,1)):(r=s2(s),r.c(),_e(r,1),r.m(e,null)):r&&(_a(),Le(r,1,1,()=>{r=null}),va())},i(s){n||(_e(r),n=!0)},o(s){Le(r),n=!1},d(s){s&&on(e),r&&r.d()}}}function D4(t){console.error(`MapLibre error: ${t.detail.error}`)}function R4(t,e,n){let r,s;Br(t,Xb,et=>n(5,r=et)),Br(t,Lg,et=>n(6,s=et));let{$$slots:u={},$$scope:p}=e,{style:c}=e,{startBounds:b=void 0}=e,S=null,T,L=!1;jv("setCamera",!window.location.hash),window.location.hash&&(b=void 0),f2(async()=>{n(4,S=await Zb(c))});async function M(et){n(4,S=await Zb(c));let st=new URL(window.location.href);st.searchParams.set("style",et),window.history.replaceState(null,"",st.toString())}async function B(){c=="google"&&r&&El(Lg,s=await xR(r),s)}function R(et){L=et,n(3,L)}function W(et){T=et,n(2,T)}return t.$$set=et=>{"style"in et&&n(1,c=et.style),"startBounds"in et&&n(0,b=et.startBounds),"$$scope"in et&&n(11,p=et.$$scope)},t.$$.update=()=>{t.$$.dirty&12&&L&&Xb.set(T),t.$$.dirty&2&&M(c)},[b,c,T,L,S,r,s,B,u,R,W,p]}class Pz extends wr{constructor(e){super(),br(this,e,R4,k4,Yn,{style:1,startBounds:0})}}const N4="Unable to save because the local storage quota has been exceeded: you may need to clear out your web browser's local storage for this app, or run in private mode before you can save again. Specific error here: ";function O4(){return{isQuotaError:!1,message:"",storedStrings:[]}}function Mz(t,e){try{return window.localStorage.setItem(t,e),O4()}catch(n){return{isQuotaError:!0,message:N4+n,storedStrings:PI()}}}function PI(){let t=[];for(let e=0;en.storageUsedInMB-e.storageUsedInMB),t}function z4(t){return t.length/(1024*1024)}function kz(){window.localStorage.clear()}function Dz(t){return window.localStorage.removeItem(t),PI()}async function Rz(){let e=await(await fetch(yR)).json();return mR(e)}function MI(){if(window.location.hostname=="localhost")return"Local development";if(window.location.hostname=="acteng.github.io"){let t=window.location.pathname.split("/");if(t.length==3&&t[0]==""&&t[1]=="atip")return"Public (development)";if(t.length==4&&t[0]==""&&t[1]=="atip")return`Public (dev branch: ${t[2]})`}else if(window.location.hostname.endsWith(".appspot.com"))return"Private (development)";return"Unknown"}async function Nz(t,e){let n=await fetch(t),r=n.body.getReader(),s=n.headers.get("Content-Length");if(!s)throw new Error(`No Content-Length header from ${t}`);let u=parseInt(s),p=0,c=[];for(;;){let{done:T,value:L}=await r.read();if(T)break;L&&(c.push(L),p+=L.length,e(100*p/u))}let b=new Uint8Array(p),S=0;for(let T of c)b.set(T,S),S+=T.length;return b}function Oz(){return"https://atip.uk/layers"}function F4(){return"https://atip.uk/private_layers"}export{ug as $,Rz as A,ez as B,Mz as C,K4 as D,A2 as E,$4 as F,Cz as G,Iz as H,Ez as I,Tz as J,rz as K,Az as L,Pz as M,Ip as N,zs as O,Bs as P,Us as Q,J4 as R,wr as S,Fs as T,Ui as U,uL as V,L2 as W,mx as X,Ba as Y,Ya as Z,pc as _,ri as a,k3 as a$,y2 as a0,lg as a1,bz as a2,nd as a3,mL as a4,tz as a5,P2 as a6,Tr as a7,Tu as a8,py as a9,hz as aA,fz as aB,pz as aC,c2 as aD,yz as aE,Lz as aF,Ga as aG,mD as aH,NS as aI,RS as aJ,c0 as aK,So as aL,Cs as aM,Zg as aN,Io as aO,bd as aP,i4 as aQ,_z as aR,IT as aS,uz as aT,h2 as aU,iz as aV,Dz as aW,kz as aX,wz as aY,j4 as aZ,vz as a_,O3 as aa,Tl as ab,Y3 as ac,El as ad,X3 as ae,Gg as af,Vc as ag,jg as ah,B3 as ai,U3 as aj,yx as ak,Z4 as al,W4 as am,AT as an,DS as ao,u0 as ap,FT as aq,X4 as ar,mz as as,PT as at,gz as au,P3 as av,gx as aw,dz as ax,A3 as ay,L3 as az,We as b,V4 as b0,xz as b1,Xb as b2,oz as b3,dx as b4,TI as b5,ia as b6,cz as b7,Oz as b8,F4 as b9,zT as ba,E4 as bb,C4 as bc,Nz as bd,H4 as be,TT as bf,$_ as bg,G4 as bh,q4 as bi,HD as bj,nz as bk,MT as bl,za as bm,U4 as bn,az as bo,sz as bp,LT as bq,kT as br,qv as bs,Sz as bt,an as c,on as d,An as e,dL as f,Ll as g,hg as h,br as i,oo as j,MI as k,lz as l,Gn as m,Ur as n,Gi as o,Le as p,va as q,cg as r,Yn as s,_e as t,qi as u,Br as v,f2 as w,Ka as x,_a as y,Y4 as z}; diff --git a/browse_layout_v3/assets/main-1f7adbfe.js b/browse_layout_v3/assets/main-1f7adbfe.js deleted file mode 100644 index fcf02e8f..00000000 --- a/browse_layout_v3/assets/main-1f7adbfe.js +++ /dev/null @@ -1 +0,0 @@ -import{S as ne,i as le,s as ae,F as Ae,c as w,m as k,t as g,a as d,d as A,v as Se,e as ce,b as v,f as S,g as y,h as L,j as K,l as $e,k as M,n as ye,r as Le,o as Me,p as B,q as c,u as Z,w as Ce,x as Y,L as Ee,y as Te,E as ge,D as Ie,R as Fe,z as x,A as ee,B as He,M as Ne,C as Oe,G as Be,H as te,I as Je,J as je,K as De,N as Ge,O as Pe,P as Re,Q as Ue,T as Ve,U as qe,V as ze,W as Ke,X as Qe}from"./index-12949150.js";import{A as We}from"./About-4dc186c6.js";import{P as Xe}from"./Popup-addc1aa5.js";function _e(a,e,n){const t=a.slice();return t[0]=e[n][0],t[3]=e[n][1],t}function de(a){let e,n;return{c(){e=S("div"),n=B(a[2]),y(e,"class","govuk-hint")},m(t,s){L(t,e,s),c(e,n)},p(t,s){s&4&&Z(n,t[2])},d(t){t&&M(e)}}}function he(a){let e,n,t;return{c(){e=S("option"),e.__value=n=a[0],K(e,e.__value),y(e,"label",t=a[3])},m(s,l){L(s,e,l)},p(s,l){l&2&&n!==(n=s[0])&&(e.__value=n,K(e,e.__value)),l&2&&t!==(t=s[3])&&y(e,"label",t)},d(s){s&&M(e)}}}function Ye(a){let e,n,t,s,l,r,u=a[2]&&de(a),p=ce(a[1]),f=[];for(let o=0;o{"label"in o&&n(3,t=o.label),"value"in o&&n(0,s=o.value),"options"in o&&n(1,l=o.options),"hint"in o&&n(2,r=o.hint)},[s,l,r,t,u,p,f]}class et extends ne{constructor(e){super(),le(this,e,xe,Ze,ae,{label:3,value:0,options:1,hint:2})}}function tt(a){let e,n,t;return{c(){e=S("div"),e.innerHTML=`Active Travel England logo`,n=v(),t=S("div"),y(e,"class","black-bar svelte-13flgp1"),y(t,"class","green-bar svelte-13flgp1")},m(s,l){L(s,e,l),L(s,n,l),L(s,t,l)},p:Y,i:Y,o:Y,d(s){s&&(M(e),M(n),M(t))}}}class nt extends ne{constructor(e){super(),le(this,e,null,tt,ae,{})}}function lt(a){let e;return{c(){e=B("About")},m(n,t){L(n,e,t)},d(n){n&&M(e)}}}function ve(a){let e,n,t;function s(r){a[10](r)}let l={label:"Select Transport Authority or Local Authority District",options:a[1].features.map(be)};return a[0]!==void 0&&(l.value=a[0]),e=new et({props:l}),x.push(()=>ee(e,"value",s)),{c(){w(e.$$.fragment)},m(r,u){k(e,r,u),t=!0},p(r,u){const p={};u&2&&(p.options=r[1].features.map(be)),!n&&u&1&&(n=!0,p.value=r[0],te(()=>n=!1)),e.$set(p)},i(r){t||(g(e.$$.fragment,r),t=!0)},o(r){d(e.$$.fragment,r),t=!1},d(r){A(e,r)}}}function at(a){let e;return{c(){e=B("Start")},m(n,t){L(n,e,t)},d(n){n&&M(e)}}}function st(a){let e,n=a[17].name+"",t,s,l=a[17].level+"",r,u;return{c(){e=S("p"),t=B(n),s=B(" ("),r=B(l),u=B(")")},m(p,f){L(p,e,f),c(e,t),c(e,s),c(e,r),c(e,u)},p(p,f){f&131072&&n!==(n=p[17].name+"")&&Z(t,n),f&131072&&l!==(l=p[17].level+"")&&Z(r,l)},d(p){p&&M(e)}}}function ot(a){let e,n;return e=new Xe({props:{$$slots:{default:[st,({props:t})=>({17:t}),({props:t})=>t?131072:0]},$$scope:{ctx:a}}}),{c(){w(e.$$.fragment)},m(t,s){k(e,t,s),n=!0},p(t,s){const l={};s&393216&&(l.$$scope={dirty:s,ctx:t}),e.$set(l)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){d(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function rt(a){let e,n,t,s;return e=new qe({props:{id:"boundaries",filter:["==",["get","level"],a[4]],paint:{"fill-color":"rgb(200, 100, 240)","fill-outline-color":"rgb(200, 100, 240)","fill-opacity":ze(0,.5)},manageHoverState:!0,hoverCursor:"pointer",$$slots:{default:[ot]},$$scope:{ctx:a}}}),e.$on("click",a[7]),t=new Ke({props:{id:"boundaries-outline",filter:["==",["get","level"],a[4]],paint:{"line-color":"rgb(200, 100, 240)","line-width":2.5},manageHoverState:!0}}),{c(){w(e.$$.fragment),n=v(),w(t.$$.fragment)},m(l,r){k(e,l,r),L(l,n,r),k(t,l,r),s=!0},p(l,r){const u={};r&16&&(u.filter=["==",["get","level"],l[4]]),r&262144&&(u.$$scope={dirty:r,ctx:l}),e.$set(u);const p={};r&16&&(p.filter=["==",["get","level"],l[4]]),t.$set(p)},i(l){s||(g(e.$$.fragment,l),g(t.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(t.$$.fragment,l),s=!1},d(l){l&&M(n),A(e,l),A(t,l)}}}function it(a){let e,n;return e=new De({props:{data:a[1],generateId:!0,$$slots:{default:[rt]},$$scope:{ctx:a}}}),{c(){w(e.$$.fragment)},m(t,s){k(e,t,s),n=!0},p(t,s){const l={};s&2&&(l.data=t[1]),s&262160&&(l.$$scope={dirty:s,ctx:t}),e.$set(l)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){d(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function ut(a){let e,n,t,s,l,r,u,p,f,o,h,m,H,D,E,R,U,V,T,$,N,C,G,I,J,j,se,q,P,O,Q,F,W,z;t=new nt({}),r=new Ee({}),o=new Te({props:{$$slots:{default:[lt]},$$scope:{ctx:a}}}),o.$on("click",a[9]),m=new ge({props:{errorMessage:a[3]}});let _=a[1].features.length>0&&ve(a);E=new Ie({props:{disabled:!a[5],$$slots:{default:[at]},$$scope:{ctx:a}}}),E.$on("click",a[8]);function we(i){a[11](i)}let oe={label:"Or pick from the map",choices:[["TA","Transport Authorities"],["LAD","Local Authority Districts"]],inlineSmall:!0};a[4]!==void 0&&(oe.value=a[4]),T=new Fe({props:oe}),x.push(()=>ee(T,"value",we)),I=new ge({props:{errorMessage:ft}}),j=new He({props:{label:"Or upload an ATIP GeoJSON file",onLoad:a[6]}}),O=new Ne({props:{style:"streets",startBounds:[-5.96,49.89,2.31,55.94],$$slots:{default:[it]},$$scope:{ctx:a}}});function ke(i){a[12](i)}let re={};return a[2]!==void 0&&(re.open=a[2]),F=new We({props:re}),x.push(()=>ee(F,"open",ke)),{c(){e=S("div"),n=S("div"),w(t.$$.fragment),s=v(),l=S("div"),w(r.$$.fragment),u=v(),p=S("p"),p.textContent=`App version: ${Oe()}`,f=v(),w(o.$$.fragment),h=v(),w(m.$$.fragment),H=v(),_&&_.c(),D=v(),w(E.$$.fragment),R=v(),U=S("hr"),V=v(),w(T.$$.fragment),N=v(),C=S("hr"),G=v(),w(I.$$.fragment),J=v(),w(j.$$.fragment),se=v(),q=S("div"),P=S("div"),w(O.$$.fragment),Q=v(),w(F.$$.fragment),y(l,"class","left svelte-lyn11h"),y(n,"class","govuk-grid-column-one-half"),y(P,"id","map"),y(P,"class","svelte-lyn11h"),y(q,"class","govuk-grid-column-one-half"),y(e,"class","govuk-grid-row")},m(i,b){L(i,e,b),c(e,n),k(t,n,null),c(n,s),c(n,l),k(r,l,null),c(l,u),c(l,p),c(l,f),k(o,l,null),c(l,h),k(m,l,null),c(l,H),_&&_.m(l,null),c(l,D),k(E,l,null),c(l,R),c(l,U),c(l,V),k(T,l,null),c(l,N),c(l,C),c(l,G),k(I,l,null),c(l,J),k(j,l,null),c(e,se),c(e,q),c(q,P),k(O,P,null),L(i,Q,b),k(F,i,b),z=!0},p(i,[b]){const ie={};b&262144&&(ie.$$scope={dirty:b,ctx:i}),o.$set(ie);const ue={};b&8&&(ue.errorMessage=i[3]),m.$set(ue),i[1].features.length>0?_?(_.p(i,b),b&2&&g(_,1)):(_=ve(i),_.c(),g(_,1),_.m(l,D)):_&&(Ge(),d(_,1,1,()=>{_=null}),Be());const X={};b&32&&(X.disabled=!i[5]),b&262144&&(X.$$scope={dirty:b,ctx:i}),E.$set(X);const fe={};!$&&b&16&&($=!0,fe.value=i[4],te(()=>$=!1)),T.$set(fe);const pe={};b&262162&&(pe.$$scope={dirty:b,ctx:i}),O.$set(pe);const me={};!W&&b&4&&(W=!0,me.open=i[2],te(()=>W=!1)),F.$set(me)},i(i){z||(g(t.$$.fragment,i),g(r.$$.fragment,i),g(o.$$.fragment,i),g(m.$$.fragment,i),g(_),g(E.$$.fragment,i),g(T.$$.fragment,i),g(I.$$.fragment,i),g(j.$$.fragment,i),g(O.$$.fragment,i),g(F.$$.fragment,i),z=!0)},o(i){d(t.$$.fragment,i),d(r.$$.fragment,i),d(o.$$.fragment,i),d(m.$$.fragment,i),d(_),d(E.$$.fragment,i),d(T.$$.fragment,i),d(I.$$.fragment,i),d(j.$$.fragment,i),d(O.$$.fragment,i),d(F.$$.fragment,i),z=!1},d(i){i&&(M(e),M(Q)),A(t),A(r),A(o),A(m),_&&_.d(),A(E),A(T),A(I),A(j),A(O),A(F,i)}}}let ft="";const be=a=>[a.properties.full_name,`${a.properties.name} (${a.properties.level})`];function pt(a,e,n){let t,s;Je(a,Qe,$=>n(13,s=$));let l={type:"FeatureCollection",features:[]},r=!1,p=new URLSearchParams(window.location.search).get("error")||"",f,o=new Set,h="TA";je(async()=>{Pe(),n(1,l=await Re());for(let $ of l.features)o.add($.properties.full_name)});function m($,N){try{let C=JSON.parse(N),G=Ue(C.features,l);if(!G)throw new Error("Can't figure out the authority boundary that fully contains this scheme");C.authority=G;let I=C.authority,J=H(C);J!="v1"&&(I+=`_${J}`),Ve(I,JSON.stringify(C)),window.location.href=`scheme.html?authority=${C.authority}&schema=${J}`}catch(C){n(3,p=`Couldn't load scheme from a file: ${C}`)}}function H($){if($.features.length>0){let N=$.features[0].properties;for(let C of["pipeline"])if(N&&C in N)return C}return s}function D($){window.location.href=`scheme.html?authority=${$.detail.features[0].properties.full_name}&schema=${s}`}function E(){window.location.href=`scheme.html?authority=${f}&schema=${s}`}const R=()=>n(2,r=!r);function U($){f=$,n(0,f)}function V($){h=$,n(4,h)}function T($){r=$,n(2,r)}return a.$$.update=()=>{a.$$.dirty&1&&n(5,t=o.has(f))},[f,l,r,p,h,t,m,D,E,R,U,V,T]}class mt extends ne{constructor(e){super(),le(this,e,pt,ut,ae,{})}}document.body.className+=" js-enabled"+("noModule"in HTMLScriptElement.prototype?" govuk-frontend-supported":"");new mt({target:document.getElementById("app")}); diff --git a/browse_layout_v3/assets/main-1f9b9707.js b/browse_layout_v3/assets/main-1f9b9707.js new file mode 100644 index 00000000..f80b3eae --- /dev/null +++ b/browse_layout_v3/assets/main-1f9b9707.js @@ -0,0 +1 @@ +import{S as $e,i as me,s as ce,e as y,l as _e,a as d,b as I,c as C,n as X,d as E,L as he,f as ve,E as ie,D as be,R as we,g as Y,h as Z,F as Ae,M as ye,j as _,k as Se,m as i,o as h,t as $,p as m,q as ke,r as x,u as v,v as Le,w as Me,x as O,G as Ce,y as Ee,z as Te,A as Ie,B as He,C as Be,H as Fe,I as Je,J as Ne,K as Oe,N as ue}from"./index-980b667c.js";import{A as je,P as De}from"./Popup-00bc00d9.js";import{A as Ge}from"./About-32237c0d.js";function Pe(r){let e,a,n;return{c(){e=y("div"),e.innerHTML=`Active Travel England logo`,a=d(),n=y("div"),I(e,"class","black-bar svelte-13flgp1"),I(n,"class","green-bar svelte-13flgp1")},m(l,t){C(l,e,t),C(l,a,t),C(l,n,t)},p:X,i:X,o:X,d(l){l&&(E(e),E(a),E(n))}}}class Re extends $e{constructor(e){super(),me(this,e,null,Pe,ce,{})}}function qe(r){let e;return{c(){e=O("About")},m(a,n){C(a,e,n)},d(a){a&&E(e)}}}function fe(r){let e,a,n;function l(o){r[10](o)}let t={label:"Select Transport Authority or Local Authority District",options:r[1].features.map(pe)};return r[0]!==void 0&&(t.value=r[0]),e=new je({props:t}),Y.push(()=>Z(e,"value",l)),{c(){_(e.$$.fragment)},m(o,g){h(e,o,g),n=!0},p(o,g){const u={};g&2&&(u.options=o[1].features.map(pe)),!a&&g&1&&(a=!0,u.value=o[0],x(()=>a=!1)),e.$set(u)},i(o){n||($(e.$$.fragment,o),n=!0)},o(o){m(e.$$.fragment,o),n=!1},d(o){v(e,o)}}}function Ue(r){let e;return{c(){e=O("Start")},m(a,n){C(a,e,n)},d(a){a&&E(e)}}}function Ve(r){let e,a=r[17].name+"",n,l,t=r[17].level+"",o,g;return{c(){e=y("p"),n=O(a),l=O(" ("),o=O(t),g=O(")")},m(u,w){C(u,e,w),i(e,n),i(e,l),i(e,o),i(e,g)},p(u,w){w&131072&&a!==(a=u[17].name+"")&&ue(n,a),w&131072&&t!==(t=u[17].level+"")&&ue(o,t)},d(u){u&&E(e)}}}function ze(r){let e,a;return e=new De({props:{$$slots:{default:[Ve,({props:n})=>({17:n}),({props:n})=>n?131072:0]},$$scope:{ctx:r}}}),{c(){_(e.$$.fragment)},m(n,l){h(e,n,l),a=!0},p(n,l){const t={};l&393216&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){a||($(e.$$.fragment,n),a=!0)},o(n){m(e.$$.fragment,n),a=!1},d(n){v(e,n)}}}function Ke(r){let e,a,n,l;return e=new Fe({props:{id:"boundaries",filter:["==",["get","level"],r[4]],paint:{"fill-color":"rgb(200, 100, 240)","fill-outline-color":"rgb(200, 100, 240)","fill-opacity":Je(0,.5)},manageHoverState:!0,hoverCursor:"pointer",$$slots:{default:[ze]},$$scope:{ctx:r}}}),e.$on("click",r[7]),n=new Ne({props:{id:"boundaries-outline",filter:["==",["get","level"],r[4]],paint:{"line-color":"rgb(200, 100, 240)","line-width":2.5},manageHoverState:!0}}),{c(){_(e.$$.fragment),a=d(),_(n.$$.fragment)},m(t,o){h(e,t,o),C(t,a,o),h(n,t,o),l=!0},p(t,o){const g={};o&16&&(g.filter=["==",["get","level"],t[4]]),o&262144&&(g.$$scope={dirty:o,ctx:t}),e.$set(g);const u={};o&16&&(u.filter=["==",["get","level"],t[4]]),n.$set(u)},i(t){l||($(e.$$.fragment,t),$(n.$$.fragment,t),l=!0)},o(t){m(e.$$.fragment,t),m(n.$$.fragment,t),l=!1},d(t){t&&E(a),v(e,t),v(n,t)}}}function Qe(r){let e,a;return e=new Ce({props:{data:r[1],generateId:!0,$$slots:{default:[Ke]},$$scope:{ctx:r}}}),{c(){_(e.$$.fragment)},m(n,l){h(e,n,l),a=!0},p(n,l){const t={};l&2&&(t.data=n[1]),l&262160&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){a||($(e.$$.fragment,n),a=!0)},o(n){m(e.$$.fragment,n),a=!1},d(n){v(e,n)}}}function We(r){let e,a,n,l,t,o,g,u,w,A,F,L,P,j,S,R,q,U,k,f,H,b,D,M,J,N,ee,V,G,B,K,T,Q,z;n=new Re({}),o=new he({}),A=new ve({props:{$$slots:{default:[qe]},$$scope:{ctx:r}}}),A.$on("click",r[9]),L=new ie({props:{errorMessage:r[3]}});let p=r[1].features.length>0&&fe(r);S=new be({props:{disabled:!r[5],$$slots:{default:[Ue]},$$scope:{ctx:r}}}),S.$on("click",r[8]);function ge(s){r[11](s)}let te={label:"Or pick from the map",choices:[["TA","Transport Authorities"],["LAD","Local Authority Districts"]],inlineSmall:!0};r[4]!==void 0&&(te.value=r[4]),k=new we({props:te}),Y.push(()=>Z(k,"value",ge)),M=new ie({props:{errorMessage:Xe}}),N=new Ae({props:{label:"Or upload an ATIP GeoJSON file",onLoad:r[6]}}),B=new ye({props:{style:"streets",startBounds:[-5.96,49.89,2.31,55.94],$$slots:{default:[Qe]},$$scope:{ctx:r}}});function de(s){r[12](s)}let ne={};return r[2]!==void 0&&(ne.open=r[2]),T=new Ge({props:ne}),Y.push(()=>Z(T,"open",de)),{c(){e=y("div"),a=y("div"),_(n.$$.fragment),l=d(),t=y("div"),_(o.$$.fragment),g=d(),u=y("p"),u.textContent=`App version: ${Se()}`,w=d(),_(A.$$.fragment),F=d(),_(L.$$.fragment),P=d(),p&&p.c(),j=d(),_(S.$$.fragment),R=d(),q=y("hr"),U=d(),_(k.$$.fragment),H=d(),b=y("hr"),D=d(),_(M.$$.fragment),J=d(),_(N.$$.fragment),ee=d(),V=y("div"),G=y("div"),_(B.$$.fragment),K=d(),_(T.$$.fragment),I(t,"class","left svelte-lyn11h"),I(a,"class","govuk-grid-column-one-half"),I(G,"id","map"),I(G,"class","svelte-lyn11h"),I(V,"class","govuk-grid-column-one-half"),I(e,"class","govuk-grid-row")},m(s,c){C(s,e,c),i(e,a),h(n,a,null),i(a,l),i(a,t),h(o,t,null),i(t,g),i(t,u),i(t,w),h(A,t,null),i(t,F),h(L,t,null),i(t,P),p&&p.m(t,null),i(t,j),h(S,t,null),i(t,R),i(t,q),i(t,U),h(k,t,null),i(t,H),i(t,b),i(t,D),h(M,t,null),i(t,J),h(N,t,null),i(e,ee),i(e,V),i(V,G),h(B,G,null),C(s,K,c),h(T,s,c),z=!0},p(s,[c]){const ae={};c&262144&&(ae.$$scope={dirty:c,ctx:s}),A.$set(ae);const re={};c&8&&(re.errorMessage=s[3]),L.$set(re),s[1].features.length>0?p?(p.p(s,c),c&2&&$(p,1)):(p=fe(s),p.c(),$(p,1),p.m(t,j)):p&&(Ee(),m(p,1,1,()=>{p=null}),ke());const W={};c&32&&(W.disabled=!s[5]),c&262144&&(W.$$scope={dirty:c,ctx:s}),S.$set(W);const se={};!f&&c&16&&(f=!0,se.value=s[4],x(()=>f=!1)),k.$set(se);const oe={};c&262162&&(oe.$$scope={dirty:c,ctx:s}),B.$set(oe);const le={};!Q&&c&4&&(Q=!0,le.open=s[2],x(()=>Q=!1)),T.$set(le)},i(s){z||($(n.$$.fragment,s),$(o.$$.fragment,s),$(A.$$.fragment,s),$(L.$$.fragment,s),$(p),$(S.$$.fragment,s),$(k.$$.fragment,s),$(M.$$.fragment,s),$(N.$$.fragment,s),$(B.$$.fragment,s),$(T.$$.fragment,s),z=!0)},o(s){m(n.$$.fragment,s),m(o.$$.fragment,s),m(A.$$.fragment,s),m(L.$$.fragment,s),m(p),m(S.$$.fragment,s),m(k.$$.fragment,s),m(M.$$.fragment,s),m(N.$$.fragment,s),m(B.$$.fragment,s),m(T.$$.fragment,s),z=!1},d(s){s&&(E(e),E(K)),v(n),v(o),v(A),v(L),p&&p.d(),v(S),v(k),v(M),v(N),v(B),v(T,s)}}}let Xe="";const pe=r=>[r.properties.full_name,`${r.properties.name} (${r.properties.level})`];function Ye(r,e,a){let n,l;Le(r,Oe,f=>a(13,l=f));let t={type:"FeatureCollection",features:[]},o=!1,u=new URLSearchParams(window.location.search).get("error")||"",w,A=new Set,F="TA";Me(async()=>{Te(),a(1,t=await Ie());for(let f of t.features)A.add(f.properties.full_name)});function L(f,H){try{let b=JSON.parse(H),D=He(b.features,t);if(!D)throw new Error("Can't figure out the authority boundary that fully contains this scheme");b.authority=D;let M=b.authority,J=P(b);J!="v1"&&(M+=`_${J}`),Be(M,JSON.stringify(b)),window.location.href=`scheme.html?authority=${b.authority}&schema=${J}`}catch(b){a(3,u=`Couldn't load scheme from a file: ${b}`)}}function P(f){if(f.features.length>0){let H=f.features[0].properties;for(let b of["pipeline"])if(H&&b in H)return b}return l}function j(f){window.location.href=`scheme.html?authority=${f.detail.features[0].properties.full_name}&schema=${l}`}function S(){window.location.href=`scheme.html?authority=${w}&schema=${l}`}const R=()=>a(2,o=!o);function q(f){w=f,a(0,w)}function U(f){F=f,a(4,F)}function k(f){o=f,a(2,o)}return r.$$.update=()=>{r.$$.dirty&1&&a(5,n=A.has(w))},[w,t,o,u,F,n,L,j,S,R,q,U,k]}class Ze extends $e{constructor(e){super(),me(this,e,Ye,We,ce,{})}}document.body.className+=" js-enabled"+("noModule"in HTMLScriptElement.prototype?" govuk-frontend-supported":"");new Ze({target:document.getElementById("app")}); diff --git a/browse_layout_v3/assets/nested-35efa1b5.js b/browse_layout_v3/assets/nested-e1f3a1bf.js similarity index 99% rename from browse_layout_v3/assets/nested-35efa1b5.js rename to browse_layout_v3/assets/nested-e1f3a1bf.js index b4fb35da..0df39015 100644 --- a/browse_layout_v3/assets/nested-35efa1b5.js +++ b/browse_layout_v3/assets/nested-e1f3a1bf.js @@ -1,4 +1,4 @@ -var Ks=Object.defineProperty;var Hs=(r,e,n)=>e in r?Ks(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var me=(r,e,n)=>(Hs(r,typeof e!="symbol"?e+"":e,n),n);import{S as ee,i as te,s as Q,Y as Jt,f as G,g as U,h as v,Z as Yt,_ as Xt,$ as Wt,t as w,a as k,k as y,y as pe,c as P,m as L,d as C,o as jr,F as Pt,v as Lt,E as Je,b as F,j as Le,l as he,p as B,q as z,u as ge,r as Qn,a0 as be,a1 as Qr,a2 as we,a3 as xr,a4 as Bo,a5 as Zs,a6 as qo,a7 as Vs,a8 as Qs,a9 as at,aa as ae,N as se,G as le,ab as Go,ac as xs,I as Y,ad as Ye,ae as el,af as Be,ag as tl,ah as nl,x as ne,U as pn,ai as rl,aj as il,ak as ol,al as sl,e as je,am as Ir,an as Br,ao as ll,ap as ul,aq as al,K as Mt,ar as fl,as as ke,at as Bt,z as Z,A as V,H as x,n as xn,au as Xe,av as Fn,aw as Pe,ax as un,J as it,ay as oe,D as ot,az as en,aA as tn,aB as kt,W as qt,aC as Rn,aD as We,aE as nn,aF as qr,aG as ei,aH as Te,aI as mr,aJ as cl,aK as pl,aL as Ge,aM as On,aN as ti,aO as pt,aP as To,aQ as ml,aR as mn,R as Gt,aS as st,aT as Ct,X as et,aU as Et,aV as dr,aW as dl,aX as gl,T as hl,B as Do,aY as Gr,aZ as jn,a_ as ni,a$ as _l,b0 as bl,b1 as er,M as $l,L as vl,C as yl,O as wl,P as kl,b2 as Sl}from"./index-12949150.js";import{M as gr,m as ze,b as Uo,l as ue,e as Tt,C as zo,a as ht,R as El,i as St,c as an,d as fn,f as Dt,g as Ml,h as Ht,S as Pl,j as Ll,k as tr,p as In,n as Cl,o as Nl,t as Al,r as ri,W as Jo,q as Fl,H as Rl,B as Ol,Z as jl,G as Il}from"./ZoomOutMap-afe869ee.js";import{A as Bl}from"./About-4dc186c6.js";function ql(r){let e,n;const t=r[1].default,o=Jt(t,r,r[0],null);return{c(){e=G("div"),o&&o.c(),U(e,"class","govuk-button-group")},m(i,s){v(i,e,s),o&&o.m(e,null),n=!0},p(i,[s]){o&&o.p&&(!n||s&1)&&Yt(o,t,i,i[0],n?Wt(t,i[0],s,null):Xt(i[0]),null)},i(i){n||(w(o,i),n=!0)},o(i){k(o,i),n=!1},d(i){i&&y(e),o&&o.d(i)}}}function Gl(r,e,n){let{$$slots:t={},$$scope:o}=e;return r.$$set=i=>{"$$scope"in i&&n(0,o=i.$$scope)},[o,t]}class Ke extends ee{constructor(e){super(),te(this,e,Gl,ql,Q,{})}}function Tl(r){let e;const n=r[1].default,t=Jt(n,r,r[3],null);return{c(){t&&t.c()},m(o,i){t&&t.m(o,i),e=!0},p(o,i){t&&t.p&&(!e||i&8)&&Yt(t,n,o,o[3],e?Wt(n,o[3],i,null):Xt(o[3]),null)},i(o){e||(w(t,o),e=!0)},o(o){k(t,o),e=!1},d(o){t&&t.d(o)}}}function Dl(r){let e,n;return e=new pe({props:{style:"margin-bottom: 0px",disabled:r[0],$$slots:{default:[Tl]},$$scope:{ctx:r}}}),e.$on("click",r[2]),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&1&&(i.disabled=t[0]),o&8&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function Ul(r,e,n){let{$$slots:t={},$$scope:o}=e,{disabled:i=!1}=e;function s(l){jr.call(this,r,l)}return r.$$set=l=>{"disabled"in l&&n(0,i=l.disabled),"$$scope"in l&&n(3,o=l.$$scope)},[i,t,s,o]}class vt extends ee{constructor(e){super(),te(this,e,Ul,Dl,Q,{disabled:0})}}function ii(r){let e,n,t=Bn(r[0])+"",o;return{c(){e=G("div"),n=B("ÂŁ"),o=B(t),U(e,"class","govuk-hint")},m(i,s){v(i,e,s),z(e,n),z(e,o)},p(i,s){s&1&&t!==(t=Bn(i[0])+"")&&ge(o,t)},d(i){i&&y(e)}}}function zl(r){let e;return{c(){e=B("multiply by 1 million")},m(n,t){v(n,e,t)},d(n){n&&y(e)}}}function Jl(r){let e,n,t,o,i,s,l,u,a;e=new Je({props:{errorMessage:oi(r[2])}});let f=r[0]!=null&&ii(r);return s=new pe({props:{disabled:r[0]==null||r[0]>1e3,$$slots:{default:[zl]},$$scope:{ctx:r}}}),s.$on("click",r[4]),{c(){P(e.$$.fragment),n=F(),f&&f.c(),t=F(),o=G("input"),i=F(),P(s.$$.fragment),U(o,"type","text"),U(o,"inputmode","numeric"),U(o,"class","govuk-input govuk-input--width-10"),U(o,"id",r[3])},m(c,p){L(e,c,p),v(c,n,p),f&&f.m(c,p),v(c,t,p),v(c,o,p),Le(o,r[2]),v(c,i,p),L(s,c,p),l=!0,u||(a=he(o,"input",r[5]),u=!0)},p(c,p){const m={};p&4&&(m.errorMessage=oi(c[2])),e.$set(m),c[0]!=null?f?f.p(c,p):(f=ii(c),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null),p&4&&o.value!==c[2]&&Le(o,c[2]);const g={};p&1&&(g.disabled=c[0]==null||c[0]>1e3),p&128&&(g.$$scope={dirty:p,ctx:c}),s.$set(g)},i(c){l||(w(e.$$.fragment,c),w(s.$$.fragment,c),l=!0)},o(c){k(e.$$.fragment,c),k(s.$$.fragment,c),l=!1},d(c){c&&(y(n),y(t),y(o),y(i)),C(e,c),f&&f.d(c),C(s,c),u=!1,a()}}}function Yl(r){let e,n;return e=new Pt({props:{label:r[1],id:r[3],$$slots:{default:[Jl]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&2&&(i.label=t[1]),o&133&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function Yo(r){if(r!="")return parseFloat(r.replaceAll(",",""))}function oi(r){let e=Yo(r);return e==null?"":isNaN(e)?"Please enter a valid number":e<0?"Please enter a positive number":""}function Bn(r){return r.toLocaleString()}function Xl(r,e,n){let{label:t}=e,{value:o}=e,i=Lt(),s=o==null?"":Bn(o);function l(f){n(0,o=Yo(f))}function u(){n(2,s=Bn(o*1e6))}function a(){s=this.value,n(2,s)}return r.$$set=f=>{"label"in f&&n(1,t=f.label),"value"in f&&n(0,o=f.value)},r.$$.update=()=>{r.$$.dirty&4&&l(s)},[o,t,s,i,u,a]}class Wl extends ee{constructor(e){super(),te(this,e,Xl,Yl,Q,{label:1,value:0})}}function Kl(r){let e,n,t,o,i,s,l;return e=new Je({props:{errorMessage:r[5](r[2])}}),{c(){P(e.$$.fragment),n=F(),t=G("input"),U(t,"type","text"),U(t,"inputmode","numeric"),U(t,"class",o=`govuk-input govuk-input--width-${r[1]}`),U(t,"id",r[3])},m(u,a){L(e,u,a),v(u,n,a),v(u,t,a),Le(t,r[2]),i=!0,s||(l=[he(t,"input",r[9]),he(t,"change",r[4])],s=!0)},p(u,a){const f={};a&4&&(f.errorMessage=u[5](u[2])),e.$set(f),(!i||a&2&&o!==(o=`govuk-input govuk-input--width-${u[1]}`))&&U(t,"class",o),a&4&&t.value!==u[2]&&Le(t,u[2])},i(u){i||(w(e.$$.fragment,u),i=!0)},o(u){k(e.$$.fragment,u),i=!1},d(u){u&&(y(n),y(t)),C(e,u),s=!1,Qn(l)}}}function Hl(r){let e,n;return e=new Pt({props:{label:r[0],id:r[3],$$slots:{default:[Kl]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&1&&(i.label=t[0]),o&1030&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function Zl(r,e,n){let{label:t}=e,{value:o}=e,{width:i}=e,{min:s=void 0}=e,{max:l=void 0}=e,u=o==null?void 0:o.toString(),a=Lt();function f(){n(6,o=u==null?void 0:parseInt(u,10))}function c(m){if(m==""||m==null)return"";if(m.includes("."))return"Please enter a number without decimals";let g=Number(m);return isNaN(g)?"Please enter a valid number":s!=null&&gl?`Please enter a number that's at most ${l};`:""}function p(){u=this.value,n(2,u)}return r.$$set=m=>{"label"in m&&n(0,t=m.label),"value"in m&&n(6,o=m.value),"width"in m&&n(1,i=m.width),"min"in m&&n(7,s=m.min),"max"in m&&n(8,l=m.max)},[t,i,u,a,f,c,o,s,l,p]}class ir extends ee{constructor(e){super(),te(this,e,Zl,Hl,Q,{label:0,value:6,width:1,min:7,max:8})}}function si(r){let e,n;return{c(){e=G("div"),n=B(r[2]),U(e,"class","govuk-hint")},m(t,o){v(t,e,o),z(e,n)},p(t,o){o&4&&ge(n,t[2])},d(t){t&&y(e)}}}function Vl(r){let e,n,t,o,i,s,l;e=new Je({props:{errorMessage:r[4]}});let u=r[2]&&si(r);return{c(){P(e.$$.fragment),n=F(),u&&u.c(),t=F(),o=G("textarea"),U(o,"class","govuk-textarea"),U(o,"id",r[5]),U(o,"rows",r[3])},m(a,f){L(e,a,f),v(a,n,f),u&&u.m(a,f),v(a,t,f),v(a,o,f),Le(o,r[0]),i=!0,s||(l=he(o,"input",r[6]),s=!0)},p(a,f){const c={};f&16&&(c.errorMessage=a[4]),e.$set(c),a[2]?u?u.p(a,f):(u=si(a),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),(!i||f&8)&&U(o,"rows",a[3]),f&1&&Le(o,a[0])},i(a){i||(w(e.$$.fragment,a),i=!0)},o(a){k(e.$$.fragment,a),i=!1},d(a){a&&(y(n),y(t),y(o)),C(e,a),u&&u.d(a),s=!1,l()}}}function Ql(r){let e,n;return e=new Pt({props:{label:r[1],id:r[5],$$slots:{default:[Vl]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&2&&(i.label=t[1]),o&157&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function xl(r,e,n){let{label:t}=e,{hint:o=""}=e,{value:i}=e,{rows:s=5}=e,{errorMessage:l=""}=e,u=Lt();function a(){i=this.value,n(0,i)}return r.$$set=f=>{"label"in f&&n(1,t=f.label),"hint"in f&&n(2,o=f.hint),"value"in f&&n(0,i=f.value),"rows"in f&&n(3,s=f.rows),"errorMessage"in f&&n(4,l=f.errorMessage)},[i,t,o,s,l,u,a]}class Tr extends ee{constructor(e){super(),te(this,e,xl,Ql,Q,{label:1,hint:2,value:0,rows:3,errorMessage:4})}}function eu(r){let e,n,t,o,i,s;return e=new Je({props:{errorMessage:r[2]}}),{c(){P(e.$$.fragment),n=F(),t=G("input"),U(t,"type","text"),U(t,"class","govuk-input"),U(t,"id",r[3])},m(l,u){L(e,l,u),v(l,n,u),v(l,t,u),Le(t,r[0]),o=!0,i||(s=[he(t,"input",r[6]),he(t,"change",r[5])],i=!0)},p(l,u){const a={};u&4&&(a.errorMessage=l[2]),e.$set(a),u&1&&t.value!==l[0]&&Le(t,l[0])},i(l){o||(w(e.$$.fragment,l),o=!0)},o(l){k(e.$$.fragment,l),o=!1},d(l){l&&(y(n),y(t)),C(e,l),i=!1,Qn(s)}}}function tu(r){let e,n;return e=new Pt({props:{label:r[1],id:r[3],$$slots:{default:[eu]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&2&&(i.label=t[1]),o&133&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function nu(r,e,n){let t,{label:o}=e,{value:i}=e,{required:s=!1}=e,l=Lt();function u(f){jr.call(this,r,f)}function a(){i=this.value,n(0,i)}return r.$$set=f=>{"label"in f&&n(1,o=f.label),"value"in f&&n(0,i=f.value),"required"in f&&n(4,s=f.required)},r.$$.update=()=>{r.$$.dirty&17&&n(2,t=s&&(i==null||i=="")?"Required":"")},[i,o,t,l,s,u,a]}class nr extends ee{constructor(e){super(),te(this,e,nu,tu,Q,{label:1,value:0,required:4})}}function ru(r){let e,n,t,o;const i=r[2].default,s=Jt(i,r,r[1],null);let l=[{type:"button"},{class:"govuk-button govuk-button--warning"},{"data-module":"govuk-button"},r[0]],u={};for(let a=0;a{n(0,e=be(be({},e),xr(s))),"$$scope"in s&&n(1,o=s.$$scope)},e=xr(e),[e,o,t,i]}class bt extends ee{constructor(e){super(),te(this,e,iu,ru,Q,{})}}class ou{constructor(e){me(this,"map");me(this,"active");me(this,"eventListenersSuccess");me(this,"eventListenersFailure");me(this,"cursor");me(this,"onMouseMove",e=>{this.active&&(this.cursor={type:"Feature",properties:{},geometry:{type:"Point",coordinates:Bo(e.lngLat.toArray())}})});me(this,"onClick",()=>{if(this.active&&this.cursor){for(let e of this.eventListenersSuccess)e(this.cursor);this.stop()}});me(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersFailure=[],this.cursor=null,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),document.removeEventListener("keydown",this.onKeyDown)}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersFailure=[]}start(){this.map.getCanvas().style.cursor="crosshair",this.active=!0}stop(){this.map.getCanvas().style.cursor="inherit",this.cursor=null,this.active=!1}}function su(r){var e=r%(2*Math.PI);return e*180/Math.PI}function bn(r){var e=r%360;return e*Math.PI/180}function gt(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function xe(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function hr(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function Xo(r,e,n){if(n===void 0&&(n={}),n.final===!0)return lu(r,e);var t=gt(r),o=gt(e),i=bn(t[0]),s=bn(o[0]),l=bn(t[1]),u=bn(o[1]),a=Math.sin(s-i)*Math.cos(u),f=Math.cos(l)*Math.sin(u)-Math.sin(l)*Math.cos(u)*Math.cos(s-i);return su(Math.atan2(a,f))}function lu(r,e){var n=Xo(e,r);return n=(n+180)%360,n}var Re=63710088e-1,uu={centimeters:Re*100,centimetres:Re*100,degrees:Re/111325,feet:Re*3.28084,inches:Re*39.37,kilometers:Re/1e3,kilometres:Re/1e3,meters:Re,metres:Re,miles:Re/1609.344,millimeters:Re*1e3,millimetres:Re*1e3,nauticalmiles:Re/1852,radians:1,yards:Re*1.0936};function au(r,e){e===void 0&&(e="kilometers");var n=uu[e];if(!n)throw new Error(e+" units is invalid");return r*n}function $n(r){var e=r%360;return e*Math.PI/180}function ft(r,e,n){n===void 0&&(n={});var t=gt(r),o=gt(e),i=$n(o[1]-t[1]),s=$n(o[0]-t[0]),l=$n(t[1]),u=$n(o[1]),a=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(l)*Math.cos(u);return au(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)),n.units)}var Oe=63710088e-1,fu={centimeters:Oe*100,centimetres:Oe*100,degrees:Oe/111325,feet:Oe*3.28084,inches:Oe*39.37,kilometers:Oe/1e3,kilometres:Oe/1e3,meters:Oe,metres:Oe,miles:Oe/1609.344,millimeters:Oe*1e3,millimetres:Oe*1e3,nauticalmiles:Oe/1852,radians:1,yards:Oe*1.0936};function cu(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function pu(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ui(r[0])||!ui(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return cu(t,e,n)}function mu(r,e){e===void 0&&(e="kilometers");var n=fu[e];if(!n)throw new Error(e+" units is invalid");return r/n}function li(r){var e=r%(2*Math.PI);return e*180/Math.PI}function or(r){var e=r%360;return e*Math.PI/180}function ui(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function ai(r,e,n,t){t===void 0&&(t={});var o=gt(r),i=or(o[0]),s=or(o[1]),l=or(n),u=mu(e,t.units),a=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(l)),f=i+Math.atan2(Math.sin(l)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(a)),c=li(f),p=li(a);return pu([c,p],t.properties)}function _r(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function du(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ci(r[0])||!ci(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return _r(t,e,n)}function fi(r,e){e===void 0&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=r,n}function ci(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function gu(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function hu(r,e,n){if(n===void 0&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var t={type:"LineString",coordinates:r};return gu(t,e,n)}function _u(r,e){e===void 0&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=r,n}function qn(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function Rt(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!pi(r[0])||!pi(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return qn(t,e,n)}function It(r,e,n){if(n===void 0&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var t={type:"LineString",coordinates:r};return qn(t,e,n)}function pi(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Wo(r){return!!r&&r.constructor===Object}function Nt(r,e,n){if(r!==null)for(var t,o,i,s,l,u,a,f=0,c=0,p,m=r.type,g=m==="FeatureCollection",$=m==="Feature",b=g?r.features.length:1,S=0;Su||g>a||$>f){l=c,u=t,a=g,f=$,i=0;return}var b=It([l,c],n.properties);if(e(b,t,o,$,i)===!1)return!1;i++,l=c})===!1)return!1}}})}function Vo(r,e,n){var t=n,o=!1;return Zo(r,function(i,s,l,u,a){o===!1&&n===void 0?t=i:t=e(t,i,s,l,u,a),o=!0}),t}function Qo(r,e){if(!r)throw new Error("geojson is required");At(r,function(n,t,o){if(n.geometry!==null){var i=n.geometry.type,s=n.geometry.coordinates;switch(i){case"LineString":if(e(n,t,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;lo?n:o,a=t>i?t:i;return[s,l,u,a]}var Ur={exports:{}},xo={exports:{}};(function(r,e){(function(n,t){r.exports=t()})(Zs,function(){function n(d,_,M,h,E){(function R(I,T,q,O,N){for(;O>q;){if(O-q>600){var A=O-q+1,j=T-q+1,W=Math.log(A),re=.5*Math.exp(2*W/3),fe=.5*Math.sqrt(W*re*(A-re)/A)*(j-A/2<0?-1:1),D=Math.max(q,Math.floor(T-j*re/A+fe)),de=Math.min(O,Math.floor(T+(A-j)*re/A+fe));R(I,T,D,de,N)}var _e=I[T],Ee=q,ve=O;for(t(I,q,T),N(I[O],_e)>0&&t(I,q,O);Ee0;)ve--}N(I[q],_e)===0?t(I,q,ve):t(I,++ve,O),ve<=T&&(q=ve+1),T<=ve&&(O=ve-1)}})(d,_,M||0,h||d.length-1,E||o)}function t(d,_,M){var h=d[_];d[_]=d[M],d[M]=h}function o(d,_){return d<_?-1:d>_?1:0}var i=function(d){d===void 0&&(d=9),this._maxEntries=Math.max(4,d),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(d,_,M){if(!M)return _.indexOf(d);for(var h=0;h<_.length;h++)if(M(d,_[h]))return h;return-1}function l(d,_){u(d,0,d.children.length,_,d)}function u(d,_,M,h,E){E||(E=b(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var R=_;R=d.minX&&_.maxY>=d.minY}function b(d){return{children:d,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(d,_,M,h,E){for(var R=[_,M];R.length;)if(!((M=R.pop())-(_=R.pop())<=h)){var I=_+Math.ceil((M-_)/h/2)*h;n(d,I,_,M,E),R.push(_,I,I,M)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(d){var _=this.data,M=[];if(!$(d,_))return M;for(var h=this.toBBox,E=[];_;){for(var R=0;R<_.children.length;R++){var I=_.children[R],T=_.leaf?h(I):I;$(d,T)&&(_.leaf?M.push(I):g(d,T)?this._all(I,M):E.push(I))}_=E.pop()}return M},i.prototype.collides=function(d){var _=this.data;if(!$(d,_))return!1;for(var M=[];_;){for(var h=0;h<_.children.length;h++){var E=_.children[h],R=_.leaf?this.toBBox(E):E;if($(d,R)){if(_.leaf||g(d,R))return!0;M.push(E)}}_=M.pop()}return!1},i.prototype.load=function(d){if(!d||!d.length)return this;if(d.length=0&&E[_].children.length>this._maxEntries;)this._split(E,_),_--;this._adjustParentBBoxes(h,E,_)},i.prototype._split=function(d,_){var M=d[_],h=M.children.length,E=this._minEntries;this._chooseSplitAxis(M,E,h);var R=this._chooseSplitIndex(M,E,h),I=b(M.children.splice(R,M.children.length-R));I.height=M.height,I.leaf=M.leaf,l(M,this.toBBox),l(I,this.toBBox),_?d[_-1].children.push(I):this._splitRoot(M,I)},i.prototype._splitRoot=function(d,_){this.data=b([d,_]),this.data.height=d.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(d,_,M){for(var h,E,R,I,T,q,O,N=1/0,A=1/0,j=_;j<=M-_;j++){var W=u(d,0,j,this.toBBox),re=u(d,j,M,this.toBBox),fe=(E=W,R=re,I=void 0,T=void 0,q=void 0,O=void 0,I=Math.max(E.minX,R.minX),T=Math.max(E.minY,R.minY),q=Math.min(E.maxX,R.maxX),O=Math.min(E.maxY,R.maxY),Math.max(0,q-I)*Math.max(0,O-T)),D=p(W)+p(re);fe=_;N--){var A=d.children[N];a(I,d.leaf?E(A):A),T+=m(I)}return T},i.prototype._adjustParentBBoxes=function(d,_,M){for(var h=M;h>=0;h--)a(_[h],d)},i.prototype._condense=function(d){for(var _=d.length-1,M=void 0;_>=0;_--)d[_].children.length===0?_>0?(M=d[_-1].children).splice(M.indexOf(d[_]),1):this.clear():l(d[_],this.toBBox)},i})})(xo);var Nu=xo.exports,es={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function e(O,N,A){A===void 0&&(A={});var j={type:"Feature"};return(A.id===0||A.id)&&(j.id=A.id),A.bbox&&(j.bbox=A.bbox),j.properties=N||{},j.geometry=O,j}r.feature=e;function n(O,N,A){switch(O){case"Point":return t(N).geometry;case"LineString":return l(N).geometry;case"Polygon":return i(N).geometry;case"MultiPoint":return c(N).geometry;case"MultiLineString":return f(N).geometry;case"MultiPolygon":return p(N).geometry;default:throw new Error(O+" is invalid")}}r.geometry=n;function t(O,N,A){if(A===void 0&&(A={}),!O)throw new Error("coordinates is required");if(!Array.isArray(O))throw new Error("coordinates must be an Array");if(O.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!R(O[0])||!R(O[1]))throw new Error("coordinates must contain numbers");var j={type:"Point",coordinates:O};return e(j,N,A)}r.point=t;function o(O,N,A){return A===void 0&&(A={}),a(O.map(function(j){return t(j,N)}),A)}r.points=o;function i(O,N,A){A===void 0&&(A={});for(var j=0,W=O;j=0))throw new Error("precision must be a positive number");var A=Math.pow(10,N||0);return Math.round(O*A)/A}r.round=g;function $(O,N){N===void 0&&(N="kilometers");var A=r.factors[N];if(!A)throw new Error(N+" units is invalid");return O*A}r.radiansToLength=$;function b(O,N){N===void 0&&(N="kilometers");var A=r.factors[N];if(!A)throw new Error(N+" units is invalid");return O/A}r.lengthToRadians=b;function S(O,N){return _(b(O,N))}r.lengthToDegrees=S;function d(O){var N=O%360;return N<0&&(N+=360),N}r.bearingToAzimuth=d;function _(O){var N=O%(2*Math.PI);return N*180/Math.PI}r.radiansToDegrees=_;function M(O){var N=O%360;return N*Math.PI/180}r.degreesToRadians=M;function h(O,N,A){if(N===void 0&&(N="kilometers"),A===void 0&&(A="kilometers"),!(O>=0))throw new Error("length must be a positive number");return $(b(O,N),A)}r.convertLength=h;function E(O,N,A){if(N===void 0&&(N="meters"),A===void 0&&(A="kilometers"),!(O>=0))throw new Error("area must be a positive number");var j=r.areaFactors[N];if(!j)throw new Error("invalid original units");var W=r.areaFactors[A];if(!W)throw new Error("invalid final units");return O/j*W}r.convertArea=E;function R(O){return!isNaN(O)&&O!==null&&!Array.isArray(O)}r.isNumber=R;function I(O){return!!O&&O.constructor===Object}r.isObject=I;function T(O){if(!O)throw new Error("bbox is required");if(!Array.isArray(O))throw new Error("bbox must be an Array");if(O.length!==4&&O.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");O.forEach(function(N){if(!R(N))throw new Error("bbox must only contain numbers")})}r.validateBBox=T;function q(O){if(!O)throw new Error("id is required");if(["string","number"].indexOf(typeof O)===-1)throw new Error("id must be a number or a string")}r.validateId=q})(es);const Au=qo(Mu),Fu=qo(Vs);var He=Nu,ts=es,ns=Au,Ot=Fu.default,Ru=ns.featureEach;ns.coordEach;ts.polygon;var mi=ts.featureCollection;function rs(r){var e=new He(r);return e.insert=function(n){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Ot(n),He.prototype.insert.call(this,n)},e.load=function(n){var t=[];return Array.isArray(n)?n.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ot(o),t.push(o)}):Ru(n,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ot(o),t.push(o)}),He.prototype.load.call(this,t)},e.remove=function(n,t){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Ot(n),He.prototype.remove.call(this,n,t)},e.clear=function(){return He.prototype.clear.call(this)},e.search=function(n){var t=He.prototype.search.call(this,this.toBBox(n));return mi(t)},e.collides=function(n){return He.prototype.collides.call(this,this.toBBox(n))},e.all=function(){var n=He.prototype.all.call(this);return mi(n)},e.toJSON=function(){return He.prototype.toJSON.call(this)},e.fromJSON=function(n){return He.prototype.fromJSON.call(this,n)},e.toBBox=function(n){var t;if(n.bbox)t=n.bbox;else if(Array.isArray(n)&&n.length===4)t=n;else if(Array.isArray(n)&&n.length===6)t=[n[0],n[1],n[3],n[4]];else if(n.type==="Feature")t=Ot(n);else if(n.type==="FeatureCollection")t=Ot(n);else throw new Error("invalid geojson");return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},e}Ur.exports=rs;Ur.exports.default=rs;var Ou=Ur.exports;const zr=Qs(Ou);function is(r,e){var n={},t=[];if(r.type==="LineString"&&(r=_r(r)),e.type==="LineString"&&(e=_r(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var o=di(r,e);return o&&t.push(o),fi(t)}var i=zr();return i.load(br(e)),Ut(br(r),function(s){Ut(i.search(s),function(l){var u=di(s,l);if(u){var a=xe(u).join(",");n[a]||(n[a]=!0,t.push(u))}})}),fi(t)}function di(r,e){var n=xe(r),t=xe(e);if(n.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(t.length!==2)throw new Error(" line2 must only contain 2 coordinates");var o=n[0][0],i=n[0][1],s=n[1][0],l=n[1][1],u=t[0][0],a=t[0][1],f=t[1][0],c=t[1][1],p=(c-a)*(s-o)-(f-u)*(l-i),m=(f-u)*(i-a)-(c-a)*(o-u),g=(s-o)*(i-a)-(l-i)*(o-u);if(p===0)return null;var $=m/p,b=g/p;if($>=0&&$<=1&&b>=0&&b<=1){var S=o+$*(s-o),d=i+$*(l-i);return du([S,d])}return null}function os(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function sr(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hi(r[0])||!hi(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return os(t,e,n)}function gi(r,e,n){if(n===void 0&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var t={type:"LineString",coordinates:r};return os(t,e,n)}function hi(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Gn(r,e,n){n===void 0&&(n={});var t=sr([1/0,1/0],{dist:1/0}),o=0;return At(r,function(i){for(var s=xe(i),l=0;l0&&(b=$.features[0],b.properties.dist=ft(e,b,n),b.properties.location=o+ft(u,b,n)),u.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(e);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let n=this.dragFrom[0]-e.lngLat.lng,t=this.dragFrom[1]-e.lngLat.lat;for(let o of this.points)o[0]-=n,o[1]-=t}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});me(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(_i(this.points).forEach((t,o)=>{n.push([o+1,Gn(t,this.cursor).properties.dist])}),n.sort((t,o)=>t[1]-o[1]),n.length>0){let t=n[0][0];this.points.splice(t,0,this.cursor.geometry.coordinates),this.hover=t}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(e))});me(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=lr(e.lngLat.toArray()),this.onClick(e),this.finish())});me(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});me(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});me(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});me(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersSuccess)n(e);else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(e){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let e=ss();this.points.forEach((o,i)=>{let s=lr(o);s.properties.hover=this.hover==i,s.properties.idx=i,e.features.push(s)}),e.features=e.features.concat(_i(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",e.features.push(n)),us.set(e);let t="crosshair";this.hover!=null&&(t=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=t,as.set(this.previousStates.length)}pointsUpdated(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersUpdated)n(e)}recalculateHovering(e){this.cursor=null,this.hover=null;for(let n of this.map.queryRenderedFeatures(e.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(n.geometry.type=="Polygon"){this.hover="polygon";break}else if(n.geometry.type=="Point"&&Object.hasOwn(n.properties,"idx")){this.hover=n.properties.idx;break}this.hover==null&&(this.cursor=lr(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(ls),n=[JSON.parse(JSON.stringify(e))];return n[0].push(JSON.parse(JSON.stringify(n[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>ju&&this.previousStates.shift()}}function _i(r){let e=[];for(let n=0;n=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[r[r.length-1],r[0]]},properties:{}}),e}class ur{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let t=0;for(let o=0;o0){for(s=e[--n];n>0&&(t=s,o=e[--n],s=t+o,i=o-(s-t),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(o=i*2,t=s+o,o==t-s&&(s=t))}return s}}var Bu=1e-6,bi=1e-12,Jr=Math.PI,$i=Jr/2,vi=180/Jr,tt=Jr/180,fs=Math.atan2,nt=Math.cos,$r=Math.hypot,rt=Math.sin,qu=Math.sqrt;function cs(r){return r>1?$i:r<-1?-$i:Math.asin(r)}function Gu(){}function Tn(r,e){r&&wi.hasOwnProperty(r.type)&&wi[r.type](r,e)}var yi={Feature:function(r,e){Tn(r.geometry,e)},FeatureCollection:function(r,e){for(var n=r.features,t=-1,o=n.length;++t{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&gs.decode();let Vt=null;function rn(){return(Vt===null||Vt.byteLength===0)&&(Vt=new Uint8Array(K.memory.buffer)),Vt}function Ve(r,e){return r=r>>>0,gs.decode(rn().subarray(r,r+e))}const ut=new Array(128).fill(void 0);ut.push(void 0,null,!0,!1);let on=ut.length;function $e(r){on===ut.length&&ut.push(ut.length+1);const e=on;return on=ut[e],ut[e]=r,e}function ie(r){return ut[r]}function Wu(r){r<132||(ut[r]=on,on=r)}function En(r){const e=ie(r);return Wu(r),e}function ar(r){return r==null}let Qt=null;function Ku(){return(Qt===null||Qt.byteLength===0)&&(Qt=new Float64Array(K.memory.buffer)),Qt}let xt=null;function ce(){return(xt===null||xt.byteLength===0)&&(xt=new Int32Array(K.memory.buffer)),xt}let mt=0;const Mn=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hu=typeof Mn.encodeInto=="function"?function(r,e){return Mn.encodeInto(r,e)}:function(r,e){const n=Mn.encode(r);return e.set(n),{read:r.length,written:n.length}};function vn(r,e,n){if(n===void 0){const l=Mn.encode(r),u=e(l.length,1)>>>0;return rn().subarray(u,u+l.length).set(l),mt=l.length,u}let t=r.length,o=e(t,1)>>>0;const i=rn();let s=0;for(;s127)break;i[o+s]=l}if(s!==t){s!==0&&(r=r.slice(s)),o=n(o,t,t=s+r.length*3,1)>>>0;const l=rn().subarray(o+s,o+t),u=Hu(r,l);s+=u.written}return mt=s,o}function Sr(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const o=r.description;return o==null?"Symbol":`Symbol(${o})`}if(e=="function"){const o=r.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(r)){const o=r.length;let i="[";o>0&&(i+=Sr(r[0]));for(let s=1;s1)t=n[1];else return toString.call(r);if(t=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} +var Ks=Object.defineProperty;var Hs=(r,e,n)=>e in r?Ks(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var me=(r,e,n)=>(Hs(r,typeof e!="symbol"?e+"":e,n),n);import{S as ee,i as te,s as Q,O as Jt,e as G,b as U,c as v,P as Yt,Q as Xt,T as Wt,t as w,p as k,d as y,f as pe,j as P,o as L,u as C,U as jr,V as Pt,W as Lt,E as Je,a as F,X as Le,Y as he,x as B,m as z,N as ge,Z as Qn,_ as be,$ as Qr,a0 as we,a1 as xr,a2 as Bo,a3 as Zs,a4 as qo,a5 as Vs,a6 as Qs,a7 as at,a8 as ae,y as se,q as le,a9 as Go,aa as xs,v as Y,ab as Ye,ac as el,ad as Be,ae as tl,af as nl,n as ne,H as pn,ag as rl,ah as il,ai as ol,aj as sl,ak as je,al as Ir,am as Br,an as ll,ao as ul,ap as al,G as Mt,aq as fl,ar as ke,as as Bt,g as Z,h as V,r as x,at as xn,au as Xe,av as Fn,aw as Pe,ax as un,w as it,ay as oe,D as ot,az as en,aA as tn,aB as kt,J as qt,aC as Rn,aD as We,aE as nn,aF as qr,aG as ei,aH as Te,aI as mr,aJ as cl,aK as pl,aL as Ge,aM as On,aN as ti,aO as pt,aP as To,aQ as ml,aR as mn,R as Gt,aS as st,aT as Ct,K as et,aU as Et,aV as dr,aW as dl,aX as gl,C as hl,F as Do,aY as Gr,aZ as jn,a_ as ni,a$ as _l,b0 as bl,b1 as er,M as $l,L as vl,k as yl,z as wl,A as kl,b2 as Sl}from"./index-980b667c.js";import{M as gr,m as ze,b as Uo,l as ue,e as Tt,C as zo,a as ht,R as El,i as St,c as an,d as fn,f as Dt,g as Ml,h as Ht,S as Pl,j as Ll,k as tr,p as In,n as Cl,o as Nl,t as Al,r as ri,W as Jo,q as Fl,H as Rl,B as Ol,Z as jl,G as Il}from"./ZoomOutMap-9940a4a0.js";import{A as Bl}from"./About-32237c0d.js";function ql(r){let e,n;const t=r[1].default,o=Jt(t,r,r[0],null);return{c(){e=G("div"),o&&o.c(),U(e,"class","govuk-button-group")},m(i,s){v(i,e,s),o&&o.m(e,null),n=!0},p(i,[s]){o&&o.p&&(!n||s&1)&&Yt(o,t,i,i[0],n?Wt(t,i[0],s,null):Xt(i[0]),null)},i(i){n||(w(o,i),n=!0)},o(i){k(o,i),n=!1},d(i){i&&y(e),o&&o.d(i)}}}function Gl(r,e,n){let{$$slots:t={},$$scope:o}=e;return r.$$set=i=>{"$$scope"in i&&n(0,o=i.$$scope)},[o,t]}class Ke extends ee{constructor(e){super(),te(this,e,Gl,ql,Q,{})}}function Tl(r){let e;const n=r[1].default,t=Jt(n,r,r[3],null);return{c(){t&&t.c()},m(o,i){t&&t.m(o,i),e=!0},p(o,i){t&&t.p&&(!e||i&8)&&Yt(t,n,o,o[3],e?Wt(n,o[3],i,null):Xt(o[3]),null)},i(o){e||(w(t,o),e=!0)},o(o){k(t,o),e=!1},d(o){t&&t.d(o)}}}function Dl(r){let e,n;return e=new pe({props:{style:"margin-bottom: 0px",disabled:r[0],$$slots:{default:[Tl]},$$scope:{ctx:r}}}),e.$on("click",r[2]),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&1&&(i.disabled=t[0]),o&8&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function Ul(r,e,n){let{$$slots:t={},$$scope:o}=e,{disabled:i=!1}=e;function s(l){jr.call(this,r,l)}return r.$$set=l=>{"disabled"in l&&n(0,i=l.disabled),"$$scope"in l&&n(3,o=l.$$scope)},[i,t,s,o]}class vt extends ee{constructor(e){super(),te(this,e,Ul,Dl,Q,{disabled:0})}}function ii(r){let e,n,t=Bn(r[0])+"",o;return{c(){e=G("div"),n=B("ÂŁ"),o=B(t),U(e,"class","govuk-hint")},m(i,s){v(i,e,s),z(e,n),z(e,o)},p(i,s){s&1&&t!==(t=Bn(i[0])+"")&&ge(o,t)},d(i){i&&y(e)}}}function zl(r){let e;return{c(){e=B("multiply by 1 million")},m(n,t){v(n,e,t)},d(n){n&&y(e)}}}function Jl(r){let e,n,t,o,i,s,l,u,a;e=new Je({props:{errorMessage:oi(r[2])}});let f=r[0]!=null&&ii(r);return s=new pe({props:{disabled:r[0]==null||r[0]>1e3,$$slots:{default:[zl]},$$scope:{ctx:r}}}),s.$on("click",r[4]),{c(){P(e.$$.fragment),n=F(),f&&f.c(),t=F(),o=G("input"),i=F(),P(s.$$.fragment),U(o,"type","text"),U(o,"inputmode","numeric"),U(o,"class","govuk-input govuk-input--width-10"),U(o,"id",r[3])},m(c,p){L(e,c,p),v(c,n,p),f&&f.m(c,p),v(c,t,p),v(c,o,p),Le(o,r[2]),v(c,i,p),L(s,c,p),l=!0,u||(a=he(o,"input",r[5]),u=!0)},p(c,p){const m={};p&4&&(m.errorMessage=oi(c[2])),e.$set(m),c[0]!=null?f?f.p(c,p):(f=ii(c),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null),p&4&&o.value!==c[2]&&Le(o,c[2]);const g={};p&1&&(g.disabled=c[0]==null||c[0]>1e3),p&128&&(g.$$scope={dirty:p,ctx:c}),s.$set(g)},i(c){l||(w(e.$$.fragment,c),w(s.$$.fragment,c),l=!0)},o(c){k(e.$$.fragment,c),k(s.$$.fragment,c),l=!1},d(c){c&&(y(n),y(t),y(o),y(i)),C(e,c),f&&f.d(c),C(s,c),u=!1,a()}}}function Yl(r){let e,n;return e=new Pt({props:{label:r[1],id:r[3],$$slots:{default:[Jl]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&2&&(i.label=t[1]),o&133&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function Yo(r){if(r!="")return parseFloat(r.replaceAll(",",""))}function oi(r){let e=Yo(r);return e==null?"":isNaN(e)?"Please enter a valid number":e<0?"Please enter a positive number":""}function Bn(r){return r.toLocaleString()}function Xl(r,e,n){let{label:t}=e,{value:o}=e,i=Lt(),s=o==null?"":Bn(o);function l(f){n(0,o=Yo(f))}function u(){n(2,s=Bn(o*1e6))}function a(){s=this.value,n(2,s)}return r.$$set=f=>{"label"in f&&n(1,t=f.label),"value"in f&&n(0,o=f.value)},r.$$.update=()=>{r.$$.dirty&4&&l(s)},[o,t,s,i,u,a]}class Wl extends ee{constructor(e){super(),te(this,e,Xl,Yl,Q,{label:1,value:0})}}function Kl(r){let e,n,t,o,i,s,l;return e=new Je({props:{errorMessage:r[5](r[2])}}),{c(){P(e.$$.fragment),n=F(),t=G("input"),U(t,"type","text"),U(t,"inputmode","numeric"),U(t,"class",o=`govuk-input govuk-input--width-${r[1]}`),U(t,"id",r[3])},m(u,a){L(e,u,a),v(u,n,a),v(u,t,a),Le(t,r[2]),i=!0,s||(l=[he(t,"input",r[9]),he(t,"change",r[4])],s=!0)},p(u,a){const f={};a&4&&(f.errorMessage=u[5](u[2])),e.$set(f),(!i||a&2&&o!==(o=`govuk-input govuk-input--width-${u[1]}`))&&U(t,"class",o),a&4&&t.value!==u[2]&&Le(t,u[2])},i(u){i||(w(e.$$.fragment,u),i=!0)},o(u){k(e.$$.fragment,u),i=!1},d(u){u&&(y(n),y(t)),C(e,u),s=!1,Qn(l)}}}function Hl(r){let e,n;return e=new Pt({props:{label:r[0],id:r[3],$$slots:{default:[Kl]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&1&&(i.label=t[0]),o&1030&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function Zl(r,e,n){let{label:t}=e,{value:o}=e,{width:i}=e,{min:s=void 0}=e,{max:l=void 0}=e,u=o==null?void 0:o.toString(),a=Lt();function f(){n(6,o=u==null?void 0:parseInt(u,10))}function c(m){if(m==""||m==null)return"";if(m.includes("."))return"Please enter a number without decimals";let g=Number(m);return isNaN(g)?"Please enter a valid number":s!=null&&gl?`Please enter a number that's at most ${l};`:""}function p(){u=this.value,n(2,u)}return r.$$set=m=>{"label"in m&&n(0,t=m.label),"value"in m&&n(6,o=m.value),"width"in m&&n(1,i=m.width),"min"in m&&n(7,s=m.min),"max"in m&&n(8,l=m.max)},[t,i,u,a,f,c,o,s,l,p]}class ir extends ee{constructor(e){super(),te(this,e,Zl,Hl,Q,{label:0,value:6,width:1,min:7,max:8})}}function si(r){let e,n;return{c(){e=G("div"),n=B(r[2]),U(e,"class","govuk-hint")},m(t,o){v(t,e,o),z(e,n)},p(t,o){o&4&&ge(n,t[2])},d(t){t&&y(e)}}}function Vl(r){let e,n,t,o,i,s,l;e=new Je({props:{errorMessage:r[4]}});let u=r[2]&&si(r);return{c(){P(e.$$.fragment),n=F(),u&&u.c(),t=F(),o=G("textarea"),U(o,"class","govuk-textarea"),U(o,"id",r[5]),U(o,"rows",r[3])},m(a,f){L(e,a,f),v(a,n,f),u&&u.m(a,f),v(a,t,f),v(a,o,f),Le(o,r[0]),i=!0,s||(l=he(o,"input",r[6]),s=!0)},p(a,f){const c={};f&16&&(c.errorMessage=a[4]),e.$set(c),a[2]?u?u.p(a,f):(u=si(a),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),(!i||f&8)&&U(o,"rows",a[3]),f&1&&Le(o,a[0])},i(a){i||(w(e.$$.fragment,a),i=!0)},o(a){k(e.$$.fragment,a),i=!1},d(a){a&&(y(n),y(t),y(o)),C(e,a),u&&u.d(a),s=!1,l()}}}function Ql(r){let e,n;return e=new Pt({props:{label:r[1],id:r[5],$$slots:{default:[Vl]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&2&&(i.label=t[1]),o&157&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function xl(r,e,n){let{label:t}=e,{hint:o=""}=e,{value:i}=e,{rows:s=5}=e,{errorMessage:l=""}=e,u=Lt();function a(){i=this.value,n(0,i)}return r.$$set=f=>{"label"in f&&n(1,t=f.label),"hint"in f&&n(2,o=f.hint),"value"in f&&n(0,i=f.value),"rows"in f&&n(3,s=f.rows),"errorMessage"in f&&n(4,l=f.errorMessage)},[i,t,o,s,l,u,a]}class Tr extends ee{constructor(e){super(),te(this,e,xl,Ql,Q,{label:1,hint:2,value:0,rows:3,errorMessage:4})}}function eu(r){let e,n,t,o,i,s;return e=new Je({props:{errorMessage:r[2]}}),{c(){P(e.$$.fragment),n=F(),t=G("input"),U(t,"type","text"),U(t,"class","govuk-input"),U(t,"id",r[3])},m(l,u){L(e,l,u),v(l,n,u),v(l,t,u),Le(t,r[0]),o=!0,i||(s=[he(t,"input",r[6]),he(t,"change",r[5])],i=!0)},p(l,u){const a={};u&4&&(a.errorMessage=l[2]),e.$set(a),u&1&&t.value!==l[0]&&Le(t,l[0])},i(l){o||(w(e.$$.fragment,l),o=!0)},o(l){k(e.$$.fragment,l),o=!1},d(l){l&&(y(n),y(t)),C(e,l),i=!1,Qn(s)}}}function tu(r){let e,n;return e=new Pt({props:{label:r[1],id:r[3],$$slots:{default:[eu]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,o){L(e,t,o),n=!0},p(t,[o]){const i={};o&2&&(i.label=t[1]),o&133&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){k(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function nu(r,e,n){let t,{label:o}=e,{value:i}=e,{required:s=!1}=e,l=Lt();function u(f){jr.call(this,r,f)}function a(){i=this.value,n(0,i)}return r.$$set=f=>{"label"in f&&n(1,o=f.label),"value"in f&&n(0,i=f.value),"required"in f&&n(4,s=f.required)},r.$$.update=()=>{r.$$.dirty&17&&n(2,t=s&&(i==null||i=="")?"Required":"")},[i,o,t,l,s,u,a]}class nr extends ee{constructor(e){super(),te(this,e,nu,tu,Q,{label:1,value:0,required:4})}}function ru(r){let e,n,t,o;const i=r[2].default,s=Jt(i,r,r[1],null);let l=[{type:"button"},{class:"govuk-button govuk-button--warning"},{"data-module":"govuk-button"},r[0]],u={};for(let a=0;a{n(0,e=be(be({},e),xr(s))),"$$scope"in s&&n(1,o=s.$$scope)},e=xr(e),[e,o,t,i]}class bt extends ee{constructor(e){super(),te(this,e,iu,ru,Q,{})}}class ou{constructor(e){me(this,"map");me(this,"active");me(this,"eventListenersSuccess");me(this,"eventListenersFailure");me(this,"cursor");me(this,"onMouseMove",e=>{this.active&&(this.cursor={type:"Feature",properties:{},geometry:{type:"Point",coordinates:Bo(e.lngLat.toArray())}})});me(this,"onClick",()=>{if(this.active&&this.cursor){for(let e of this.eventListenersSuccess)e(this.cursor);this.stop()}});me(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersFailure=[],this.cursor=null,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),document.removeEventListener("keydown",this.onKeyDown)}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersFailure=[]}start(){this.map.getCanvas().style.cursor="crosshair",this.active=!0}stop(){this.map.getCanvas().style.cursor="inherit",this.cursor=null,this.active=!1}}function su(r){var e=r%(2*Math.PI);return e*180/Math.PI}function bn(r){var e=r%360;return e*Math.PI/180}function gt(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function xe(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function hr(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function Xo(r,e,n){if(n===void 0&&(n={}),n.final===!0)return lu(r,e);var t=gt(r),o=gt(e),i=bn(t[0]),s=bn(o[0]),l=bn(t[1]),u=bn(o[1]),a=Math.sin(s-i)*Math.cos(u),f=Math.cos(l)*Math.sin(u)-Math.sin(l)*Math.cos(u)*Math.cos(s-i);return su(Math.atan2(a,f))}function lu(r,e){var n=Xo(e,r);return n=(n+180)%360,n}var Re=63710088e-1,uu={centimeters:Re*100,centimetres:Re*100,degrees:Re/111325,feet:Re*3.28084,inches:Re*39.37,kilometers:Re/1e3,kilometres:Re/1e3,meters:Re,metres:Re,miles:Re/1609.344,millimeters:Re*1e3,millimetres:Re*1e3,nauticalmiles:Re/1852,radians:1,yards:Re*1.0936};function au(r,e){e===void 0&&(e="kilometers");var n=uu[e];if(!n)throw new Error(e+" units is invalid");return r*n}function $n(r){var e=r%360;return e*Math.PI/180}function ft(r,e,n){n===void 0&&(n={});var t=gt(r),o=gt(e),i=$n(o[1]-t[1]),s=$n(o[0]-t[0]),l=$n(t[1]),u=$n(o[1]),a=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(l)*Math.cos(u);return au(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)),n.units)}var Oe=63710088e-1,fu={centimeters:Oe*100,centimetres:Oe*100,degrees:Oe/111325,feet:Oe*3.28084,inches:Oe*39.37,kilometers:Oe/1e3,kilometres:Oe/1e3,meters:Oe,metres:Oe,miles:Oe/1609.344,millimeters:Oe*1e3,millimetres:Oe*1e3,nauticalmiles:Oe/1852,radians:1,yards:Oe*1.0936};function cu(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function pu(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ui(r[0])||!ui(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return cu(t,e,n)}function mu(r,e){e===void 0&&(e="kilometers");var n=fu[e];if(!n)throw new Error(e+" units is invalid");return r/n}function li(r){var e=r%(2*Math.PI);return e*180/Math.PI}function or(r){var e=r%360;return e*Math.PI/180}function ui(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function ai(r,e,n,t){t===void 0&&(t={});var o=gt(r),i=or(o[0]),s=or(o[1]),l=or(n),u=mu(e,t.units),a=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(l)),f=i+Math.atan2(Math.sin(l)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(a)),c=li(f),p=li(a);return pu([c,p],t.properties)}function _r(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function du(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ci(r[0])||!ci(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return _r(t,e,n)}function fi(r,e){e===void 0&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=r,n}function ci(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function gu(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function hu(r,e,n){if(n===void 0&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var t={type:"LineString",coordinates:r};return gu(t,e,n)}function _u(r,e){e===void 0&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=r,n}function qn(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function Rt(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!pi(r[0])||!pi(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return qn(t,e,n)}function It(r,e,n){if(n===void 0&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var t={type:"LineString",coordinates:r};return qn(t,e,n)}function pi(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Wo(r){return!!r&&r.constructor===Object}function Nt(r,e,n){if(r!==null)for(var t,o,i,s,l,u,a,f=0,c=0,p,m=r.type,g=m==="FeatureCollection",$=m==="Feature",b=g?r.features.length:1,S=0;Su||g>a||$>f){l=c,u=t,a=g,f=$,i=0;return}var b=It([l,c],n.properties);if(e(b,t,o,$,i)===!1)return!1;i++,l=c})===!1)return!1}}})}function Vo(r,e,n){var t=n,o=!1;return Zo(r,function(i,s,l,u,a){o===!1&&n===void 0?t=i:t=e(t,i,s,l,u,a),o=!0}),t}function Qo(r,e){if(!r)throw new Error("geojson is required");At(r,function(n,t,o){if(n.geometry!==null){var i=n.geometry.type,s=n.geometry.coordinates;switch(i){case"LineString":if(e(n,t,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;lo?n:o,a=t>i?t:i;return[s,l,u,a]}var Ur={exports:{}},xo={exports:{}};(function(r,e){(function(n,t){r.exports=t()})(Zs,function(){function n(d,_,M,h,E){(function R(I,T,q,O,N){for(;O>q;){if(O-q>600){var A=O-q+1,j=T-q+1,W=Math.log(A),re=.5*Math.exp(2*W/3),fe=.5*Math.sqrt(W*re*(A-re)/A)*(j-A/2<0?-1:1),D=Math.max(q,Math.floor(T-j*re/A+fe)),de=Math.min(O,Math.floor(T+(A-j)*re/A+fe));R(I,T,D,de,N)}var _e=I[T],Ee=q,ve=O;for(t(I,q,T),N(I[O],_e)>0&&t(I,q,O);Ee0;)ve--}N(I[q],_e)===0?t(I,q,ve):t(I,++ve,O),ve<=T&&(q=ve+1),T<=ve&&(O=ve-1)}})(d,_,M||0,h||d.length-1,E||o)}function t(d,_,M){var h=d[_];d[_]=d[M],d[M]=h}function o(d,_){return d<_?-1:d>_?1:0}var i=function(d){d===void 0&&(d=9),this._maxEntries=Math.max(4,d),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(d,_,M){if(!M)return _.indexOf(d);for(var h=0;h<_.length;h++)if(M(d,_[h]))return h;return-1}function l(d,_){u(d,0,d.children.length,_,d)}function u(d,_,M,h,E){E||(E=b(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var R=_;R=d.minX&&_.maxY>=d.minY}function b(d){return{children:d,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(d,_,M,h,E){for(var R=[_,M];R.length;)if(!((M=R.pop())-(_=R.pop())<=h)){var I=_+Math.ceil((M-_)/h/2)*h;n(d,I,_,M,E),R.push(_,I,I,M)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(d){var _=this.data,M=[];if(!$(d,_))return M;for(var h=this.toBBox,E=[];_;){for(var R=0;R<_.children.length;R++){var I=_.children[R],T=_.leaf?h(I):I;$(d,T)&&(_.leaf?M.push(I):g(d,T)?this._all(I,M):E.push(I))}_=E.pop()}return M},i.prototype.collides=function(d){var _=this.data;if(!$(d,_))return!1;for(var M=[];_;){for(var h=0;h<_.children.length;h++){var E=_.children[h],R=_.leaf?this.toBBox(E):E;if($(d,R)){if(_.leaf||g(d,R))return!0;M.push(E)}}_=M.pop()}return!1},i.prototype.load=function(d){if(!d||!d.length)return this;if(d.length=0&&E[_].children.length>this._maxEntries;)this._split(E,_),_--;this._adjustParentBBoxes(h,E,_)},i.prototype._split=function(d,_){var M=d[_],h=M.children.length,E=this._minEntries;this._chooseSplitAxis(M,E,h);var R=this._chooseSplitIndex(M,E,h),I=b(M.children.splice(R,M.children.length-R));I.height=M.height,I.leaf=M.leaf,l(M,this.toBBox),l(I,this.toBBox),_?d[_-1].children.push(I):this._splitRoot(M,I)},i.prototype._splitRoot=function(d,_){this.data=b([d,_]),this.data.height=d.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(d,_,M){for(var h,E,R,I,T,q,O,N=1/0,A=1/0,j=_;j<=M-_;j++){var W=u(d,0,j,this.toBBox),re=u(d,j,M,this.toBBox),fe=(E=W,R=re,I=void 0,T=void 0,q=void 0,O=void 0,I=Math.max(E.minX,R.minX),T=Math.max(E.minY,R.minY),q=Math.min(E.maxX,R.maxX),O=Math.min(E.maxY,R.maxY),Math.max(0,q-I)*Math.max(0,O-T)),D=p(W)+p(re);fe=_;N--){var A=d.children[N];a(I,d.leaf?E(A):A),T+=m(I)}return T},i.prototype._adjustParentBBoxes=function(d,_,M){for(var h=M;h>=0;h--)a(_[h],d)},i.prototype._condense=function(d){for(var _=d.length-1,M=void 0;_>=0;_--)d[_].children.length===0?_>0?(M=d[_-1].children).splice(M.indexOf(d[_]),1):this.clear():l(d[_],this.toBBox)},i})})(xo);var Nu=xo.exports,es={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function e(O,N,A){A===void 0&&(A={});var j={type:"Feature"};return(A.id===0||A.id)&&(j.id=A.id),A.bbox&&(j.bbox=A.bbox),j.properties=N||{},j.geometry=O,j}r.feature=e;function n(O,N,A){switch(O){case"Point":return t(N).geometry;case"LineString":return l(N).geometry;case"Polygon":return i(N).geometry;case"MultiPoint":return c(N).geometry;case"MultiLineString":return f(N).geometry;case"MultiPolygon":return p(N).geometry;default:throw new Error(O+" is invalid")}}r.geometry=n;function t(O,N,A){if(A===void 0&&(A={}),!O)throw new Error("coordinates is required");if(!Array.isArray(O))throw new Error("coordinates must be an Array");if(O.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!R(O[0])||!R(O[1]))throw new Error("coordinates must contain numbers");var j={type:"Point",coordinates:O};return e(j,N,A)}r.point=t;function o(O,N,A){return A===void 0&&(A={}),a(O.map(function(j){return t(j,N)}),A)}r.points=o;function i(O,N,A){A===void 0&&(A={});for(var j=0,W=O;j=0))throw new Error("precision must be a positive number");var A=Math.pow(10,N||0);return Math.round(O*A)/A}r.round=g;function $(O,N){N===void 0&&(N="kilometers");var A=r.factors[N];if(!A)throw new Error(N+" units is invalid");return O*A}r.radiansToLength=$;function b(O,N){N===void 0&&(N="kilometers");var A=r.factors[N];if(!A)throw new Error(N+" units is invalid");return O/A}r.lengthToRadians=b;function S(O,N){return _(b(O,N))}r.lengthToDegrees=S;function d(O){var N=O%360;return N<0&&(N+=360),N}r.bearingToAzimuth=d;function _(O){var N=O%(2*Math.PI);return N*180/Math.PI}r.radiansToDegrees=_;function M(O){var N=O%360;return N*Math.PI/180}r.degreesToRadians=M;function h(O,N,A){if(N===void 0&&(N="kilometers"),A===void 0&&(A="kilometers"),!(O>=0))throw new Error("length must be a positive number");return $(b(O,N),A)}r.convertLength=h;function E(O,N,A){if(N===void 0&&(N="meters"),A===void 0&&(A="kilometers"),!(O>=0))throw new Error("area must be a positive number");var j=r.areaFactors[N];if(!j)throw new Error("invalid original units");var W=r.areaFactors[A];if(!W)throw new Error("invalid final units");return O/j*W}r.convertArea=E;function R(O){return!isNaN(O)&&O!==null&&!Array.isArray(O)}r.isNumber=R;function I(O){return!!O&&O.constructor===Object}r.isObject=I;function T(O){if(!O)throw new Error("bbox is required");if(!Array.isArray(O))throw new Error("bbox must be an Array");if(O.length!==4&&O.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");O.forEach(function(N){if(!R(N))throw new Error("bbox must only contain numbers")})}r.validateBBox=T;function q(O){if(!O)throw new Error("id is required");if(["string","number"].indexOf(typeof O)===-1)throw new Error("id must be a number or a string")}r.validateId=q})(es);const Au=qo(Mu),Fu=qo(Vs);var He=Nu,ts=es,ns=Au,Ot=Fu.default,Ru=ns.featureEach;ns.coordEach;ts.polygon;var mi=ts.featureCollection;function rs(r){var e=new He(r);return e.insert=function(n){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Ot(n),He.prototype.insert.call(this,n)},e.load=function(n){var t=[];return Array.isArray(n)?n.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ot(o),t.push(o)}):Ru(n,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ot(o),t.push(o)}),He.prototype.load.call(this,t)},e.remove=function(n,t){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Ot(n),He.prototype.remove.call(this,n,t)},e.clear=function(){return He.prototype.clear.call(this)},e.search=function(n){var t=He.prototype.search.call(this,this.toBBox(n));return mi(t)},e.collides=function(n){return He.prototype.collides.call(this,this.toBBox(n))},e.all=function(){var n=He.prototype.all.call(this);return mi(n)},e.toJSON=function(){return He.prototype.toJSON.call(this)},e.fromJSON=function(n){return He.prototype.fromJSON.call(this,n)},e.toBBox=function(n){var t;if(n.bbox)t=n.bbox;else if(Array.isArray(n)&&n.length===4)t=n;else if(Array.isArray(n)&&n.length===6)t=[n[0],n[1],n[3],n[4]];else if(n.type==="Feature")t=Ot(n);else if(n.type==="FeatureCollection")t=Ot(n);else throw new Error("invalid geojson");return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},e}Ur.exports=rs;Ur.exports.default=rs;var Ou=Ur.exports;const zr=Qs(Ou);function is(r,e){var n={},t=[];if(r.type==="LineString"&&(r=_r(r)),e.type==="LineString"&&(e=_r(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var o=di(r,e);return o&&t.push(o),fi(t)}var i=zr();return i.load(br(e)),Ut(br(r),function(s){Ut(i.search(s),function(l){var u=di(s,l);if(u){var a=xe(u).join(",");n[a]||(n[a]=!0,t.push(u))}})}),fi(t)}function di(r,e){var n=xe(r),t=xe(e);if(n.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(t.length!==2)throw new Error(" line2 must only contain 2 coordinates");var o=n[0][0],i=n[0][1],s=n[1][0],l=n[1][1],u=t[0][0],a=t[0][1],f=t[1][0],c=t[1][1],p=(c-a)*(s-o)-(f-u)*(l-i),m=(f-u)*(i-a)-(c-a)*(o-u),g=(s-o)*(i-a)-(l-i)*(o-u);if(p===0)return null;var $=m/p,b=g/p;if($>=0&&$<=1&&b>=0&&b<=1){var S=o+$*(s-o),d=i+$*(l-i);return du([S,d])}return null}function os(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function sr(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hi(r[0])||!hi(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return os(t,e,n)}function gi(r,e,n){if(n===void 0&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var t={type:"LineString",coordinates:r};return os(t,e,n)}function hi(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Gn(r,e,n){n===void 0&&(n={});var t=sr([1/0,1/0],{dist:1/0}),o=0;return At(r,function(i){for(var s=xe(i),l=0;l0&&(b=$.features[0],b.properties.dist=ft(e,b,n),b.properties.location=o+ft(u,b,n)),u.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(e);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let n=this.dragFrom[0]-e.lngLat.lng,t=this.dragFrom[1]-e.lngLat.lat;for(let o of this.points)o[0]-=n,o[1]-=t}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});me(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(_i(this.points).forEach((t,o)=>{n.push([o+1,Gn(t,this.cursor).properties.dist])}),n.sort((t,o)=>t[1]-o[1]),n.length>0){let t=n[0][0];this.points.splice(t,0,this.cursor.geometry.coordinates),this.hover=t}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(e))});me(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=lr(e.lngLat.toArray()),this.onClick(e),this.finish())});me(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});me(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});me(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});me(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersSuccess)n(e);else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(e){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let e=ss();this.points.forEach((o,i)=>{let s=lr(o);s.properties.hover=this.hover==i,s.properties.idx=i,e.features.push(s)}),e.features=e.features.concat(_i(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",e.features.push(n)),us.set(e);let t="crosshair";this.hover!=null&&(t=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=t,as.set(this.previousStates.length)}pointsUpdated(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersUpdated)n(e)}recalculateHovering(e){this.cursor=null,this.hover=null;for(let n of this.map.queryRenderedFeatures(e.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(n.geometry.type=="Polygon"){this.hover="polygon";break}else if(n.geometry.type=="Point"&&Object.hasOwn(n.properties,"idx")){this.hover=n.properties.idx;break}this.hover==null&&(this.cursor=lr(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(ls),n=[JSON.parse(JSON.stringify(e))];return n[0].push(JSON.parse(JSON.stringify(n[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>ju&&this.previousStates.shift()}}function _i(r){let e=[];for(let n=0;n=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[r[r.length-1],r[0]]},properties:{}}),e}class ur{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let t=0;for(let o=0;o0){for(s=e[--n];n>0&&(t=s,o=e[--n],s=t+o,i=o-(s-t),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(o=i*2,t=s+o,o==t-s&&(s=t))}return s}}var Bu=1e-6,bi=1e-12,Jr=Math.PI,$i=Jr/2,vi=180/Jr,tt=Jr/180,fs=Math.atan2,nt=Math.cos,$r=Math.hypot,rt=Math.sin,qu=Math.sqrt;function cs(r){return r>1?$i:r<-1?-$i:Math.asin(r)}function Gu(){}function Tn(r,e){r&&wi.hasOwnProperty(r.type)&&wi[r.type](r,e)}var yi={Feature:function(r,e){Tn(r.geometry,e)},FeatureCollection:function(r,e){for(var n=r.features,t=-1,o=n.length;++t{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&gs.decode();let Vt=null;function rn(){return(Vt===null||Vt.byteLength===0)&&(Vt=new Uint8Array(K.memory.buffer)),Vt}function Ve(r,e){return r=r>>>0,gs.decode(rn().subarray(r,r+e))}const ut=new Array(128).fill(void 0);ut.push(void 0,null,!0,!1);let on=ut.length;function $e(r){on===ut.length&&ut.push(ut.length+1);const e=on;return on=ut[e],ut[e]=r,e}function ie(r){return ut[r]}function Wu(r){r<132||(ut[r]=on,on=r)}function En(r){const e=ie(r);return Wu(r),e}function ar(r){return r==null}let Qt=null;function Ku(){return(Qt===null||Qt.byteLength===0)&&(Qt=new Float64Array(K.memory.buffer)),Qt}let xt=null;function ce(){return(xt===null||xt.byteLength===0)&&(xt=new Int32Array(K.memory.buffer)),xt}let mt=0;const Mn=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hu=typeof Mn.encodeInto=="function"?function(r,e){return Mn.encodeInto(r,e)}:function(r,e){const n=Mn.encode(r);return e.set(n),{read:r.length,written:n.length}};function vn(r,e,n){if(n===void 0){const l=Mn.encode(r),u=e(l.length,1)>>>0;return rn().subarray(u,u+l.length).set(l),mt=l.length,u}let t=r.length,o=e(t,1)>>>0;const i=rn();let s=0;for(;s127)break;i[o+s]=l}if(s!==t){s!==0&&(r=r.slice(s)),o=n(o,t,t=s+r.length*3,1)>>>0;const l=rn().subarray(o+s,o+t),u=Hu(r,l);s+=u.written}return mt=s,o}function Sr(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const o=r.description;return o==null?"Symbol":`Symbol(${o})`}if(e=="function"){const o=r.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(r)){const o=r.length;let i="[";o>0&&(i+=Sr(r[0]));for(let s=1;s1)t=n[1];else return toString.call(r);if(t=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} ${r.stack}`:t}function Zu(r,e){const n=e(r.length*1,1)>>>0;return rn().set(r,n/1),mt=r.length,n}function fr(r,e){try{return r.apply(this,e)}catch(n){K.__wbindgen_exn_store($e(n))}}class Kn{static __wrap(e){e=e>>>0;const n=Object.create(Kn.prototype);return n.__wbg_ptr=e,n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();K.__wbg_jsroutesnapper_free(e)}constructor(e){try{const i=K.__wbindgen_add_to_stack_pointer(-16),s=Zu(e,K.__wbindgen_malloc),l=mt;K.jsroutesnapper_new(i,s,l);var n=ce()[i/4+0],t=ce()[i/4+1],o=ce()[i/4+2];if(o)throw En(t);return Kn.__wrap(n)}finally{K.__wbindgen_add_to_stack_pointer(16)}}setRouteConfig(e){K.jsroutesnapper_setRouteConfig(this.__wbg_ptr,$e(e))}setAreaMode(){K.jsroutesnapper_setAreaMode(this.__wbg_ptr)}getConfig(){let e,n;try{const i=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_getConfig(i,this.__wbg_ptr);var t=ce()[i/4+0],o=ce()[i/4+1];return e=t,n=o,Ve(t,o)}finally{K.__wbindgen_add_to_stack_pointer(16),K.__wbindgen_free(e,n,1)}}toFinalFeature(){try{const t=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_toFinalFeature(t,this.__wbg_ptr);var e=ce()[t/4+0],n=ce()[t/4+1];let o;return e!==0&&(o=Ve(e,n).slice(),K.__wbindgen_free(e,n*1)),o}finally{K.__wbindgen_add_to_stack_pointer(16)}}renderGeojson(){let e,n;try{const i=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_renderGeojson(i,this.__wbg_ptr);var t=ce()[i/4+0],o=ce()[i/4+1];return e=t,n=o,Ve(t,o)}finally{K.__wbindgen_add_to_stack_pointer(16),K.__wbindgen_free(e,n,1)}}toggleSnapMode(){K.jsroutesnapper_toggleSnapMode(this.__wbg_ptr)}onMouseMove(e,n,t){return K.jsroutesnapper_onMouseMove(this.__wbg_ptr,e,n,t)!==0}onClick(){K.jsroutesnapper_onClick(this.__wbg_ptr)}onDragStart(){return K.jsroutesnapper_onDragStart(this.__wbg_ptr)!==0}onMouseUp(){return K.jsroutesnapper_onMouseUp(this.__wbg_ptr)!==0}clearState(){K.jsroutesnapper_clearState(this.__wbg_ptr)}editExisting(e){try{const o=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_editExisting(o,this.__wbg_ptr,$e(e));var n=ce()[o/4+0],t=ce()[o/4+1];if(t)throw En(n)}finally{K.__wbindgen_add_to_stack_pointer(16)}}debugRenderGraph(){let e,n;try{const i=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_debugRenderGraph(i,this.__wbg_ptr);var t=ce()[i/4+0],o=ce()[i/4+1];return e=t,n=o,Ve(t,o)}finally{K.__wbindgen_add_to_stack_pointer(16),K.__wbindgen_free(e,n,1)}}debugSnappableNodes(){let e,n;try{const i=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_debugSnappableNodes(i,this.__wbg_ptr);var t=ce()[i/4+0],o=ce()[i/4+1];return e=t,n=o,Ve(t,o)}finally{K.__wbindgen_add_to_stack_pointer(16),K.__wbindgen_free(e,n,1)}}routeNameForWaypoints(e){let n,t;try{const f=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_routeNameForWaypoints(f,this.__wbg_ptr,$e(e));var o=ce()[f/4+0],i=ce()[f/4+1],s=ce()[f/4+2],l=ce()[f/4+3],u=o,a=i;if(l)throw u=0,a=0,En(s);return n=u,t=a,Ve(u,a)}finally{K.__wbindgen_add_to_stack_pointer(16),K.__wbindgen_free(n,t,1)}}addSnappedWaypoint(e,n){K.jsroutesnapper_addSnappedWaypoint(this.__wbg_ptr,e,n)}undo(){K.jsroutesnapper_undo(this.__wbg_ptr)}}async function Vu(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(t){if(r.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}const n=await r.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(r,e);return n instanceof WebAssembly.Instance?{instance:n,module:r}:n}}function Qu(){const r={};return r.wbg={},r.wbg.__wbindgen_string_new=function(e,n){const t=Ve(e,n);return $e(t)},r.wbg.__wbindgen_object_drop_ref=function(e){En(e)},r.wbg.__wbindgen_error_new=function(e,n){const t=new Error(Ve(e,n));return $e(t)},r.wbg.__wbindgen_is_object=function(e){const n=ie(e);return typeof n=="object"&&n!==null},r.wbg.__wbindgen_is_undefined=function(e){return ie(e)===void 0},r.wbg.__wbindgen_in=function(e,n){return ie(e)in ie(n)},r.wbg.__wbindgen_number_get=function(e,n){const t=ie(n),o=typeof t=="number"?t:void 0;Ku()[e/8+1]=ar(o)?0:o,ce()[e/4+0]=!ar(o)},r.wbg.__wbindgen_boolean_get=function(e){const n=ie(e);return typeof n=="boolean"?n?1:0:2},r.wbg.__wbindgen_jsval_loose_eq=function(e,n){return ie(e)==ie(n)},r.wbg.__wbindgen_string_get=function(e,n){const t=ie(n),o=typeof t=="string"?t:void 0;var i=ar(o)?0:vn(o,K.__wbindgen_malloc,K.__wbindgen_realloc),s=mt;ce()[e/4+1]=s,ce()[e/4+0]=i},r.wbg.__wbg_getwithrefkey_d1f0d12f1f1b63ea=function(e,n){const t=ie(e)[ie(n)];return $e(t)},r.wbg.__wbindgen_object_clone_ref=function(e){const n=ie(e);return $e(n)},r.wbg.__wbg_String_4370c5505c674d30=function(e,n){const t=String(ie(n)),o=vn(t,K.__wbindgen_malloc,K.__wbindgen_realloc),i=mt;ce()[e/4+1]=i,ce()[e/4+0]=o},r.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return $e(e)},r.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const t=ie(n).stack,o=vn(t,K.__wbindgen_malloc,K.__wbindgen_realloc),i=mt;ce()[e/4+1]=i,ce()[e/4+0]=o},r.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let t,o;try{t=e,o=n,console.error(Ve(e,n))}finally{K.__wbindgen_free(t,o,1)}},r.wbg.__wbg_debug_9a6b3243fbbebb61=function(e){console.debug(ie(e))},r.wbg.__wbg_error_788ae33f81d3b84b=function(e){console.error(ie(e))},r.wbg.__wbg_info_2e30e8204b29d91d=function(e){console.info(ie(e))},r.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(ie(e))},r.wbg.__wbg_warn_d60e832f9882c1b2=function(e){console.warn(ie(e))},r.wbg.__wbg_get_44be0491f933a435=function(e,n){const t=ie(e)[n>>>0];return $e(t)},r.wbg.__wbg_length_fff51ee6522a1a18=function(e){return ie(e).length},r.wbg.__wbindgen_is_function=function(e){return typeof ie(e)=="function"},r.wbg.__wbg_next_526fc47e980da008=function(e){const n=ie(e).next;return $e(n)},r.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return fr(function(e){const n=ie(e).next();return $e(n)},arguments)},r.wbg.__wbg_done_5c1f01fb660d73b5=function(e){return ie(e).done},r.wbg.__wbg_value_1695675138684bd5=function(e){const n=ie(e).value;return $e(n)},r.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return $e(Symbol.iterator)},r.wbg.__wbg_get_97b561fb56f034b5=function(){return fr(function(e,n){const t=Reflect.get(ie(e),ie(n));return $e(t)},arguments)},r.wbg.__wbg_call_cb65541d95d71282=function(){return fr(function(e,n){const t=ie(e).call(ie(n));return $e(t)},arguments)},r.wbg.__wbg_isArray_4c24b343cb13cfb1=function(e){return Array.isArray(ie(e))},r.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(e){let n;try{n=ie(e)instanceof ArrayBuffer}catch{n=!1}return n},r.wbg.__wbg_buffer_085ec1f694018c4f=function(e){const n=ie(e).buffer;return $e(n)},r.wbg.__wbg_new_8125e318e6245eed=function(e){const n=new Uint8Array(ie(e));return $e(n)},r.wbg.__wbg_set_5cf90238115182c3=function(e,n,t){ie(e).set(ie(n),t>>>0)},r.wbg.__wbg_length_72e2208bbc0efc61=function(e){return ie(e).length},r.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(e){let n;try{n=ie(e)instanceof Uint8Array}catch{n=!1}return n},r.wbg.__wbindgen_debug_string=function(e,n){const t=Sr(ie(n)),o=vn(t,K.__wbindgen_malloc,K.__wbindgen_realloc),i=mt;ce()[e/4+1]=i,ce()[e/4+0]=o},r.wbg.__wbindgen_throw=function(e,n){throw new Error(Ve(e,n))},r.wbg.__wbindgen_memory=function(){const e=K.memory;return $e(e)},r}function xu(r,e){return K=r.exports,hs.__wbindgen_wasm_module=e,Qt=null,xt=null,Vt=null,K}async function hs(r){if(K!==void 0)return K;typeof r>"u"&&(r="/atip/browse_layout_v3/assets/route_snapper_bg.wasm");const e=Qu();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:n,module:t}=await Vu(await r,e);return xu(n,t)}function ea(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function ta(r,e,n){if(n===void 0&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Mi(r[0])||!Mi(r[1]))throw new Error("coordinates must contain numbers");var t={type:"Point",coordinates:r};return ea(t,e,n)}function Mi(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Er(r,e){return e===void 0&&(e={}),Vo(r,function(n,t){var o=t.geometry.coordinates;return n+ft(o[0],o[1],e)},0)}function na(r,e,n){n===void 0&&(n={});var t={type:"Feature"};return(n.id===0||n.id)&&(t.id=n.id),n.bbox&&(t.bbox=n.bbox),t.properties=e||{},t.geometry=r,t}function ra(r,e,n){if(n===void 0&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var t={type:"LineString",coordinates:r};return na(t,e,n)}function ia(r,e,n){var t=xe(n);if(hr(n)!=="LineString")throw new Error("line must be a LineString");var o=Gn(n,r),i=Gn(n,e),s;o.properties.index<=i.properties.index?s=[o,i]:s=[i,o];for(var l=[s[0].geometry.coordinates],u=s[0].properties.index+1;u=s){var l=(n+o)/2;return[e,l-(t-e)/2,t,l+(t-e)/2]}else{var u=(e+t)/2;return[u-(o-n)/2,n,u+(o-n)/2,o]}}function Mr(r){var e=[1/0,1/0,-1/0,-1/0];return Nt(r,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2] is required");if(typeof n!="number")throw new Error(" must be a number");if(typeof t!="number")throw new Error(" must be a number");(o===!1||o===void 0)&&(r=JSON.parse(JSON.stringify(r)));var i=Math.pow(10,n);return Nt(r,function(s){la(s,i,t)}),r}function la(r,e,n){r.length>n&&r.splice(n,r.length);for(var t=0;t1&&n.push(Pi(f)),sn(n)}function _s(r,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var n,t=1/0;return Ut(e,function(o){var i=Gn(o,r),s=i.properties.dist;s{if(!this.active)return;const l=[s.point.x-pa,s.point.y],u=this.map.unproject(s.point).distanceTo(this.map.unproject(l));this.inner.onMouseMove(s.lngLat.lng,s.lngLat.lat,u)&&(this.redraw(),this.dataUpdated())},this.onClick=()=>{this.active&&(this.inner.onClick(),this.redraw(),this.dataUpdated())},this.onDoubleClick=s=>{this.active&&(s.preventDefault(),this.inner.onClick(),this.finish())},this.onDragStart=()=>{this.active&&this.inner.onDragStart()&&this.map.dragPan.disable()},this.onMouseUp=()=>{this.active&&this.inner.onMouseUp()&&this.map.dragPan.enable()},this.onKeyDown=s=>{this.active&&s.key=="Escape"&&(s.stopPropagation(),this.cancel())},this.onKeyPress=s=>{this.active&&s.target.tagName!="INPUT"&&(s.key=="Enter"?(s.stopPropagation(),this.finish()):s.key=="s"||s.key=="S"?(s.stopPropagation(),this.inner.toggleSnapMode(),this.redraw()):s.key=="z"&&s.ctrlKey&&this.undo())},this.map=e,console.time("Deserialize and setup JsRouteSnapper"),this.inner=new Kn(n),console.timeEnd("Deserialize and setup JsRouteSnapper"),this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.routeToolGj=t,this.snapMode=o,this.undoLength=i,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("dragstart",this.onDragStart),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keypress",this.onKeyPress)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("dragstart",this.onDragStart),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keypress",this.onKeyPress)}startRoute(){this.active||(this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}startArea(){this.active||(this.inner.setAreaMode(),this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}stop(){this.active=!1,this.inner.clearState(),this.redraw(),this.map.boxZoom.enable(),this.map.doubleClickZoom.enable()}editExistingRoute(e){this.active&&window.alert("Bug: editExistingRoute called when tool is already active"),e.properties.waypoints||(e.properties.waypoints=[{lon:e.geometry.coordinates[0][0],lat:e.geometry.coordinates[0][1],snapped:!0},{lon:e.geometry.coordinates[e.geometry.coordinates.length-1][0],lat:e.geometry.coordinates[e.geometry.coordinates.length-1][1],snapped:!0}]),this.startRoute(),this.inner.editExisting(e.properties.waypoints),this.redraw()}editExistingArea(e){this.active&&window.alert("Bug: editExistingArea called when tool is already active"),e.properties.waypoints||window.alert("Bug: editExistingArea called for a polygon not produced by the route-snapper"),this.startArea(),this.inner.editExisting(e.properties.waypoints),this.redraw()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}isActive(){return this.active}finish(){let e=this.inner.toFinalFeature();if(e)for(let n of this.eventListenersSuccess)n(JSON.parse(e));else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){this.inner.clearState(),this.finish()}setRouteConfig(e){this.inner.setRouteConfig(e),this.redraw()}addSnappedWaypoint(e){this.inner.addSnappedWaypoint(e[0],e[1]),this.redraw()}undo(){this.inner.undo(),this.redraw()}toggleSnapMode(){this.inner.toggleSnapMode(),this.redraw()}redraw(){let e=JSON.parse(this.inner.renderGeojson());this.routeToolGj.set(e),this.map.getCanvas().style.cursor=e.cursor,this.snapMode.set(e.snap_mode),this.undoLength.set(e.undo_length)}dataUpdated(){let e=this.inner.toFinalFeature();if(e)for(let n of this.eventListenersUpdated)n(JSON.parse(e))}}async function da(r,e){let n=await fetch(r),t=n.body.getReader(),o=n.headers.get("Content-Length");if(!o)throw new Error(`No Content-Length header from ${r}`);let i=parseInt(o),s=0,l=[];for(;;){let{done:f,value:c}=await t.read();if(f)break;c&&(l.push(c),s+=c.length,e(100*s/i))}let u=new Uint8Array(s),a=0;for(let f of l)u.set(f,a),a+=f.length;return u}function Ai(r){let e=r[0],n,t,o=Fi(r);return{c(){o.c(),n=ae()},m(i,s){o.m(i,s),v(i,n,s),t=!0},p(i,s){s&1&&Q(e,e=i[0])?(se(),k(o,1,1,ne),le(),o=Fi(i),o.c(),w(o,1),o.m(n.parentNode,n)):o.p(i,s)},i(i){t||(w(o),t=!0)},o(i){k(o),t=!1},d(i){i&&y(n),o.d(i)}}}function Fi(r){let e;const n=r[10].default,t=Jt(n,r,r[9],null);return{c(){t&&t.c()},m(o,i){t&&t.m(o,i),e=!0},p(o,i){t&&t.p&&(!e||i&512)&&Yt(t,n,o,o[9],e?Wt(n,o[9],i,null):Xt(o[9]),null)},i(o){e||(w(t,o),e=!0)},o(o){k(t,o),e=!1},d(o){t&&t.d(o)}}}function ga(r){let e,n,t=r[0]&&Ai(r);return{c(){t&&t.c(),e=ae()},m(o,i){t&&t.m(o,i),v(o,e,i),n=!0},p(o,[i]){o[0]?t?(t.p(o,i),i&1&&w(t,1)):(t=Ai(o),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(se(),k(t,1,1,()=>{t=null}),le())},i(o){n||(w(t),n=!0)},o(o){k(t),n=!1},d(o){o&&y(e),t&&t.d(o)}}}function ha(r,e,n){let t,o,{$$slots:i={},$$scope:s}=e,{id:l=Go("image")}=e,{url:u}=e,{coordinates:a}=e;const{map:f,self:c}=xs();Y(r,f,g=>n(8,o=g)),Y(r,c,g=>n(0,t=g));let p,m=!0;return Ye(()=>{t&&o&&(el(f,t,p),Be(c,t=null,t),n(6,p=void 0))}),r.$$set=g=>{"id"in g&&n(3,l=g.id),"url"in g&&n(4,u=g.url),"coordinates"in g&&n(5,a=g.coordinates),"$$scope"in g&&n(9,s=g.$$scope)},r.$$.update=()=>{r.$$.dirty&313&&o&&t!==l&&(Be(c,t=l,t),tl(o,t,nl({type:"image",url:u,coordinates:a}),g=>o&&g===t,()=>{t&&(n(6,p=o==null?void 0:o.getSource(t)),n(7,m=!0))})),r.$$.dirty&264&&(o==null||o.on("style.load",()=>{n(6,p=o==null?void 0:o.getSource(l))})),r.$$.dirty&224&&p&&(m?n(7,m=!1):p.setCoordinates(a))},[t,f,c,l,u,a,p,m,o,s,i]}class _a extends ee{constructor(e){super(),te(this,e,ha,ga,Q,{id:3,url:4,coordinates:5})}}const{Map:ba}=ll;function Ri(r,e,n){const t=r.slice();t[40]=e[n];const o=t[1](t[40]);t[41]=o;const i=typeof t[7]=="function"?t[7](t[40]):t[7];return t[42]=i,t}const $a=r=>({feature:r[0]&1024,position:r[0]&1026}),Oi=r=>({feature:r[40],position:r[41]});function ji(r){let e=[],n=new ba,t,o,i=je(r[10]);const s=l=>l[40].id;for(let l=0;l=r[13]&&r[11]<=r[12]&&ji(r);return{c(){P(e.$$.fragment),n=F(),i&&i.c(),t=ae()},m(s,l){L(e,s,l),v(s,n,l),i&&i.m(s,l),v(s,t,l),o=!0},p(s,l){const u={};l[0]&32&&(u.minzoom=s[5]),l[0]&64&&(u.maxzoom=s[6]),e.$set(u),s[11]>=s[13]&&s[11]<=s[12]?i?(i.p(s,l),l[0]&14336&&w(i,1)):(i=ji(s),i.c(),w(i,1),i.m(t.parentNode,t)):i&&(se(),k(i,1,1,()=>{i=null}),le())},i(s){o||(w(e.$$.fragment,s),w(i),o=!0)},o(s){k(e.$$.fragment,s),k(i),o=!1},d(s){s&&(y(n),y(t)),C(e,s),i&&i.d(s)}}}function wa(r,e,n){let t,o,i,s,l,u,a,{$$slots:f={},$$scope:c}=e;const{map:p,source:m,minzoom:g,maxzoom:$}=rl();Y(r,p,X=>n(21,s=X)),Y(r,m,X=>n(9,l=X)),Y(r,g,X=>n(23,a=X)),Y(r,$,X=>n(22,u=X));const b=il();let{applyToClusters:S=void 0}=e,{filter:d=void 0}=e,{markerLngLat:_=Xu}=e,{interactive:M=!0}=e,{asButton:h=!1}=e,{draggable:E=!1}=e,{minzoom:R=void 0}=e,{maxzoom:I=void 0}=e,{hovered:T=null}=e,{zIndex:q=void 0}=e,{class:O=void 0}=e,N=!1;function A(){s&&(N=!0,s.on("zoom",D),s.on("move",re),s.on("moveend",re),s.loaded()?s.once("load",re):re())}function j(X){X.sourceId===l&&X.isSourceLoaded&&(N?re():A())}Ye(()=>{s&&(s.off("zoom",D),s.off("move",re),s.off("moveend",re),s.off("sourcedata",j))});let W=[];function re(){var Ft;if(!s||!l)return;let X=s.querySourceFeatures(l,{filter:i}),ye=new Map;for(let Me of X)Me.id||((Ft=Me.properties)!=null&&Ft.cluster_id?Me.id="autocluster_"+Me.properties.cluster_id:Me.id=Go("autofeat")),ye.set(Me.id,Me);n(10,W=[...ye.values()].sort((Me,Ws)=>Me.id.toString().localeCompare(Ws.id.toString())))}let fe=(s==null?void 0:s.getZoom())??0;function D(X){n(11,fe=s.getZoom()),re()}const de=X=>{n(0,T=X)},_e=X=>{(T==null?void 0:T.id)===X.id&&n(0,T=null)},Ee=(X,ye)=>b("dragstart",{...ye.detail,source:l,feature:X}),ve=(X,ye)=>b("drag",{...ye.detail,source:l,feature:X}),_n=(X,ye)=>b("dragend",{...ye.detail,source:l,feature:X}),J=(X,ye)=>b("click",{...ye.detail,source:l,feature:X}),H=(X,ye)=>b("dblclick",{...ye.detail,source:l,feature:X}),Ie=(X,ye)=>b("contextmenu",{...ye.detail,source:l,feature:X});return r.$$set=X=>{"applyToClusters"in X&&n(19,S=X.applyToClusters),"filter"in X&&n(20,d=X.filter),"markerLngLat"in X&&n(1,_=X.markerLngLat),"interactive"in X&&n(2,M=X.interactive),"asButton"in X&&n(3,h=X.asButton),"draggable"in X&&n(4,E=X.draggable),"minzoom"in X&&n(5,R=X.minzoom),"maxzoom"in X&&n(6,I=X.maxzoom),"hovered"in X&&n(0,T=X.hovered),"zIndex"in X&&n(7,q=X.zIndex),"class"in X&&n(8,O=X.class),"$$scope"in X&&n(33,c=X.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&8388640&&n(13,t=R??a),r.$$.dirty[0]&4194368&&n(12,o=I??u),r.$$.dirty[0]&1572864&&(i=ol("all",sl(S),d)),r.$$.dirty[0]&2097664&&s&&l){let X=s.getSource(l);X!=null&&X.loaded()?A():s.on("sourcedata",j)}},[T,_,M,h,E,R,I,q,O,l,W,fe,o,t,p,m,g,$,b,S,d,s,u,a,f,de,_e,Ee,ve,_n,J,H,Ie,c]}class ka extends ee{constructor(e){super(),te(this,e,wa,ya,Q,{applyToClusters:19,filter:20,markerLngLat:1,interactive:2,asButton:3,draggable:4,minzoom:5,maxzoom:6,hovered:0,zIndex:7,class:8},null,[-1,-1])}}/** * splaytree v3.1.1 * Fast Splay tree for Node and browser diff --git a/browse_layout_v3/assets/nested2-1a524c96.js b/browse_layout_v3/assets/nested2-1a524c96.js deleted file mode 100644 index 7135467e..00000000 --- a/browse_layout_v3/assets/nested2-1a524c96.js +++ /dev/null @@ -1,177 +0,0 @@ -import{S as Q,i as Z,s as J,f as C,g as z,aw as _e,h as $,x,k as p,aT as Ls,z as H,A as E,b as L,c as b,m as k,l as He,H as B,t as g,a as d,d as w,Y as mt,Z as _t,_ as gt,$ as dt,b4 as Pn,q as h,e as ve,N as ae,G as ue,n as Ze,p as v,u as G,aa as ye,ab as gn,ac as Is,I as K,ad as Ms,ae as Ns,af as Ae,ag as Os,ah as js,b5 as Hs,o as St,b6 as Dn,b7 as Es,K as kt,aO as fn,a0 as le,W as de,y as Ee,aQ as Bs,b3 as ee,a9 as Fe,b8 as me,V as ne,U as Ge,a2 as se,as as re,aS as xt,j as Pe,r as Ps,b0 as Vt,b9 as Qt,ba as pt,R as Ds,bb as Us,bc as Ws,J as Rs,bd as Ys,D as Js,F as Jt,b2 as dn,be as Vs,T as Qs,C as hn,B as Zs,E as Ks,aU as Xs,aV as an,L as xs,M as er,O as tr}from"./index-12949150.js";import{e as Rn,s as q,u as Qe,t as nr,q as nt,M as lr,a as oe,v as he,k as ht,R as sr,h as Ke,C as st,f as bt,b as rr,p as An,g as or,d as Fn,w as Gn,c as qn,x as Yt,i as Xt,W as As,B as ir,S as fr,n as ar,H as ur,Z as cr,G as $r,m as zn}from"./ZoomOutMap-afe869ee.js";import{P as ce}from"./Popup-addc1aa5.js";function pr(r){let e;return{c(){e=C("span"),z(e,"class","svelte-kzgqtg"),_e(e,"background",r[0])},m(l,t){$(l,e,t)},p(l,[t]){t&1&&_e(e,"background",l[0])},i:x,o:x,d(l){l&&p(e)}}}function mr(r,e,l){let{color:t}=e;return r.$$set=n=>{"color"in n&&l(0,t=n.color)},[t]}class Te extends Q{constructor(e){super(),Z(this,e,mr,pr,J,{color:0})}}const _r="/atip/browse_layout_v3/assets/help-d011708a.svg";function gr(r){let e,l;const t=r[1].default,n=mt(t,r,r[4],null);return{c(){e=C("div"),n&&n.c(),z(e,"class","govuk-prose")},m(s,o){$(s,e,o),n&&n.m(e,null),l=!0},p(s,o){n&&n.p&&(!l||o&16)&&_t(n,t,s,s[4],l?dt(t,s[4],o,null):gt(s[4]),null)},i(s){l||(g(n,s),l=!0)},o(s){d(n,s),l=!1},d(s){s&&p(e),n&&n.d(s)}}}function dr(r){let e,l,t,n,s,o,u;function f(a){r[3](a)}let i={title:"Help",$$slots:{default:[gr]},$$scope:{ctx:r}};return r[0]!==void 0&&(i.open=r[0]),t=new Ls({props:i}),H.push(()=>E(t,"open",f)),{c(){e=C("button"),e.innerHTML=`Help`,l=L(),b(t.$$.fragment),z(e,"class","svelte-7d9d1l")},m(a,c){$(a,e,c),$(a,l,c),k(t,a,c),s=!0,o||(u=He(e,"click",r[2]),o=!0)},p(a,[c]){const m={};c&16&&(m.$$scope={dirty:c,ctx:a}),!n&&c&1&&(n=!0,m.open=a[0],B(()=>n=!1)),t.$set(m)},i(a){s||(g(t.$$.fragment,a),s=!0)},o(a){d(t.$$.fragment,a),s=!1},d(a){a&&(p(e),p(l)),w(t,a),o=!1,u()}}}function hr(r,e,l){let{$$slots:t={},$$scope:n}=e,s=!1;const o=()=>l(0,s=!0);function u(f){s=f,l(0,s)}return r.$$set=f=>{"$$scope"in f&&l(4,n=f.$$scope)},[s,t,o,u,n]}class $e extends Q{constructor(e){super(),Z(this,e,hr,dr,J,{})}}const br=r=>({}),Hn=r=>({}),kr=r=>({}),En=r=>({});function wr(r){let e,l,t,n,s,o,u,f,i,a,c;const m=r[4].sidebar,_=mt(m,r,r[3],En),S=r[4].main,y=mt(S,r,r[3],Hn);return{c(){e=C("div"),l=C("aside"),t=C("div"),_&&_.c(),n=L(),s=C("button"),s.textContent="→",u=L(),f=C("main"),y&&y.c(),z(t,"class","sidebar-content content-container svelte-1n0etgd"),z(s,"type","button"),z(s,"class","sidebar-toggle rounded-rect svelte-1n0etgd"),z(l,"class",o=Pn(r[1]?"":"collapsed")+" svelte-1n0etgd"),_e(l,"--sidebarWidth",r[0]),z(f,"class","svelte-1n0etgd"),z(e,"class","overall-layout svelte-1n0etgd")},m(T,j){$(T,e,j),h(e,l),h(l,t),_&&_.m(t,null),h(l,n),h(l,s),h(e,u),h(e,f),y&&y.m(f,null),i=!0,a||(c=He(s,"click",r[2]),a=!0)},p(T,[j]){_&&_.p&&(!i||j&8)&&_t(_,m,T,T[3],i?dt(m,T[3],j,kr):gt(T[3]),En),(!i||j&2&&o!==(o=Pn(T[1]?"":"collapsed")+" svelte-1n0etgd"))&&z(l,"class",o),(!i||j&1)&&_e(l,"--sidebarWidth",T[0]),y&&y.p&&(!i||j&8)&&_t(y,S,T,T[3],i?dt(S,T[3],j,br):gt(T[3]),Hn)},i(T){i||(g(_,T),g(y,T),i=!0)},o(T){d(_,T),d(y,T),i=!1},d(T){T&&p(e),_&&_.d(T),y&&y.d(T),a=!1,c()}}}function vr(r,e,l){let{$$slots:t={},$$scope:n}=e,{sidebarWidth:s="25rem"}=e,o=!0;function u(){l(1,o=!o)}return r.$$set=f=>{"sidebarWidth"in f&&l(0,s=f.sidebarWidth),"$$scope"in f&&l(3,n=f.$$scope)},[s,o,u,n,t]}class yr extends Q{constructor(e){super(),Z(this,e,vr,wr,J,{sidebarWidth:0})}}function Bn(r,e,l){const t=r.slice();return t[1]=e[l][0],t[2]=e[l][1],t}function Un(r){let e,l,t,n=r[1]+"",s,o,u;return l=new Te({props:{color:r[2]}}),{c(){e=C("li"),b(l.$$.fragment),t=L(),s=v(n),o=L()},m(f,i){$(f,e,i),k(l,e,null),h(e,t),h(e,s),h(e,o),u=!0},p(f,i){const a={};i&1&&(a.color=f[2]),l.$set(a),(!u||i&1)&&n!==(n=f[1]+"")&&G(s,n)},i(f){u||(g(l.$$.fragment,f),u=!0)},o(f){d(l.$$.fragment,f),u=!1},d(f){f&&p(e),w(l)}}}function Sr(r){let e,l,t=ve(r[0]),n=[];for(let o=0;od(n[o],1,1,()=>{n[o]=null});return{c(){e=C("ul");for(let o=0;o{"rows"in n&&l(0,t=n.rows)},[t]}class Zt extends Q{constructor(e){super(),Z(this,e,Cr,Sr,J,{rows:0})}}function Wn(r){let e=r[0],l,t,n=Yn(r);return{c(){n.c(),l=ye()},m(s,o){n.m(s,o),$(s,l,o),t=!0},p(s,o){o&1&&J(e,e=s[0])?(ae(),d(n,1,1,x),ue(),n=Yn(s),n.c(),g(n,1),n.m(l.parentNode,l)):n.p(s,o)},i(s){t||(g(n),t=!0)},o(s){d(n),t=!1},d(s){s&&p(l),n.d(s)}}}function Yn(r){let e;const l=r[16].default,t=mt(l,r,r[15],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&32768)&&_t(t,l,n,n[15],e?dt(l,n[15],s,null):gt(n[15]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function Tr(r){let e,l,t=r[0]&&Wn(r);return{c(){t&&t.c(),e=ye()},m(n,s){t&&t.m(n,s),$(n,e,s),l=!0},p(n,[s]){n[0]?t?(t.p(n,s),s&1&&g(t,1)):(t=Wn(n),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(ae(),d(t,1,1,()=>{t=null}),ue())},i(n){l||(g(t),l=!0)},o(n){d(t),l=!1},d(n){n&&p(e),t&&t.d(n)}}}function Lr(r,e,l){let t,n,{$$slots:s={},$$scope:o}=e,{id:u=gn("raster-source")}=e,{tiles:f}=e,{tileSize:i=void 0}=e,{bounds:a=null}=e,{scheme:c=null}=e,{attribution:m=null}=e,{minzoom:_=null}=e,{maxzoom:S=null}=e,{volatile:y=null}=e;const{map:T,self:j}=Is();K(r,T,N=>l(14,n=N)),K(r,j,N=>l(0,t=N));let F,R=!0;return Ms(()=>{t&&F&&n&&(Ns(T,t,F),Ae(j,t=null,t),l(12,F=void 0))}),r.$$set=N=>{"id"in N&&l(3,u=N.id),"tiles"in N&&l(4,f=N.tiles),"tileSize"in N&&l(5,i=N.tileSize),"bounds"in N&&l(6,a=N.bounds),"scheme"in N&&l(7,c=N.scheme),"attribution"in N&&l(8,m=N.attribution),"minzoom"in N&&l(9,_=N.minzoom),"maxzoom"in N&&l(10,S=N.maxzoom),"volatile"in N&&l(11,y=N.volatile),"$$scope"in N&&l(15,o=N.$$scope)},r.$$.update=()=>{r.$$.dirty&24569&&n&&t!==u&&(Ae(j,t=u,t),Os(n,t,js({type:"raster",tiles:f,tileSize:i,bounds:a,scheme:c,attribution:m,minzoom:_,maxzoom:S,volatile:y}),N=>n&&N===t,()=>{t&&(l(12,F=n==null?void 0:n.getSource(t)),l(13,R=!0))})),r.$$.dirty&16392&&(n==null||n.on("style.load",()=>{l(12,F=n==null?void 0:n.getSource(u))})),r.$$.dirty&12304&&F&&(R?l(13,R=!1):F.setTiles(f))},[t,T,j,u,f,i,a,c,m,_,S,y,F,R,n,o,s]}class Ir extends Q{constructor(e){super(),Z(this,e,Lr,Tr,J,{id:3,tiles:4,tileSize:5,bounds:6,scheme:7,attribution:8,minzoom:9,maxzoom:10,volatile:11})}}function Mr(r){let e;const l=r[16].default,t=mt(l,r,r[24],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&16777216)&&_t(t,l,n,n[24],e?dt(l,n[24],s,null):gt(n[24]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function Nr(r){let e,l,t;function n(o){r[17](o)}let s={id:r[1],type:"symbol",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],applyToClusters:r[9],minzoom:r[10],maxzoom:r[11],hoverCursor:r[12],manageHoverState:r[13],eventsIfTopMost:r[14],interactive:r[15],$$slots:{default:[Mr]},$$scope:{ctx:r}};return r[0]!==void 0&&(s.hovered=r[0]),e=new Hs({props:s}),H.push(()=>E(e,"hovered",n)),e.$on("click",r[18]),e.$on("dblclick",r[19]),e.$on("contextmenu",r[20]),e.$on("mouseenter",r[21]),e.$on("mousemove",r[22]),e.$on("mouseleave",r[23]),{c(){b(e.$$.fragment)},m(o,u){k(e,o,u),t=!0},p(o,[u]){const f={};u&2&&(f.id=o[1]),u&4&&(f.source=o[2]),u&8&&(f.sourceLayer=o[3]),u&16&&(f.beforeId=o[4]),u&32&&(f.beforeLayerType=o[5]),u&64&&(f.paint=o[6]),u&128&&(f.layout=o[7]),u&256&&(f.filter=o[8]),u&512&&(f.applyToClusters=o[9]),u&1024&&(f.minzoom=o[10]),u&2048&&(f.maxzoom=o[11]),u&4096&&(f.hoverCursor=o[12]),u&8192&&(f.manageHoverState=o[13]),u&16384&&(f.eventsIfTopMost=o[14]),u&32768&&(f.interactive=o[15]),u&16777216&&(f.$$scope={dirty:u,ctx:o}),!l&&u&1&&(l=!0,f.hovered=o[0],B(()=>l=!1)),e.$set(f)},i(o){t||(g(e.$$.fragment,o),t=!0)},o(o){d(e.$$.fragment,o),t=!1},d(o){w(e,o)}}}function Or(r,e,l){let{$$slots:t={},$$scope:n}=e,{id:s=gn("symbol")}=e,{source:o=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:f=void 0}=e,{beforeLayerType:i=void 0}=e,{paint:a=void 0}=e,{layout:c=void 0}=e,{filter:m=void 0}=e,{applyToClusters:_=void 0}=e,{minzoom:S=void 0}=e,{maxzoom:y=void 0}=e,{hoverCursor:T=void 0}=e,{manageHoverState:j=!1}=e,{hovered:F=null}=e,{eventsIfTopMost:R=!1}=e,{interactive:N=!0}=e;function M(A){F=A,l(0,F)}function O(A){St.call(this,r,A)}function D(A){St.call(this,r,A)}function I(A){St.call(this,r,A)}function P(A){St.call(this,r,A)}function U(A){St.call(this,r,A)}function X(A){St.call(this,r,A)}return r.$$set=A=>{"id"in A&&l(1,s=A.id),"source"in A&&l(2,o=A.source),"sourceLayer"in A&&l(3,u=A.sourceLayer),"beforeId"in A&&l(4,f=A.beforeId),"beforeLayerType"in A&&l(5,i=A.beforeLayerType),"paint"in A&&l(6,a=A.paint),"layout"in A&&l(7,c=A.layout),"filter"in A&&l(8,m=A.filter),"applyToClusters"in A&&l(9,_=A.applyToClusters),"minzoom"in A&&l(10,S=A.minzoom),"maxzoom"in A&&l(11,y=A.maxzoom),"hoverCursor"in A&&l(12,T=A.hoverCursor),"manageHoverState"in A&&l(13,j=A.manageHoverState),"hovered"in A&&l(0,F=A.hovered),"eventsIfTopMost"in A&&l(14,R=A.eventsIfTopMost),"interactive"in A&&l(15,N=A.interactive),"$$scope"in A&&l(24,n=A.$$scope)},[F,s,o,u,f,i,a,c,m,_,S,y,T,j,R,N,t,M,O,D,I,P,U,X,n]}class bn extends Q{constructor(e){super(),Z(this,e,Or,Nr,J,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function Jn(r){let e=r[0],l,t,n=Vn(r);return{c(){n.c(),l=ye()},m(s,o){n.m(s,o),$(s,l,o),t=!0},p(s,o){o&1&&J(e,e=s[0])?(ae(),d(n,1,1,x),ue(),n=Vn(s),n.c(),g(n,1),n.m(l.parentNode,l)):n.p(s,o)},i(s){t||(g(n),t=!0)},o(s){d(n),t=!1},d(s){s&&p(l),n.d(s)}}}function Vn(r){let e;const l=r[15].default,t=mt(l,r,r[14],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&16384)&&_t(t,l,n,n[14],e?dt(l,n[14],s,null):gt(n[14]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function jr(r){let e,l,t=r[0]&&Jn(r);return{c(){t&&t.c(),e=ye()},m(n,s){t&&t.m(n,s),$(n,e,s),l=!0},p(n,[s]){n[0]?t?(t.p(n,s),s&1&&g(t,1)):(t=Jn(n),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(ae(),d(t,1,1,()=>{t=null}),ue())},i(n){l||(g(t),l=!0)},o(n){d(t),l=!1},d(n){n&&p(e),t&&t.d(n)}}}function Pr(r,e,l){let t,n,{$$slots:s={},$$scope:o}=e,{id:u=gn("vector")}=e,{url:f=null}=e,{tiles:i=null}=e,{promoteId:a=null}=e,{bounds:c=null}=e,{scheme:m=null}=e,{attribution:_=null}=e,{minzoom:S=null}=e,{maxzoom:y=null}=e,{volatile:T=null}=e;if(f&&f.includes("pmtiles://")&&!Dn.config.REGISTERED_PROTOCOLS.hasOwnProperty("pmtiles")){let N=new Es;Dn.addProtocol("pmtiles",N.tile)}const{map:j,self:F}=Is();K(r,j,N=>l(13,n=N)),K(r,F,N=>l(0,t=N));let R;return Ms(()=>{t&&n&&(Ns(j,t,R),Ae(F,t=null,t),R=void 0)}),r.$$set=N=>{"id"in N&&l(3,u=N.id),"url"in N&&l(4,f=N.url),"tiles"in N&&l(5,i=N.tiles),"promoteId"in N&&l(6,a=N.promoteId),"bounds"in N&&l(7,c=N.bounds),"scheme"in N&&l(8,m=N.scheme),"attribution"in N&&l(9,_=N.attribution),"minzoom"in N&&l(10,S=N.minzoom),"maxzoom"in N&&l(11,y=N.maxzoom),"volatile"in N&&l(12,T=N.volatile),"$$scope"in N&&l(14,o=N.$$scope)},r.$$.update=()=>{r.$$.dirty&16377&&n&&t!==u&&(Ae(F,t=u,t),Os(n,t,js({type:"vector",url:f,tiles:i,promoteId:a,bounds:c,scheme:m,attribution:_,minzoom:S,maxzoom:y,volatile:T}),N=>n&&N===t,()=>{t&&(R=n==null?void 0:n.getSource(t))})),r.$$.dirty&8200&&(n==null||n.on("style.load",()=>{R=n==null?void 0:n.getSource(u)}))},[t,j,F,u,f,i,a,c,m,_,S,y,T,n,o,s]}class ge extends Q{constructor(e){super(),Z(this,e,Pr,jr,J,{id:3,url:4,tiles:5,promoteId:6,bounds:7,scheme:8,attribution:9,minzoom:10,maxzoom:11,volatile:12})}}function Qn(r,e,l){const t=r.slice();return t[11]=e[l],t[12]=e,t[13]=l,t}function Dr(r){let e,l,t;return l=new Ee({props:{$$slots:{default:[Ar]},$$scope:{ctx:r}}}),l.$on("click",r[9]),{c(){e=C("div"),b(l.$$.fragment)},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16384&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Rr(r){let e,l,t,n,s,o,u,f,i,a;l=new Ee({props:{$$slots:{default:[Fr]},$$scope:{ctx:r}}}),l.$on("click",r[4]);let c=r[2]&&Zn(r);s=new nt({props:{label:"Help",$$slots:{default:[Gr]},$$scope:{ctx:r}}}),u=new Bs({}),u.$on("click",r[3]);let m=ve(r[0]),_=[];for(let y=0;yd(_[y],1,1,()=>{_[y]=null});return{c(){e=C("div"),b(l.$$.fragment),t=L(),c&&c.c(),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment),f=L();for(let y=0;y<_.length;y+=1)_[y].c();i=ye()},m(y,T){$(y,e,T),k(l,e,null),$(y,t,T),c&&c.m(y,T),$(y,n,T),k(s,y,T),$(y,o,T),k(u,y,T),$(y,f,T);for(let j=0;j<_.length;j+=1)_[j]&&_[j].m(y,T);$(y,i,T),a=!0},p(y,T){const j={};T&16384&&(j.$$scope={dirty:T,ctx:y}),l.$set(j),y[2]?c?c.p(y,T):(c=Zn(y),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null);const F={};if(T&16384&&(F.$$scope={dirty:T,ctx:y}),s.$set(F),T&65){m=ve(y[0]);let R;for(R=0;RClick - on the map to place a new waypoint
  • Click and drag - an existing waypoint to move it
  • Click - an existing waypoint to delete it
  • Press Escape - to exit this mode
  • `},m(l,t){$(l,e,t)},p:x,d(l){l&&p(e)}}}function qr(r){let e,l;return{c(){e=C("span"),l=L(),z(e,"class","dot svelte-1tzt432")},m(t,n){$(t,e,n),$(t,l,n)},p:x,d(t){t&&(p(e),p(l))}}}function Kn(r){let e,l,t;function n(u){r[7](u,r[11],r[12],r[13])}function s(){return r[8](r[13])}let o={draggable:!0,$$slots:{default:[qr]},$$scope:{ctx:r}};return r[11]!==void 0&&(o.lngLat=r[11]),e=new lr({props:o}),H.push(()=>E(e,"lngLat",n)),e.$on("click",s),{c(){b(e.$$.fragment)},m(u,f){k(e,u,f),t=!0},p(u,f){r=u;const i={};f&16384&&(i.$$scope={dirty:f,ctx:r}),!l&&f&1&&(l=!0,i.lngLat=r[11],B(()=>l=!1)),e.$set(i)},i(u){t||(g(e.$$.fragment,u),t=!0)},o(u){d(e.$$.fragment,u),t=!1},d(u){w(e,u)}}}function zr(r){let e,l;const t=[q("measurement-line"),{paint:{"line-color":Qe.measuringLine,"line-width":5}}];let n={};for(let s=0;s{i[_]=null}),ue(),l=i[e],l?l.p(c,m):(l=i[e]=f[e](c),l.c()),g(l,1),l.m(t.parentNode,t));const S={};m&1&&(S.data=c[0].length<2?Rn():fn(c[0])),m&16384&&(S.$$scope={dirty:m,ctx:c}),n.$set(S)},i(c){s||(g(l),g(n.$$.fragment,c),s=!0)},o(c){d(l),d(n.$$.fragment,c),s=!1},d(c){c&&p(t),i[e].d(c),w(n,c),o=!1,u()}}}function Er(r,e,l){let t,n=!1,s=[];function o(S){return S.length<2?null:1e3*nr(fn(S),{units:"kilometers"})}function u(S){l(0,s=[...s,S.detail.lngLat.toArray()])}function f(){l(1,n=!1),l(0,s=[])}function i(S){n&&S.key==="Escape"&&(S.stopPropagation(),f())}function a(S){s.splice(S,1),l(0,s)}function c(S,y,T,j){T[j]=S,l(0,s)}const m=S=>a(S),_=()=>l(1,n=!0);return r.$$.update=()=>{r.$$.dirty&1&&l(2,t=o(s))},[s,n,t,u,f,i,a,c,m,_]}class Br extends Q{constructor(e){super(),Z(this,e,Er,Hr,J,{})}}const te={education:{schools:"#007DBB",colleges:"maroon",universities:"navy"},hospitals:"#B73D25",mrn:"#781400",srn:"#006478",national_cycle_network:"#640078",sports_spaces:"#013220",parliamentary_constituencies:"#006E59",wards:"purple",combined_authorities:"cyan",local_authority_districts:"orange",local_planning_authorities:"red",bus_route_with_lane:"#9362BA",bus_route_without_lane:"#C2A6D8",trams:"black",signalized_crossing:"green",other_crossing:"black",cycle_paths:{track:"#0000FF",lane:"#009FEF",shared_use_segregated:"#FF9900",shared_use_unsegregated:"#E7E700"},sequential_low_to_high:["#CDE594","#80C6A3","#1F9EB7","#186290","#080C54"],gradient_flat_to_steep:["#267300","#FFAA00","#E60000","#A80000","#730000","#000000"]},De=["interpolate",["exponential",1.6],["zoom"],3,1,7,2,18,20];function Ur(r){let e;return{c(){e=v(`Open Government License - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Wr(r){let e,l,t,n,s;return t=new ee({props:{href:"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",$$slots:{default:[Ur]},$$scope:{ctx:r}}}),{c(){e=C("p"),l=v("License: "),b(t.$$.fragment),n=v(`. Contains OS data © Crown copyright and database right - 2023.`)},m(o,u){$(o,e,u),h(e,l),k(t,e,null),h(e,n),s=!0},p(o,[u]){const f={};u&1&&(f.$$scope={dirty:u,ctx:o}),t.$set(f)},i(o){s||(g(t.$$.fragment,o),s=!0)},o(o){d(t.$$.fragment,o),s=!1},d(o){o&&p(e),w(t)}}}class Le extends Q{constructor(e){super(),Z(this,e,null,Wr,J,{})}}function Xn(r,e,l){const t=r.slice();return t[2]=e[l],t}function xn(r,e,l){const t=r.slice();return t[5]=e[l],t}function el(r){let e,l;return{c(){e=C("span"),l=v(`  - `),_e(e,"background",r[5]),_e(e,"width","100%"),_e(e,"border","1px solid black")},m(t,n){$(t,e,n),h(e,l)},p(t,n){n&1&&_e(e,"background",t[5])},d(t){t&&p(e)}}}function tl(r){let e,l=r[2]+"",t;return{c(){e=C("span"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&2&&l!==(l=n[2]+"")&&G(t,l)},d(n){n&&p(e)}}}function Yr(r){let e,l,t,n=ve(r[0]),s=[];for(let f=0;f{"colorScale"in s&&l(0,t=s.colorScale),"limits"in s&&l(1,n=s.limits)},[t,n]}class qe extends Q{constructor(e){super(),Z(this,e,Jr,Yr,J,{colorScale:0,limits:1})}}function be(r){let e=new URLSearchParams(window.location.search).has(r),l=Fe(e);return l.subscribe(t=>{let n=new URL(window.location.href);t?n.searchParams.set(r,"1"):n.searchParams.delete(r),window.history.replaceState(null,"",n.toString())}),l}function wt(r,e,l,t){let n=e,s=new URLSearchParams(window.location.search).get(r);if(s!=null)try{n=t(s)}catch(u){console.warn(`Parsing URL parameter ${r}=${s} failed, using default value: ${u}`)}let o=Fe(n);return o.subscribe(u=>{let f=new URL(window.location.href),i=l(u);i==null?f.searchParams.delete(r):f.searchParams.set(r,i),window.history.replaceState(null,"",f.toString())}),o}function nl(r){const e=r[14].OA21CD;r[15]=e;const l=r[14][r[3].kind];r[16]=l}function Vr(r){let e;return{c(){e=v("Percent of households with a car")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Qr(r){let e;return{c(){e=v(`NOMIS TS045 - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Zr(r){let e;return{c(){e=v(`ONS Geography - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Kr(r){let e;return{c(){e=v(`Open Government License - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Xr(r){let e,l,t,n,s,o,u,f,i,a,c,m;return t=new ee({props:{href:"https://www.nomisweb.co.uk/sources/census_2021_bulk",$$slots:{default:[Qr]},$$scope:{ctx:r}}}),s=new ee({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::output-areas-2021-boundaries-ew-bgc/explore",$$slots:{default:[Zr]},$$scope:{ctx:r}}}),a=new ee({props:{href:"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",$$slots:{default:[Kr]},$$scope:{ctx:r}}}),{c(){e=C("p"),l=v("Car/van availability data is from the 2021 census, via "),b(t.$$.fragment),n=v(". Output area boundaries from "),b(s.$$.fragment),o=v("."),u=L(),f=C("p"),i=v("License: "),b(a.$$.fragment),c=v(`. Contains OS data © Crown copyright and database - right 2023.`)},m(_,S){$(_,e,S),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),$(_,u,S),$(_,f,S),h(f,i),k(a,f,null),h(f,c),m=!0},p(_,S){const y={};S&131072&&(y.$$scope={dirty:S,ctx:_}),t.$set(y);const T={};S&131072&&(T.$$scope={dirty:S,ctx:_}),s.$set(T);const j={};S&131072&&(j.$$scope={dirty:S,ctx:_}),a.$set(j)},i(_){m||(g(t.$$.fragment,_),g(s.$$.fragment,_),g(a.$$.fragment,_),m=!0)},o(_){d(t.$$.fragment,_),d(s.$$.fragment,_),d(a.$$.fragment,_),m=!1},d(_){_&&(p(e),p(u),p(f)),w(t),w(s),w(a)}}}function xr(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Xr]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function ll(r){let e,l;return e=new qe({props:{colorScale:r[4],limits:at(r[3].kind)}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&8&&(s.limits=at(t[3].kind)),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function eo(r){let e;return{c(){e=v("Average cars per household")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function to(r){let e;return{c(){e=v(`NOMIS TS045 - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function no(r){let e;return{c(){e=v(`ONS Geography - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function lo(r){let e;return{c(){e=v(`Open Government License - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function so(r){let e,l,t,n,s,o,u,f,i,a,c,m,_,S;return s=new ee({props:{href:"https://www.nomisweb.co.uk/sources/census_2021_bulk",$$slots:{default:[to]},$$scope:{ctx:r}}}),u=new ee({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::output-areas-2021-boundaries-ew-bgc/explore",$$slots:{default:[no]},$$scope:{ctx:r}}}),m=new ee({props:{href:"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",$$slots:{default:[lo]},$$scope:{ctx:r}}}),{c(){e=C("p"),e.textContent=`Where the census counts "3 or more cars or vans", the average shown here - assumes 3.`,l=L(),t=C("p"),n=v("Car/van availability data is from the 2021 census, via "),b(s.$$.fragment),o=v(". Output area boundaries from "),b(u.$$.fragment),f=v("."),i=L(),a=C("p"),c=v("License: "),b(m.$$.fragment),_=v(`. Contains OS data © Crown copyright and database - right 2023.`)},m(y,T){$(y,e,T),$(y,l,T),$(y,t,T),h(t,n),k(s,t,null),h(t,o),k(u,t,null),h(t,f),$(y,i,T),$(y,a,T),h(a,c),k(m,a,null),h(a,_),S=!0},p(y,T){const j={};T&131072&&(j.$$scope={dirty:T,ctx:y}),s.$set(j);const F={};T&131072&&(F.$$scope={dirty:T,ctx:y}),u.$set(F);const R={};T&131072&&(R.$$scope={dirty:T,ctx:y}),m.$set(R)},i(y){S||(g(s.$$.fragment,y),g(u.$$.fragment,y),g(m.$$.fragment,y),S=!0)},o(y){d(s.$$.fragment,y),d(u.$$.fragment,y),d(m.$$.fragment,y),S=!1},d(y){y&&(p(e),p(l),p(t),p(i),p(a)),w(s),w(u),w(m)}}}function ro(r){let e,l,t;return l=new $e({props:{$$slots:{default:[so]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function sl(r){let e,l;return e=new qe({props:{colorScale:r[4],limits:at(r[3].kind)}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&8&&(s.limits=at(t[3].kind)),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function oo(r){let e;return{c(){e=v("Population density")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function io(r){let e;return{c(){e=v(`NOMIS TS006 - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function fo(r){let e;return{c(){e=v(`ONS Geography - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ao(r){let e,l,t,n,s,o,u,f,i;return t=new ee({props:{href:"https://www.nomisweb.co.uk/sources/census_2021_bulk",$$slots:{default:[io]},$$scope:{ctx:r}}}),s=new ee({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::output-areas-2021-boundaries-ew-bgc/explore",$$slots:{default:[fo]},$$scope:{ctx:r}}}),f=new Le({}),{c(){e=C("p"),l=v("Population density data is from the 2021 census, via "),b(t.$$.fragment),n=v(". Output area boundaries from "),b(s.$$.fragment),o=v("."),u=L(),b(f.$$.fragment)},m(a,c){$(a,e,c),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),$(a,u,c),k(f,a,c),i=!0},p(a,c){const m={};c&131072&&(m.$$scope={dirty:c,ctx:a}),t.$set(m);const _={};c&131072&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){i||(g(t.$$.fragment,a),g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(p(e),p(u)),w(t),w(s),w(f,a)}}}function uo(r){let e,l,t;return l=new $e({props:{$$slots:{default:[ao]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function rl(r){let e,l,t,n;return t=new qe({props:{colorScale:r[4],limits:at(r[3].kind).map(ol)}}),{c(){e=C("p"),e.textContent="(people per square kilometres)",l=L(),b(t.$$.fragment)},m(s,o){$(s,e,o),$(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&8&&(u.limits=at(s[3].kind).map(ol)),t.$set(u)},i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(p(e),p(l)),w(t,s)}}}function co(r){let e,l,t,n=r[16].toLocaleString()+"",s,o,u=r[15]+"",f;return{c(){e=C("p"),l=v("There are "),t=C("b"),s=v(n),o=v(` - people per square kilometre in `),f=v(u)},m(i,a){$(i,e,a),h(e,l),h(e,t),h(t,s),h(e,o),h(e,f)},p(i,a){a&16392&&n!==(n=i[16].toLocaleString()+"")&&G(s,n),a&16384&&u!==(u=i[15]+"")&&G(f,u)},d(i){i&&p(e)}}}function $o(r){let e,l,t=r[15]+"",n,s,o,u=r[16]+"",f,i;return{c(){e=C("p"),l=v("Households in "),n=v(t),s=v(` have an average of - `),o=C("b"),f=v(u),i=v(` - cars`)},m(a,c){$(a,e,c),h(e,l),h(e,n),h(e,s),h(e,o),h(o,f),h(e,i)},p(a,c){c&16384&&t!==(t=a[15]+"")&&G(n,t),c&16392&&u!==(u=a[16]+"")&&G(f,u)},d(a){a&&p(e)}}}function po(r){let e,l,t=r[16]+"",n,s,o,u=r[15]+"",f,i;return{c(){e=C("p"),l=C("b"),n=v(t),s=v("%"),o=v(` - of households in `),f=v(u),i=v(" have 1 or more cars")},m(a,c){$(a,e,c),h(e,l),h(l,n),h(l,s),h(e,o),h(e,f),h(e,i)},p(a,c){c&16392&&t!==(t=a[16]+"")&&G(n,t),c&16384&&u!==(u=a[15]+"")&&G(f,u)},d(a){a&&p(e)}}}function mo(r){nl(r);let e;function l(s,o){return s[3].kind=="percent_households_with_car"?po:s[3].kind=="average_cars_per_household"?$o:co}let t=l(r),n=t(r);return{c(){n.c(),e=ye()},m(s,o){n.m(s,o),$(s,e,o)},p(s,o){nl(s),t===(t=l(s))&&n?n.p(s,o):(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},d(s){s&&p(e),n.d(s)}}}function _o(r){let e,l;return e=new ce({props:{$$slots:{default:[mo,({props:t})=>({14:t}),({props:t})=>t?16384:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&147464&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function go(r){let e,l,t,n;const s=[q(Be),{sourceLayer:Be},{paint:{"fill-color":he(["get",r[3].kind],at(r[3].kind),r[4]),"fill-opacity":ne(.5,.7)}},{layout:{visibility:r[3].kind!=""?"visible":"none"}},{eventsIfTopMost:!0},{manageHoverState:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[_o]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",y)),e.$on("change",r[8]);let j=r[3].kind=="percent_households_with_car"&&ll(r);function F(I){r[9](I)}let R={$$slots:{right:[ro],default:[eo]},$$scope:{ctx:r}};r[1]!==void 0&&(R.checked=r[1]),s=new oe({props:R}),H.push(()=>E(s,"checked",F)),s.$on("change",r[10]);let N=r[3].kind=="average_cars_per_household"&&sl(r);function M(I){r[11](I)}let O={$$slots:{right:[uo],default:[oo]},$$scope:{ctx:r}};r[2]!==void 0&&(O.checked=r[2]),i=new oe({props:O}),H.push(()=>E(i,"checked",M)),i.$on("change",r[12]);let D=r[3].kind=="population_density"&&rl(r);return _=new ge({props:{url:`pmtiles://${me()}/v1/${Be}.pmtiles`,$$slots:{default:[go]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),j&&j.c(),n=L(),b(s.$$.fragment),u=L(),N&&N.c(),f=L(),b(i.$$.fragment),c=L(),D&&D.c(),m=L(),b(_.$$.fragment)},m(I,P){k(e,I,P),$(I,t,P),j&&j.m(I,P),$(I,n,P),k(s,I,P),$(I,u,P),N&&N.m(I,P),$(I,f,P),k(i,I,P),$(I,c,P),D&&D.m(I,P),$(I,m,P),k(_,I,P),S=!0},p(I,[P]){const U={};P&131072&&(U.$$scope={dirty:P,ctx:I}),!l&&P&1&&(l=!0,U.checked=I[0],B(()=>l=!1)),e.$set(U),I[3].kind=="percent_households_with_car"?j?(j.p(I,P),P&8&&g(j,1)):(j=ll(I),j.c(),g(j,1),j.m(n.parentNode,n)):j&&(ae(),d(j,1,1,()=>{j=null}),ue());const X={};P&131072&&(X.$$scope={dirty:P,ctx:I}),!o&&P&2&&(o=!0,X.checked=I[1],B(()=>o=!1)),s.$set(X),I[3].kind=="average_cars_per_household"?N?(N.p(I,P),P&8&&g(N,1)):(N=sl(I),N.c(),g(N,1),N.m(f.parentNode,f)):N&&(ae(),d(N,1,1,()=>{N=null}),ue());const A={};P&131072&&(A.$$scope={dirty:P,ctx:I}),!a&&P&4&&(a=!0,A.checked=I[2],B(()=>a=!1)),i.$set(A),I[3].kind=="population_density"?D?(D.p(I,P),P&8&&g(D,1)):(D=rl(I),D.c(),g(D,1),D.m(m.parentNode,m)):D&&(ae(),d(D,1,1,()=>{D=null}),ue());const Y={};P&131080&&(Y.$$scope={dirty:P,ctx:I}),_.$set(Y)},i(I){S||(g(e.$$.fragment,I),g(j),g(s.$$.fragment,I),g(N),g(i.$$.fragment,I),g(D),g(_.$$.fragment,I),S=!0)},o(I){d(e.$$.fragment,I),d(j),d(s.$$.fragment,I),d(N),d(i.$$.fragment,I),d(D),d(_.$$.fragment,I),S=!1},d(I){I&&(p(t),p(n),p(u),p(f),p(c),p(m)),w(e,I),j&&j.d(I),w(s,I),N&&N.d(I),w(i,I),D&&D.d(I),w(_,I)}}}let Be="census_output_areas";function bo(r){return r.show?r.kind:null}function ko(r){return{show:!0,kind:r}}function at(r){return r=="percent_households_with_car"?[0,20,40,60,80,100]:r=="average_cars_per_household"?[0,.5,1,1.5,2,2.5]:[0,4700,13e3,33e3,94e3,198e4]}const ol=r=>r.toLocaleString();function wo(r,e,l){let t,n=te.sequential_low_to_high,o=wt(Be,{show:!1,kind:""},bo,ko);K(r,o,j=>l(3,t=j));let u=t.kind=="percent_households_with_car",f=t.kind=="average_cars_per_household",i=t.kind=="population_density";function a(j){let F=j.detail.features[0].properties.OA21CD;t.kind=="percent_households_with_car"||t.kind=="average_cars_per_household"?window.open(`https://www.ons.gov.uk/census/maps/choropleth/housing/number-of-cars-or-vans/number-of-cars-5a/no-cars-or-vans-in-household?oa=${F}`,"_blank"):window.open(`https://www.ons.gov.uk/census/maps/choropleth/population/population-density/population-density/persons-per-square-kilometre?oa=${F}`,"_blank")}function c(j){u=j,l(0,u)}const m=()=>{l(1,f=!1),l(2,i=!1)};function _(j){f=j,l(1,f)}const S=()=>{l(0,u=!1),l(2,i=!1)};function y(j){i=j,l(2,i)}const T=()=>{l(0,u=!1),l(1,f=!1)};return r.$$.update=()=>{r.$$.dirty&7&&(u?(Ae(o,t.show=!0,t),Ae(o,t.kind="percent_households_with_car",t)):f?(Ae(o,t.show=!0,t),Ae(o,t.kind="average_cars_per_household",t)):i?(Ae(o,t.show=!0,t),Ae(o,t.kind="population_density",t)):(Ae(o,t.show=!1,t),Ae(o,t.kind="",t)))},[u,f,i,t,n,o,a,c,m,_,S,y,T]}class vo extends Q{constructor(e){super(),Z(this,e,wo,ho,J,{})}}function yo(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - Combined authorities`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function So(r){let e;return{c(){e=v(`ONS Geography - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Co(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::combined-authorities-december-2022-boundaries-en-buc/explore",$$slots:{default:[So]},$$scope:{ctx:r}}}),o=new Le({}),{c(){e=C("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of December 2022."),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function To(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Co]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Lo(r){let e,l=r[4].name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&p(e)}}}function Io(r){let e,l;return e=new ce({props:{$$slots:{default:[Lo,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Mo(r){let e,l,t,n;const s=[q(Ct),{paint:{"fill-color":r[1],"fill-opacity":ne(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[Io]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new kt({props:{data:`${me()}/v1/${Ct}.geojson`,$$slots:{default:[Mo]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let Ct="combined_authorities";function Oo(r){window.open(`https://www.ons.gov.uk/visualisations/areas/${r.detail.features[0].properties.CAUTH22CD}`,"_blank")}function jo(r,e,l){let t,n=te.combined_authorities,s=be(Ct);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Po extends Q{constructor(e){super(),Z(this,e,jo,No,J,{})}}function Do(r){let e;return{c(){e=v("Indices of Multiple Deprivation")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Ro(r){let e;return{c(){e=v(`DLUCH GIS - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Ao(r){let e;return{c(){e=v(`here - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Fo(r){let e,l,t,n,s,o,u,f,i;return t=new ee({props:{href:"https://data-communities.opendata.arcgis.com/datasets/communities::indices-of-multiple-deprivation-imd-2019-1/explore",$$slots:{default:[Ro]},$$scope:{ctx:r}}}),s=new ee({props:{href:"http://dclgapps.communities.gov.uk/imd/iod_index.html",$$slots:{default:[Ao]},$$scope:{ctx:r}}}),f=new Le({}),{c(){e=C("p"),l=v("The 2019 English IMD scores come from "),b(t.$$.fragment),n=v(`. Note the LSOAs identified are from the 2011 census. A - detailed breakdown of the score across different categories can be found `),b(s.$$.fragment),o=v("."),u=L(),b(f.$$.fragment)},m(a,c){$(a,e,c),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),$(a,u,c),k(f,a,c),i=!0},p(a,c){const m={};c&64&&(m.$$scope={dirty:c,ctx:a}),t.$set(m);const _={};c&64&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){i||(g(t.$$.fragment,a),g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(p(e),p(u)),w(t),w(s),w(f,a)}}}function Go(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Fo]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function il(r){let e,l;return e=new qe({props:{colorScale:r[1],limits:["Least deprived","Most deprived"]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function qo(r){let e,l=r[5].LSOA11CD+"",t,n,s,o=r[5].score+"",u,f,i,a,c,m=r[5].rank.toLocaleString()+"",_,S;return{c(){e=C("p"),t=v(l),n=v(` has an IMD score of - `),s=C("b"),u=v(o),f=L(),i=C("p"),a=v("Rank: "),c=C("b"),_=v(m),S=v(` - / 32,844 LSOAs`)},m(y,T){$(y,e,T),h(e,t),h(e,n),h(e,s),h(s,u),$(y,f,T),$(y,i,T),h(i,a),h(i,c),h(c,_),h(i,S)},p(y,T){T&32&&l!==(l=y[5].LSOA11CD+"")&&G(t,l),T&32&&o!==(o=y[5].score+"")&&G(u,o),T&32&&m!==(m=y[5].rank.toLocaleString()+"")&&G(_,m)},d(y){y&&(p(e),p(f),p(i))}}}function zo(r){let e,l;return e=new ce({props:{$$slots:{default:[qo,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ho(r){let e,l,t,n;const s=[q(Ue),{sourceLayer:Ue},{paint:{"fill-color":he(["-",10,["get","decile"]],r[2],r[1]),"fill-opacity":ne(.5,.7)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let o={$$slots:{default:[zo]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",u));let i=r[0]&&il(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Ue}.pmtiles`,$$slots:{default:[Ho]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&64&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=il(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ue="imd";function Bo(r,e,l){let t,n=te.sequential_low_to_high,s=[0,2,4,6,8,10],o=be(Ue);K(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class Uo extends Q{constructor(e){super(),Z(this,e,Bo,Eo,J,{})}}function Wo(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - Local Authority Districts`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function Yo(r){let e;return{c(){e=v(`ONS Geography - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Jo(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://geoportal.statistics.gov.uk/maps/79a4e87783be4b6bbb96ddad6dda52a3",$$slots:{default:[Yo]},$$scope:{ctx:r}}}),o=new Le({}),{c(){e=C("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of January 2024."),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function Vo(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Jo]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Qo(r){let e,l=r[4].name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&p(e)}}}function Zo(r){let e,l;return e=new ce({props:{$$slots:{default:[Qo,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ko(r){let e,l,t,n;const s=[q(Tt),{paint:{"fill-color":r[1],"fill-opacity":ne(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[Zo]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new kt({props:{data:`${me()}/v1/${Tt}.geojson`,$$slots:{default:[Ko]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let Tt="local_authority_districts";function xo(r){window.open(`https://www.ons.gov.uk/visualisations/areas/${r.detail.features[0].properties.LAD23CD}`,"_blank")}function ei(r,e,l){let t,n=te.local_authority_districts,s=be(Tt);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class ti extends Q{constructor(e){super(),Z(this,e,ei,Xo,J,{})}}function ni(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - Local Planning Authorities`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function li(r){let e;return{c(){e=v(`local authority - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function si(r){let e;return{c(){e=v(`national park authorit - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ri(r){let e;return{c(){e=v(`development corporation - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function oi(r){let e;return{c(){e=v("this map")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ii(r){let e;return{c(){e=v(`planning.data.gov.uk - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function fi(r){let e,l,t,n,s,o,u,f,i,a,c,m,_,S,y,T,j,F,R,N,M,O;return t=new ee({props:{href:"https://www.planning.data.gov.uk/dataset/local-authority",$$slots:{default:[li]},$$scope:{ctx:r}}}),s=new ee({props:{href:"https://www.planning.data.gov.uk/dataset/national-park-authority",$$slots:{default:[si]},$$scope:{ctx:r}}}),u=new ee({props:{href:"https://www.planning.data.gov.uk/dataset/development-corporation",$$slots:{default:[ri]},$$scope:{ctx:r}}}),_=new ee({props:{href:"https://www.planning.data.gov.uk/map/?dataset=local-planning-authority",$$slots:{default:[oi]},$$scope:{ctx:r}}}),F=new ee({props:{href:"https://www.planning.data.gov.uk/dataset/local-planning-authority",$$slots:{default:[ii]},$$scope:{ctx:r}}}),M=new Le({}),{c(){e=C("p"),l=v("LPAs may be a "),b(t.$$.fragment),n=v(", "),b(s.$$.fragment),o=v("y, or "),b(u.$$.fragment),f=v("."),i=L(),a=C("p"),c=C("strong"),m=v(`Note there are overlapping LPAs near Northhamptonshire. Only one - authority name is shown when hovering. Use `),b(_.$$.fragment),S=v(" to get more details."),y=L(),T=C("p"),j=v("Data from ONS Geography via "),b(F.$$.fragment),R=v(", as of November 2022."),N=L(),b(M.$$.fragment)},m(D,I){$(D,e,I),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),k(u,e,null),h(e,f),$(D,i,I),$(D,a,I),h(a,c),h(c,m),k(_,c,null),h(c,S),$(D,y,I),$(D,T,I),h(T,j),k(F,T,null),h(T,R),$(D,N,I),k(M,D,I),O=!0},p(D,I){const P={};I&32&&(P.$$scope={dirty:I,ctx:D}),t.$set(P);const U={};I&32&&(U.$$scope={dirty:I,ctx:D}),s.$set(U);const X={};I&32&&(X.$$scope={dirty:I,ctx:D}),u.$set(X);const A={};I&32&&(A.$$scope={dirty:I,ctx:D}),_.$set(A);const Y={};I&32&&(Y.$$scope={dirty:I,ctx:D}),F.$set(Y)},i(D){O||(g(t.$$.fragment,D),g(s.$$.fragment,D),g(u.$$.fragment,D),g(_.$$.fragment,D),g(F.$$.fragment,D),g(M.$$.fragment,D),O=!0)},o(D){d(t.$$.fragment,D),d(s.$$.fragment,D),d(u.$$.fragment,D),d(_.$$.fragment,D),d(F.$$.fragment,D),d(M.$$.fragment,D),O=!1},d(D){D&&(p(e),p(i),p(a),p(y),p(T),p(N)),w(t),w(s),w(u),w(_),w(F),w(M,D)}}}function ai(r){let e,l,t;return l=new $e({props:{$$slots:{default:[fi]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function ui(r){let e,l=r[4].name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&p(e)}}}function ci(r){let e,l;return e=new ce({props:{$$slots:{default:[ui,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function $i(r){let e,l,t,n;const s=[q(We),{sourceLayer:We},{paint:{"fill-color":r[1],"fill-opacity":ne(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let o={$$slots:{default:[ci]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${We}.pmtiles`,$$slots:{default:[$i]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let We="local_planning_authorities";function mi(r,e,l){let t,n=te.local_planning_authorities,s=be(We);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class _i extends Q{constructor(e){super(),Z(this,e,mi,pi,J,{})}}function gi(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - Parliamentary constituencies`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function di(r){let e;return{c(){e=v(`Ordnance Survey Boundary-Line - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function hi(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://www.ordnancesurvey.co.uk/products/boundary-line",$$slots:{default:[di]},$$scope:{ctx:r}}}),o=new Le({}),{c(){e=C("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of May 2023."),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function bi(r){let e,l,t;return l=new $e({props:{$$slots:{default:[hi]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function ki(r){let e,l=r[4].Name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].Name+"")&&G(t,l)},d(n){n&&p(e)}}}function wi(r){let e,l;return e=new ce({props:{$$slots:{default:[ki,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function vi(r){let e,l,t,n;const s=[q(Ye),{sourceLayer:Ye},{paint:{"fill-color":r[1],"fill-opacity":ne(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[wi]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${Ye}.pmtiles`,$$slots:{default:[vi]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let Ye="parliamentary_constituencies";function Si(r){let e=r.detail.features[0].properties.Name;e=e.replace(/ Boro Const$/,""),e=e.replace(/ Co Const$/,""),e=encodeURIComponent(e),window.open(`https://members.parliament.uk/members/Commons?SearchText=${e}`,"_blank")}function Ci(r,e,l){let t,n=te.parliamentary_constituencies,s=be(Ye);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Ti extends Q{constructor(e){super(),Z(this,e,Ci,yi,J,{})}}function Li(r){let e;return{c(){e=v("Pollution")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Ii(r){let e;return{c(){e=v(`DEFRA - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Mi(r){let e,l,t,n,s,o,u,f,i;return t=new ee({props:{href:"https://uk-air.defra.gov.uk/data/wms-services",$$slots:{default:[Ii]},$$scope:{ctx:r}}}),f=new Le({}),{c(){e=C("p"),l=v("Most layers show air quality data from "),b(t.$$.fragment),n=v(`. The measurements are annual means, in units of - µgm - `),s=C("sup"),s.textContent="3",o=v(` - . Note the particulate matter layers are not corrected for natural sources.`),u=L(),b(f.$$.fragment)},m(a,c){$(a,e,c),h(e,l),k(t,e,null),h(e,n),h(e,s),h(e,o),$(a,u,c),k(f,a,c),i=!0},p(a,c){const m={};c&4096&&(m.$$scope={dirty:c,ctx:a}),t.$set(m)},i(a){i||(g(t.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(p(e),p(u)),w(t),w(f,a)}}}function Ni(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Mi]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&4096&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function fl(r){let e,l,t,n,s=r[3](r[0].pollutant)+"",o,u,f,i,a,c,m,_,S,y,T,j,F;function R(M){r[6](M)}let N={label:"Pollutant",choices:[["PM25_viridis","Background PM2.5"],["PM10_viridis","Background PM10"],["NOx_viridis","Background NOx"],["PM25Roads_viridis","Roadside PM2.5"],["PM10Roads_viridis","Roadside PM10"],["NOxRoads_viridis","Roadside NOx"]]};return r[0].pollutant!==void 0&&(N.value=r[0].pollutant),e=new ht({props:N}),H.push(()=>E(e,"value",R)),{c(){b(e.$$.fragment),t=L(),n=C("p"),o=v(s),u=L(),f=C("div"),i=C("label"),a=v(`Opacity - `),c=C("input"),m=L(),_=C("img"),z(c,"type","range"),z(c,"min","0"),z(c,"max","100"),xt(_.src,S=r[4](r[0].pollutant))||z(_,"src",S),z(_,"width",150),z(_,"alt",y=`Legend for ${r[0].pollutant} layer`)},m(M,O){k(e,M,O),$(M,t,O),$(M,n,O),h(n,o),$(M,u,O),$(M,f,O),h(f,i),h(i,a),h(i,c),Pe(c,r[0].opacity),$(M,m,O),$(M,_,O),T=!0,j||(F=[He(c,"change",r[7]),He(c,"input",r[7])],j=!0)},p(M,O){const D={};!l&&O&1&&(l=!0,D.value=M[0].pollutant,B(()=>l=!1)),e.$set(D),(!T||O&1)&&s!==(s=M[3](M[0].pollutant)+"")&&G(o,s),O&1&&Pe(c,M[0].opacity),(!T||O&1&&!xt(_.src,S=M[4](M[0].pollutant)))&&z(_,"src",S),(!T||O&1&&y!==(y=`Legend for ${M[0].pollutant} layer`))&&z(_,"alt",y)},i(M){T||(g(e.$$.fragment,M),T=!0)},o(M){d(e.$$.fragment,M),T=!1},d(M){M&&(p(t),p(n),p(u),p(f),p(m),p(_)),w(e,M),j=!1,Ps(F)}}}function Oi(r){let e,l;const t=[q("pollution"),{paint:{"raster-opacity":r[0].opacity/100}},{layout:{visibility:r[0].show?"visible":"none"}}];let n={};for(let s=0;sE(e,"checked",u));let i=r[0].show&&fl(r);return s=new Ir({props:{tiles:[r[1]],tileSize:256,$$slots:{default:[Oi]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&4096&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0].show,B(()=>l=!1)),e.$set(m),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=fl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&2&&(_.tiles=[a[1]]),c&4097&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}function Pi(r){return r.show?`${r.pollutant}/${r.opacity}`:null}function Di(r){let[e,l]=r.split("/");return{show:!0,pollutant:e,opacity:parseInt(l)}}function Ri(r,e,l){let t,n,s,u=wt("pollution",{show:!1,pollutant:"PM25_viridis",opacity:50},Pi,Di);K(r,u,y=>l(0,s=y));function f(){return`https://ukair.maps.rcdo.co.uk/ukairserver/services/aq_amb_2022/${s.pollutant}/MapServer/WMSServer`}function i(y){return t[1]}function a(y){let T=new URLSearchParams({request:"GetMap",version:"1.3.0",format:"image/png",crs:"EPSG:3857",width:"256",height:"256",styles:"",layers:t[0]}).toString();return`${f()}?bbox={bbox-epsg-3857}&${T}`}function c(y){let T=new URLSearchParams({request:"GetLegendGraphic",version:"1.3.0",format:"image/png",layer:t[0]}).toString();return`${f()}?${T}`}function m(y){r.$$.not_equal(s.show,y)&&(s.show=y,u.set(s))}function _(y){r.$$.not_equal(s.pollutant,y)&&(s.pollutant=y,u.set(s))}function S(){s.opacity=Vt(this.value),u.set(s)}return r.$$.update=()=>{r.$$.dirty&1&&(t={NOx_viridis:["22","Data for 2022"],PM25_viridis:["21","Data for 2022"],PM10_viridis:["22","Data for 2022"],NOxRoads_viridis:["22","Data for 2022"],PM25Roads_viridis:["14","Data for 2022"],PM10Roads_viridis:["22","Data for 2022"]}[s.pollutant]),r.$$.dirty&1&&l(1,n=a(s.pollutant))},[s,n,u,i,c,m,_,S]}class Ai extends Q{constructor(e){super(),Z(this,e,Ri,ji,J,{})}}function Fi(r){let e;return{c(){e=v("Road noise")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Gi(r){let e;return{c(){e=v(`DEFRA - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function qi(r){let e,l,t,n,s,o,u,f,i;return s=new ee({props:{href:"https://environment.data.gov.uk/dataset/b9c6bf30-a02d-4378-94a0-2982de1bef86",$$slots:{default:[Gi]},$$scope:{ctx:r}}}),f=new Le({}),{c(){e=C("p"),e.textContent=`This is the LAeq,16h dataset showing annual average noise levels in - units of decibels for the 16-hour period between 7am and 11pm. Only - roads in areas with at least 100,000 people are included.`,l=L(),t=C("p"),n=v("Data from June 2019, produced by "),b(s.$$.fragment),o=v(". See there for methodology details"),u=L(),b(f.$$.fragment)},m(a,c){$(a,e,c),$(a,l,c),$(a,t,c),h(t,n),k(s,t,null),h(t,o),$(a,u,c),k(f,a,c),i=!0},p(a,c){const m={};c&32&&(m.$$scope={dirty:c,ctx:a}),s.$set(m)},i(a){i||(g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(p(e),p(l),p(t),p(u)),w(s),w(f,a)}}}function zi(r){let e,l,t;return l=new $e({props:{$$slots:{default:[qi]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function al(r){let e,l;return e=new qe({props:{colorScale:r[1],limits:["55","65","75",">"]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Hi(r){let e,l=r[4].noiseclass+"",t,n,s=ul(r[4].noiseclass)+"",o,u;return{c(){e=C("p"),t=v(l),n=v(" dB ("),o=v(s),u=v(")")},m(f,i){$(f,e,i),h(e,t),h(e,n),h(e,o),h(e,u)},p(f,i){i&16&&l!==(l=f[4].noiseclass+"")&&G(t,l),i&16&&s!==(s=ul(f[4].noiseclass)+"")&&G(o,s)},d(f){f&&p(e)}}}function Ei(r){let e,l;return e=new ce({props:{$$slots:{default:[Hi,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Bi(r){let e,l;const t=[q(Lt),{sourceLayer:Lt},{paint:{"fill-color":Ke(["get","noiseclass"],{"55.0-59.9":r[1][0],"60.0-64.9":r[1][0],"65.0-69.9":r[1][1],"70.0-74.9":r[1][1],">=75.0":r[1][2]},"red"),"fill-opacity":ne(.5,.8)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[Ei]},$$scope:{ctx:r}};for(let s=0;s=75.0":s[1][2]},"red"),"fill-opacity":ne(.5,.8)}},o&1&&{layout:{visibility:s[0]?"visible":"none"}},t[4],t[5]]):{};o&32&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){l||(g(e.$$.fragment,s),l=!0)},o(s){d(e.$$.fragment,s),l=!1},d(s){w(e,s)}}}function Ui(r){let e,l,t,n,s,o;function u(a){r[3](a)}let f={$$slots:{right:[zi],default:[Fi]},$$scope:{ctx:r}};r[0]!==void 0&&(f.checked=r[0]),e=new oe({props:f}),H.push(()=>E(e,"checked",u));let i=r[0]&&al(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Lt}.pmtiles`,$$slots:{default:[Bi]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&32&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=al(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&33&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Lt="road_noise";function ul(r){return{"55.0-59.9":"Comfortable noise levels","60.0-64.9":"Comfortable noise levels","65.0-69.9":"Slightly noisy","70.0-74.9":"Slightly noisy",">=75.0":"Excessively noisy"}[r]}function Wi(r,e,l){let t,n=[te.sequential_low_to_high[0],te.sequential_low_to_high[2],te.sequential_low_to_high[4]],s=be(Lt);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Yi extends Q{constructor(e){super(),Z(this,e,Wi,Ui,J,{})}}function Ji(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - Wards`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function Vi(r){let e;return{c(){e=v(`ONS Geography - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Qi(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::wards-may-2023-boundaries-uk-bgc/explore",$$slots:{default:[Vi]},$$scope:{ctx:r}}}),o=new Le({}),{c(){e=C("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of May 2023."),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function Zi(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Qi]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Ki(r){let e,l=r[4].name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&p(e)}}}function Xi(r){let e,l;return e=new ce({props:{$$slots:{default:[Ki,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function xi(r){let e,l,t,n;const s=[q(Je),{sourceLayer:Je},{paint:{"fill-color":r[1],"fill-opacity":ne(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[Xi]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${Je}.pmtiles`,$$slots:{default:[xi]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let Je="wards";function tf(r){let e=encodeURIComponent(r.detail.features[0].properties.name);window.open(`https://www.google.com/search?q=${e}+councillor`,"_blank")}function nf(r,e,l){let t,n=te.wards,s=be(Je);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class lf extends Q{constructor(e){super(),Z(this,e,nf,ef,J,{})}}function sf(r){let e;return{c(){e=v("Open Data Commons Open Database License")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function rf(r){let e,l,t,n;return t=new ee({props:{href:"https://www.openstreetmap.org/copyright",$$slots:{default:[sf]},$$scope:{ctx:r}}}),{c(){e=C("p"),l=v("License: "),b(t.$$.fragment)},m(s,o){$(s,e,o),h(e,l),k(t,e,null),n=!0},p(s,[o]){const u={};o&1&&(u.$$scope={dirty:o,ctx:s}),t.$set(u)},i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&p(e),w(t)}}}class Xe extends Q{constructor(e){super(),Z(this,e,null,rf,J,{})}}function of(r){let e,l,t;return e=new Te({props:{color:te.bus_route_with_lane}}),{c(){b(e.$$.fragment),l=v(` - Bus routes`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function ff(r){let e;return{c(){e=v(`GTFS - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function af(r){let e,l,t,n,s,o,u,f,i;return s=new ee({props:{href:"https://gtfs.org",$$slots:{default:[ff]},$$scope:{ctx:r}}}),f=new Xe({}),{c(){e=C("p"),e.textContent=`This shows all roads with at least one bus route crossing them. It also - shows whether the road has a bus lane or not.`,l=L(),t=C("p"),n=v("Note this data is from OpenStreetMap (as of 9 August 2023), not "),b(s.$$.fragment),o=v(`, and doesn't include which routes are run or the - frequency of service.`),u=L(),b(f.$$.fragment)},m(a,c){$(a,e,c),$(a,l,c),$(a,t,c),h(t,n),k(s,t,null),h(t,o),$(a,u,c),k(f,a,c),i=!0},p(a,c){const m={};c&16&&(m.$$scope={dirty:c,ctx:a}),s.$set(m)},i(a){i||(g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(p(e),p(l),p(t),p(u)),w(s),w(f,a)}}}function uf(r){let e,l,t;return l=new $e({props:{$$slots:{default:[af]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function cf(r){let e;return{c(){e=C("p"),e.textContent="At least one bus route crosses here, without any bus lanes"},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function $f(r){let e;return{c(){e=C("p"),e.textContent=`At least one bus route crosses here, with a bus lane in one or more - directions`},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function pf(r){let e;function l(s,o){return s[3].has_bus_lane?$f:cf}let t=l(r),n=t(r);return{c(){n.c(),e=ye()},m(s,o){n.m(s,o),$(s,e,o)},p(s,o){t!==(t=l(s))&&(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},d(s){s&&p(e),n.d(s)}}}function mf(r){let e,l;return e=new ce({props:{$$slots:{default:[pf,({props:t})=>({3:t}),({props:t})=>t?8:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&24&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function _f(r){let e,l;const t=[q(It),{sourceLayer:It},{paint:{"line-color":["case",["boolean",["get","has_bus_lane"],!1],te.bus_route_with_lane,te.bus_route_without_lane],"line-width":5,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[mf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${It}.pmtiles`,$$slots:{default:[_f]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&16&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&17&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let It="bus_routes";function df(r,e,l){let t,n=be(It);K(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class hf extends Q{constructor(e){super(),Z(this,e,df,gf,J,{})}}function cl(r){const e=Mf(r[9]);r[10]=e[0],r[11]=e[1],r[12]=e[2]}function $l(r,e,l){const t=r.slice();return t[10]=e[l][0],t[13]=e[l][1],t[14]=e[l][2],t[15]=e,t[16]=l,t}function bf(r){let e;return{c(){e=v("Cycle paths")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function kf(r){let e,l,t,n,s,o,u,f;return u=new Xe({}),{c(){e=C("p"),e.textContent=`This shows different types of cycle path, according to OpenStreetMap (as - of 15 August 2023).`,l=L(),t=C("ul"),t.innerHTML=`
  • Separated tracks - include fully or partly segregated cycletracks alongside a carriageway, - stepped cycletracks, and tracks off the carriageway entirely. They're also - separated from foot traffic.
  • Unprotected lanes - are mandatory or advisory lanes on the carriageway, without any physical - protection. They do not included shared bus lanes.
  • Shared-use - paths are split between cycle and foot traffic, and are separated from - motor traffic somehow. There can be segregation between cyclists and pedestrians - or not.
  • `,n=L(),s=C("p"),s.textContent=`Note there are many known limitations with this layer. Data in - OpenStreetMap can be missing, mapped twice, or mapped incorrectly. Our - processing is also imperfect. You can click a segment to see full - OpenStreetMap data. Please do report issues with the classification or - data.`,o=L(),b(u.$$.fragment)},m(i,a){$(i,e,a),$(i,l,a),$(i,t,a),$(i,n,a),$(i,s,a),$(i,o,a),k(u,i,a),f=!0},p:x,i(i){f||(g(u.$$.fragment,i),f=!0)},o(i){d(u.$$.fragment,i),f=!1},d(i){i&&(p(e),p(l),p(t),p(n),p(s),p(o)),w(u,i)}}}function wf(r){let e,l,t;return l=new $e({props:{$$slots:{default:[kf]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function pl(r){let e,l,t;return l=new st({props:{$$slots:{default:[yf]},$$scope:{ctx:r}}}),{c(){e=C("div"),b(l.$$.fragment),_e(e,"border","1px solid black"),_e(e,"padding","8px")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131073&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function vf(r){let e,l,t=r[13]+"",n,s,o;return e=new Te({props:{color:r[14]}}),{c(){b(e.$$.fragment),l=L(),n=v(t),s=L()},m(u,f){k(e,u,f),$(u,l,f),$(u,n,f),$(u,s,f),o=!0},p:x,i(u){o||(g(e.$$.fragment,u),o=!0)},o(u){d(e.$$.fragment,u),o=!1},d(u){u&&(p(l),p(n),p(s)),w(e,u)}}}function ml(r){let e,l,t;function n(o){r[5](o,r[10])}let s={$$slots:{default:[vf]},$$scope:{ctx:r}};return r[0][r[10]]!==void 0&&(s.checked=r[0][r[10]]),e=new oe({props:s}),H.push(()=>E(e,"checked",n)),{c(){b(e.$$.fragment)},m(o,u){k(e,o,u),t=!0},p(o,u){r=o;const f={};u&131072&&(f.$$scope={dirty:u,ctx:r}),!l&&u&5&&(l=!0,f.checked=r[0][r[10]],B(()=>l=!1)),e.$set(f)},i(o){t||(g(e.$$.fragment,o),t=!0)},o(o){d(e.$$.fragment,o),t=!1},d(o){w(e,o)}}}function yf(r){let e,l,t=ve(r[2]),n=[];for(let o=0;od(n[o],1,1,()=>{n[o]=null});return{c(){for(let o=0;o({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&131584&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Tf(r){let e,l;const t=[q(Mt),{sourceLayer:Mt},{paint:{"line-color":Ke(["get","kind"],{track:te.cycle_paths.track,lane:te.cycle_paths.lane,shared_use_segregated:te.cycle_paths.shared_use_segregated,shared_use_unsegregated:te.cycle_paths.shared_use_unsegregated},"red"),"line-width":De,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0].show?"visible":"none"}},{filter:r[3](r[0])},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let n={$$slots:{default:[Cf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&pl(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Mt}.pmtiles`,$$slots:{default:[Tf]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&131072&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0].show,B(()=>l=!1)),e.$set(m),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=pl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&131073&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Mt="cycle_paths";function If(r){return{show:!0,track:r.includes("track"),lane:r.includes("lane"),shared_use_segregated:r.includes("shared_use_segregated"),shared_use_unsegregated:r.includes("shared_use_unsegregated")}}function Mf(r){let e={track:"Separated track",lane:"Unprotected lane",shared_use_segregated:"Shared-use (segregated)",shared_use_unsegregated:"Shared-use (unsegregated)"}[r.kind],l={"one-way":"↑","two-way":"↕",unknown:""}[r.direction],t=r.width=="unknown"?"unknown":`${r.width} meters`;return[e,`${l} ${r.direction}`,t]}function Nf(r){window.open(`http://openstreetmap.org/way/${r.detail.features[0].properties.osm_id}`,"_blank")}function Of(r,e,l){let t,n=["track","lane","shared_use_segregated","shared_use_unsegregated"],s={show:!1,track:!0,lane:!0,shared_use_segregated:!0,shared_use_unsegregated:!0};function o(m){return m.show?n.filter(_=>m[_]).join(","):null}let u=wt(Mt,s,o,If);K(r,u,m=>l(0,t=m));let f=[["track","Separated tracks",te.cycle_paths.track],["lane","Unprotected lanes",te.cycle_paths.lane],["shared_use_segregated","Shared-use (segregated)",te.cycle_paths.shared_use_segregated],["shared_use_unsegregated","Shared-use (unsegregated)",te.cycle_paths.shared_use_unsegregated]];function i(m){let _=n.filter(S=>m[S]);return["in",["get","kind"],["literal",_]]}function a(m){r.$$.not_equal(t.show,m)&&(t.show=m,u.set(t))}function c(m,_){r.$$.not_equal(t[_],m)&&(t[_]=m,u.set(t))}return[t,u,f,i,a,c]}class jf extends Q{constructor(e){super(),Z(this,e,Of,Lf,J,{})}}function Pf(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - Major Road Network`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function Df(r){let e;return{c(){e=v(`Major Road Network - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Rf(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://maps.dft.gov.uk/major-road-network/index.html",$$slots:{default:[Df]},$$scope:{ctx:r}}}),o=new Le({}),{c(){e=C("p"),l=v("Data from the "),b(t.$$.fragment),n=v(", as of September 2021."),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function Af(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Rf]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Ff(r){let e,l=(r[4].name??"Unknown MRN road")+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=(n[4].name??"Unknown MRN road")+"")&&G(t,l)},d(n){n&&p(e)}}}function Gf(r){let e,l;return e=new ce({props:{$$slots:{default:[Ff,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function qf(r){let e,l;const t=[q(Nt),{sourceLayer:Nt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":r[1],"line-width":7,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[Gf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${Nt}.pmtiles`,$$slots:{default:[qf]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let Nt="mrn";function Hf(r,e,l){let t,n=te.mrn,s=be(Nt);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Ef extends Q{constructor(e){super(),Z(this,e,Hf,zf,J,{})}}function Bf(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - Strategic Road Network`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function Uf(r){let e;return{c(){e=v(`OS Open Roads - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Wf(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://osdatahub.os.uk/downloads/open/OpenRoads",$$slots:{default:[Uf]},$$scope:{ctx:r}}}),o=new Le({}),{c(){e=C("p"),l=v("Data from "),b(t.$$.fragment),n=v(`, as of December 2023. The SRN is equivalent to trunk - roads.`),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function Yf(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Wf]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Jf(r){let e,l=(r[4].name??"Unknown SRN road")+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=(n[4].name??"Unknown SRN road")+"")&&G(t,l)},d(n){n&&p(e)}}}function Vf(r){let e,l;return e=new ce({props:{$$slots:{default:[Jf,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Qf(r){let e,l;const t=[q(Ot),{sourceLayer:Ot},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":r[1],"line-width":7,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[Vf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${Ot}.pmtiles`,$$slots:{default:[Qf]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let Ot="srn";function Kf(r,e,l){let t,n=te.srn,s=be(Ot);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Xf extends Q{constructor(e){super(),Z(this,e,Kf,Zf,J,{})}}function xf(r){let e,l,t;return e=new Te({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` - National Cycle Network`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function ea(r){let e;return{c(){e=v(`National Cycle Network - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ta(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://data-sustrans-uk.opendata.arcgis.com/",$$slots:{default:[ea]},$$scope:{ctx:r}}}),o=new Le({}),{c(){e=C("p"),l=v("Data from Sustrans about the "),b(t.$$.fragment),n=v(", downloaded on 22/01/2024."),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function na(r){let e,l,t;return l=new $e({props:{$$slots:{default:[ta]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function _l(r){let e,l,t,n=r[4].Desc_+"",s;return{c(){e=C("li"),l=v("Description: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Desc_+"")&&G(s,n)},d(o){o&&p(e)}}}function gl(r){let e,l,t,n=r[4].Greenway+"",s;return{c(){e=C("li"),l=v("Is greenway: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Greenway+"")&&G(s,n)},d(o){o&&p(e)}}}function dl(r){let e,l,t,n=r[4].RouteType+"",s;return{c(){e=C("li"),l=v("Route type: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RouteType+"")&&G(s,n)},d(o){o&&p(e)}}}function hl(r){let e,l,t,n=r[4].RouteNo+"",s;return{c(){e=C("li"),l=v("Route number: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RouteNo+"")&&G(s,n)},d(o){o&&p(e)}}}function bl(r){let e,l,t,n=r[4].RouteCat+"",s;return{c(){e=C("li"),l=v("Route Category: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RouteCat+"")&&G(s,n)},d(o){o&&p(e)}}}function kl(r){let e,l,t,n=r[4].OpenStatus+"",s;return{c(){e=C("li"),l=v("Open Status: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].OpenStatus+"")&&G(s,n)},d(o){o&&p(e)}}}function wl(r){let e,l,t,n=r[4].Surface+"",s;return{c(){e=C("li"),l=v("Surface: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Surface+"")&&G(s,n)},d(o){o&&p(e)}}}function vl(r){let e,l,t,n=r[4].Quality+"",s;return{c(){e=C("li"),l=v("Quality: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Quality+"")&&G(s,n)},d(o){o&&p(e)}}}function yl(r){let e,l,t,n=r[4].RoadClass+"",s;return{c(){e=C("li"),l=v("Road Class: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RoadClass+"")&&G(s,n)},d(o){o&&p(e)}}}function la(r){let e,l,t,n,s,o,u,f,i,a=r[4].Desc_&&_l(r),c=r[4].Greenway&&gl(r),m=r[4].RouteType&&dl(r),_=r[4].RouteNo&&hl(r),S=r[4].RouteCat&&bl(r),y=r[4].OpenStatus&&kl(r),T=r[4].Surface&&wl(r),j=r[4].Quality&&vl(r),F=r[4].RoadClass&&yl(r);return{c(){e=C("ul"),a&&a.c(),l=L(),c&&c.c(),t=L(),m&&m.c(),n=L(),_&&_.c(),s=L(),S&&S.c(),o=L(),y&&y.c(),u=L(),T&&T.c(),f=L(),j&&j.c(),i=L(),F&&F.c()},m(R,N){$(R,e,N),a&&a.m(e,null),h(e,l),c&&c.m(e,null),h(e,t),m&&m.m(e,null),h(e,n),_&&_.m(e,null),h(e,s),S&&S.m(e,null),h(e,o),y&&y.m(e,null),h(e,u),T&&T.m(e,null),h(e,f),j&&j.m(e,null),h(e,i),F&&F.m(e,null)},p(R,N){R[4].Desc_?a?a.p(R,N):(a=_l(R),a.c(),a.m(e,l)):a&&(a.d(1),a=null),R[4].Greenway?c?c.p(R,N):(c=gl(R),c.c(),c.m(e,t)):c&&(c.d(1),c=null),R[4].RouteType?m?m.p(R,N):(m=dl(R),m.c(),m.m(e,n)):m&&(m.d(1),m=null),R[4].RouteNo?_?_.p(R,N):(_=hl(R),_.c(),_.m(e,s)):_&&(_.d(1),_=null),R[4].RouteCat?S?S.p(R,N):(S=bl(R),S.c(),S.m(e,o)):S&&(S.d(1),S=null),R[4].OpenStatus?y?y.p(R,N):(y=kl(R),y.c(),y.m(e,u)):y&&(y.d(1),y=null),R[4].Surface?T?T.p(R,N):(T=wl(R),T.c(),T.m(e,f)):T&&(T.d(1),T=null),R[4].Quality?j?j.p(R,N):(j=vl(R),j.c(),j.m(e,i)):j&&(j.d(1),j=null),R[4].RoadClass?F?F.p(R,N):(F=yl(R),F.c(),F.m(e,null)):F&&(F.d(1),F=null)},d(R){R&&p(e),a&&a.d(),c&&c.d(),m&&m.d(),_&&_.d(),S&&S.d(),y&&y.d(),T&&T.d(),j&&j.d(),F&&F.d()}}}function sa(r){let e,l;return e=new ce({props:{$$slots:{default:[la,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function ra(r){let e,l;const t=[q(jt),{sourceLayer:jt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":r[1],"line-width":4,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[sa]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${jt}.pmtiles`,$$slots:{default:[ra]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let jt="national_cycle_network";function ia(r,e,l){let t,n=te.national_cycle_network,s=be(jt);K(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class fa extends Q{constructor(e){super(),Z(this,e,ia,oa,J,{})}}function Sl(r,e,l){const t=r.slice();return t[6]=e[l][0],t[7]=e[l][1],t[8]=e[l][2],t}function aa(r){let e;return{c(){e=v("OS Pavement widths")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ua(r){let e;return{c(){e=v(`Public Sector Geospatial Agreement - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ca(r){let e,l,t,n,s,o,u,f,i,a,c;return i=new ee({props:{href:"https://www.ordnancesurvey.co.uk/documents/licensing/psga-member-licence.pdf",$$slots:{default:[ua]},$$scope:{ctx:r}}}),{c(){e=C("p"),e.textContent=`This shows the average and minimum pavement width (in meters) from - Ordnance Survey. Because the shape of pavement may vary along a road, - both average and minimum are reported. Measurements may be available for - the left side of the road, the right, or both. The coloring shows the - larger of the two average widths, and the line thickness has no meaning. - Hover over a line to see if there's pavement on one or both sides of the - road. (You won't be able to distinguish left and right though; use the - OS Road basemap instead.)`,l=L(),t=C("p"),t.textContent=`Note these measurements are difficult to interpret near dual - carriageways (shown as parallel lines).`,n=L(),s=C("p"),s.textContent="Data valid as of 1 January, 2024",o=L(),u=C("p"),f=v(`License: Contains OS data © Crown copyright and database right - 2023. Made available under the `),b(i.$$.fragment),a=v(".")},m(m,_){$(m,e,_),$(m,l,_),$(m,t,_),$(m,n,_),$(m,s,_),$(m,o,_),$(m,u,_),h(u,f),k(i,u,null),h(u,a),c=!0},p(m,_){const S={};_&2048&&(S.$$scope={dirty:_,ctx:m}),i.$set(S)},i(m){c||(g(i.$$.fragment,m),c=!0)},o(m){d(i.$$.fragment,m),c=!1},d(m){m&&(p(e),p(l),p(t),p(n),p(s),p(o),p(u)),w(i)}}}function $a(r){let e,l,t;return l=new $e({props:{$$slots:{default:[ca]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2048&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Cl(r){let e,l;return e=new qe({props:{colorScale:r[1],limits:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function pa(r){let e,l,t=en(r[5].angle+r[8])+"",n;return{c(){e=C("p"),l=new pt(!1),n=v(` side of the road: no pavement - `),l.a=n},m(s,o){$(s,e,o),l.m(t,e),h(e,n)},p(s,o){o&32&&t!==(t=en(s[5].angle+s[8])+"")&&l.p(t)},d(s){s&&p(e)}}}function ma(r){let e,l,t=en(r[5].angle+r[8])+"",n,s,o=r[6]+"",u,f,i,a=r[7]+"",c,m;return{c(){e=C("p"),l=new pt(!1),n=v(` side of the road: - `),s=C("b"),u=v(o),f=v(` - m average, - `),i=C("b"),c=v(a),m=v(` - m minimum - `),l.a=n},m(_,S){$(_,e,S),l.m(t,e),h(e,n),h(e,s),h(s,u),h(e,f),h(e,i),h(i,c),h(e,m)},p(_,S){S&32&&t!==(t=en(_[5].angle+_[8])+"")&&l.p(t),S&32&&o!==(o=_[6]+"")&&G(u,o),S&32&&a!==(a=_[7]+"")&&G(c,a)},d(_){_&&p(e)}}}function Tl(r){let e;function l(s,o){return s[6]?ma:pa}let t=l(r),n=t(r);return{c(){n.c(),e=ye()},m(s,o){n.m(s,o),$(s,e,o)},p(s,o){t===(t=l(s))&&n?n.p(s,o):(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},d(s){s&&p(e),n.d(s)}}}function _a(r){let e,l=ve([[r[5].left_average,r[5].left_minimum,-90],[r[5].right_average,r[5].right_minimum,90]]),t=[];for(let n=0;n<2;n+=1)t[n]=Tl(Sl(r,l,n));return{c(){for(let n=0;n<2;n+=1)t[n].c();e=ye()},m(n,s){for(let o=0;o<2;o+=1)t[o]&&t[o].m(n,s);$(n,e,s)},p(n,s){if(s&32){l=ve([[n[5].left_average,n[5].left_minimum,-90],[n[5].right_average,n[5].right_minimum,90]]);let o;for(o=0;o<2;o+=1){const u=Sl(n,l,o);t[o]?t[o].p(u,s):(t[o]=Tl(u),t[o].c(),t[o].m(e.parentNode,e))}for(;o<2;o+=1)t[o].d(1)}},d(n){n&&p(e),Ze(t,n)}}}function ga(r){let e,l;return e=new ce({props:{openOn:"hover",$$slots:{default:[_a,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&2080&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function da(r){let e,l;const t=[q(Pt),{sourceLayer:Pt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":he(["max",["number",["get","left_average"],0],["number",["get","right_average"],0]],r[2],r[1]),"line-width":De,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[ga]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Cl(r);return s=new ge({props:{url:`pmtiles://${Qt()}/v1/${Pt}.pmtiles`,$$slots:{default:[da]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&2048&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Cl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&2049&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Pt="pavement_widths";function ba(r){let e=Math.floor((r+22.5)%360/45);return["N","NE","E","SE","S","SW","W","NW","N"][e]}function en(r){return`${ba(r)} ⬆`}function ka(r,e,l){let t,n=te.sequential_low_to_high,s=[0,2,4,6,8,13],o=be(Pt);K(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class wa extends Q{constructor(e){super(),Z(this,e,ka,ha,J,{})}}function va(r){let e;return{c(){e=v("Propensity to Cycle Tool")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ya(r){let e;return{c(){e=v("the PCT website")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Sa(r){let e;return{c(){e=v("2017 journal article")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Ca(r){let e,l,t,n,s,o,u,f,i,a,c;return u=new ee({props:{href:"https://www.pct.bike",$$slots:{default:[ya]},$$scope:{ctx:r}}}),i=new ee({props:{href:"https://www.jtlu.org/index.php/jtlu/article/view/862",$$slots:{default:[Sa]},$$scope:{ctx:r}}}),{c(){e=C("p"),e.textContent=`The PCT shows major links on the transport network on which there is - high latent demand for cycling under scenarios of change, based on the - "fastest" routes from CycleStreets. Counts approximate daily rush hour - traffic levels.`,l=L(),t=C("p"),t.textContent=`Note this layer uses 2011 census data and outdated OpenStreetMap data. - Please use this layer with caution.`,n=L(),s=C("p"),o=v("See "),b(u.$$.fragment),f=v(" and "),b(i.$$.fragment),a=v(" for details on methodology and data sources.")},m(m,_){$(m,e,_),$(m,l,_),$(m,t,_),$(m,n,_),$(m,s,_),h(s,o),k(u,s,null),h(s,f),k(i,s,null),h(s,a),c=!0},p(m,_){const S={};_&1024&&(S.$$scope={dirty:_,ctx:m}),u.$set(S);const y={};_&1024&&(y.$$scope={dirty:_,ctx:m}),i.$set(y)},i(m){c||(g(u.$$.fragment,m),g(i.$$.fragment,m),c=!0)},o(m){d(u.$$.fragment,m),d(i.$$.fragment,m),c=!1},d(m){m&&(p(e),p(l),p(t),p(n),p(s)),w(u),w(i)}}}function Ta(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Ca]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&1024&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Ll(r){let e,l,t,n,s,o,u,f;e=new qe({props:{colorScale:r[1],limits:r[2]}});function i(_){r[6](_)}let a={label:"Trip purpose",choices:[["pct_commute","Commuting"],["pct_school","School"]],inlineSmall:!0};r[0].tripPurpose!==void 0&&(a.value=r[0].tripPurpose),t=new Ds({props:a}),H.push(()=>E(t,"value",i));function c(_){r[7](_)}let m={label:"Scenario",choices:[["baseline","Baseline (2011)"],["gov_target","Government target (2025)"],["go_dutch","Go Dutch"]]};return r[0].scenario!==void 0&&(m.value=r[0].scenario),o=new ht({props:m}),H.push(()=>E(o,"value",c)),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),s=L(),b(o.$$.fragment)},m(_,S){k(e,_,S),$(_,l,S),k(t,_,S),$(_,s,S),k(o,_,S),f=!0},p(_,S){const y={};!n&&S&1&&(n=!0,y.value=_[0].tripPurpose,B(()=>n=!1)),t.$set(y);const T={};!u&&S&1&&(u=!0,T.value=_[0].scenario,B(()=>u=!1)),o.$set(T)},i(_){f||(g(e.$$.fragment,_),g(t.$$.fragment,_),g(o.$$.fragment,_),f=!0)},o(_){d(e.$$.fragment,_),d(t.$$.fragment,_),d(o.$$.fragment,_),f=!1},d(_){_&&(p(l),p(s)),w(e,_),w(t,_),w(o,_)}}}function La(r){let e,l=r[4](r[9])+"",t;return{c(){e=new pt(!1),t=ye(),e.a=t},m(n,s){e.m(l,n,s),$(n,t,s)},p(n,s){s&512&&l!==(l=n[4](n[9])+"")&&e.p(l)},d(n){n&&(p(t),e.d())}}}function Ia(r){let e,l;return e=new ce({props:{$$slots:{default:[La,({props:t})=>({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1536&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ma(r){let e,l;const t=[q(lt),{sourceLayer:lt},{paint:{"line-color":he(["get",r[0].scenario],r[2],r[1]),"line-width":De,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0].show&&r[0].tripPurpose==lt?"visible":"none"}}];let n={$$slots:{default:[Ia]},$$scope:{ctx:r}};for(let s=0;s({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1536&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function ja(r){let e,l;const t=[q($t),{sourceLayer:$t},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":he(["get",r[0].scenario],r[2],r[1]),"line-width":De,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0].show&&r[0].tripPurpose==$t?"visible":"none"}}];let n={$$slots:{default:[Oa]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",i));let c=r[0].show&&Ll(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${lt}.pmtiles`,$$slots:{default:[Ma]},$$scope:{ctx:r}}}),u=new ge({props:{url:`pmtiles://${me()}/v1/${$t}.pmtiles`,$$slots:{default:[ja]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),c&&c.c(),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment)},m(m,_){k(e,m,_),$(m,t,_),c&&c.m(m,_),$(m,n,_),k(s,m,_),$(m,o,_),k(u,m,_),f=!0},p(m,[_]){const S={};_&1024&&(S.$$scope={dirty:_,ctx:m}),!l&&_&1&&(l=!0,S.checked=m[0].show,B(()=>l=!1)),e.$set(S),m[0].show?c?(c.p(m,_),_&1&&g(c,1)):(c=Ll(m),c.c(),g(c,1),c.m(n.parentNode,n)):c&&(ae(),d(c,1,1,()=>{c=null}),ue());const y={};_&1025&&(y.$$scope={dirty:_,ctx:m}),s.$set(y);const T={};_&1025&&(T.$$scope={dirty:_,ctx:m}),u.$set(T)},i(m){f||(g(e.$$.fragment,m),g(c),g(s.$$.fragment,m),g(u.$$.fragment,m),f=!0)},o(m){d(e.$$.fragment,m),d(c),d(s.$$.fragment,m),d(u.$$.fragment,m),f=!1},d(m){m&&(p(t),p(n),p(o)),w(e,m),c&&c.d(m),w(s,m),w(u,m)}}}let lt="pct_commute",$t="pct_school";function Da(r){return r.show?`${r.tripPurpose}/${r.scenario}`:null}function Ra(r){let[e,l]=r.split("/");return{show:!0,tripPurpose:e,scenario:l}}function Aa(r,e,l){let t,n=te.sequential_low_to_high,s=[0,50,100,500,1e3,2e3],u=wt("pct",{show:!1,tripPurpose:lt,scenario:"baseline"},Da,Ra);K(r,u,m=>l(0,t=m));function f(m){let _=m.baseline,S=m.gov_target,y=m.go_dutch,T=`

    Trip purpose: ${t.tripPurpose==lt?"commuting":"school"}

    `;if(T+=`

    Baseline (2011): ${_.toLocaleString()}

    `,_==0)T+=`

    Government target (2025): ${S.toLocaleString()}

    `,T+=`

    Go Dutch: ${y.toLocaleString()}

    `;else{let j=(S/_).toFixed(1),F=(y/_).toFixed(1);T+=`

    Government target (2025): ${S.toLocaleString()} (${j}x of baseline)

    `,T+=`

    Go Dutch: ${y.toLocaleString()} (${F}x of baseline)

    `}return T}function i(m){r.$$.not_equal(t.show,m)&&(t.show=m,u.set(t))}function a(m){r.$$.not_equal(t.tripPurpose,m)&&(t.tripPurpose=m,u.set(t))}function c(m){r.$$.not_equal(t.scenario,m)&&(t.scenario=m,u.set(t))}return[t,n,s,u,f,i,a,c]}class Fa extends Q{constructor(e){super(),Z(this,e,Aa,Pa,J,{})}}function Ga(r){let e;return{c(){e=v("OS Speeds")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function qa(r){let e;return{c(){e=v("Basemap")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function za(r){let e;return{c(){e=v(`Public Sector Geospatial Agreement - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Ha(r){let e,l,t,n,s,o,u,f,i,a,c,m;return t=new ee({props:{href:"https://basemap.co.uk/speed-data",$$slots:{default:[qa]},$$scope:{ctx:r}}}),a=new ee({props:{href:"https://www.ordnancesurvey.co.uk/documents/licensing/psga-member-licence.pdf",$$slots:{default:[za]},$$scope:{ctx:r}}}),{c(){e=C("p"),l=v("The average speed data is collected over a six-month period by "),b(t.$$.fragment),n=v(` from 135,000 vehicle telematic systems and provided through - Ordnance Survey. The averages are grouped by different time periods for weekdays - and weekends. This map shows the highest average.`),s=L(),o=C("p"),o.textContent="Data valid as of 1 September, 2023",u=L(),f=C("p"),i=v(`License: Contains OS data © Crown copyright and database right - 2023. Made available under the `),b(a.$$.fragment),c=v(".")},m(_,S){$(_,e,S),h(e,l),k(t,e,null),h(e,n),$(_,s,S),$(_,o,S),$(_,u,S),$(_,f,S),h(f,i),k(a,f,null),h(f,c),m=!0},p(_,S){const y={};S&512&&(y.$$scope={dirty:S,ctx:_}),t.$set(y);const T={};S&512&&(T.$$scope={dirty:S,ctx:_}),a.$set(T)},i(_){m||(g(t.$$.fragment,_),g(a.$$.fragment,_),m=!0)},o(_){d(t.$$.fragment,_),d(a.$$.fragment,_),m=!1},d(_){_&&(p(e),p(s),p(o),p(u),p(f)),w(t),w(a)}}}function Ea(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Ha]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&512&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Il(r){let e,l,t,n,s;e=new qe({props:{colorScale:r[1],limits:r[2]}});function o(f){r[6](f)}let u={label:"Show speed types",choices:[["indicative_mph","Posted speed limit"],["highest_mph","Highest measured average speed"]],inlineSmall:!0};return r[0].kind!==void 0&&(u.value=r[0].kind),t=new Ds({props:u}),H.push(()=>E(t,"value",o)),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment)},m(f,i){k(e,f,i),$(f,l,i),k(t,f,i),s=!0},p(f,i){const a={};!n&&i&1&&(n=!0,a.value=f[0].kind,B(()=>n=!1)),t.$set(a)},i(f){s||(g(e.$$.fragment,f),g(t.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(t.$$.fragment,f),s=!1},d(f){f&&p(l),w(e,f),w(t,f)}}}function Ba(r){let e,l,t=r[8].indicative_mph+"",n,s,o,u,f,i=r[8].highest_mph+"",a,c,m=r[4][r[8].highest_description]+"",_,S;return{c(){e=C("p"),l=v("Posted speed limit: "),n=v(t),s=v(" mph"),o=L(),u=C("p"),f=v("Highest average speed: "),a=v(i),c=v(" mph (during "),_=v(m),S=v(")")},m(y,T){$(y,e,T),h(e,l),h(e,n),h(e,s),$(y,o,T),$(y,u,T),h(u,f),h(u,a),h(u,c),h(u,_),h(u,S)},p(y,T){T&256&&t!==(t=y[8].indicative_mph+"")&&G(n,t),T&256&&i!==(i=y[8].highest_mph+"")&&G(a,i),T&256&&m!==(m=y[4][y[8].highest_description]+"")&&G(_,m)},d(y){y&&(p(e),p(o),p(u))}}}function Ua(r){let e,l;return e=new ce({props:{$$slots:{default:[Ba,({props:t})=>({8:t}),({props:t})=>t?256:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&768&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Wa(r){let e,l;const t=[q(Dt),{sourceLayer:Dt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":he(["get",r[0].kind],r[2],r[1]),"line-width":De,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0].show?"visible":"none"}}];let n={$$slots:{default:[Ua]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&Il(r);return s=new ge({props:{url:`pmtiles://${Qt()}/v1/${Dt}.pmtiles`,$$slots:{default:[Wa]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&512&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0].show,B(()=>l=!1)),e.$set(m),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=Il(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&513&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Dt="road_speeds";function Ja(r){return r.show?r.kind:null}function Va(r){return{show:!0,kind:r}}function Qa(r,e,l){let t,n=te.sequential_low_to_high,s=[0,20,30,40,50,90],u=wt(Dt,{show:!1,kind:"indicative_mph"},Ja,Va);K(r,u,c=>l(0,t=c));let f={mf4to7:"Monday-Friday 4-7am",mf7to9:"Monday-Friday 7-9am",mf9to12:"Monday-Friday 9am-12pm",mf12to14:"Monday-Friday 12-2pm",mf14to16:"Monday-Friday 2-4pm",mf16to19:"Monday-Friday 4-7pm",mf19to22:"Monday-Friday 7-10pm",mf22to4:"Monday-Friday 10pm-4am",ss4to7:"Saturday-Sunday 4-7am",ss7to10:"Saturday-Sunday 7-10am",ss10to14:"Saturday-Sunday 10am-2pm",ss14to19:"Saturday-Sunday 2-7pm",ss19to22:"Saturday-Sunday 7-10pm",ss22to4:"Saturday-Sunday 10pm-4am"};function i(c){r.$$.not_equal(t.show,c)&&(t.show=c,u.set(t))}function a(c){r.$$.not_equal(t.kind,c)&&(t.kind=c,u.set(t))}return[t,n,s,u,f,i,a]}class Za extends Q{constructor(e){super(),Z(this,e,Qa,Ya,J,{})}}function Ka(r){let e;return{c(){e=v("OS Road widths")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Xa(r){let e;return{c(){e=v(`Public Sector Geospatial Agreement - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function xa(r){let e,l,t,n,s,o,u,f,i;return u=new ee({props:{href:"https://www.ordnancesurvey.co.uk/documents/licensing/psga-member-licence.pdf",$$slots:{default:[Xa]},$$scope:{ctx:r}}}),{c(){e=C("p"),e.textContent=`This is average and minimum road carriageway width (in meters) from - Ordnance Survey. The coloring shows the average width, and the line - thickness has no meaning. Be careful interpreting the data near dual - carriageways and crossing islands.`,l=L(),t=C("p"),t.textContent="Data valid as of 1 September, 2023",n=L(),s=C("p"),o=v(`License: Contains OS data © Crown copyright and database right - 2023. Made available under the `),b(u.$$.fragment),f=v(".")},m(a,c){$(a,e,c),$(a,l,c),$(a,t,c),$(a,n,c),$(a,s,c),h(s,o),k(u,s,null),h(s,f),i=!0},p(a,c){const m={};c&64&&(m.$$scope={dirty:c,ctx:a}),u.$set(m)},i(a){i||(g(u.$$.fragment,a),i=!0)},o(a){d(u.$$.fragment,a),i=!1},d(a){a&&(p(e),p(l),p(t),p(n),p(s)),w(u)}}}function eu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[xa]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Ml(r){let e,l;return e=new qe({props:{colorScale:r[1],limits:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function tu(r){let e,l,t,n=r[5].average+"",s,o,u,f,i,a,c=r[5].minimum+"",m,_;return{c(){e=C("p"),l=v("Average width: "),t=C("b"),s=v(n),o=v(` - meters`),u=L(),f=C("p"),i=v("Minimum width: "),a=C("b"),m=v(c),_=v(` - meters`)},m(S,y){$(S,e,y),h(e,l),h(e,t),h(t,s),h(e,o),$(S,u,y),$(S,f,y),h(f,i),h(f,a),h(a,m),h(f,_)},p(S,y){y&32&&n!==(n=S[5].average+"")&&G(s,n),y&32&&c!==(c=S[5].minimum+"")&&G(m,c)},d(S){S&&(p(e),p(u),p(f))}}}function nu(r){let e,l;return e=new ce({props:{$$slots:{default:[tu,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function lu(r){let e,l;const t=[q(Rt),{sourceLayer:Rt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":he(["get","average"],r[2],r[1]),"line-width":De,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[nu]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Ml(r);return s=new ge({props:{url:`pmtiles://${Qt()}/v1/${Rt}.pmtiles`,$$slots:{default:[lu]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&64&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Ml(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Rt="road_widths";function ru(r,e,l){let t,n=te.sequential_low_to_high,s=[0,5,10,15,20,100],o=be(Rt);K(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class ou extends Q{constructor(e){super(),Z(this,e,ru,su,J,{})}}function iu(r){let e,l,t;return e=new Te({props:{color:te.trams}}),{c(){b(e.$$.fragment),l=v(` - Trams`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function fu(r){let e,l,t,n;return t=new Xe({}),{c(){e=C("p"),e.textContent=`This shows all trams and light rail lines, according to OpenStreetMap - (as of 7 February 2024). When these are close to a scheme, interactions - between the modes must be designed carefully.`,l=L(),b(t.$$.fragment)},m(s,o){$(s,e,o),$(s,l,o),k(t,s,o),n=!0},p:x,i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(p(e),p(l)),w(t,s)}}}function au(r){let e,l,t;return l=new $e({props:{$$slots:{default:[fu]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&8&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function uu(r){let e,l;const t=[q(At),{sourceLayer:At},{paint:{"line-color":te.trams,"line-width":5,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let n={};for(let s=0;sE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${At}.pmtiles`,$$slots:{default:[uu]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&8&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&9&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let At="trams";function $u(r){window.open(`http://openstreetmap.org/way/${r.detail.features[0].properties.osm_id}`,"_blank")}function pu(r,e,l){let t,n=be(At);K(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class mu extends Q{constructor(e){super(),Z(this,e,pu,cu,J,{})}}function _u(r){let e;return{c(){e=v("Bus stops")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function gu(r){let e;return{c(){e=v(`Bus Open Data Service - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function du(r){let e,l,t,n,s,o,u,f,i;return t=new ee({props:{href:"https://data.bus-data.dft.gov.uk",$$slots:{default:[gu]},$$scope:{ctx:r}}}),f=new Le({}),{c(){e=C("p"),l=v("Data from the "),b(t.$$.fragment),n=v(`, as of 7 February 2024. To calculate frequency, every - scheduled arrival time per stop is considered, grouped by day of the - week. The total daily count is just the number of scheduled arrivals for - a day. The peak hour frequency is the highest number of buses in any one - hour window. That window might not lined up perfectly on the hour -- a - peak hour might occur from 8:25 to 9:25,for example.`),s=L(),o=C("p"),o.textContent=`There are known limitations with this layer, so please use caution when - using these numbers. Some stops may not be shown at all. Frequency could - be over- or under-counted, due to exceptions to the regular daily - schedule of a service.`,u=L(),b(f.$$.fragment)},m(a,c){$(a,e,c),h(e,l),k(t,e,null),h(e,n),$(a,s,c),$(a,o,c),$(a,u,c),k(f,a,c),i=!0},p(a,c){const m={};c&64&&(m.$$scope={dirty:c,ctx:a}),t.$set(m)},i(a){i||(g(t.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(p(e),p(s),p(o),p(u)),w(t),w(f,a)}}}function hu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[du]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Nl(r){let e,l,t,n;return t=new qe({props:{colorScale:r[1],limits:r[2]}}),{c(){e=C("p"),e.textContent="Peak hourly frequency:",l=L(),b(t.$$.fragment)},m(s,o){$(s,e,o),$(s,l,o),k(t,s,o),n=!0},p:x,i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(p(e),p(l)),w(t,s)}}}function bu(r){let e,l,t,n=r[5].stop_name+"",s,o,u,f,i,a=r[5].peak+"",c,m,_,S,y,T=r[5].peak_description+"",j,F,R,N,M,O=r[5].total+"",D,I,P=r[5].total_description+"",U,X;return{c(){e=C("p"),l=v("Stop name: "),t=C("b"),s=v(n),o=L(),u=C("p"),f=v("Peak: "),i=C("b"),c=v(a),m=v(` - buses during the busiest hour of any day`),_=L(),S=C("p"),y=v("The peak hour is "),j=v(T),F=L(),R=C("p"),N=v("Total buses per day: "),M=C("b"),D=v(O),I=v(` - (for `),U=v(P),X=v(", the busiest day of the week)")},m(A,Y){$(A,e,Y),h(e,l),h(e,t),h(t,s),$(A,o,Y),$(A,u,Y),h(u,f),h(u,i),h(i,c),h(u,m),$(A,_,Y),$(A,S,Y),h(S,y),h(S,j),$(A,F,Y),$(A,R,Y),h(R,N),h(R,M),h(M,D),h(R,I),h(R,U),h(R,X)},p(A,Y){Y&32&&n!==(n=A[5].stop_name+"")&&G(s,n),Y&32&&a!==(a=A[5].peak+"")&&G(c,a),Y&32&&T!==(T=A[5].peak_description+"")&&G(j,T),Y&32&&O!==(O=A[5].total+"")&&G(D,O),Y&32&&P!==(P=A[5].total_description+"")&&G(U,P)},d(A){A&&(p(e),p(o),p(u),p(_),p(S),p(F),p(R))}}}function ku(r){let e,l;return e=new ce({props:{$$slots:{default:[bu,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function wu(r){let e,l;const t=[q(Ft),{sourceLayer:Ft},{paint:{"circle-color":he(["get","peak"],r[2],r[1]),"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,10]}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[ku]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Nl(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Ft}.pmtiles`,$$slots:{default:[wu]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&64&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Nl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ft="bus_stops";function yu(r,e,l){let t,n=te.sequential_low_to_high,s=[0,3,10,20,30,100],o=be(Ft);K(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class Su extends Q{constructor(e){super(),Z(this,e,yu,vu,J,{})}}function Cu(r){let e;return{c(){e=v("Crossings")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Tu(r){let e;return{c(){e=v("crossing")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Lu(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://wiki.openstreetmap.org/wiki/Key:crossing",$$slots:{default:[Tu]},$$scope:{ctx:r}}}),o=new Xe({}),{c(){e=C("p"),l=v("This shows "),b(t.$$.fragment),n=v(" data from OpenStreetMap (as of 9 August 2023)."),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function Iu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Lu]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Ol(r){let e,l;return e=new Zt({props:{rows:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Mu(r){let e,l=jl(r[4])+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=jl(n[4])+"")&&G(t,l)},d(n){n&&p(e)}}}function Nu(r){let e,l;return e=new ce({props:{$$slots:{default:[Mu,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ou(r){let e,l;const t=[q(Gt),{sourceLayer:Gt},{paint:{"circle-color":Ke(["get","crossing"],{traffic_signals:te.signalized_crossing},te.other_crossing),"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,10]}},{layout:{visibility:r[0]?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[Nu]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Ol(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Gt}.pmtiles`,$$slots:{default:[Ou]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&32&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Ol(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&33&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Gt="crossings";function jl(r){return{no:"Location where crossing is impossible/illegal but where there is a clear desire line to cross",traffic_signals:"Signalised crossing",marked:"Crossing with no traffic signals",uncontrolled:"Crossing with no traffic signals",unmarked:"Crossing with no markings or signals",zebra:"Zebra crossing",island:"Crossing with an island",informal:"Informal crossing with an obvious desire line, but no official infrastructure to support it"}[r.crossing]??`Unknown crossing type (${r.crossing})`}function Pu(r){window.open(`http://openstreetmap.org/node/${r.detail.features[0].properties.osm_id}`,"_blank")}function Du(r,e,l){let t,n=be(Gt);K(r,n,u=>l(0,t=u));let s=[["Signalized",te.signalized_crossing],["Other",te.other_crossing]];function o(u){t=u,n.set(t)}return[t,n,s,o]}class Ru extends Q{constructor(e){super(),Z(this,e,Du,ju,J,{})}}function Au(r){let e;return{c(){e=v("Gradients")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Fu(r){let e;return{c(){e=v("OS Terrain 50")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Gu(r){let e,l,t,n,s,o,u,f,i,a,c,m,_;return u=new ee({props:{href:"https://www.ordnancesurvey.co.uk/products/os-terrain-50",$$slots:{default:[Fu]},$$scope:{ctx:r}}}),a=new Le({}),m=new Xe({}),{c(){e=C("p"),e.textContent=`This layer shows the steepness of roads, with the arrows pointing - uphill. You have to zoom in to see all roads.`,l=L(),t=C("p"),t.textContent=`Note the gradient may be incorrect near bridges and tunnels, depending - on the underlying Digital Elevation Model used.`,n=L(),s=C("p"),o=v("This layer is built from "),b(u.$$.fragment),f=v(` and roads from OpenStreetMap. The data is valid as of 18 - February 2024.`),i=L(),b(a.$$.fragment),c=L(),b(m.$$.fragment)},m(S,y){$(S,e,y),$(S,l,y),$(S,t,y),$(S,n,y),$(S,s,y),h(s,o),k(u,s,null),h(s,f),$(S,i,y),k(a,S,y),$(S,c,y),k(m,S,y),_=!0},p(S,y){const T={};y&64&&(T.$$scope={dirty:y,ctx:S}),u.$set(T)},i(S){_||(g(u.$$.fragment,S),g(a.$$.fragment,S),g(m.$$.fragment,S),_=!0)},o(S){d(u.$$.fragment,S),d(a.$$.fragment,S),d(m.$$.fragment,S),_=!1},d(S){S&&(p(e),p(l),p(t),p(n),p(s),p(i),p(c)),w(u),w(a,S),w(m,S)}}}function qu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Gu]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Pl(r){let e,l;return e=new qe({props:{colorScale:r[1],limits:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function zu(r){let e,l,t,n=Math.abs(r[5].gradient)/100+"",s,o;return{c(){e=C("p"),l=v("Gradient: "),t=C("b"),s=v(n),o=v(` - %`)},m(u,f){$(u,e,f),h(e,l),h(e,t),h(t,s),h(e,o)},p(u,f){f&32&&n!==(n=Math.abs(u[5].gradient)/100+"")&&G(s,n)},d(u){u&&p(e)}}}function Hu(r){let e,l;return e=new ce({props:{$$slots:{default:[zu,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Eu(r){let e,l,t,n;const s=[q(Ve),{sourceLayer:Ve},{manageHoverState:!0},{paint:{"line-color":he(["/",["abs",["get","gradient"]],100],r[2],r[1]),"line-width":De,"line-opacity":ne(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let o={$$slots:{default:[Hu]},$$scope:{ctx:r}};for(let i=0;i",["abs",["get","gradient"]],300]},{layout:{"icon-image":"chevron","icon-size":1,"symbol-placement":"line","symbol-spacing":50,"icon-allow-overlap":!0,"icon-rotate":["case",["<",["get","gradient"],0],180,0],visibility:r[0]?"visible":"none"}}];let f={};for(let i=0;iE(e,"checked",u));let i=r[0]&&Pl(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Ve}.pmtiles`,$$slots:{default:[Eu]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&64&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Pl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ve="gradient";function Uu(r,e,l){let t,n=te.gradient_flat_to_steep,s=[0,3,5,8,10,20,100],o=be(Ve);K(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class Wu extends Q{constructor(e){super(),Z(this,e,Uu,Bu,J,{})}}function Yu(r){let e,l,t;return{c(){e=C("img"),t=v(` - Cycle parking`),xt(e.src,l=Us)||z(e,"src",l),z(e,"alt","a logo representing cycle parking")},m(n,s){$(n,e,s),$(n,t,s)},p:x,d(n){n&&(p(e),p(t))}}}function Ju(r){let e;return{c(){e=v("OpenStreetMap")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Vu(r){let e;return{c(){e=v("OpenStreetMap Carto")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Qu(r){let e,l,t,n,s,o,u,f,i,a,c;return t=new ee({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbicycle_parking",$$slots:{default:[Ju]},$$scope:{ctx:r}}}),f=new ee({props:{href:"https://github.com/gravitystorm/openstreetmap-carto",$$slots:{default:[Vu]},$$scope:{ctx:r}}}),a=new Xe({}),{c(){e=C("p"),l=v("Cycle parking, according to "),b(t.$$.fragment),n=v(` (as of 9 August 2023). The type of parking, public/private - access, and whether it's covered are not shown.`),s=L(),o=C("p"),u=v("Icon from "),b(f.$$.fragment),i=L(),b(a.$$.fragment)},m(m,_){$(m,e,_),h(e,l),k(t,e,null),h(e,n),$(m,s,_),$(m,o,_),h(o,u),k(f,o,null),$(m,i,_),k(a,m,_),c=!0},p(m,_){const S={};_&16&&(S.$$scope={dirty:_,ctx:m}),t.$set(S);const y={};_&16&&(y.$$scope={dirty:_,ctx:m}),f.$set(y)},i(m){c||(g(t.$$.fragment,m),g(f.$$.fragment,m),g(a.$$.fragment,m),c=!0)},o(m){d(t.$$.fragment,m),d(f.$$.fragment,m),d(a.$$.fragment,m),c=!1},d(m){m&&(p(e),p(s),p(o),p(i)),w(t),w(f),w(a,m)}}}function Zu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Qu]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Ku(r){let e,l,t,n=(r[3].capacity??"unknown")+"",s;return{c(){e=C("p"),l=v("Capacity: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&8&&n!==(n=(o[3].capacity??"unknown")+"")&&G(s,n)},d(o){o&&p(e)}}}function Xu(r){let e,l;return e=new ce({props:{$$slots:{default:[Ku,({props:t})=>({3:t}),({props:t})=>t?8:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&24&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function xu(r){let e,l;const t=[q(qt),{sourceLayer:qt},{layout:{"icon-image":"cycle_parking","icon-size":1,"icon-allow-overlap":!0,visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[Xu]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${qt}.pmtiles`,$$slots:{default:[xu]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&16&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&17&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let qt="cycle_parking";function tc(r,e,l){let t,n=be(qt);K(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class nc extends Q{constructor(e){super(),Z(this,e,tc,ec,J,{})}}function lc(r){let e;return{c(){e=v("Education")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function sc(r){let e,l,t,n;return t=new Xe({}),{c(){e=C("p"),e.textContent=`This shows different places of education according to OpenStreetMap (as - of 07 February 2024).`,l=L(),b(t.$$.fragment)},m(s,o){$(s,e,o),$(s,l,o),k(t,s,o),n=!0},p:x,i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(p(e),p(l)),w(t,s)}}}function rc(r){let e,l,t;return l=new $e({props:{$$slots:{default:[sc]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2048&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Dl(r){let e,l,t;return l=new st({props:{$$slots:{default:[ac]},$$scope:{ctx:r}}}),{c(){e=C("div"),b(l.$$.fragment),_e(e,"border","1px solid black"),_e(e,"padding","8px")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2049&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function oc(r){let e,l,t;return e=new Te({props:{color:te.education.schools}}),{c(){b(e.$$.fragment),l=v(` - Schools`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function ic(r){let e,l,t;return e=new Te({props:{color:te.education.colleges}}),{c(){b(e.$$.fragment),l=v(` - Colleges`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function fc(r){let e,l,t;return e=new Te({props:{color:te.education.universities}}),{c(){b(e.$$.fragment),l=v(` - Universities`)},m(n,s){k(e,n,s),$(n,l,s),t=!0},p:x,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&p(l),w(e,n)}}}function ac(r){let e,l,t,n,s,o,u,f,i;function a(T){r[4](T)}let c={$$slots:{default:[oc]},$$scope:{ctx:r}};r[0].school!==void 0&&(c.checked=r[0].school),e=new oe({props:c}),H.push(()=>E(e,"checked",a));function m(T){r[5](T)}let _={$$slots:{default:[ic]},$$scope:{ctx:r}};r[0].college!==void 0&&(_.checked=r[0].college),n=new oe({props:_}),H.push(()=>E(n,"checked",m));function S(T){r[6](T)}let y={$$slots:{default:[fc]},$$scope:{ctx:r}};return r[0].university!==void 0&&(y.checked=r[0].university),u=new oe({props:y}),H.push(()=>E(u,"checked",S)),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment),o=L(),b(u.$$.fragment)},m(T,j){k(e,T,j),$(T,t,j),k(n,T,j),$(T,o,j),k(u,T,j),i=!0},p(T,j){const F={};j&2048&&(F.$$scope={dirty:j,ctx:T}),!l&&j&1&&(l=!0,F.checked=T[0].school,B(()=>l=!1)),e.$set(F);const R={};j&2048&&(R.$$scope={dirty:j,ctx:T}),!s&&j&1&&(s=!0,R.checked=T[0].college,B(()=>s=!1)),n.$set(R);const N={};j&2048&&(N.$$scope={dirty:j,ctx:T}),!f&&j&1&&(f=!0,N.checked=T[0].university,B(()=>f=!1)),u.$set(N)},i(T){i||(g(e.$$.fragment,T),g(n.$$.fragment,T),g(u.$$.fragment,T),i=!0)},o(T){d(e.$$.fragment,T),d(n.$$.fragment,T),d(u.$$.fragment,T),i=!1},d(T){T&&(p(t),p(o)),w(e,T),w(n,T),w(u,T)}}}function uc(r){let e,l=(r[10].name??"Unnamed institution")+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=(n[10].name??"Unnamed institution")+"")&&G(t,l)},d(n){n&&p(e)}}}function cc(r){let e,l;return e=new ce({props:{$$slots:{default:[uc,({props:t})=>({10:t}),({props:t})=>t?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&3072&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function $c(r){let e,l;const t=[q(zt),{sourceLayer:zt},{paint:{"fill-color":Ke(["get","type"],{school:te.education.schools,college:te.education.colleges,university:te.education.universities},"grey"),"fill-opacity":ne(.7,1)}},{layout:{visibility:r[0].show?"visible":"none"}},{filter:r[2](r[0])},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[cc]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&Dl(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${zt}.pmtiles`,$$slots:{default:[$c]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&2048&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0].show,B(()=>l=!1)),e.$set(m),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=Dl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&2049&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let zt="education";function mc(r){return{show:!0,school:r.includes("school"),college:r.includes("college"),university:r.includes("university")}}function _c(r,e,l){let t,n=["school","college","university"],s={show:!1,school:!0,college:!0,university:!0};function o(_){return _.show?n.filter(S=>_[S]).join(","):null}let u=wt(zt,s,o,mc);K(r,u,_=>l(0,t=_));function f(_){let S=n.filter(y=>_[y]);return["in",["get","type"],["literal",S]]}function i(_){r.$$.not_equal(t.show,_)&&(t.show=_,u.set(t))}function a(_){r.$$.not_equal(t.school,_)&&(t.school=_,u.set(t))}function c(_){r.$$.not_equal(t.college,_)&&(t.college=_,u.set(t))}function m(_){r.$$.not_equal(t.university,_)&&(t.university=_,u.set(t))}return[t,u,f,i,a,c,m]}class gc extends Q{constructor(e){super(),Z(this,e,_c,pc,J,{})}}function dc(r){let e,l,t,n;return e=new Te({props:{color:r[4]}}),{c(){b(e.$$.fragment),l=L(),t=v(r[2])},m(s,o){k(e,s,o),$(s,l,o),$(s,t,o),n=!0},p(s,o){(!n||o&4)&&G(t,s[2])},i(s){n||(g(e.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),n=!1},d(s){s&&(p(l),p(t)),w(e,s)}}}function hc(r){let e;const l=r[6].default,t=mt(l,r,r[8],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&256)&&_t(t,l,n,n[8],e?dt(l,n[8],s,null):gt(n[8]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function bc(r){let e,l,t;return l=new $e({props:{$$slots:{default:[hc]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&256&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function kc(r){let e,l=(r[9].name??`Unnamed ${r[1]}`)+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&514&&l!==(l=(n[9].name??`Unnamed ${n[1]}`)+"")&&G(t,l)},d(n){n&&p(e)}}}function wc(r){let e,l;return e=new ce({props:{$$slots:{default:[kc,({props:t})=>({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&770&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function vc(r){let e,l;const t=[q(r[0]),{sourceLayer:r[0]},{paint:{"fill-color":r[4],"fill-opacity":ne(.7,1)}},{layout:{visibility:r[3]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[wc]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new ge({props:{url:`pmtiles://${me()}/v1/${r[0]}.pmtiles`,$$slots:{default:[vc]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&260&&(a.$$scope={dirty:i,ctx:f}),!l&&i&8&&(l=!0,a.checked=f[3],B(()=>l=!1)),e.$set(a);const c={};i&1&&(c.url=`pmtiles://${me()}/v1/${f[0]}.pmtiles`),i&267&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}function Sc(r,e,l){let t,{$$slots:n={},$$scope:s}=e,{name:o}=e,{singularNoun:u}=e,{pluralNoun:f}=e,i=te[o],a=be(o);K(r,a,m=>l(3,t=m));function c(m){t=m,a.set(t)}return r.$$set=m=>{"name"in m&&l(0,o=m.name),"singularNoun"in m&&l(1,u=m.singularNoun),"pluralNoun"in m&&l(2,f=m.pluralNoun),"$$scope"in m&&l(8,s=m.$$scope)},[o,u,f,t,i,a,n,c,s]}class Fs extends Q{constructor(e){super(),Z(this,e,Sc,yc,J,{name:0,singularNoun:1,pluralNoun:2})}}function Cc(r){let e;return{c(){e=v("hospital")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Tc(r){let e,l,t,n,s,o,u;return t=new ee({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dhospital",$$slots:{default:[Cc]},$$scope:{ctx:r}}}),o=new Xe({}),{c(){e=C("p"),l=v("This shows "),b(t.$$.fragment),n=v(` data from OpenStreetMap (as of 9 August 2023). It doesn't include - outpatient clinics or individual doctor's offices.`),s=L(),b(o.$$.fragment)},m(f,i){$(f,e,i),h(e,l),k(t,e,null),h(e,n),$(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&1&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(p(e),p(s)),w(t),w(o,f)}}}function Lc(r){let e,l;return e=new Fs({props:{name:"hospitals",singularNoun:"hospital",pluralNoun:"Hospitals",$$slots:{default:[Tc]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,[n]){const s={};n&1&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}class Ic extends Q{constructor(e){super(),Z(this,e,null,Lc,J,{})}}function Mc(r){let e,l,t;return{c(){e=C("img"),t=v(` - Railway Stations`),xt(e.src,l=Ws)||z(e,"src",l),z(e,"alt","A logo representing a train")},m(n,s){$(n,e,s),$(n,t,s)},p:x,d(n){n&&(p(e),p(t))}}}function Nc(r){let e;return{c(){e=v("railway station")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Oc(r){let e;return{c(){e=v(`National Rail - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function jc(r){let e,l,t,n,s,o,u,f,i,a,c,m;return t=new ee({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:railway%3Dstation",$$slots:{default:[Nc]},$$scope:{ctx:r}}}),f=new ee({props:{href:"https://www.nationalrail.co.uk/",$$slots:{default:[Oc]},$$scope:{ctx:r}}}),c=new Xe({}),{c(){e=C("p"),l=v("This shows "),b(t.$$.fragment),n=v(" data from OpenStreetMap (as of 9 August 2023)."),s=L(),o=C("p"),u=v("Icon from "),b(f.$$.fragment),i=v(". (Note that not all stations shown are National Rail.)"),a=L(),b(c.$$.fragment)},m(_,S){$(_,e,S),h(e,l),k(t,e,null),h(e,n),$(_,s,S),$(_,o,S),h(o,u),k(f,o,null),h(o,i),$(_,a,S),k(c,_,S),m=!0},p(_,S){const y={};S&16&&(y.$$scope={dirty:S,ctx:_}),t.$set(y);const T={};S&16&&(T.$$scope={dirty:S,ctx:_}),f.$set(T)},i(_){m||(g(t.$$.fragment,_),g(f.$$.fragment,_),g(c.$$.fragment,_),m=!0)},o(_){d(t.$$.fragment,_),d(f.$$.fragment,_),d(c.$$.fragment,_),m=!1},d(_){_&&(p(e),p(s),p(o),p(a)),w(t),w(f),w(c,_)}}}function Pc(r){let e,l,t;return l=new $e({props:{$$slots:{default:[jc]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Dc(r){let e,l=(r[3].name??"Unnamed railway station")+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&8&&l!==(l=(n[3].name??"Unnamed railway station")+"")&&G(t,l)},d(n){n&&p(e)}}}function Rc(r){let e,l;return e=new ce({props:{$$slots:{default:[Dc,({props:t})=>({3:t}),({props:t})=>t?8:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&24&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ac(r){let e,l;const t=[q(tn),{layout:{"icon-image":"railway_station","icon-size":1,"icon-allow-overlap":!0,visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[Rc]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new kt({props:{data:`${me()}/v1/${tn}.geojson`,$$slots:{default:[Ac]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&16&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&17&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}let tn="railway_stations";function Gc(r,e,l){let t,n=be(tn);K(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class qc extends Q{constructor(e){super(),Z(this,e,Gc,Fc,J,{})}}function zc(r){let e;return{c(){e=v("sports pitches")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Hc(r){let e;return{c(){e=v("sports centres")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Ec(r){let e,l,t,n,s,o,u,f,i;return t=new ee({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dpitch",$$slots:{default:[zc]},$$scope:{ctx:r}}}),s=new ee({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dsports_centre",$$slots:{default:[Hc]},$$scope:{ctx:r}}}),f=new Xe({}),{c(){e=C("p"),l=v("This shows "),b(t.$$.fragment),n=v(" and "),b(s.$$.fragment),o=v(" data from OpenStreetMap (as of 9 August 2023)."),u=L(),b(f.$$.fragment)},m(a,c){$(a,e,c),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),$(a,u,c),k(f,a,c),i=!0},p(a,c){const m={};c&1&&(m.$$scope={dirty:c,ctx:a}),t.$set(m);const _={};c&1&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){i||(g(t.$$.fragment,a),g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(p(e),p(u)),w(t),w(s),w(f,a)}}}function Bc(r){let e,l;return e=new Fs({props:{name:"sports_spaces",singularNoun:"sports space",pluralNoun:"Sports spaces",$$slots:{default:[Ec]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,[n]){const s={};n&1&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}class Uc extends Q{constructor(e){super(),Z(this,e,null,Bc,J,{})}}function Wc(r){let e;return{c(){e=v("Stats19")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Yc(r){let e;return{c(){e=v("DfT stats19")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Jc(r){let e;return{c(){e=v("documented by DfT")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Vc(r){let e,l,t,n,s,o,u,f,i,a,c,m,_,S,y,T,j,F,R,N,M,O,D;return t=new ee({props:{href:"https://www.data.gov.uk/dataset/cb7ae6f0-4be6-4935-9277-47e5ce24a11f/road-safety-data",$$slots:{default:[Yc]},$$scope:{ctx:r}}}),j=new ee({props:{href:"https://www.gov.uk/guidance/road-accident-and-safety-statistics-guidance",$$slots:{default:[Jc]},$$scope:{ctx:r}}}),O=new Le({}),{c(){e=C("p"),l=v("This layer shows collisions recorded in the "),b(t.$$.fragment),n=v(" dataset. Please note these limitations:"),s=L(),o=C("ul"),u=C("li"),u.textContent="Only collisions between 2017 and 2022 are included",f=L(),i=C("li"),i.textContent=`This tool is intended to be used at high-zoom levels, while inspecting - a scheme or development area. Not all points are shown at lower zoom - levels. Do not use this to look for trends across a city or region - scale.`,a=L(),c=C("li"),c.textContent=`Approximately 150 collisions from the source data aren't included, due - to problems with the recorded location`,m=L(),_=C("li"),_.textContent='The "pedestrians" category also include mobility scooters',S=L(),y=C("li"),T=v("All limitations "),b(j.$$.fragment),F=v(` also apply. Not all collisions or near misses are reported. - There's nuance with the severity categories.`),R=L(),N=C("p"),N.textContent="You can click a point to open the full report, thanks to CycleStreets.",M=L(),b(O.$$.fragment)},m(I,P){$(I,e,P),h(e,l),k(t,e,null),h(e,n),$(I,s,P),$(I,o,P),h(o,u),h(o,f),h(o,i),h(o,a),h(o,c),h(o,m),h(o,_),h(o,S),h(o,y),h(y,T),k(j,y,null),h(y,F),$(I,R,P),$(I,N,P),$(I,M,P),k(O,I,P),D=!0},p(I,P){const U={};P&4194304&&(U.$$scope={dirty:P,ctx:I}),t.$set(U);const X={};P&4194304&&(X.$$scope={dirty:P,ctx:I}),j.$set(X)},i(I){D||(g(t.$$.fragment,I),g(j.$$.fragment,I),g(O.$$.fragment,I),D=!0)},o(I){d(t.$$.fragment,I),d(j.$$.fragment,I),d(O.$$.fragment,I),D=!1},d(I){I&&(p(e),p(s),p(o),p(R),p(N),p(M)),w(t),w(j),w(O,I)}}}function Qc(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Vc]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&4194304&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Rl(r){let e,l,t,n,s,o,u,f,i,a,c,m,_;return l=new st({props:{small:!0,$$slots:{default:[e$]},$$scope:{ctx:r}}}),a=new Zt({props:{rows:r[9]}}),{c(){e=C("div"),b(l.$$.fragment),t=L(),n=C("div"),s=v(`Filter years: - `),o=C("input"),u=v(` - - - `),f=C("input"),i=L(),b(a.$$.fragment),z(o,"type","number"),z(o,"min",2017),z(o,"max",2022),z(o,"class","svelte-1ft65rw"),z(f,"type","number"),z(f,"min",2017),z(f,"max",2022),z(f,"class","svelte-1ft65rw"),_e(e,"border","1px solid black"),_e(e,"padding","8px")},m(S,y){$(S,e,y),k(l,e,null),h(e,t),h(e,n),h(n,s),h(n,o),Pe(o,r[0].minYear),h(n,u),h(n,f),Pe(f,r[0].maxYear),h(e,i),k(a,e,null),c=!0,m||(_=[He(o,"input",r[15]),He(f,"input",r[16])],m=!0)},p(S,y){const T={};y&4194305&&(T.$$scope={dirty:y,ctx:S}),l.$set(T),y&1&&Vt(o.value)!==S[0].minYear&&Pe(o,S[0].minYear),y&1&&Vt(f.value)!==S[0].maxYear&&Pe(f,S[0].maxYear)},i(S){c||(g(l.$$.fragment,S),g(a.$$.fragment,S),c=!0)},o(S){d(l.$$.fragment,S),d(a.$$.fragment,S),c=!1},d(S){S&&p(e),w(l),w(a),m=!1,Ps(_)}}}function Zc(r){let e;return{c(){e=v("Pedestrians")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Kc(r){let e;return{c(){e=v("Cyclists")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Xc(r){let e;return{c(){e=v("Horse riders")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function xc(r){let e;return{c(){e=v("Other")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function e$(r){let e,l,t,n,s,o,u,f,i,a,c,m;function _(M){r[11](M)}let S={$$slots:{default:[Zc]},$$scope:{ctx:r}};r[0].pedestrians!==void 0&&(S.checked=r[0].pedestrians),e=new oe({props:S}),H.push(()=>E(e,"checked",_));function y(M){r[12](M)}let T={$$slots:{default:[Kc]},$$scope:{ctx:r}};r[0].cyclists!==void 0&&(T.checked=r[0].cyclists),n=new oe({props:T}),H.push(()=>E(n,"checked",y));function j(M){r[13](M)}let F={$$slots:{default:[Xc]},$$scope:{ctx:r}};r[0].horseRiders!==void 0&&(F.checked=r[0].horseRiders),u=new oe({props:F}),H.push(()=>E(u,"checked",j));function R(M){r[14](M)}let N={$$slots:{default:[xc]},$$scope:{ctx:r}};return r[0].other!==void 0&&(N.checked=r[0].other),a=new oe({props:N}),H.push(()=>E(a,"checked",R)),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment),o=L(),b(u.$$.fragment),i=L(),b(a.$$.fragment)},m(M,O){k(e,M,O),$(M,t,O),k(n,M,O),$(M,o,O),k(u,M,O),$(M,i,O),k(a,M,O),m=!0},p(M,O){const D={};O&4194304&&(D.$$scope={dirty:O,ctx:M}),!l&&O&1&&(l=!0,D.checked=M[0].pedestrians,B(()=>l=!1)),e.$set(D);const I={};O&4194304&&(I.$$scope={dirty:O,ctx:M}),!s&&O&1&&(s=!0,I.checked=M[0].cyclists,B(()=>s=!1)),n.$set(I);const P={};O&4194304&&(P.$$scope={dirty:O,ctx:M}),!f&&O&1&&(f=!0,P.checked=M[0].horseRiders,B(()=>f=!1)),u.$set(P);const U={};O&4194304&&(U.$$scope={dirty:O,ctx:M}),!c&&O&1&&(c=!0,U.checked=M[0].other,B(()=>c=!1)),a.$set(U)},i(M){m||(g(e.$$.fragment,M),g(n.$$.fragment,M),g(u.$$.fragment,M),g(a.$$.fragment,M),m=!0)},o(M){d(e.$$.fragment,M),d(n.$$.fragment,M),d(u.$$.fragment,M),d(a.$$.fragment,M),m=!1},d(M){M&&(p(t),p(o),p(i)),w(e,M),w(n,M),w(u,M),w(a,M)}}}function Al(r){let e,l,t,n=r[3][r[21].pedestrian_location]+"",s;return{c(){e=C("p"),l=v("Pedestrian location: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&2097152&&n!==(n=o[3][o[21].pedestrian_location]+"")&&G(s,n)},d(o){o&&p(e)}}}function Fl(r){let e,l,t,n=r[4][r[21].pedestrian_movement]+"",s;return{c(){e=C("p"),l=v("Pedestrian movement: "),t=C("b"),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&2097152&&n!==(n=o[4][o[21].pedestrian_movement]+"")&&G(s,n)},d(o){o&&p(e)}}}function t$(r){let e,l,t,n=r[21].year+"",s,o,u,f,i,a=r[5][r[21].severity]+"",c,m,_,S,y,T=Gl(r[21])+"",j,F,R,N,M,O=r[21].pedestrian_location&&Al(r),D=r[21].pedestrian_movement&&Fl(r);return{c(){e=C("p"),l=v("Year: "),t=C("b"),s=v(n),o=L(),u=C("p"),f=v("Severity: "),i=C("b"),c=v(a),m=L(),_=C("p"),S=v("Casualties: "),y=C("b"),j=v(T),F=L(),O&&O.c(),R=L(),D&&D.c(),N=L(),M=C("p"),M.textContent="Click to open full report in CycleStreets"},m(I,P){$(I,e,P),h(e,l),h(e,t),h(t,s),$(I,o,P),$(I,u,P),h(u,f),h(u,i),h(i,c),$(I,m,P),$(I,_,P),h(_,S),h(_,y),h(y,j),$(I,F,P),O&&O.m(I,P),$(I,R,P),D&&D.m(I,P),$(I,N,P),$(I,M,P)},p(I,P){P&2097152&&n!==(n=I[21].year+"")&&G(s,n),P&2097152&&a!==(a=I[5][I[21].severity]+"")&&G(c,a),P&2097152&&T!==(T=Gl(I[21])+"")&&G(j,T),I[21].pedestrian_location?O?O.p(I,P):(O=Al(I),O.c(),O.m(R.parentNode,R)):O&&(O.d(1),O=null),I[21].pedestrian_movement?D?D.p(I,P):(D=Fl(I),D.c(),D.m(N.parentNode,N)):D&&(D.d(1),D=null)},d(I){I&&(p(e),p(o),p(u),p(m),p(_),p(F),p(R),p(N),p(M)),O&&O.d(I),D&&D.d(I)}}}function n$(r){let e,l;return e=new ce({props:{$$slots:{default:[t$,({props:t})=>({21:t}),({props:t})=>t?2097152:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&6291456&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function l$(r){let e,l;const t=[q(Ht),{sourceLayer:Ht},{paint:{"circle-color":he(["get","severity"],[1,2,3],[r[6],r[7],r[8]]),"circle-opacity":.9,"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,15],"circle-stroke-color":"black","circle-stroke-width":.1}},{filter:r[1]},{layout:{visibility:r[0].show?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[n$]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&Rl(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Ht}.pmtiles`,$$slots:{default:[l$]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&4194304&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0].show,B(()=>l=!1)),e.$set(m),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=Rl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&4194307&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ht="stats19";function r$(r){let[e,l,t]=r.split("/");return{show:!0,pedestrians:e.includes("pedestrians"),cyclists:e.includes("cyclists"),horseRiders:e.includes("horseRiders"),other:e.includes("other"),minYear:parseInt(l),maxYear:parseInt(t)}}function Gl(r){let e=[];return r.pedestrian&&e.push("pedestrian"),r.cyclist&&e.push("cyclist"),r.horse_rider&&e.push("horse rider"),r.other&&e.push("other"),e.join(", ")}function o$(r){window.open(`https://www.cyclestreets.net/collisions/reports/${r.detail.features[0].properties.accident_index}`,"_blank")}function i$(r,e,l){let t,n,s=["pedestrians","cyclists","horseRiders","other"],o={show:!1,pedestrians:!0,cyclists:!0,horseRiders:!0,other:!1,minYear:2017,maxYear:2022};function u(I){return I.show?`${s.filter(U=>I[U]).join(",")}/${I.minYear}/${I.maxYear}`:null}let f=wt(Ht,o,u,r$);K(r,f,I=>l(0,n=I));function i(I,P,U,X,A,Y){let V=["any"];return n.pedestrians&&V.push(["get","pedestrian"]),n.cyclists&&V.push(["get","cyclist"]),n.horseRiders&&V.push(["get","horse_rider"]),n.other&&V.push(["get","other"]),["all",[">=",["get","year"],n.minYear],["<=",["get","year"],n.maxYear],V]}let a={1:"Crossing on pedestrian crossing facility",2:"Crossing in zig-zag approach lines",3:"Crossing in zig-zag exit lines",4:"Crossing elsewhere within 50m. of pedestrian crossing",5:"In carriageway, crossing elsewhere",6:"On footway or verge",7:"On refuge, central island or central reservation",8:"In centre of carriageway - not on refuge, island or central reservation",9:"In carriageway, not crossing"},c={1:"Crossing from driver's nearside",2:"Crossing from nearside - masked by parked or stationary vehicle",3:"Crossing from driver's offside",4:"Crossing from offside - masked by parked or stationary vehicle",5:"In carriageway, stationary - not crossing (standing or playing)",6:"In carriageway, stationary - not crossing (standing or playing - masked by parked or stationary vehicle)",7:"Walking along in carriageway, facing traffic",8:"Walking along in carriageway, back to traffic"},m={1:"Fatal",2:"Serious",3:"Slight"},_=te.sequential_low_to_high[4],S=te.sequential_low_to_high[2],y=te.sequential_low_to_high[0],T=[["Fatal",_],["Serious",S],["Slight",y]];function j(I){r.$$.not_equal(n.show,I)&&(n.show=I,f.set(n))}function F(I){r.$$.not_equal(n.pedestrians,I)&&(n.pedestrians=I,f.set(n))}function R(I){r.$$.not_equal(n.cyclists,I)&&(n.cyclists=I,f.set(n))}function N(I){r.$$.not_equal(n.horseRiders,I)&&(n.horseRiders=I,f.set(n))}function M(I){r.$$.not_equal(n.other,I)&&(n.other=I,f.set(n))}function O(){n.minYear=Vt(this.value),f.set(n)}function D(){n.maxYear=Vt(this.value),f.set(n)}return r.$$.update=()=>{r.$$.dirty&1&&l(1,t=i(n.minYear,n.maxYear,n.pedestrians,n.cyclists,n.horseRiders,n.other))},[n,t,f,a,c,m,_,S,y,T,j,F,R,N,M,O,D]}class f$ extends Q{constructor(e){super(),Z(this,e,i$,s$,J,{})}}function a$(r){let e;return{c(){e=v("Vehicle counts")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function u$(r){let e;return{c(){e=v(`DfT road statistics - `)},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function c$(r){let e;return{c(){e=v("methodology")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function $$(r){let e,l,t,n,s,o,u,f,i,a,c;return t=new ee({props:{href:"https://roadtraffic.dft.gov.uk/downloads",$$slots:{default:[u$]},$$scope:{ctx:r}}}),s=new ee({props:{href:"https://storage.googleapis.com/dft-statistics/road-traffic/all-traffic-data-metadata.pdf",$$slots:{default:[c$]},$$scope:{ctx:r}}}),a=new Le({}),{c(){e=C("p"),l=v("AADF (annual average daily flow) data from "),b(t.$$.fragment),n=v(`. This counts the total daily number of vehicles - traveling past a count point (in both directions) on an average day of - the year. Data from the latest year available is shown. See `),b(s.$$.fragment),o=v(" for details and caveats about the measurements."),u=L(),f=C("p"),f.textContent=`The colors show motor vehicles AADF, not pedal cycles. The outline is - thicker when the latest data is a manual or automatic count, and thinner - when it's an estimate from previous years or nearby counters. Click a - point for full data.`,i=L(),b(a.$$.fragment)},m(m,_){$(m,e,_),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),$(m,u,_),$(m,f,_),$(m,i,_),k(a,m,_),c=!0},p(m,_){const S={};_&128&&(S.$$scope={dirty:_,ctx:m}),t.$set(S);const y={};_&128&&(y.$$scope={dirty:_,ctx:m}),s.$set(y)},i(m){c||(g(t.$$.fragment,m),g(s.$$.fragment,m),g(a.$$.fragment,m),c=!0)},o(m){d(t.$$.fragment,m),d(s.$$.fragment,m),d(a.$$.fragment,m),c=!1},d(m){m&&(p(e),p(u),p(f),p(i)),w(t),w(s),w(a,m)}}}function p$(r){let e,l,t;return l=new $e({props:{$$slots:{default:[$$]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&128&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function ql(r){let e,l;return e=new qe({props:{colorScale:r[1],limits:r[3]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function m$(r){let e,l=r[6].location+"",t,n,s,o,u=r[6].year+"",f,i,a,c=r[6].motor_vehicles.toLocaleString()+"",m,_,S,y,T=r[6].year+"",j,F,R,N=r[6].pedal_cycles.toLocaleString()+"",M,O,D,I,P,U=r[6].method+"",X;return{c(){e=C("h2"),t=v(l),n=L(),s=C("p"),o=v("Total motor vehicles ("),f=v(u),i=v(` AADF): - `),a=C("b"),m=v(c),_=L(),S=C("p"),y=v("Total pedal cycles ("),j=v(T),F=v(` AADF): - `),R=C("b"),M=v(N),O=L(),D=C("p"),I=v("Count method: "),P=C("b"),X=v(U)},m(A,Y){$(A,e,Y),h(e,t),$(A,n,Y),$(A,s,Y),h(s,o),h(s,f),h(s,i),h(s,a),h(a,m),$(A,_,Y),$(A,S,Y),h(S,y),h(S,j),h(S,F),h(S,R),h(R,M),$(A,O,Y),$(A,D,Y),h(D,I),h(D,P),h(P,X)},p(A,Y){Y&64&&l!==(l=A[6].location+"")&&G(t,l),Y&64&&u!==(u=A[6].year+"")&&G(f,u),Y&64&&c!==(c=A[6].motor_vehicles.toLocaleString()+"")&&G(m,c),Y&64&&T!==(T=A[6].year+"")&&G(j,T),Y&64&&N!==(N=A[6].pedal_cycles.toLocaleString()+"")&&G(M,N),Y&64&&U!==(U=A[6].method+"")&&G(X,U)},d(A){A&&(p(e),p(n),p(s),p(_),p(S),p(O),p(D))}}}function _$(r){let e,l;return e=new ce({props:{$$slots:{default:[m$,({props:t})=>({6:t}),({props:t})=>t?64:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&192&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function g$(r){let e,l;const t=[q(Et),{sourceLayer:Et},{paint:{"circle-color":he(["get","motor_vehicles"],r[2],r[1]),"circle-opacity":.9,"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,15],"circle-stroke-color":"black","circle-stroke-width":["case",["in",["get","method"],["literal",["Manual count","Automatic counter"]]],1.5,.1]}},{layout:{visibility:r[0]?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[_$]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&ql(r);return s=new ge({props:{url:`pmtiles://${me()}/v1/${Et}.pmtiles`,$$slots:{default:[g$]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&128&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=ql(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&129&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Et="vehicle_counts";function h$(r){window.open(`https://roadtraffic.dft.gov.uk/manualcountpoints/${r.detail.features[0].properties.count_point}`,"_blank")}function b$(r,e,l){let t,n=te.sequential_low_to_high,s=[0,4e4,8e4,12e4,16e4,205e3],o=["","40k","80k","120k","160k",""],u=be(Et);K(r,u,i=>l(0,t=i));function f(i){t=i,u.set(t)}return[t,n,s,o,u,f]}class k$ extends Q{constructor(e){super(),Z(this,e,b$,d$,J,{})}}function zl(r,e,l){const t=r.slice();return t[6]=e[l],t}function w$(r){let e;return{c(){e=v("Issues & Conflicts")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function v$(r){let e,l,t;return{c(){e=C("p"),e.textContent=`Critical issues and policy conflicts from the Design Assistance Log. - This is internally collected data.`,l=L(),t=C("p"),t.textContent=`This layer is manually copied from a copy of the DA Log. The data is - recent as of 10 June 2024.`},m(n,s){$(n,e,s),$(n,l,s),$(n,t,s)},p:x,d(n){n&&(p(e),p(l),p(t))}}}function y$(r){let e,l,t;return l=new $e({props:{$$slots:{default:[v$]},$$scope:{ctx:r}}}),{c(){e=C("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&512&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function Hl(r){let e,l;return e=new Zt({props:{rows:r[3]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function S$(r){let e,l=r[5]["Issue ID"]+"",t,n,s=r[5].Code+"",o,u,f,i=r[5]["Issue Stage"]+"",a;return{c(){e=C("h2"),t=v(l),n=v(" - "),o=v(s),u=L(),f=C("p"),a=v(i)},m(c,m){$(c,e,m),h(e,t),h(e,n),h(e,o),$(c,u,m),$(c,f,m),h(f,a)},p(c,m){m&32&&l!==(l=c[5]["Issue ID"]+"")&&G(t,l),m&32&&s!==(s=c[5].Code+"")&&G(o,s),m&32&&i!==(i=c[5]["Issue Stage"]+"")&&G(a,i)},d(c){c&&(p(e),p(u),p(f))}}}function El(r){let e,l=r[6]+"",t,n,s,o=r[5][r[6]]+"",u,f;return{c(){e=C("p"),t=v(l),n=v(`: - `),s=C("b"),u=v(o),f=L()},m(i,a){$(i,e,a),h(e,t),h(e,n),h(e,s),h(s,u),h(e,f)},p(i,a){a&32&&o!==(o=i[5][i[6]]+"")&&G(u,o)},d(i){i&&p(e)}}}function C$(r){let e,l=ve(r[2]),t=[];for(let n=0;n({5:s}),({props:s})=>s?32:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[C$,({props:s})=>({5:s}),({props:s})=>s?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment)},m(s,o){k(e,s,o),$(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&544&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&544&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&p(l),w(e,s),w(t,s)}}}function L$(r){let e,l;const t=[q(un),{paint:{"circle-color":Ke(["get","Design Review Status"],Object.fromEntries(r[3]),"cyan"),"circle-opacity":.9,"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,15],"circle-stroke-color":"black","circle-stroke-width":.1}},{layout:{visibility:r[0]?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[T$]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Hl(r);return s=new kt({props:{data:`${Qt()}/v1/problems.geojson.gz`,$$slots:{default:[L$]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=L(),i&&i.c(),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,t,c),i&&i.m(a,c),$(a,n,c),k(s,a,c),o=!0},p(a,[c]){const m={};c&512&&(m.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,m.checked=a[0],B(()=>l=!1)),e.$set(m),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Hl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&513&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(p(t),p(n)),w(e,a),i&&i.d(a),w(s,a)}}}let un="problems";function M$(r,e,l){let t,n=be(un);K(r,n,f=>l(0,t=f));let s=["Issue ID","Scheme ID","Date Logged","Inspector","Street Location","Code","Issue Description","External Inspectorate Comment for LA","Issue Stage","Resolved by Design","Design Review Status","Date of Resolution","Design Resolution"],o=[["Outstanding","red"],["Pending","yellow"],["Resolved","green"],["Not Applicable","grey"],["No Resolution Planned","black"]];function u(f){t=f,n.set(t)}return[t,n,s,o,u]}class N$ extends Q{constructor(e){super(),Z(this,e,M$,I$,J,{})}}function O$(r){let e;function l(s,o){return s[2]<=100?D$:P$}let t=l(r),n=t(r);return{c(){n.c(),e=ye()},m(s,o){n.m(s,o),$(s,e,o)},p(s,o){t===(t=l(s))&&n?n.p(s,o):(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},i:x,o:x,d(s){s&&p(e),n.d(s)}}}function j$(r){let e,l;return e=new Ee({props:{$$slots:{default:[R$]},$$scope:{ctx:r}}}),e.$on("click",r[3]),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&64&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function P$(r){let e;return{c(){e=C("label"),e.innerHTML=`Processing scheme data - `},m(l,t){$(l,e,t)},p:x,d(l){l&&p(e)}}}function D$(r){let e,l,t;return{c(){e=C("label"),l=v(`Downloading scheme data - `),t=C("progress"),t.value=r[2],z(t,"class","svelte-q3473n")},m(n,s){$(n,e,s),h(e,l),h(e,t)},p(n,s){s&4&&(t.value=n[2])},d(n){n&&p(e)}}}function R$(r){let e;return{c(){e=v("Load latest scheme data")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function A$(r){let e,l,t,n;const s=[j$,O$],o=[];function u(f,i){return f[0]?f[1]?1:-1:0}return~(e=u(r))&&(l=o[e]=s[e](r)),{c(){l&&l.c(),t=ye()},m(f,i){~e&&o[e].m(f,i),$(f,t,i),n=!0},p(f,[i]){let a=e;e=u(f),e===a?~e&&o[e].p(f,i):(l&&(ae(),d(o[a],1,1,()=>{o[a]=null}),ue()),~e?(l=o[e],l?l.p(f,i):(l=o[e]=s[e](f),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(f){n||(g(l),n=!0)},o(f){d(l),n=!1},d(f){f&&p(t),~e&&o[e].d(f)}}}function F$(r,e,l){let{loadFile:t}=e,n=!new URLSearchParams(window.location.search).has("disable_schemes"),s=!0,o=0;async function u(){let i=await Ys(`${Qt()}/v1/all_schemes_output.geojson.gz`,c=>{l(2,o=c)});l(2,o=100);let a=new TextDecoder().decode(i);t("all_schemes_output.geojson",a),l(1,s=!1)}Rs(async()=>{n&&await u()});async function f(){l(0,n=!0),await u()}return r.$$set=i=>{"loadFile"in i&&l(4,t=i.loadFile)},[n,s,o,f,t]}class G$ extends Q{constructor(e){super(),Z(this,e,F$,A$,J,{loadFile:4})}}const nn=Fe({type:"FeatureCollection",features:[],schemes:{}}),cn=Fe(new Map),Bl=Fe(""),Ul=Fe(""),$n=Fe({type:"FeatureCollection",features:[],schemes:{}}),pn=Fe(new Map),Wl=Fe(""),Yl=Fe("");function q$(r){let e={type:"FeatureCollection",features:[],schemes:{},notes:r.notes},l=new Map,t={type:"FeatureCollection",features:[],schemes:{},notes:r.notes},n=new Map;for(let[s,o]of Object.entries(r.schemes))o.pipeline?(n.set(s,o),t.schemes[s]=o):(l.set(s,o),e.schemes[s]=o);for(let s of r.features){if(!z$(s))continue;let o=s.properties.scheme_reference,u=l.has(o),i=(u?l:n).get(o);i.browse&&(s.properties.funding_programme=i.browse.funding_programme,s.properties.current_milestone=i.browse.current_milestone);let a=u?e:t;s.id=a.features.length+1,a.features.push(s)}nn.set(e),cn.set(l),$n.set(t),pn.set(n)}function z$(r){return!["eb0ad8ed183c137da4bae66afa944da9","0a568f07241be96f0a70aa73a0de80c8","6c4a5d57176eaeb3296eba790f869909","475e9a43749ce09c7edaaffa0ae57a2f","117b783cb2916a1bb4262960e523acc5","7a600e6342b226aa0983c8dfed19254f","84cc5eb1b52a4e49188058373e587ff0"].includes(r.properties.id)}let Bt={ATF2:"#66c2a5","ATF2 or ATF3":"#fc8d62",ATF3:"#8da0cb",ATF4:"#e78ac3",ATF4E:"#a6d854"},mn={removed:"grey","no data":"grey","not progressed":"red",superseded:"red","preliminary design completed":"#fbb862","feasability design completed":"#eddc76","detailed design completed":"#dafd9d","consruction started":"#76c384","construction completed":"#488f31"};function Jl(r,e,l){const t=r.slice();return t[30]=e[l],t[31]=e,t[32]=l,t}function H$(r){let e;return{c(){e=v("Filters")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function E$(r){let e;return{c(){e=v("Reset all filters")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function B$(r){let e,l,t,n,s,o,u;e=new Jt({props:{label:"Intervention name or description",id:"filterInterventionText",$$slots:{default:[Y$]},$$scope:{ctx:r}}}),t=new Jt({props:{label:"Scheme name or reference",id:"filterSchemeText",$$slots:{default:[V$]},$$scope:{ctx:r}}});function f(a){r[26](a)}let i={label:"Authority or region",choices:r[9],emptyOption:!0};return r[3]!==void 0&&(i.value=r[3]),s=new ht({props:i}),H.push(()=>E(s,"value",f)),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment)},m(a,c){k(e,a,c),$(a,l,c),k(t,a,c),$(a,n,c),k(s,a,c),u=!0},p(a,c){const m={};c[0]&2|c[1]&4&&(m.$$scope={dirty:c,ctx:a}),e.$set(m);const _={};c[0]&1|c[1]&4&&(_.$$scope={dirty:c,ctx:a}),t.$set(_);const S={};c[0]&512&&(S.choices=a[9]),!o&&c[0]&8&&(o=!0,S.value=a[3],B(()=>o=!1)),s.$set(S)},i(a){u||(g(e.$$.fragment,a),g(t.$$.fragment,a),g(s.$$.fragment,a),u=!0)},o(a){d(e.$$.fragment,a),d(t.$$.fragment,a),d(s.$$.fragment,a),u=!1},d(a){a&&(p(l),p(n)),w(e,a),w(t,a),w(s,a)}}}function U$(r){let e,l,t,n,s,o,u,f,i,a,c,m,_,S,y;t=new Jt({props:{label:"Intervention name or description",id:"filterInterventionText",$$slots:{default:[Z$]},$$scope:{ctx:r}}}),s=new Jt({props:{label:"Scheme name or reference",id:"filterSchemeText",$$slots:{default:[X$]},$$scope:{ctx:r}}});function T(N){r[19](N)}let j={label:"Authority or region",choices:r[9],emptyOption:!0};r[3]!==void 0&&(j.value=r[3]),u=new ht({props:j}),H.push(()=>E(u,"value",T)),c=new Jt({props:{label:"Funding programmes",id:"filterFundingProgrammes",$$slots:{default:[tp]},$$scope:{ctx:r}}});function F(N){r[21](N)}let R={label:"Current milestone",choices:r[10],emptyOption:!0};return r[5]!==void 0&&(R.value=r[5]),_=new ht({props:R}),H.push(()=>E(_,"value",F)),{c(){e=C("div"),l=C("div"),b(t.$$.fragment),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment),i=L(),a=C("div"),b(c.$$.fragment),m=L(),b(_.$$.fragment),z(l,"class","govuk-grid-column-one-half"),z(a,"class","govuk-grid-column-one-half"),z(e,"class","govuk-grid-row")},m(N,M){$(N,e,M),h(e,l),k(t,l,null),h(l,n),k(s,l,null),h(l,o),k(u,l,null),h(e,i),h(e,a),k(c,a,null),h(a,m),k(_,a,null),y=!0},p(N,M){const O={};M[0]&2|M[1]&4&&(O.$$scope={dirty:M,ctx:N}),t.$set(O);const D={};M[0]&1|M[1]&4&&(D.$$scope={dirty:M,ctx:N}),s.$set(D);const I={};M[0]&512&&(I.choices=N[9]),!f&&M[0]&8&&(f=!0,I.value=N[3],B(()=>f=!1)),u.$set(I);const P={};M[0]&16|M[1]&4&&(P.$$scope={dirty:M,ctx:N}),c.$set(P);const U={};!S&&M[0]&32&&(S=!0,U.value=N[5],B(()=>S=!1)),_.$set(U)},i(N){y||(g(t.$$.fragment,N),g(s.$$.fragment,N),g(u.$$.fragment,N),g(c.$$.fragment,N),g(_.$$.fragment,N),y=!0)},o(N){d(t.$$.fragment,N),d(s.$$.fragment,N),d(u.$$.fragment,N),d(c.$$.fragment,N),d(_.$$.fragment,N),y=!1},d(N){N&&p(e),w(t),w(s),w(u),w(c),w(_)}}}function W$(r){let e;return{c(){e=v("Clear")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Y$(r){let e,l,t,n,s,o;return t=new Ee({props:{$$slots:{default:[W$]},$$scope:{ctx:r}}}),t.$on("click",r[23]),{c(){e=C("input"),l=L(),b(t.$$.fragment),z(e,"type","text"),z(e,"class","govuk-input govuk-input--width-10"),z(e,"id","filterInterventionText")},m(u,f){$(u,e,f),Pe(e,r[1]),$(u,l,f),k(t,u,f),n=!0,s||(o=He(e,"input",r[22]),s=!0)},p(u,f){f[0]&2&&e.value!==u[1]&&Pe(e,u[1]);const i={};f[1]&4&&(i.$$scope={dirty:f,ctx:u}),t.$set(i)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){d(t.$$.fragment,u),n=!1},d(u){u&&(p(e),p(l)),w(t,u),s=!1,o()}}}function J$(r){let e;return{c(){e=v("Clear")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function V$(r){let e,l,t,n,s,o;return t=new Ee({props:{$$slots:{default:[J$]},$$scope:{ctx:r}}}),t.$on("click",r[25]),{c(){e=C("input"),l=L(),b(t.$$.fragment),z(e,"type","text"),z(e,"class","govuk-input govuk-input--width-10"),z(e,"id","filterSchemeText")},m(u,f){$(u,e,f),Pe(e,r[0]),$(u,l,f),k(t,u,f),n=!0,s||(o=He(e,"input",r[24]),s=!0)},p(u,f){f[0]&1&&e.value!==u[0]&&Pe(e,u[0]);const i={};f[1]&4&&(i.$$scope={dirty:f,ctx:u}),t.$set(i)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){d(t.$$.fragment,u),n=!1},d(u){u&&(p(e),p(l)),w(t,u),s=!1,o()}}}function Q$(r){let e;return{c(){e=v("Clear")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Z$(r){let e,l,t,n,s,o;return t=new Ee({props:{$$slots:{default:[Q$]},$$scope:{ctx:r}}}),t.$on("click",r[16]),{c(){e=C("input"),l=L(),b(t.$$.fragment),z(e,"type","text"),z(e,"class","govuk-input govuk-input--width-10"),z(e,"id","filterInterventionText")},m(u,f){$(u,e,f),Pe(e,r[1]),$(u,l,f),k(t,u,f),n=!0,s||(o=He(e,"input",r[15]),s=!0)},p(u,f){f[0]&2&&e.value!==u[1]&&Pe(e,u[1]);const i={};f[1]&4&&(i.$$scope={dirty:f,ctx:u}),t.$set(i)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){d(t.$$.fragment,u),n=!1},d(u){u&&(p(e),p(l)),w(t,u),s=!1,o()}}}function K$(r){let e;return{c(){e=v("Clear")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function X$(r){let e,l,t,n,s,o;return t=new Ee({props:{$$slots:{default:[K$]},$$scope:{ctx:r}}}),t.$on("click",r[18]),{c(){e=C("input"),l=L(),b(t.$$.fragment),z(e,"type","text"),z(e,"class","govuk-input govuk-input--width-10"),z(e,"id","filterSchemeText")},m(u,f){$(u,e,f),Pe(e,r[0]),$(u,l,f),k(t,u,f),n=!0,s||(o=He(e,"input",r[17]),s=!0)},p(u,f){f[0]&1&&e.value!==u[0]&&Pe(e,u[0]);const i={};f[1]&4&&(i.$$scope={dirty:f,ctx:u}),t.$set(i)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){d(t.$$.fragment,u),n=!1},d(u){u&&(p(e),p(l)),w(t,u),s=!1,o()}}}function x$(r){let e=r[30]+"",l,t;return{c(){l=v(e),t=L()},m(n,s){$(n,l,s),$(n,t,s)},p:x,d(n){n&&(p(l),p(t))}}}function Vl(r){let e,l,t;function n(o){r[20](o,r[30])}let s={$$slots:{default:[x$]},$$scope:{ctx:r}};return r[4][r[30]]!==void 0&&(s.checked=r[4][r[30]]),e=new oe({props:s}),H.push(()=>E(e,"checked",n)),{c(){b(e.$$.fragment)},m(o,u){k(e,o,u),t=!0},p(o,u){r=o;const f={};u[1]&4&&(f.$$scope={dirty:u,ctx:r}),!l&&u[0]&16&&(l=!0,f.checked=r[4][r[30]],B(()=>l=!1)),e.$set(f)},i(o){t||(g(e.$$.fragment,o),t=!0)},o(o){d(e.$$.fragment,o),t=!1},d(o){w(e,o)}}}function ep(r){let e,l,t=ve(Object.keys(Bt)),n=[];for(let o=0;od(n[o],1,1,()=>{n[o]=null});return{c(){for(let o=0;o{A[ie]=null}),ue(),D=A[O],D?D.p(V,pe):(D=A[O]=X[O](V),D.c()),g(D,1),D.m(I.parentNode,I));const W={};pe[1]&4&&(W.$$scope={dirty:pe,ctx:V}),P.$set(W)},i(V){U||(g(N.$$.fragment,V),g(D),g(P.$$.fragment,V),U=!0)},o(V){d(N.$$.fragment,V),d(D),d(P.$$.fragment,V),U=!1},d(V){V&&(p(e),p(l),p(t),p(R),p(M),p(I)),w(N,V),A[O].d(V),w(P,V)}}}function sp(r){let e,l,t,n,s;e=new Ee({props:{$$slots:{default:[H$]},$$scope:{ctx:r}}}),e.$on("click",r[14]);function o(f){r[28](f)}let u={title:`Filter ${r[2]} schemes`,$$slots:{default:[lp]},$$scope:{ctx:r}};return r[6]!==void 0&&(u.open=r[6]),t=new Ls({props:u}),H.push(()=>E(t,"open",o)),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment)},m(f,i){k(e,f,i),$(f,l,i),k(t,f,i),s=!0},p(f,i){const a={};i[1]&4&&(a.$$scope={dirty:i,ctx:f}),e.$set(a);const c={};i[0]&4&&(c.title=`Filter ${f[2]} schemes`),i[0]&1023|i[1]&4&&(c.$$scope={dirty:i,ctx:f}),!n&&i[0]&64&&(n=!0,c.open=f[6],B(()=>n=!1)),t.$set(c)},i(f){s||(g(e.$$.fragment,f),g(t.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(t.$$.fragment,f),s=!1},d(f){f&&p(l),w(e,f),w(t,f)}}}function rp(r){var t;let e=new Set;for(let n of r.values())(t=n.browse)!=null&&t.authority_or_region&&e.add(n.browse.authority_or_region);let l=Array.from(e.entries());return l.sort(),l}function Ql(r){return r*621371e-9}function op(r,e,l){let t,{source:n}=e,{schemes:s}=e,{schemesGj:o}=e,{filterSchemeText:u}=e,{filterInterventionText:f}=e,i=!1,a=new Set,c={interventions:0,totalLength:0},m=Object.keys(mn).map(ie=>[ie,ie]),_="",S=Object.fromEntries(Object.keys(Bt).map(ie=>[ie,!0])),y="";function T(ie,W,ut,xe,vt){let et=ie.toLowerCase(),rt=W.toLowerCase(),Ut=we=>{var tt,Wt,ct,yt;if(et&&!((tt=we.properties.name)!=null&&tt.toLowerCase().includes(et))&&!((Wt=we.properties.description)!=null&&Wt.toLowerCase().includes(et)))return!1;let Ie=s.get(we.properties.scheme_reference);return!(ut&&((ct=Ie.browse)==null?void 0:ct.authority_or_region)!=ut||n=="ATF"&&!xe[Ie.browse.funding_programme]||vt&&((yt=Ie.browse)==null?void 0:yt.current_milestone)!=vt||rt&&!Ie.scheme_reference.toLowerCase().includes(rt)&&!(Ie.scheme_name??"").toLowerCase().includes(rt))};l(7,a=new Set(o.features.filter(Ut).map(we=>we.properties.scheme_reference))),l(8,c={interventions:0,totalLength:0});let Kt=we=>{var Ie,tt;return!(!a.has(we.properties.scheme_reference)||et&&!((Ie=we.properties.name)!=null&&Ie.toLowerCase().includes(et))&&!((tt=we.properties.description)!=null&&tt.toLowerCase().includes(et)))};for(let we of o.features)Kt(we)?(delete we.properties.hide_while_editing,l(8,c.interventions++,c),we.geometry.type=="LineString"&&we.properties.length_meters&&l(8,c.totalLength+=we.properties.length_meters,c)):we.properties.hide_while_editing=!0;l(12,o),l(8,c)}function j(){l(3,_=""),l(4,S=Object.fromEntries(Object.keys(Bt).map(ie=>[ie,!0]))),l(5,y=""),l(1,f=""),l(0,u="")}const F=()=>l(6,i=!0);function R(){f=this.value,l(1,f)}const N=()=>l(1,f="");function M(){u=this.value,l(0,u)}const O=()=>l(0,u="");function D(ie){_=ie,l(3,_)}function I(ie,W){r.$$.not_equal(S[W],ie)&&(S[W]=ie,l(4,S))}function P(ie){y=ie,l(5,y)}function U(){f=this.value,l(1,f)}const X=()=>l(1,f="");function A(){u=this.value,l(0,u)}const Y=()=>l(0,u="");function V(ie){_=ie,l(3,_)}const pe=()=>l(6,i=!1);function Re(ie){i=ie,l(6,i)}return r.$$set=ie=>{"source"in ie&&l(2,n=ie.source),"schemes"in ie&&l(13,s=ie.schemes),"schemesGj"in ie&&l(12,o=ie.schemesGj),"filterSchemeText"in ie&&l(0,u=ie.filterSchemeText),"filterInterventionText"in ie&&l(1,f=ie.filterInterventionText)},r.$$.update=()=>{r.$$.dirty[0]&8192&&l(9,t=rp(s)),r.$$.dirty[0]&59&&T(f,u,_,S,y)},[u,f,n,_,S,y,i,a,c,t,m,j,o,s,F,R,N,M,O,D,I,P,U,X,A,Y,V,pe,Re]}class Gs extends Q{constructor(e){super(),Z(this,e,op,sp,J,{source:2,schemes:13,schemesGj:12,filterSchemeText:0,filterInterventionText:1},null,[-1,-1])}}function Zl(r){let e,l,t,n=r[0].status+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Status",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].status+"")&&G(s,n)},d(o){o&&p(e)}}}function Kl(r){let e,l,t,n=r[0].timescale+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Timescale",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].timescale+"")&&G(s,n)},d(o){o&&p(e)}}}function Xl(r){let e,l,t,n=r[0].timescale_year+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Estimated completion year",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].timescale_year+"")&&G(s,n)},d(o){o&&p(e)}}}function xl(r){let e,l,t,n=r[0].year_published+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Scheme most recently published",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].year_published+"")&&G(s,n)},d(o){o&&p(e)}}}function es(r){let e,l,t,n=r[0].year_consulted+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Scheme most recently consulted on",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].year_consulted+"")&&G(s,n)},d(o){o&&p(e)}}}function ip(r){let e,l,t,n,s,o=r[0].status&&Zl(r),u=r[0].timescale&&Kl(r),f=r[0].timescale_year&&Xl(r),i=r[0].year_published&&xl(r),a=r[0].year_consulted&&es(r);return{c(){o&&o.c(),e=L(),u&&u.c(),l=L(),f&&f.c(),t=L(),i&&i.c(),n=L(),a&&a.c(),s=ye()},m(c,m){o&&o.m(c,m),$(c,e,m),u&&u.m(c,m),$(c,l,m),f&&f.m(c,m),$(c,t,m),i&&i.m(c,m),$(c,n,m),a&&a.m(c,m),$(c,s,m)},p(c,[m]){c[0].status?o?o.p(c,m):(o=Zl(c),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[0].timescale?u?u.p(c,m):(u=Kl(c),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),c[0].timescale_year?f?f.p(c,m):(f=Xl(c),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null),c[0].year_published?i?i.p(c,m):(i=xl(c),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null),c[0].year_consulted?a?a.p(c,m):(a=es(c),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i:x,o:x,d(c){c&&(p(e),p(l),p(t),p(n),p(s)),o&&o.d(c),u&&u.d(c),f&&f.d(c),i&&i.d(c),a&&a.d(c)}}}function fp(r,e,l){let{props:t}=e;return r.$$set=n=>{"props"in n&&l(0,t=n.props)},[t]}class qs extends Q{constructor(e){super(),Z(this,e,fp,ip,J,{props:0})}}function ts(r){let e,l,t,n=r[0].budget.toLocaleString()+"",s,o;return{c(){e=C("p"),l=C("b"),l.textContent="Cost",t=v(` - : `),s=v(n),o=v(` - GBP`)},m(u,f){$(u,e,f),h(e,l),h(e,t),h(e,s),h(e,o)},p(u,f){f&1&&n!==(n=u[0].budget.toLocaleString()+"")&&G(s,n)},d(u){u&&p(e)}}}function ns(r){let e;return{c(){e=C("p"),e.textContent="Development is fully funded"},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ls(r){let e;return{c(){e=C("p"),e.textContent="Construction is fully funded"},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ss(r){let e,l,t,n;return{c(){e=C("p"),l=C("b"),l.textContent="Funding sources",t=v(` - : `),n=v(r[1])},m(s,o){$(s,e,o),h(e,l),h(e,t),h(e,n)},p(s,o){o&2&&G(n,s[1])},d(s){s&&p(e)}}}function ap(r){let e,l,t,n,s=r[0].budget&&ts(r),o=r[0].development_funded&&ns(),u=r[0].construction_funded&&ls(),f=r[1]&&ss(r);return{c(){s&&s.c(),e=L(),o&&o.c(),l=L(),u&&u.c(),t=L(),f&&f.c(),n=ye()},m(i,a){s&&s.m(i,a),$(i,e,a),o&&o.m(i,a),$(i,l,a),u&&u.m(i,a),$(i,t,a),f&&f.m(i,a),$(i,n,a)},p(i,[a]){i[0].budget?s?s.p(i,a):(s=ts(i),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),i[0].development_funded?o||(o=ns(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),i[0].construction_funded?u||(u=ls(),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),i[1]?f?f.p(i,a):(f=ss(i),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null)},i:x,o:x,d(i){i&&(p(e),p(l),p(t),p(n)),s&&s.d(i),o&&o.d(i),u&&u.d(i),f&&f.d(i)}}}function up(r){if(!r.funding_sources)return"";let e=[];for(let l of["atf2","atf3","atf4","atf4e","crsts","luf"])r.funding_sources[l]&&e.push(l.toUpperCase());return r.funding_sources.other&&e.push(r.funding_sources.other),e.join(", ")}function cp(r,e,l){let t,{props:n}=e;return r.$$set=s=>{"props"in s&&l(0,n=s.props)},r.$$.update=()=>{r.$$.dirty&1&&l(1,t=up(n))},[n,t]}class zs extends Q{constructor(e){super(),Z(this,e,cp,ap,J,{props:0})}}function rn(r){const e=r.slice(),l=e[5].pipeline;return e[12]=l,e}function on(r){const e=r.slice(),l=e[1].pipeline;return e[12]=l,e}function rs(r){let e,l,t,n=An(r[1].length_meters)+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Length",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&2&&n!==(n=An(o[1].length_meters)+"")&&G(s,n)},d(o){o&&p(e)}}}function os(r){let e,l=ft(r[1].description,r[3])+"";return{c(){e=C("p")},m(t,n){$(t,e,n),e.innerHTML=l},p(t,n){n&10&&l!==(l=ft(t[1].description,t[3])+"")&&(e.innerHTML=l)},d(t){t&&p(e)}}}function is(r){let e,l,t,n,s,o,u,f=r[12].atf4_type&&fs(r),i=r[12].accuracy&&as(r),a=r[12].is_alternative&&us();return n=new zs({props:{props:r[12]}}),o=new qs({props:{props:r[12]}}),{c(){f&&f.c(),e=L(),i&&i.c(),l=L(),a&&a.c(),t=L(),b(n.$$.fragment),s=L(),b(o.$$.fragment)},m(c,m){f&&f.m(c,m),$(c,e,m),i&&i.m(c,m),$(c,l,m),a&&a.m(c,m),$(c,t,m),k(n,c,m),$(c,s,m),k(o,c,m),u=!0},p(c,m){c[12].atf4_type?f?f.p(c,m):(f=fs(c),f.c(),f.m(e.parentNode,e)):f&&(f.d(1),f=null),c[12].accuracy?i?i.p(c,m):(i=as(c),i.c(),i.m(l.parentNode,l)):i&&(i.d(1),i=null),c[12].is_alternative?a||(a=us(),a.c(),a.m(t.parentNode,t)):a&&(a.d(1),a=null);const _={};m&2&&(_.props=c[12]),n.$set(_);const S={};m&2&&(S.props=c[12]),o.$set(S)},i(c){u||(g(n.$$.fragment,c),g(o.$$.fragment,c),u=!0)},o(c){d(n.$$.fragment,c),d(o.$$.fragment,c),u=!1},d(c){c&&(p(e),p(l),p(t),p(s)),f&&f.d(c),i&&i.d(c),a&&a.d(c),w(n,c),w(o,c)}}}function fs(r){let e,l,t,n=r[12].atf4_type+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="ATF4 type",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&2&&n!==(n=o[12].atf4_type+"")&&G(s,n)},d(o){o&&p(e)}}}function as(r){let e,l,t,n=r[12].accuracy+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Accuracy",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&2&&n!==(n=o[12].accuracy+"")&&G(s,n)},d(o){o&&p(e)}}}function us(r){let e;return{c(){e=C("p"),e.textContent="Represents an alternative route"},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function cs(r){var o;let e,l,t,n=((o=r[5].browse)==null?void 0:o.capital_scheme_id)+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Capital scheme ID",t=v(` - : `),s=v(n)},m(u,f){$(u,e,f),h(e,l),h(e,t),h(e,s)},p(u,f){var i;f&32&&n!==(n=((i=u[5].browse)==null?void 0:i.capital_scheme_id)+"")&&G(s,n)},d(u){u&&p(e)}}}function $s(r){var o;let e,l,t,n=((o=r[5].browse)==null?void 0:o.current_milestone)+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Current milestone",t=v(` - : `),s=v(n)},m(u,f){$(u,e,f),h(e,l),h(e,t),h(e,s)},p(u,f){var i;f&32&&n!==(n=((i=u[5].browse)==null?void 0:i.current_milestone)+"")&&G(s,n)},d(u){u&&p(e)}}}function ps(r){let e,l,t,n,s,o,u,f=r[12].scheme_type&&ms(r),i=r[12].atf4_lead_type&&_s(r),a=r[12].scheme_description&&gs(r);return n=new zs({props:{props:r[12]}}),o=new qs({props:{props:r[12]}}),{c(){f&&f.c(),e=L(),i&&i.c(),l=L(),a&&a.c(),t=L(),b(n.$$.fragment),s=L(),b(o.$$.fragment)},m(c,m){f&&f.m(c,m),$(c,e,m),i&&i.m(c,m),$(c,l,m),a&&a.m(c,m),$(c,t,m),k(n,c,m),$(c,s,m),k(o,c,m),u=!0},p(c,m){c[12].scheme_type?f?f.p(c,m):(f=ms(c),f.c(),f.m(e.parentNode,e)):f&&(f.d(1),f=null),c[12].atf4_lead_type?i?i.p(c,m):(i=_s(c),i.c(),i.m(l.parentNode,l)):i&&(i.d(1),i=null),c[12].scheme_description?a?a.p(c,m):(a=gs(c),a.c(),a.m(t.parentNode,t)):a&&(a.d(1),a=null);const _={};m&32&&(_.props=c[12]),n.$set(_);const S={};m&32&&(S.props=c[12]),o.$set(S)},i(c){u||(g(n.$$.fragment,c),g(o.$$.fragment,c),u=!0)},o(c){d(n.$$.fragment,c),d(o.$$.fragment,c),u=!1},d(c){c&&(p(e),p(l),p(t),p(s)),f&&f.d(c),i&&i.d(c),a&&a.d(c),w(n,c),w(o,c)}}}function ms(r){let e,l,t,n=r[12].scheme_type+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Scheme type",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&32&&n!==(n=o[12].scheme_type+"")&&G(s,n)},d(o){o&&p(e)}}}function _s(r){let e,l,t,n=r[12].atf4_lead_type+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="ATF4 lead type",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&32&&n!==(n=o[12].atf4_lead_type+"")&&G(s,n)},d(o){o&&p(e)}}}function gs(r){let e,l,t,n=r[12].scheme_description+"",s;return{c(){e=C("p"),l=C("b"),l.textContent="Descripton",t=v(` - : `),s=v(n)},m(o,u){$(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&32&&n!==(n=o[12].scheme_description+"")&&G(s,n)},d(o){o&&p(e)}}}function $p(r){let e;return{c(){e=v("Zoom to show entire scheme")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function pp(r){let e;return{c(){e=v("Edit a copy of this scheme")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function ds(r){var yn,Sn,Cn,Tn;let e,l,t,n,s,o,u,f=ft(r[1].name,r[3])+"",i,a=r[1].intervention_type+"",c,m,_,S,y,T,j,F,R,N=r[0].toUpperCase()+"",M,O,D,I,P,U,X,A=ft(r[5].scheme_name??"",r[2])+"",Y,V,pe,Re,ie,W=ft(r[1].scheme_reference,r[2])+"",ut,xe,vt,et,rt=((yn=r[5].browse)==null?void 0:yn.authority_or_region)+"",Ut,Kt,we,Ie,tt,Wt,ct=((Sn=r[5].browse)==null?void 0:Sn.funding_programme)+"",yt,wn,ln,sn,ot,vn,it,ze,Me=r[1].length_meters&&rs(r),Ne=r[1].description&&os(r),Se=r[1].pipeline&&is(on(r)),Oe=((Cn=r[5].browse)==null?void 0:Cn.capital_scheme_id)&&cs(r),je=((Tn=r[5].browse)==null?void 0:Tn.current_milestone)&&$s(r),Ce=r[5].pipeline&&ps(rn(r));return ot=new Ee({props:{$$slots:{default:[$p]},$$scope:{ctx:r}}}),ot.$on("click",r[6]),it=new Ee({props:{$$slots:{default:[pp]},$$scope:{ctx:r}}}),it.$on("click",r[7]),{c(){e=C("div"),l=C("h2"),l.textContent="Intervention",t=L(),n=C("p"),s=C("b"),s.textContent="Name",o=v(` - : `),u=new pt(!1),i=v(" ("),c=v(a),m=v(")"),_=L(),Me&&Me.c(),S=L(),Ne&&Ne.c(),y=L(),Se&&Se.c(),T=L(),j=C("hr"),F=L(),R=C("h2"),M=v(N),O=v(" Scheme"),D=L(),I=C("p"),P=C("b"),P.textContent="Scheme name",U=v(` - : `),X=new pt(!1),Y=L(),V=C("p"),pe=C("b"),pe.textContent="Scheme reference",Re=v(` - : `),ie=new pt(!1),ut=L(),xe=C("p"),vt=C("b"),vt.textContent="Authority or region",et=v(` - : `),Ut=v(rt),Kt=L(),Oe&&Oe.c(),we=L(),Ie=C("p"),tt=C("b"),tt.textContent="Funding programme",Wt=v(` - : `),yt=v(ct),wn=L(),je&&je.c(),ln=L(),Ce&&Ce.c(),sn=L(),b(ot.$$.fragment),vn=L(),b(it.$$.fragment),u.a=i,X.a=null,ie.a=null,_e(e,"max-width","30vw"),_e(e,"max-height","60vh"),_e(e,"overflow","auto")},m(fe,ke){$(fe,e,ke),h(e,l),h(e,t),h(e,n),h(n,s),h(n,o),u.m(f,n),h(n,i),h(n,c),h(n,m),h(e,_),Me&&Me.m(e,null),h(e,S),Ne&&Ne.m(e,null),h(e,y),Se&&Se.m(e,null),h(e,T),h(e,j),h(e,F),h(e,R),h(R,M),h(R,O),h(e,D),h(e,I),h(I,P),h(I,U),X.m(A,I),h(e,Y),h(e,V),h(V,pe),h(V,Re),ie.m(W,V),h(e,ut),h(e,xe),h(xe,vt),h(xe,et),h(xe,Ut),h(e,Kt),Oe&&Oe.m(e,null),h(e,we),h(e,Ie),h(Ie,tt),h(Ie,Wt),h(Ie,yt),h(e,wn),je&&je.m(e,null),h(e,ln),Ce&&Ce.m(e,null),h(e,sn),k(ot,e,null),h(e,vn),k(it,e,null),r[10](e),ze=!0},p(fe,ke){var Mn,Nn,On,jn;(!ze||ke&10)&&f!==(f=ft(fe[1].name,fe[3])+"")&&u.p(f),(!ze||ke&2)&&a!==(a=fe[1].intervention_type+"")&&G(c,a),fe[1].length_meters?Me?Me.p(fe,ke):(Me=rs(fe),Me.c(),Me.m(e,S)):Me&&(Me.d(1),Me=null),fe[1].description?Ne?Ne.p(fe,ke):(Ne=os(fe),Ne.c(),Ne.m(e,y)):Ne&&(Ne.d(1),Ne=null),fe[1].pipeline?Se?(Se.p(on(fe),ke),ke&2&&g(Se,1)):(Se=is(on(fe)),Se.c(),g(Se,1),Se.m(e,T)):Se&&(ae(),d(Se,1,1,()=>{Se=null}),ue()),(!ze||ke&1)&&N!==(N=fe[0].toUpperCase()+"")&&G(M,N),(!ze||ke&36)&&A!==(A=ft(fe[5].scheme_name??"",fe[2])+"")&&X.p(A),(!ze||ke&6)&&W!==(W=ft(fe[1].scheme_reference,fe[2])+"")&&ie.p(W),(!ze||ke&32)&&rt!==(rt=((Mn=fe[5].browse)==null?void 0:Mn.authority_or_region)+"")&&G(Ut,rt),(Nn=fe[5].browse)!=null&&Nn.capital_scheme_id?Oe?Oe.p(fe,ke):(Oe=cs(fe),Oe.c(),Oe.m(e,we)):Oe&&(Oe.d(1),Oe=null),(!ze||ke&32)&&ct!==(ct=((On=fe[5].browse)==null?void 0:On.funding_programme)+"")&&G(yt,ct),(jn=fe[5].browse)!=null&&jn.current_milestone?je?je.p(fe,ke):(je=$s(fe),je.c(),je.m(e,ln)):je&&(je.d(1),je=null),fe[5].pipeline?Ce?(Ce.p(rn(fe),ke),ke&32&&g(Ce,1)):(Ce=ps(rn(fe)),Ce.c(),g(Ce,1),Ce.m(e,sn)):Ce&&(ae(),d(Ce,1,1,()=>{Ce=null}),ue());const Ln={};ke&8192&&(Ln.$$scope={dirty:ke,ctx:fe}),ot.$set(Ln);const In={};ke&8192&&(In.$$scope={dirty:ke,ctx:fe}),it.$set(In)},i(fe){ze||(g(Se),g(Ce),g(ot.$$.fragment,fe),g(it.$$.fragment,fe),ze=!0)},o(fe){d(Se),d(Ce),d(ot.$$.fragment,fe),d(it.$$.fragment,fe),ze=!1},d(fe){fe&&p(e),Me&&Me.d(),Ne&&Ne.d(),Se&&Se.d(),Oe&&Oe.d(),je&&je.d(),Ce&&Ce.d(),w(ot),w(it),r[10](null)}}}function mp(r){let e=r[1],l,t,n=ds(r);return{c(){n.c(),l=ye()},m(s,o){n.m(s,o),$(s,l,o),t=!0},p(s,[o]){o&2&&J(e,e=s[1])?(ae(),d(n,1,1,x),ue(),n=ds(s),n.c(),g(n,1),n.m(l.parentNode,l)):n.p(s,o)},i(s){t||(g(n),t=!0)},o(s){d(n),t=!1},d(s){s&&p(l),n.d(s)}}}function ft(r,e){return e?r.replace(new RegExp(e,"gi"),l=>`${l}`):r}function _p(r,e,l){let t,n;K(r,dn,y=>l(11,n=y));let{source:s}=e,{props:o}=e,{schemes:u}=e,{schemesGj:f}=e,{filterSchemeText:i}=e,{filterInterventionText:a}=e,c;Vs(()=>{c&&l(4,c.scrollTop=0,c)});function m(){let y={type:"FeatureCollection",features:f.features.filter(T=>T.properties.scheme_reference==t.scheme_reference)};n==null||n.fitBounds(rr(y),{padding:20,animate:!1})}function _(){var F,R;let y={type:"FeatureCollection",features:f.features.filter(N=>N.properties.scheme_reference==t.scheme_reference),schemes:{}};y.schemes[t.scheme_reference]=t;let T=((F=t.browse)==null?void 0:F.authority_or_region)||"unknown authority",j=t.pipeline?"pipeline":"v1";j=="pipeline"&&(T+="_pipeline"),Qs(T,JSON.stringify(y)),window.open(`scheme.html?authority=${(R=t.browse)==null?void 0:R.authority_or_region}&schema=${j}`,"_blank")}function S(y){H[y?"unshift":"push"](()=>{c=y,l(4,c)})}return r.$$set=y=>{"source"in y&&l(0,s=y.source),"props"in y&&l(1,o=y.props),"schemes"in y&&l(8,u=y.schemes),"schemesGj"in y&&l(9,f=y.schemesGj),"filterSchemeText"in y&&l(2,i=y.filterSchemeText),"filterInterventionText"in y&&l(3,a=y.filterInterventionText)},r.$$.update=()=>{r.$$.dirty&258&&l(5,t=u.get(o.scheme_reference))},[s,o,i,a,c,t,m,_,u,f,S]}class kn extends Q{constructor(e){super(),Z(this,e,_p,mp,J,{source:0,props:1,schemes:8,schemesGj:9,filterSchemeText:2,filterInterventionText:3})}}function gp(r){let e,l=r[10].name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=n[10].name+"")&&G(t,l)},d(n){n&&p(e)}}}function dp(r){let e,l;return e=new kn({props:{source:r[0],props:r[10],schemesGj:r[3],schemes:r[2],filterSchemeText:r[4],filterInterventionText:r[5]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1&&(s.source=t[0]),n&1024&&(s.props=t[10]),n&8&&(s.schemesGj=t[3]),n&4&&(s.schemes=t[2]),n&16&&(s.filterSchemeText=t[4]),n&32&&(s.filterInterventionText=t[5]),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function hp(r){let e,l,t,n;return e=new ce({props:{popupClass:"border-popup",$$slots:{default:[gp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[dp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment)},m(s,o){k(e,s,o),$(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&3072&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&3133&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&p(l),w(e,s),w(t,s)}}}function bp(r){let e,l=r[10].name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=n[10].name+"")&&G(t,l)},d(n){n&&p(e)}}}function kp(r){let e,l;return e=new kn({props:{source:r[0],props:r[10],schemesGj:r[3],schemes:r[2],filterSchemeText:r[4],filterInterventionText:r[5]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1&&(s.source=t[0]),n&1024&&(s.props=t[10]),n&8&&(s.schemesGj=t[3]),n&4&&(s.schemes=t[2]),n&16&&(s.filterSchemeText=t[4]),n&32&&(s.filterInterventionText=t[5]),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function wp(r){let e,l,t,n;return e=new ce({props:{popupClass:"border-popup",$$slots:{default:[bp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[kp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment)},m(s,o){k(e,s,o),$(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&3072&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&3133&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&p(l),w(e,s),w(t,s)}}}function vp(r){let e,l=r[10].name+"",t;return{c(){e=C("p"),t=v(l)},m(n,s){$(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=n[10].name+"")&&G(t,l)},d(n){n&&p(e)}}}function yp(r){let e,l;return e=new kn({props:{source:r[0],props:r[10],schemesGj:r[3],schemes:r[2],filterSchemeText:r[4],filterInterventionText:r[5]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1&&(s.source=t[0]),n&1024&&(s.props=t[10]),n&8&&(s.schemesGj=t[3]),n&4&&(s.schemes=t[2]),n&16&&(s.filterSchemeText=t[4]),n&32&&(s.filterInterventionText=t[5]),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Sp(r){let e,l,t,n;return e=new ce({props:{popupClass:"border-popup",$$slots:{default:[vp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[yp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment)},m(s,o){k(e,s,o),$(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&3072&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&3133&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&p(l),w(e,s),w(t,s)}}}function Cp(r){let e,l,t,n,s,o,u,f,i,a;const c=[q(`${r[0]}-interventions-points`),{filter:["all",Fn,r[8],r[9]]},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"circle-color":r[6],"circle-radius":Gn,"circle-opacity":ne(1,.5)}},{layout:{visibility:r[1]?"visible":"none"}},{hoverCursor:"pointer"}];let m={$$slots:{default:[hp]},$$scope:{ctx:r}};for(let M=0;M{"source"in _&&l(0,n=_.source),"show"in _&&l(1,s=_.show),"schemes"in _&&l(2,o=_.schemes),"schemesGj"in _&&l(3,u=_.schemesGj),"filterSchemeText"in _&&l(4,f=_.filterSchemeText),"filterInterventionText"in _&&l(5,i=_.filterInterventionText),"color"in _&&l(6,a=_.color)},r.$$.update=()=>{r.$$.dirty&8&&l(7,t=or(u))},[n,s,o,u,f,i,a,t,c,m]}class hs extends Q{constructor(e){super(),Z(this,e,Lp,Tp,J,{source:0,show:1,schemes:2,schemesGj:3,filterSchemeText:4,filterInterventionText:5,color:6})}}function Ip(r){return Ke(["get","intervention_type"],{area:Qe.area,route:Qe.route,crossing:Qe.crossing,other:Qe.other},"white")}function Mp(r){return[["Areas",Qe.area],["Routes",Qe.route],["Crossings",Qe.crossing],["Other",Qe.other]]}function bs(r,e,l){const t=r.slice();return t[31]=e[l],t}function ks(r,e,l){const t=r.slice();return t[31]=e[l],t}function Np(r){let e,l;return e=new G$({props:{loadFile:r[17]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:x,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function ws(r){let e,l,t,n,s,o,u,f,i,a,c,m,_,S;function y(I){r[18](I)}let T={$$slots:{right:[Pp],default:[Op]},$$scope:{ctx:r}};r[3]!==void 0&&(T.checked=r[3]),e=new oe({props:T}),H.push(()=>E(e,"checked",y));function j(I){r[19](I)}function F(I){r[20](I)}function R(I){r[21](I)}function N(I){r[22](I)}let M={source:"ATF"};r[10]!==void 0&&(M.schemesGj=r[10]),r[9]!==void 0&&(M.schemes=r[9]),r[11]!==void 0&&(M.filterSchemeText=r[11]),r[12]!==void 0&&(M.filterInterventionText=r[12]),n=new Gs({props:M}),H.push(()=>E(n,"schemesGj",j)),H.push(()=>E(n,"schemes",F)),H.push(()=>E(n,"filterSchemeText",R)),H.push(()=>E(n,"filterInterventionText",N));function O(I){r[23](I)}let D={label:"Colour interventions",choices:[["fundingProgramme","By funding programme"],["interventionType","By intervention type"],["currentMilestone","By current milestone"]]};return r[0]!==void 0&&(D.value=r[0]),a=new ht({props:D}),H.push(()=>E(a,"value",O)),_=new Zt({props:{rows:r[7]}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment),i=L(),b(a.$$.fragment),m=L(),b(_.$$.fragment)},m(I,P){k(e,I,P),$(I,t,P),k(n,I,P),$(I,i,P),k(a,I,P),$(I,m,P),k(_,I,P),S=!0},p(I,P){const U={};P[0]&1024|P[1]&32&&(U.$$scope={dirty:P,ctx:I}),!l&&P[0]&8&&(l=!0,U.checked=I[3],B(()=>l=!1)),e.$set(U);const X={};!s&&P[0]&1024&&(s=!0,X.schemesGj=I[10],B(()=>s=!1)),!o&&P[0]&512&&(o=!0,X.schemes=I[9],B(()=>o=!1)),!u&&P[0]&2048&&(u=!0,X.filterSchemeText=I[11],B(()=>u=!1)),!f&&P[0]&4096&&(f=!0,X.filterInterventionText=I[12],B(()=>f=!1)),n.$set(X);const A={};!c&&P[0]&1&&(c=!0,A.value=I[0],B(()=>c=!1)),a.$set(A);const Y={};P[0]&128&&(Y.rows=I[7]),_.$set(Y)},i(I){S||(g(e.$$.fragment,I),g(n.$$.fragment,I),g(a.$$.fragment,I),g(_.$$.fragment,I),S=!0)},o(I){d(e.$$.fragment,I),d(n.$$.fragment,I),d(a.$$.fragment,I),d(_.$$.fragment,I),S=!1},d(I){I&&(p(t),p(i),p(m)),w(e,I),w(n,I),w(a,I),w(_,I)}}}function Op(r){let e;return{c(){e=v("ATF schemes")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function vs(r){let e,l,t=r[31]+"",n;return{c(){e=C("li"),l=C("p"),n=v(t)},m(s,o){$(s,e,o),h(e,l),h(l,n)},p(s,o){o[0]&1024&&t!==(t=s[31]+"")&&G(n,t)},d(s){s&&p(e)}}}function jp(r){let e,l,t,n,s,o;l=new As({props:{text:"Scheme data caveats"}});let u=ve(r[10].notes??[]),f=[];for(let i=0;iE(e,"checked",y));function j(I){r[25](I)}function F(I){r[26](I)}function R(I){r[27](I)}function N(I){r[28](I)}let M={source:"LCWIP"};r[14]!==void 0&&(M.schemesGj=r[14]),r[13]!==void 0&&(M.schemes=r[13]),r[15]!==void 0&&(M.filterSchemeText=r[15]),r[16]!==void 0&&(M.filterInterventionText=r[16]),n=new Gs({props:M}),H.push(()=>E(n,"schemesGj",j)),H.push(()=>E(n,"schemes",F)),H.push(()=>E(n,"filterSchemeText",R)),H.push(()=>E(n,"filterInterventionText",N));function O(I){r[29](I)}let D={label:"Colour interventions",choices:[["interventionType","By intervention type"]]};return r[1]!==void 0&&(D.value=r[1]),a=new ht({props:D}),H.push(()=>E(a,"value",O)),_=new Zt({props:{rows:r[5]}}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment),i=L(),b(a.$$.fragment),m=L(),b(_.$$.fragment)},m(I,P){k(e,I,P),$(I,t,P),k(n,I,P),$(I,i,P),k(a,I,P),$(I,m,P),k(_,I,P),S=!0},p(I,P){const U={};P[0]&16384|P[1]&32&&(U.$$scope={dirty:P,ctx:I}),!l&&P[0]&16&&(l=!0,U.checked=I[4],B(()=>l=!1)),e.$set(U);const X={};!s&&P[0]&16384&&(s=!0,X.schemesGj=I[14],B(()=>s=!1)),!o&&P[0]&8192&&(o=!0,X.schemes=I[13],B(()=>o=!1)),!u&&P[0]&32768&&(u=!0,X.filterSchemeText=I[15],B(()=>u=!1)),!f&&P[0]&65536&&(f=!0,X.filterInterventionText=I[16],B(()=>f=!1)),n.$set(X);const A={};!c&&P[0]&2&&(c=!0,A.value=I[1],B(()=>c=!1)),a.$set(A);const Y={};P[0]&32&&(Y.rows=I[5]),_.$set(Y)},i(I){S||(g(e.$$.fragment,I),g(n.$$.fragment,I),g(a.$$.fragment,I),g(_.$$.fragment,I),S=!0)},o(I){d(e.$$.fragment,I),d(n.$$.fragment,I),d(a.$$.fragment,I),d(_.$$.fragment,I),S=!1},d(I){I&&(p(t),p(i),p(m)),w(e,I),w(n,I),w(a,I),w(_,I)}}}function Dp(r){let e;return{c(){e=v("LCWIP schemes")},m(l,t){$(l,e,t)},d(l){l&&p(e)}}}function Ss(r){let e,l,t=r[31]+"",n;return{c(){e=C("li"),l=C("p"),n=v(t)},m(s,o){$(s,e,o),h(e,l),h(l,n)},p(s,o){o[0]&16384&&t!==(t=s[31]+"")&&G(n,t)},d(s){s&&p(e)}}}function Rp(r){let e,l,t,n,s,o;l=new As({props:{text:"Scheme data caveats"}});let u=ve(r[14].notes??[]),f=[];for(let i=0;i0&&ws(r),c=r[13].size>0&&ys(r);return s=new Zs({props:{label:"Load schemes from GeoJSON",onLoad:r[17]}}),u=new Ks({props:{errorMessage:r[2]}}),{c(){i&&i.c(),l=L(),a&&a.c(),t=L(),c&&c.c(),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment)},m(m,_){i&&i.m(m,_),$(m,l,_),a&&a.m(m,_),$(m,t,_),c&&c.m(m,_),$(m,n,_),k(s,m,_),$(m,o,_),k(u,m,_),f=!0},p(m,_){e&&i.p(m,_),m[9].size>0?a?(a.p(m,_),_[0]&512&&g(a,1)):(a=ws(m),a.c(),g(a,1),a.m(t.parentNode,t)):a&&(ae(),d(a,1,1,()=>{a=null}),ue()),m[13].size>0?c?(c.p(m,_),_[0]&8192&&g(c,1)):(c=ys(m),c.c(),g(c,1),c.m(n.parentNode,n)):c&&(ae(),d(c,1,1,()=>{c=null}),ue());const S={};_[0]&4&&(S.errorMessage=m[2]),u.$set(S)},i(m){f||(g(i),g(a),g(c),g(s.$$.fragment,m),g(u.$$.fragment,m),f=!0)},o(m){d(i),d(a),d(c),d(s.$$.fragment,m),d(u.$$.fragment,m),f=!1},d(m){m&&(p(l),p(t),p(n),p(o)),i&&i.d(m),a&&a.d(m),c&&c.d(m),w(s,m),w(u,m)}}}function Gp(r){let e,l,t,n,s,o;return e=new nt({props:{label:"Schemes",open:!0,$$slots:{default:[Fp]},$$scope:{ctx:r}}}),t=new hs({props:{source:"atf",show:r[3],schemesGj:r[10],schemes:r[9],filterSchemeText:r[11],filterInterventionText:r[12],color:r[8]}}),s=new hs({props:{source:"lcwip",show:r[4],schemesGj:r[14],schemes:r[13],filterSchemeText:r[15],filterInterventionText:r[16],color:r[6]}}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment)},m(u,f){k(e,u,f),$(u,l,f),k(t,u,f),$(u,n,f),k(s,u,f),o=!0},p(u,f){const i={};f[0]&130751|f[1]&32&&(i.$$scope={dirty:f,ctx:u}),e.$set(i);const a={};f[0]&8&&(a.show=u[3]),f[0]&1024&&(a.schemesGj=u[10]),f[0]&512&&(a.schemes=u[9]),f[0]&2048&&(a.filterSchemeText=u[11]),f[0]&4096&&(a.filterInterventionText=u[12]),f[0]&256&&(a.color=u[8]),t.$set(a);const c={};f[0]&16&&(c.show=u[4]),f[0]&16384&&(c.schemesGj=u[14]),f[0]&8192&&(c.schemes=u[13]),f[0]&32768&&(c.filterSchemeText=u[15]),f[0]&65536&&(c.filterInterventionText=u[16]),f[0]&64&&(c.color=u[6]),s.$set(c)},i(u){o||(g(e.$$.fragment,u),g(t.$$.fragment,u),g(s.$$.fragment,u),o=!0)},o(u){d(e.$$.fragment,u),d(t.$$.fragment,u),d(s.$$.fragment,u),o=!1},d(u){u&&(p(l),p(n)),w(e,u),w(t,u),w(s,u)}}}function qp(r,e,l){let t,n,s,o,u,f,i,a,c,m,_,S;K(r,cn,W=>l(9,u=W)),K(r,nn,W=>l(10,f=W)),K(r,Ul,W=>l(11,i=W)),K(r,Bl,W=>l(12,a=W)),K(r,pn,W=>l(13,c=W)),K(r,$n,W=>l(14,m=W)),K(r,Yl,W=>l(15,_=W)),K(r,Wl,W=>l(16,S=W));let y="",T=!0,j=!0,F="fundingProgramme",R="interventionType";function N(W,ut){try{q$(JSON.parse(ut)),l(2,y="")}catch(xe){l(2,y=`The file you loaded is broken: ${xe}`)}}function M(W){return W=="interventionType"?[Ip(),Mp()]:W=="fundingProgramme"?[Ke(["get","funding_programme"],Bt,"grey"),Object.entries(Bt)]:W=="currentMilestone"?[Ke(["get","current_milestone"],mn,"grey"),Object.entries(mn)]:["red",[]]}function O(W){T=W,l(3,T)}function D(W){f=W,nn.set(f)}function I(W){u=W,cn.set(u)}function P(W){i=W,Ul.set(i)}function U(W){a=W,Bl.set(a)}function X(W){F=W,l(0,F)}function A(W){j=W,l(4,j)}function Y(W){m=W,$n.set(m)}function V(W){c=W,pn.set(c)}function pe(W){_=W,Yl.set(_)}function Re(W){S=W,Wl.set(S)}function ie(W){R=W,l(1,R)}return r.$$.update=()=>{r.$$.dirty[0]&1&&l(8,[t,n]=M(F),t,(l(7,n),l(0,F))),r.$$.dirty[0]&2&&l(6,[s,o]=M(R),s,(l(5,o),l(1,R)))},[F,R,y,T,j,o,s,n,t,u,f,i,a,c,m,_,S,N,O,D,I,P,U,X,A,Y,V,pe,Re,ie]}class zp extends Q{constructor(e){super(),Z(this,e,qp,Gp,J,{},null,[-1,-1])}}const Cs=Fe(!0);let _n=Fe(null);function Hp(r){let e,l,t,n,s,o,u,f;return e=new gc({}),t=new Ic({}),s=new Uc({}),u=new qc({}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment)},m(i,a){k(e,i,a),$(i,l,a),k(t,i,a),$(i,n,a),k(s,i,a),$(i,o,a),k(u,i,a),f=!0},i(i){f||(g(e.$$.fragment,i),g(t.$$.fragment,i),g(s.$$.fragment,i),g(u.$$.fragment,i),f=!0)},o(i){d(e.$$.fragment,i),d(t.$$.fragment,i),d(s.$$.fragment,i),d(u.$$.fragment,i),f=!1},d(i){i&&(p(l),p(n),p(o)),w(e,i),w(t,i),w(s,i),w(u,i)}}}function Ep(r){let e,l;return e=new st({props:{small:!0,$$slots:{default:[Hp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Bp(r){let e,l,t,n,s,o,u,f,i,a,c,m;return e=new jf({}),t=new fa({}),s=new Ef({}),u=new Xf({}),i=new nc({}),c=new Ru({}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment),f=L(),b(i.$$.fragment),a=L(),b(c.$$.fragment)},m(_,S){k(e,_,S),$(_,l,S),k(t,_,S),$(_,n,S),k(s,_,S),$(_,o,S),k(u,_,S),$(_,f,S),k(i,_,S),$(_,a,S),k(c,_,S),m=!0},i(_){m||(g(e.$$.fragment,_),g(t.$$.fragment,_),g(s.$$.fragment,_),g(u.$$.fragment,_),g(i.$$.fragment,_),g(c.$$.fragment,_),m=!0)},o(_){d(e.$$.fragment,_),d(t.$$.fragment,_),d(s.$$.fragment,_),d(u.$$.fragment,_),d(i.$$.fragment,_),d(c.$$.fragment,_),m=!1},d(_){_&&(p(l),p(n),p(o),p(f),p(a)),w(e,_),w(t,_),w(s,_),w(u,_),w(i,_),w(c,_)}}}function Up(r){let e,l;return e=new st({props:{small:!0,$$slots:{default:[Bp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Wp(r){let e,l,t,n,s,o;return e=new hf({}),t=new mu({}),s=new Su({}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment)},m(u,f){k(e,u,f),$(u,l,f),k(t,u,f),$(u,n,f),k(s,u,f),o=!0},i(u){o||(g(e.$$.fragment,u),g(t.$$.fragment,u),g(s.$$.fragment,u),o=!0)},o(u){d(e.$$.fragment,u),d(t.$$.fragment,u),d(s.$$.fragment,u),o=!1},d(u){u&&(p(l),p(n)),w(e,u),w(t,u),w(s,u)}}}function Yp(r){let e,l,t,n,s,o,u,f,i,a;return e=new Ti({}),t=new lf({}),s=new Po({}),u=new ti({}),i=new _i({}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment),f=L(),b(i.$$.fragment)},m(c,m){k(e,c,m),$(c,l,m),k(t,c,m),$(c,n,m),k(s,c,m),$(c,o,m),k(u,c,m),$(c,f,m),k(i,c,m),a=!0},i(c){a||(g(e.$$.fragment,c),g(t.$$.fragment,c),g(s.$$.fragment,c),g(u.$$.fragment,c),g(i.$$.fragment,c),a=!0)},o(c){d(e.$$.fragment,c),d(t.$$.fragment,c),d(s.$$.fragment,c),d(u.$$.fragment,c),d(i.$$.fragment,c),a=!1},d(c){c&&(p(l),p(n),p(o),p(f)),w(e,c),w(t,c),w(s,c),w(u,c),w(i,c)}}}function Jp(r){let e,l;return e=new st({props:{small:!0,$$slots:{default:[Yp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Vp(r){let e,l,t,n;return e=new vo({}),t=new Uo({}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment)},m(s,o){k(e,s,o),$(s,l,o),k(t,s,o),n=!0},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&p(l),w(e,s),w(t,s)}}}function Qp(r){let e,l;return e=new st({props:{small:!0,$$slots:{default:[Vp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Zp(r){let e,l,t,n,s,o,u,f;return e=new ou({}),t=new wa({}),s=new Za({}),u=new N$({}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment)},m(i,a){k(e,i,a),$(i,l,a),k(t,i,a),$(i,n,a),k(s,i,a),$(i,o,a),k(u,i,a),f=!0},i(i){f||(g(e.$$.fragment,i),g(t.$$.fragment,i),g(s.$$.fragment,i),g(u.$$.fragment,i),f=!0)},o(i){d(e.$$.fragment,i),d(t.$$.fragment,i),d(s.$$.fragment,i),d(u.$$.fragment,i),f=!1},d(i){i&&(p(l),p(n),p(o)),w(e,i),w(t,i),w(s,i),w(u,i)}}}function Kp(r){let e,l,t,n,s,o,u,f,i=hn()=="Private (development)",a,c,m,_,S;e=new k$({}),t=new f$({}),s=new Fa({}),u=new Wu({});let y=i&&Zp();return c=new Ai({}),_=new Yi({}),{c(){b(e.$$.fragment),l=L(),b(t.$$.fragment),n=L(),b(s.$$.fragment),o=L(),b(u.$$.fragment),f=L(),y&&y.c(),a=L(),b(c.$$.fragment),m=L(),b(_.$$.fragment)},m(T,j){k(e,T,j),$(T,l,j),k(t,T,j),$(T,n,j),k(s,T,j),$(T,o,j),k(u,T,j),$(T,f,j),y&&y.m(T,j),$(T,a,j),k(c,T,j),$(T,m,j),k(_,T,j),S=!0},p:x,i(T){S||(g(e.$$.fragment,T),g(t.$$.fragment,T),g(s.$$.fragment,T),g(u.$$.fragment,T),g(y),g(c.$$.fragment,T),g(_.$$.fragment,T),S=!0)},o(T){d(e.$$.fragment,T),d(t.$$.fragment,T),d(s.$$.fragment,T),d(u.$$.fragment,T),d(y),d(c.$$.fragment,T),d(_.$$.fragment,T),S=!1},d(T){T&&(p(l),p(n),p(o),p(f),p(a),p(m)),w(e,T),w(t,T),w(s,T),w(u,T),y&&y.d(T),w(c,T),w(_,T)}}}function Xp(r){let e,l;return e=new st({props:{small:!0,$$slots:{default:[Kp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function xp(r){let e,l,t,n,s;function o(f){r[6](f)}let u={cfg:r[5],map:r[3]};return r[0]!==void 0&&(u.enabled=r[0]),e=new fr({props:u}),H.push(()=>E(e,"enabled",o)),n=new Br({}),{c(){b(e.$$.fragment),t=L(),b(n.$$.fragment)},m(f,i){k(e,f,i),$(f,t,i),k(n,f,i),s=!0},p(f,i){const a={};i&8&&(a.map=f[3]),!l&&i&1&&(l=!0,a.enabled=f[0],B(()=>l=!1)),e.$set(a)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&p(t),w(e,f),w(n,f)}}}function em(r){let e,l;const t=[q("cover-interactive-layers"),{paint:{"fill-color":"black","fill-opacity":0}},{layout:{visibility:r[1]?"none":"visible"}}];let n={};for(let s=0;sl(1,n=c)),K(r,_n,c=>l(2,s=c)),K(r,dn,c=>l(3,o=c));let u={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]}},f={getStreetViewRoadLayerNames:c=>ar(c,Xs(an))};function i(c){t=c,l(0,t),l(1,n)}function a(c){H[c?"unshift":"push"](()=>{s=c,_n.set(s)})}return r.$$.update=()=>{r.$$.dirty&2&&l(0,t=!n),r.$$.dirty&1&&Cs.set(!t)},[t,n,s,o,u,f,i,a]}class lm extends Q{constructor(e){super(),Z(this,e,nm,tm,J,{})}}function sm(r){let e,l,t,n,s,o,u,f,i,a,c,m,_,S;return l=new ur({}),u=new cr({props:{boundaryGeojson:r[3]}}),i=new xs({}),{c(){e=C("div"),b(l.$$.fragment),t=L(),n=C("div"),s=C("h1"),s.textContent="Browse schemes",o=L(),b(u.$$.fragment),f=L(),b(i.$$.fragment),a=L(),c=C("p"),c.textContent=`App version: ${hn()}`,m=L(),_=C("div"),_e(n,"display","flex"),_e(n,"justify-content","space-between"),z(e,"slot","sidebar"),z(e,"class","govuk-prose")},m(y,T){$(y,e,T),k(l,e,null),h(e,t),h(e,n),h(n,s),h(n,o),k(u,n,null),h(e,f),k(i,e,null),h(e,a),h(e,c),h(e,m),h(e,_),r[6](_),S=!0},p(y,T){const j={};T&8&&(j.boundaryGeojson=y[3]),u.$set(j)},i(y){S||(g(l.$$.fragment,y),g(u.$$.fragment,y),g(i.$$.fragment,y),S=!0)},o(y){d(l.$$.fragment,y),d(u.$$.fragment,y),d(i.$$.fragment,y),S=!1},d(y){y&&p(e),w(l),w(u),w(i),r[6](null)}}}function Ts(r){let e,l;return e=new lm({}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function rm(r){let e,l,t,n;e=new $r({});let s=r[2]&&Ts();return{c(){b(e.$$.fragment),l=L(),s&&s.c(),t=ye()},m(o,u){k(e,o,u),$(o,l,u),s&&s.m(o,u),$(o,t,u),n=!0},p(o,u){o[2]?s?u&4&&g(s,1):(s=Ts(),s.c(),g(s,1),s.m(t.parentNode,t)):s&&(ae(),d(s,1,1,()=>{s=null}),ue())},i(o){n||(g(e.$$.fragment,o),g(s),n=!0)},o(o){d(e.$$.fragment,o),d(s),n=!1},d(o){o&&(p(l),p(t)),w(e,o),s&&s.d(o)}}}function om(r){let e,l,t;return l=new er({props:{style:r[1],startBounds:[-5.96,49.89,2.31,55.94],$$slots:{default:[rm]},$$scope:{ctx:r}}}),{c(){e=C("div"),b(l.$$.fragment),z(e,"slot","main")},m(n,s){$(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2&&(o.style=n[1]),s&260&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&p(e),w(l)}}}function im(r){let e,l;return e=new yr({props:{$$slots:{main:[om],sidebar:[sm]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,[n]){const s={};n&271&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function fm(r,e,l){let t,n,s,o,u;K(r,_n,c=>l(4,t=c)),K(r,dn,c=>l(5,n=c)),K(r,an,c=>l(1,s=c)),K(r,zn,c=>l(2,o=c)),K(r,nn,c=>l(3,u=c)),Rs(()=>{tr()});const f=new URLSearchParams(window.location.search);an.set(f.get("style")||"dataviz");let i;function a(c){H[c?"unshift":"push"](()=>{i=c,l(0,i),l(4,t)})}return r.$$.update=()=>{r.$$.dirty&32&&n&&zn.set(n),r.$$.dirty&17&&i&&t&&(l(0,i.innerHTML="",i),i.appendChild(t))},[i,s,o,u,t,n,a]}class am extends Q{constructor(e){super(),Z(this,e,fm,im,J,{})}}document.body.className+=" js-enabled"+("noModule"in HTMLScriptElement.prototype?" govuk-frontend-supported":"");new am({target:document.getElementById("app")}); diff --git a/browse_layout_v3/assets/nested2-ba23dce0.js b/browse_layout_v3/assets/nested2-ba23dce0.js new file mode 100644 index 00000000..640e011f --- /dev/null +++ b/browse_layout_v3/assets/nested2-ba23dce0.js @@ -0,0 +1,177 @@ +import{S as K,i as X,s as V,e as T,b as z,aw as me,c as p,n as ee,d as m,aT as Is,g as H,h as E,a as I,j as b,o as k,Y as tt,r as B,t as g,p as d,u as w,O as pt,P as mt,Q as _t,T as gt,b4 as Dn,m as h,ak as we,y as ae,q as ue,at as Qe,x as v,N as G,a8 as ve,a9 as dn,aa as Ms,v as x,ab as Ns,ac as Os,ad as Re,ae as Ps,af as js,b5 as Bs,U as yt,b6 as Rn,b7 as Us,G as bt,aO as fn,_ as se,J as ge,f as nt,aQ as Ws,b3 as te,a7 as Ae,b8 as pe,I as le,H as Fe,a0 as re,ar as oe,aS as Kt,X as Je,Z as Ds,b0 as Wt,b9 as Yt,ba as $t,R as Rs,bb as Ys,bc as Js,w as As,bd as Vs,D as Qs,V as an,b2 as hn,be as Zs,C as Ks,k as bn,F as Xs,E as xs,aU as er,aV as un,L as tr,M as nr,z as lr}from"./index-980b667c.js";import{e as An,s as q,u as Ve,t as sr,q as xe,M as rr,a as ie,v as de,k as dt,R as or,h as Ze,C as lt,f as ht,b as ir,p as Fn,g as fr,d as Gn,w as qn,c as zn,x as Ut,i as Zt,W as Fs,B as ar,S as ur,n as cr,H as $r,Z as pr,G as mr,m as Hn}from"./ZoomOutMap-9940a4a0.js";import{P as ce,A as Gs}from"./Popup-00bc00d9.js";function _r(r){let e;return{c(){e=T("span"),z(e,"class","svelte-kzgqtg"),me(e,"background",r[0])},m(l,t){p(l,e,t)},p(l,[t]){t&1&&me(e,"background",l[0])},i:ee,o:ee,d(l){l&&m(e)}}}function gr(r,e,l){let{color:t}=e;return r.$$set=n=>{"color"in n&&l(0,t=n.color)},[t]}class Ce extends K{constructor(e){super(),X(this,e,gr,_r,V,{color:0})}}const dr="/atip/browse_layout_v3/assets/help-d011708a.svg";function hr(r){let e,l;const t=r[1].default,n=pt(t,r,r[4],null);return{c(){e=T("div"),n&&n.c(),z(e,"class","govuk-prose")},m(s,o){p(s,e,o),n&&n.m(e,null),l=!0},p(s,o){n&&n.p&&(!l||o&16)&&mt(n,t,s,s[4],l?gt(t,s[4],o,null):_t(s[4]),null)},i(s){l||(g(n,s),l=!0)},o(s){d(n,s),l=!1},d(s){s&&m(e),n&&n.d(s)}}}function br(r){let e,l,t,n,s,o,u;function f(a){r[3](a)}let i={title:"Help",$$slots:{default:[hr]},$$scope:{ctx:r}};return r[0]!==void 0&&(i.open=r[0]),t=new Is({props:i}),H.push(()=>E(t,"open",f)),{c(){e=T("button"),e.innerHTML=`Help`,l=I(),b(t.$$.fragment),z(e,"class","svelte-7d9d1l")},m(a,c){p(a,e,c),p(a,l,c),k(t,a,c),s=!0,o||(u=tt(e,"click",r[2]),o=!0)},p(a,[c]){const $={};c&16&&($.$$scope={dirty:c,ctx:a}),!n&&c&1&&(n=!0,$.open=a[0],B(()=>n=!1)),t.$set($)},i(a){s||(g(t.$$.fragment,a),s=!0)},o(a){d(t.$$.fragment,a),s=!1},d(a){a&&(m(e),m(l)),w(t,a),o=!1,u()}}}function kr(r,e,l){let{$$slots:t={},$$scope:n}=e,s=!1;const o=()=>l(0,s=!0);function u(f){s=f,l(0,s)}return r.$$set=f=>{"$$scope"in f&&l(4,n=f.$$scope)},[s,t,o,u,n]}class $e extends K{constructor(e){super(),X(this,e,kr,br,V,{})}}const wr=r=>({}),En=r=>({}),vr=r=>({}),Bn=r=>({});function yr(r){let e,l,t,n,s,o,u,f,i,a,c;const $=r[4].sidebar,_=pt($,r,r[3],Bn),y=r[4].main,S=pt(y,r,r[3],En);return{c(){e=T("div"),l=T("aside"),t=T("div"),_&&_.c(),n=I(),s=T("button"),s.textContent="→",u=I(),f=T("main"),S&&S.c(),z(t,"class","sidebar-content content-container svelte-1n0etgd"),z(s,"type","button"),z(s,"class","sidebar-toggle rounded-rect svelte-1n0etgd"),z(l,"class",o=Dn(r[1]?"":"collapsed")+" svelte-1n0etgd"),me(l,"--sidebarWidth",r[0]),z(f,"class","svelte-1n0etgd"),z(e,"class","overall-layout svelte-1n0etgd")},m(C,O){p(C,e,O),h(e,l),h(l,t),_&&_.m(t,null),h(l,n),h(l,s),h(e,u),h(e,f),S&&S.m(f,null),i=!0,a||(c=tt(s,"click",r[2]),a=!0)},p(C,[O]){_&&_.p&&(!i||O&8)&&mt(_,$,C,C[3],i?gt($,C[3],O,vr):_t(C[3]),Bn),(!i||O&2&&o!==(o=Dn(C[1]?"":"collapsed")+" svelte-1n0etgd"))&&z(l,"class",o),(!i||O&1)&&me(l,"--sidebarWidth",C[0]),S&&S.p&&(!i||O&8)&&mt(S,y,C,C[3],i?gt(y,C[3],O,wr):_t(C[3]),En)},i(C){i||(g(_,C),g(S,C),i=!0)},o(C){d(_,C),d(S,C),i=!1},d(C){C&&m(e),_&&_.d(C),S&&S.d(C),a=!1,c()}}}function Sr(r,e,l){let{$$slots:t={},$$scope:n}=e,{sidebarWidth:s="25rem"}=e,o=!0;function u(){l(1,o=!o)}return r.$$set=f=>{"sidebarWidth"in f&&l(0,s=f.sidebarWidth),"$$scope"in f&&l(3,n=f.$$scope)},[s,o,u,n,t]}class Cr extends K{constructor(e){super(),X(this,e,Sr,yr,V,{sidebarWidth:0})}}function Un(r,e,l){const t=r.slice();return t[1]=e[l][0],t[2]=e[l][1],t}function Wn(r){let e,l,t,n=r[1]+"",s,o,u;return l=new Ce({props:{color:r[2]}}),{c(){e=T("li"),b(l.$$.fragment),t=I(),s=v(n),o=I()},m(f,i){p(f,e,i),k(l,e,null),h(e,t),h(e,s),h(e,o),u=!0},p(f,i){const a={};i&1&&(a.color=f[2]),l.$set(a),(!u||i&1)&&n!==(n=f[1]+"")&&G(s,n)},i(f){u||(g(l.$$.fragment,f),u=!0)},o(f){d(l.$$.fragment,f),u=!1},d(f){f&&m(e),w(l)}}}function Tr(r){let e,l,t=we(r[0]),n=[];for(let o=0;od(n[o],1,1,()=>{n[o]=null});return{c(){e=T("ul");for(let o=0;o{"rows"in n&&l(0,t=n.rows)},[t]}class Jt extends K{constructor(e){super(),X(this,e,Lr,Tr,V,{rows:0})}}function Yn(r){let e=r[0],l,t,n=Jn(r);return{c(){n.c(),l=ve()},m(s,o){n.m(s,o),p(s,l,o),t=!0},p(s,o){o&1&&V(e,e=s[0])?(ae(),d(n,1,1,ee),ue(),n=Jn(s),n.c(),g(n,1),n.m(l.parentNode,l)):n.p(s,o)},i(s){t||(g(n),t=!0)},o(s){d(n),t=!1},d(s){s&&m(l),n.d(s)}}}function Jn(r){let e;const l=r[16].default,t=pt(l,r,r[15],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&32768)&&mt(t,l,n,n[15],e?gt(l,n[15],s,null):_t(n[15]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function Ir(r){let e,l,t=r[0]&&Yn(r);return{c(){t&&t.c(),e=ve()},m(n,s){t&&t.m(n,s),p(n,e,s),l=!0},p(n,[s]){n[0]?t?(t.p(n,s),s&1&&g(t,1)):(t=Yn(n),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(ae(),d(t,1,1,()=>{t=null}),ue())},i(n){l||(g(t),l=!0)},o(n){d(t),l=!1},d(n){n&&m(e),t&&t.d(n)}}}function Mr(r,e,l){let t,n,{$$slots:s={},$$scope:o}=e,{id:u=dn("raster-source")}=e,{tiles:f}=e,{tileSize:i=void 0}=e,{bounds:a=null}=e,{scheme:c=null}=e,{attribution:$=null}=e,{minzoom:_=null}=e,{maxzoom:y=null}=e,{volatile:S=null}=e;const{map:C,self:O}=Ms();x(r,C,j=>l(14,n=j)),x(r,O,j=>l(0,t=j));let F,R=!0;return Ns(()=>{t&&F&&n&&(Os(C,t,F),Re(O,t=null,t),l(12,F=void 0))}),r.$$set=j=>{"id"in j&&l(3,u=j.id),"tiles"in j&&l(4,f=j.tiles),"tileSize"in j&&l(5,i=j.tileSize),"bounds"in j&&l(6,a=j.bounds),"scheme"in j&&l(7,c=j.scheme),"attribution"in j&&l(8,$=j.attribution),"minzoom"in j&&l(9,_=j.minzoom),"maxzoom"in j&&l(10,y=j.maxzoom),"volatile"in j&&l(11,S=j.volatile),"$$scope"in j&&l(15,o=j.$$scope)},r.$$.update=()=>{r.$$.dirty&24569&&n&&t!==u&&(Re(O,t=u,t),Ps(n,t,js({type:"raster",tiles:f,tileSize:i,bounds:a,scheme:c,attribution:$,minzoom:_,maxzoom:y,volatile:S}),j=>n&&j===t,()=>{t&&(l(12,F=n==null?void 0:n.getSource(t)),l(13,R=!0))})),r.$$.dirty&16392&&(n==null||n.on("style.load",()=>{l(12,F=n==null?void 0:n.getSource(u))})),r.$$.dirty&12304&&F&&(R?l(13,R=!1):F.setTiles(f))},[t,C,O,u,f,i,a,c,$,_,y,S,F,R,n,o,s]}class Nr extends K{constructor(e){super(),X(this,e,Mr,Ir,V,{id:3,tiles:4,tileSize:5,bounds:6,scheme:7,attribution:8,minzoom:9,maxzoom:10,volatile:11})}}function Or(r){let e;const l=r[16].default,t=pt(l,r,r[24],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&16777216)&&mt(t,l,n,n[24],e?gt(l,n[24],s,null):_t(n[24]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function Pr(r){let e,l,t;function n(o){r[17](o)}let s={id:r[1],type:"symbol",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],applyToClusters:r[9],minzoom:r[10],maxzoom:r[11],hoverCursor:r[12],manageHoverState:r[13],eventsIfTopMost:r[14],interactive:r[15],$$slots:{default:[Or]},$$scope:{ctx:r}};return r[0]!==void 0&&(s.hovered=r[0]),e=new Bs({props:s}),H.push(()=>E(e,"hovered",n)),e.$on("click",r[18]),e.$on("dblclick",r[19]),e.$on("contextmenu",r[20]),e.$on("mouseenter",r[21]),e.$on("mousemove",r[22]),e.$on("mouseleave",r[23]),{c(){b(e.$$.fragment)},m(o,u){k(e,o,u),t=!0},p(o,[u]){const f={};u&2&&(f.id=o[1]),u&4&&(f.source=o[2]),u&8&&(f.sourceLayer=o[3]),u&16&&(f.beforeId=o[4]),u&32&&(f.beforeLayerType=o[5]),u&64&&(f.paint=o[6]),u&128&&(f.layout=o[7]),u&256&&(f.filter=o[8]),u&512&&(f.applyToClusters=o[9]),u&1024&&(f.minzoom=o[10]),u&2048&&(f.maxzoom=o[11]),u&4096&&(f.hoverCursor=o[12]),u&8192&&(f.manageHoverState=o[13]),u&16384&&(f.eventsIfTopMost=o[14]),u&32768&&(f.interactive=o[15]),u&16777216&&(f.$$scope={dirty:u,ctx:o}),!l&&u&1&&(l=!0,f.hovered=o[0],B(()=>l=!1)),e.$set(f)},i(o){t||(g(e.$$.fragment,o),t=!0)},o(o){d(e.$$.fragment,o),t=!1},d(o){w(e,o)}}}function jr(r,e,l){let{$$slots:t={},$$scope:n}=e,{id:s=dn("symbol")}=e,{source:o=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:f=void 0}=e,{beforeLayerType:i=void 0}=e,{paint:a=void 0}=e,{layout:c=void 0}=e,{filter:$=void 0}=e,{applyToClusters:_=void 0}=e,{minzoom:y=void 0}=e,{maxzoom:S=void 0}=e,{hoverCursor:C=void 0}=e,{manageHoverState:O=!1}=e,{hovered:F=null}=e,{eventsIfTopMost:R=!1}=e,{interactive:j=!0}=e;function M(A){F=A,l(0,F)}function N(A){yt.call(this,r,A)}function P(A){yt.call(this,r,A)}function L(A){yt.call(this,r,A)}function D(A){yt.call(this,r,A)}function W(A){yt.call(this,r,A)}function Q(A){yt.call(this,r,A)}return r.$$set=A=>{"id"in A&&l(1,s=A.id),"source"in A&&l(2,o=A.source),"sourceLayer"in A&&l(3,u=A.sourceLayer),"beforeId"in A&&l(4,f=A.beforeId),"beforeLayerType"in A&&l(5,i=A.beforeLayerType),"paint"in A&&l(6,a=A.paint),"layout"in A&&l(7,c=A.layout),"filter"in A&&l(8,$=A.filter),"applyToClusters"in A&&l(9,_=A.applyToClusters),"minzoom"in A&&l(10,y=A.minzoom),"maxzoom"in A&&l(11,S=A.maxzoom),"hoverCursor"in A&&l(12,C=A.hoverCursor),"manageHoverState"in A&&l(13,O=A.manageHoverState),"hovered"in A&&l(0,F=A.hovered),"eventsIfTopMost"in A&&l(14,R=A.eventsIfTopMost),"interactive"in A&&l(15,j=A.interactive),"$$scope"in A&&l(24,n=A.$$scope)},[F,s,o,u,f,i,a,c,$,_,y,S,C,O,R,j,t,M,N,P,L,D,W,Q,n]}class kn extends K{constructor(e){super(),X(this,e,jr,Pr,V,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function Vn(r){let e=r[0],l,t,n=Qn(r);return{c(){n.c(),l=ve()},m(s,o){n.m(s,o),p(s,l,o),t=!0},p(s,o){o&1&&V(e,e=s[0])?(ae(),d(n,1,1,ee),ue(),n=Qn(s),n.c(),g(n,1),n.m(l.parentNode,l)):n.p(s,o)},i(s){t||(g(n),t=!0)},o(s){d(n),t=!1},d(s){s&&m(l),n.d(s)}}}function Qn(r){let e;const l=r[15].default,t=pt(l,r,r[14],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&16384)&&mt(t,l,n,n[14],e?gt(l,n[14],s,null):_t(n[14]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function Dr(r){let e,l,t=r[0]&&Vn(r);return{c(){t&&t.c(),e=ve()},m(n,s){t&&t.m(n,s),p(n,e,s),l=!0},p(n,[s]){n[0]?t?(t.p(n,s),s&1&&g(t,1)):(t=Vn(n),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(ae(),d(t,1,1,()=>{t=null}),ue())},i(n){l||(g(t),l=!0)},o(n){d(t),l=!1},d(n){n&&m(e),t&&t.d(n)}}}function Rr(r,e,l){let t,n,{$$slots:s={},$$scope:o}=e,{id:u=dn("vector")}=e,{url:f=null}=e,{tiles:i=null}=e,{promoteId:a=null}=e,{bounds:c=null}=e,{scheme:$=null}=e,{attribution:_=null}=e,{minzoom:y=null}=e,{maxzoom:S=null}=e,{volatile:C=null}=e;if(f&&f.includes("pmtiles://")&&!Rn.config.REGISTERED_PROTOCOLS.hasOwnProperty("pmtiles")){let j=new Us;Rn.addProtocol("pmtiles",j.tile)}const{map:O,self:F}=Ms();x(r,O,j=>l(13,n=j)),x(r,F,j=>l(0,t=j));let R;return Ns(()=>{t&&n&&(Os(O,t,R),Re(F,t=null,t),R=void 0)}),r.$$set=j=>{"id"in j&&l(3,u=j.id),"url"in j&&l(4,f=j.url),"tiles"in j&&l(5,i=j.tiles),"promoteId"in j&&l(6,a=j.promoteId),"bounds"in j&&l(7,c=j.bounds),"scheme"in j&&l(8,$=j.scheme),"attribution"in j&&l(9,_=j.attribution),"minzoom"in j&&l(10,y=j.minzoom),"maxzoom"in j&&l(11,S=j.maxzoom),"volatile"in j&&l(12,C=j.volatile),"$$scope"in j&&l(14,o=j.$$scope)},r.$$.update=()=>{r.$$.dirty&16377&&n&&t!==u&&(Re(F,t=u,t),Ps(n,t,js({type:"vector",url:f,tiles:i,promoteId:a,bounds:c,scheme:$,attribution:_,minzoom:y,maxzoom:S,volatile:C}),j=>n&&j===t,()=>{t&&(R=n==null?void 0:n.getSource(t))})),r.$$.dirty&8200&&(n==null||n.on("style.load",()=>{R=n==null?void 0:n.getSource(u)}))},[t,O,F,u,f,i,a,c,$,_,y,S,C,n,o,s]}class _e extends K{constructor(e){super(),X(this,e,Rr,Dr,V,{id:3,url:4,tiles:5,promoteId:6,bounds:7,scheme:8,attribution:9,minzoom:10,maxzoom:11,volatile:12})}}function Zn(r,e,l){const t=r.slice();return t[11]=e[l],t[12]=e,t[13]=l,t}function Ar(r){let e,l,t;return l=new nt({props:{$$slots:{default:[Gr]},$$scope:{ctx:r}}}),l.$on("click",r[9]),{c(){e=T("div"),b(l.$$.fragment)},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16384&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Fr(r){let e,l,t,n,s,o,u,f,i,a;l=new nt({props:{$$slots:{default:[qr]},$$scope:{ctx:r}}}),l.$on("click",r[4]);let c=r[2]&&Kn(r);s=new xe({props:{label:"Help",$$slots:{default:[zr]},$$scope:{ctx:r}}}),u=new Ws({}),u.$on("click",r[3]);let $=we(r[0]),_=[];for(let S=0;S<$.length;S+=1)_[S]=Xn(Zn(r,$,S));const y=S=>d(_[S],1,1,()=>{_[S]=null});return{c(){e=T("div"),b(l.$$.fragment),t=I(),c&&c.c(),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment),f=I();for(let S=0;S<_.length;S+=1)_[S].c();i=ve()},m(S,C){p(S,e,C),k(l,e,null),p(S,t,C),c&&c.m(S,C),p(S,n,C),k(s,S,C),p(S,o,C),k(u,S,C),p(S,f,C);for(let O=0;O<_.length;O+=1)_[O]&&_[O].m(S,C);p(S,i,C),a=!0},p(S,C){const O={};C&16384&&(O.$$scope={dirty:C,ctx:S}),l.$set(O),S[2]?c?c.p(S,C):(c=Kn(S),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null);const F={};if(C&16384&&(F.$$scope={dirty:C,ctx:S}),s.$set(F),C&65){$=we(S[0]);let R;for(R=0;R<$.length;R+=1){const j=Zn(S,$,R);_[R]?(_[R].p(j,C),g(_[R],1)):(_[R]=Xn(j),_[R].c(),g(_[R],1),_[R].m(i.parentNode,i))}for(ae(),R=$.length;R<_.length;R+=1)y(R);ue()}},i(S){if(!a){g(l.$$.fragment,S),g(s.$$.fragment,S),g(u.$$.fragment,S);for(let C=0;C<$.length;C+=1)g(_[C]);a=!0}},o(S){d(l.$$.fragment,S),d(s.$$.fragment,S),d(u.$$.fragment,S),_=_.filter(Boolean);for(let C=0;C<_.length;C+=1)d(_[C]);a=!1},d(S){S&&(m(e),m(t),m(n),m(o),m(f),m(i)),w(l),c&&c.d(S),w(s,S),w(u,S),Qe(_,S)}}}function Gr(r){let e;return{c(){e=v("Measure lines")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function qr(r){let e;return{c(){e=v("Stop measuring")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Kn(r){let e,l,t=r[2].toFixed(2)+"",n,s;return{c(){e=T("p"),l=v("Length: "),n=v(t),s=v(" meters")},m(o,u){p(o,e,u),h(e,l),h(e,n),h(e,s)},p(o,u){u&4&&t!==(t=o[2].toFixed(2)+"")&&G(n,t)},d(o){o&&m(e)}}}function zr(r){let e;return{c(){e=T("ul"),e.innerHTML=`
  • Click + on the map to place a new waypoint
  • Click and drag + an existing waypoint to move it
  • Click + an existing waypoint to delete it
  • Press Escape + to exit this mode
  • `},m(l,t){p(l,e,t)},p:ee,d(l){l&&m(e)}}}function Hr(r){let e,l;return{c(){e=T("span"),l=I(),z(e,"class","dot svelte-1tzt432")},m(t,n){p(t,e,n),p(t,l,n)},p:ee,d(t){t&&(m(e),m(l))}}}function Xn(r){let e,l,t;function n(u){r[7](u,r[11],r[12],r[13])}function s(){return r[8](r[13])}let o={draggable:!0,$$slots:{default:[Hr]},$$scope:{ctx:r}};return r[11]!==void 0&&(o.lngLat=r[11]),e=new rr({props:o}),H.push(()=>E(e,"lngLat",n)),e.$on("click",s),{c(){b(e.$$.fragment)},m(u,f){k(e,u,f),t=!0},p(u,f){r=u;const i={};f&16384&&(i.$$scope={dirty:f,ctx:r}),!l&&f&1&&(l=!0,i.lngLat=r[11],B(()=>l=!1)),e.$set(i)},i(u){t||(g(e.$$.fragment,u),t=!0)},o(u){d(e.$$.fragment,u),t=!1},d(u){w(e,u)}}}function Er(r){let e,l;const t=[q("measurement-line"),{paint:{"line-color":Ve.measuringLine,"line-width":5}}];let n={};for(let s=0;s{i[_]=null}),ue(),l=i[e],l?l.p(c,$):(l=i[e]=f[e](c),l.c()),g(l,1),l.m(t.parentNode,t));const y={};$&1&&(y.data=c[0].length<2?An():fn(c[0])),$&16384&&(y.$$scope={dirty:$,ctx:c}),n.$set(y)},i(c){s||(g(l),g(n.$$.fragment,c),s=!0)},o(c){d(l),d(n.$$.fragment,c),s=!1},d(c){c&&m(t),i[e].d(c),w(n,c),o=!1,u()}}}function Ur(r,e,l){let t,n=!1,s=[];function o(y){return y.length<2?null:1e3*sr(fn(y),{units:"kilometers"})}function u(y){l(0,s=[...s,y.detail.lngLat.toArray()])}function f(){l(1,n=!1),l(0,s=[])}function i(y){n&&y.key==="Escape"&&(y.stopPropagation(),f())}function a(y){s.splice(y,1),l(0,s)}function c(y,S,C,O){C[O]=y,l(0,s)}const $=y=>a(y),_=()=>l(1,n=!0);return r.$$.update=()=>{r.$$.dirty&1&&l(2,t=o(s))},[s,n,t,u,f,i,a,c,$,_]}class Wr extends K{constructor(e){super(),X(this,e,Ur,Br,V,{})}}const ne={education:{schools:"#007DBB",colleges:"maroon",universities:"navy"},hospitals:"#B73D25",mrn:"#781400",srn:"#006478",national_cycle_network:"#640078",sports_spaces:"#013220",parliamentary_constituencies:"#006E59",wards:"purple",combined_authorities:"cyan",local_authority_districts:"orange",local_planning_authorities:"red",bus_route_with_lane:"#9362BA",bus_route_without_lane:"#C2A6D8",trams:"black",signalized_crossing:"green",other_crossing:"black",cycle_paths:{track:"#0000FF",lane:"#009FEF",shared_use_segregated:"#FF9900",shared_use_unsegregated:"#E7E700"},sequential_low_to_high:["#CDE594","#80C6A3","#1F9EB7","#186290","#080C54"],gradient_flat_to_steep:["#267300","#FFAA00","#E60000","#A80000","#730000","#000000"]},De=["interpolate",["exponential",1.6],["zoom"],3,1,7,2,18,20];function Yr(r){let e;return{c(){e=v(`Open Government License + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Jr(r){let e,l,t,n,s;return t=new te({props:{href:"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",$$slots:{default:[Yr]},$$scope:{ctx:r}}}),{c(){e=T("p"),l=v("License: "),b(t.$$.fragment),n=v(`. Contains OS data © Crown copyright and database right + 2023.`)},m(o,u){p(o,e,u),h(e,l),k(t,e,null),h(e,n),s=!0},p(o,[u]){const f={};u&1&&(f.$$scope={dirty:u,ctx:o}),t.$set(f)},i(o){s||(g(t.$$.fragment,o),s=!0)},o(o){d(t.$$.fragment,o),s=!1},d(o){o&&m(e),w(t)}}}class Te extends K{constructor(e){super(),X(this,e,null,Jr,V,{})}}function xn(r,e,l){const t=r.slice();return t[2]=e[l],t}function el(r,e,l){const t=r.slice();return t[5]=e[l],t}function tl(r){let e,l;return{c(){e=T("span"),l=v(`  + `),me(e,"background",r[5]),me(e,"width","100%"),me(e,"border","1px solid black")},m(t,n){p(t,e,n),h(e,l)},p(t,n){n&1&&me(e,"background",t[5])},d(t){t&&m(e)}}}function nl(r){let e,l=r[2]+"",t;return{c(){e=T("span"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&2&&l!==(l=n[2]+"")&&G(t,l)},d(n){n&&m(e)}}}function Vr(r){let e,l,t,n=we(r[0]),s=[];for(let f=0;f{"colorScale"in s&&l(0,t=s.colorScale),"limits"in s&&l(1,n=s.limits)},[t,n]}class Ge extends K{constructor(e){super(),X(this,e,Qr,Vr,V,{colorScale:0,limits:1})}}function he(r){let e=new URLSearchParams(window.location.search).has(r),l=Ae(e);return l.subscribe(t=>{let n=new URL(window.location.href);t?n.searchParams.set(r,"1"):n.searchParams.delete(r),window.history.replaceState(null,"",n.toString())}),l}function kt(r,e,l,t){let n=e,s=new URLSearchParams(window.location.search).get(r);if(s!=null)try{n=t(s)}catch(u){console.warn(`Parsing URL parameter ${r}=${s} failed, using default value: ${u}`)}let o=Ae(n);return o.subscribe(u=>{let f=new URL(window.location.href),i=l(u);i==null?f.searchParams.delete(r):f.searchParams.set(r,i),window.history.replaceState(null,"",f.toString())}),o}function ll(r){const e=r[14].OA21CD;r[15]=e;const l=r[14][r[3].kind];r[16]=l}function Zr(r){let e;return{c(){e=v("Percent of households with a car")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Kr(r){let e;return{c(){e=v(`NOMIS TS045 + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Xr(r){let e;return{c(){e=v(`ONS Geography + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function xr(r){let e;return{c(){e=v(`Open Government License + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function eo(r){let e,l,t,n,s,o,u,f,i,a,c,$;return t=new te({props:{href:"https://www.nomisweb.co.uk/sources/census_2021_bulk",$$slots:{default:[Kr]},$$scope:{ctx:r}}}),s=new te({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::output-areas-2021-boundaries-ew-bgc/explore",$$slots:{default:[Xr]},$$scope:{ctx:r}}}),a=new te({props:{href:"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",$$slots:{default:[xr]},$$scope:{ctx:r}}}),{c(){e=T("p"),l=v("Car/van availability data is from the 2021 census, via "),b(t.$$.fragment),n=v(". Output area boundaries from "),b(s.$$.fragment),o=v("."),u=I(),f=T("p"),i=v("License: "),b(a.$$.fragment),c=v(`. Contains OS data © Crown copyright and database + right 2023.`)},m(_,y){p(_,e,y),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),p(_,u,y),p(_,f,y),h(f,i),k(a,f,null),h(f,c),$=!0},p(_,y){const S={};y&131072&&(S.$$scope={dirty:y,ctx:_}),t.$set(S);const C={};y&131072&&(C.$$scope={dirty:y,ctx:_}),s.$set(C);const O={};y&131072&&(O.$$scope={dirty:y,ctx:_}),a.$set(O)},i(_){$||(g(t.$$.fragment,_),g(s.$$.fragment,_),g(a.$$.fragment,_),$=!0)},o(_){d(t.$$.fragment,_),d(s.$$.fragment,_),d(a.$$.fragment,_),$=!1},d(_){_&&(m(e),m(u),m(f)),w(t),w(s),w(a)}}}function to(r){let e,l,t;return l=new $e({props:{$$slots:{default:[eo]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function sl(r){let e,l;return e=new Ge({props:{colorScale:r[4],limits:ft(r[3].kind)}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&8&&(s.limits=ft(t[3].kind)),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function no(r){let e;return{c(){e=v("Average cars per household")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function lo(r){let e;return{c(){e=v(`NOMIS TS045 + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function so(r){let e;return{c(){e=v(`ONS Geography + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ro(r){let e;return{c(){e=v(`Open Government License + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function oo(r){let e,l,t,n,s,o,u,f,i,a,c,$,_,y;return s=new te({props:{href:"https://www.nomisweb.co.uk/sources/census_2021_bulk",$$slots:{default:[lo]},$$scope:{ctx:r}}}),u=new te({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::output-areas-2021-boundaries-ew-bgc/explore",$$slots:{default:[so]},$$scope:{ctx:r}}}),$=new te({props:{href:"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",$$slots:{default:[ro]},$$scope:{ctx:r}}}),{c(){e=T("p"),e.textContent=`Where the census counts "3 or more cars or vans", the average shown here + assumes 3.`,l=I(),t=T("p"),n=v("Car/van availability data is from the 2021 census, via "),b(s.$$.fragment),o=v(". Output area boundaries from "),b(u.$$.fragment),f=v("."),i=I(),a=T("p"),c=v("License: "),b($.$$.fragment),_=v(`. Contains OS data © Crown copyright and database + right 2023.`)},m(S,C){p(S,e,C),p(S,l,C),p(S,t,C),h(t,n),k(s,t,null),h(t,o),k(u,t,null),h(t,f),p(S,i,C),p(S,a,C),h(a,c),k($,a,null),h(a,_),y=!0},p(S,C){const O={};C&131072&&(O.$$scope={dirty:C,ctx:S}),s.$set(O);const F={};C&131072&&(F.$$scope={dirty:C,ctx:S}),u.$set(F);const R={};C&131072&&(R.$$scope={dirty:C,ctx:S}),$.$set(R)},i(S){y||(g(s.$$.fragment,S),g(u.$$.fragment,S),g($.$$.fragment,S),y=!0)},o(S){d(s.$$.fragment,S),d(u.$$.fragment,S),d($.$$.fragment,S),y=!1},d(S){S&&(m(e),m(l),m(t),m(i),m(a)),w(s),w(u),w($)}}}function io(r){let e,l,t;return l=new $e({props:{$$slots:{default:[oo]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function rl(r){let e,l;return e=new Ge({props:{colorScale:r[4],limits:ft(r[3].kind)}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&8&&(s.limits=ft(t[3].kind)),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function fo(r){let e;return{c(){e=v("Population density")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ao(r){let e;return{c(){e=v(`NOMIS TS006 + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function uo(r){let e;return{c(){e=v(`ONS Geography + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function co(r){let e,l,t,n,s,o,u,f,i;return t=new te({props:{href:"https://www.nomisweb.co.uk/sources/census_2021_bulk",$$slots:{default:[ao]},$$scope:{ctx:r}}}),s=new te({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::output-areas-2021-boundaries-ew-bgc/explore",$$slots:{default:[uo]},$$scope:{ctx:r}}}),f=new Te({}),{c(){e=T("p"),l=v("Population density data is from the 2021 census, via "),b(t.$$.fragment),n=v(". Output area boundaries from "),b(s.$$.fragment),o=v("."),u=I(),b(f.$$.fragment)},m(a,c){p(a,e,c),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),p(a,u,c),k(f,a,c),i=!0},p(a,c){const $={};c&131072&&($.$$scope={dirty:c,ctx:a}),t.$set($);const _={};c&131072&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){i||(g(t.$$.fragment,a),g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(m(e),m(u)),w(t),w(s),w(f,a)}}}function $o(r){let e,l,t;return l=new $e({props:{$$slots:{default:[co]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function ol(r){let e,l,t,n;return t=new Ge({props:{colorScale:r[4],limits:ft(r[3].kind).map(il)}}),{c(){e=T("p"),e.textContent="(people per square kilometres)",l=I(),b(t.$$.fragment)},m(s,o){p(s,e,o),p(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&8&&(u.limits=ft(s[3].kind).map(il)),t.$set(u)},i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(m(e),m(l)),w(t,s)}}}function po(r){let e,l,t,n=r[16].toLocaleString()+"",s,o,u=r[15]+"",f;return{c(){e=T("p"),l=v("There are "),t=T("b"),s=v(n),o=v(` + people per square kilometre in `),f=v(u)},m(i,a){p(i,e,a),h(e,l),h(e,t),h(t,s),h(e,o),h(e,f)},p(i,a){a&16392&&n!==(n=i[16].toLocaleString()+"")&&G(s,n),a&16384&&u!==(u=i[15]+"")&&G(f,u)},d(i){i&&m(e)}}}function mo(r){let e,l,t=r[15]+"",n,s,o,u=r[16]+"",f,i;return{c(){e=T("p"),l=v("Households in "),n=v(t),s=v(` have an average of + `),o=T("b"),f=v(u),i=v(` + cars`)},m(a,c){p(a,e,c),h(e,l),h(e,n),h(e,s),h(e,o),h(o,f),h(e,i)},p(a,c){c&16384&&t!==(t=a[15]+"")&&G(n,t),c&16392&&u!==(u=a[16]+"")&&G(f,u)},d(a){a&&m(e)}}}function _o(r){let e,l,t=r[16]+"",n,s,o,u=r[15]+"",f,i;return{c(){e=T("p"),l=T("b"),n=v(t),s=v("%"),o=v(` + of households in `),f=v(u),i=v(" have 1 or more cars")},m(a,c){p(a,e,c),h(e,l),h(l,n),h(l,s),h(e,o),h(e,f),h(e,i)},p(a,c){c&16392&&t!==(t=a[16]+"")&&G(n,t),c&16384&&u!==(u=a[15]+"")&&G(f,u)},d(a){a&&m(e)}}}function go(r){ll(r);let e;function l(s,o){return s[3].kind=="percent_households_with_car"?_o:s[3].kind=="average_cars_per_household"?mo:po}let t=l(r),n=t(r);return{c(){n.c(),e=ve()},m(s,o){n.m(s,o),p(s,e,o)},p(s,o){ll(s),t===(t=l(s))&&n?n.p(s,o):(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},d(s){s&&m(e),n.d(s)}}}function ho(r){let e,l;return e=new ce({props:{$$slots:{default:[go,({props:t})=>({14:t}),({props:t})=>t?16384:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&147464&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function bo(r){let e,l,t,n;const s=[q(He),{sourceLayer:He},{paint:{"fill-color":de(["get",r[3].kind],ft(r[3].kind),r[4]),"fill-opacity":le(.5,.7)}},{layout:{visibility:r[3].kind!=""?"visible":"none"}},{eventsIfTopMost:!0},{manageHoverState:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[ho]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",S)),e.$on("change",r[8]);let O=r[3].kind=="percent_households_with_car"&&sl(r);function F(L){r[9](L)}let R={$$slots:{right:[io],default:[no]},$$scope:{ctx:r}};r[1]!==void 0&&(R.checked=r[1]),s=new ie({props:R}),H.push(()=>E(s,"checked",F)),s.$on("change",r[10]);let j=r[3].kind=="average_cars_per_household"&&rl(r);function M(L){r[11](L)}let N={$$slots:{right:[$o],default:[fo]},$$scope:{ctx:r}};r[2]!==void 0&&(N.checked=r[2]),i=new ie({props:N}),H.push(()=>E(i,"checked",M)),i.$on("change",r[12]);let P=r[3].kind=="population_density"&&ol(r);return _=new _e({props:{url:`pmtiles://${pe()}/v1/${He}.pmtiles`,$$slots:{default:[bo]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),O&&O.c(),n=I(),b(s.$$.fragment),u=I(),j&&j.c(),f=I(),b(i.$$.fragment),c=I(),P&&P.c(),$=I(),b(_.$$.fragment)},m(L,D){k(e,L,D),p(L,t,D),O&&O.m(L,D),p(L,n,D),k(s,L,D),p(L,u,D),j&&j.m(L,D),p(L,f,D),k(i,L,D),p(L,c,D),P&&P.m(L,D),p(L,$,D),k(_,L,D),y=!0},p(L,[D]){const W={};D&131072&&(W.$$scope={dirty:D,ctx:L}),!l&&D&1&&(l=!0,W.checked=L[0],B(()=>l=!1)),e.$set(W),L[3].kind=="percent_households_with_car"?O?(O.p(L,D),D&8&&g(O,1)):(O=sl(L),O.c(),g(O,1),O.m(n.parentNode,n)):O&&(ae(),d(O,1,1,()=>{O=null}),ue());const Q={};D&131072&&(Q.$$scope={dirty:D,ctx:L}),!o&&D&2&&(o=!0,Q.checked=L[1],B(()=>o=!1)),s.$set(Q),L[3].kind=="average_cars_per_household"?j?(j.p(L,D),D&8&&g(j,1)):(j=rl(L),j.c(),g(j,1),j.m(f.parentNode,f)):j&&(ae(),d(j,1,1,()=>{j=null}),ue());const A={};D&131072&&(A.$$scope={dirty:D,ctx:L}),!a&&D&4&&(a=!0,A.checked=L[2],B(()=>a=!1)),i.$set(A),L[3].kind=="population_density"?P?(P.p(L,D),D&8&&g(P,1)):(P=ol(L),P.c(),g(P,1),P.m($.parentNode,$)):P&&(ae(),d(P,1,1,()=>{P=null}),ue());const Y={};D&131080&&(Y.$$scope={dirty:D,ctx:L}),_.$set(Y)},i(L){y||(g(e.$$.fragment,L),g(O),g(s.$$.fragment,L),g(j),g(i.$$.fragment,L),g(P),g(_.$$.fragment,L),y=!0)},o(L){d(e.$$.fragment,L),d(O),d(s.$$.fragment,L),d(j),d(i.$$.fragment,L),d(P),d(_.$$.fragment,L),y=!1},d(L){L&&(m(t),m(n),m(u),m(f),m(c),m($)),w(e,L),O&&O.d(L),w(s,L),j&&j.d(L),w(i,L),P&&P.d(L),w(_,L)}}}let He="census_output_areas";function wo(r){return r.show?r.kind:null}function vo(r){return{show:!0,kind:r}}function ft(r){return r=="percent_households_with_car"?[0,20,40,60,80,100]:r=="average_cars_per_household"?[0,.5,1,1.5,2,2.5]:[0,4700,13e3,33e3,94e3,198e4]}const il=r=>r.toLocaleString();function yo(r,e,l){let t,n=ne.sequential_low_to_high,o=kt(He,{show:!1,kind:""},wo,vo);x(r,o,O=>l(3,t=O));let u=t.kind=="percent_households_with_car",f=t.kind=="average_cars_per_household",i=t.kind=="population_density";function a(O){let F=O.detail.features[0].properties.OA21CD;t.kind=="percent_households_with_car"||t.kind=="average_cars_per_household"?window.open(`https://www.ons.gov.uk/census/maps/choropleth/housing/number-of-cars-or-vans/number-of-cars-5a/no-cars-or-vans-in-household?oa=${F}`,"_blank"):window.open(`https://www.ons.gov.uk/census/maps/choropleth/population/population-density/population-density/persons-per-square-kilometre?oa=${F}`,"_blank")}function c(O){u=O,l(0,u)}const $=()=>{l(1,f=!1),l(2,i=!1)};function _(O){f=O,l(1,f)}const y=()=>{l(0,u=!1),l(2,i=!1)};function S(O){i=O,l(2,i)}const C=()=>{l(0,u=!1),l(1,f=!1)};return r.$$.update=()=>{r.$$.dirty&7&&(u?(Re(o,t.show=!0,t),Re(o,t.kind="percent_households_with_car",t)):f?(Re(o,t.show=!0,t),Re(o,t.kind="average_cars_per_household",t)):i?(Re(o,t.show=!0,t),Re(o,t.kind="population_density",t)):(Re(o,t.show=!1,t),Re(o,t.kind="",t)))},[u,f,i,t,n,o,a,c,$,_,y,S,C]}class So extends K{constructor(e){super(),X(this,e,yo,ko,V,{})}}function Co(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + Combined authorities`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function To(r){let e;return{c(){e=v(`ONS Geography + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Lo(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::combined-authorities-december-2022-boundaries-en-buc/explore",$$slots:{default:[To]},$$scope:{ctx:r}}}),o=new Te({}),{c(){e=T("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of December 2022."),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function Io(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Lo]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Mo(r){let e,l=r[4].name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&m(e)}}}function No(r){let e,l;return e=new ce({props:{$$slots:{default:[Mo,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Oo(r){let e,l,t,n;const s=[q(St),{paint:{"fill-color":r[1],"fill-opacity":le(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[No]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new bt({props:{data:`${pe()}/v1/${St}.geojson`,$$slots:{default:[Oo]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let St="combined_authorities";function jo(r){window.open(`https://www.ons.gov.uk/visualisations/areas/${r.detail.features[0].properties.CAUTH22CD}`,"_blank")}function Do(r,e,l){let t,n=ne.combined_authorities,s=he(St);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Ro extends K{constructor(e){super(),X(this,e,Do,Po,V,{})}}function Ao(r){let e;return{c(){e=v("Indices of Multiple Deprivation")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Fo(r){let e;return{c(){e=v(`DLUCH GIS + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Go(r){let e;return{c(){e=v(`here + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function qo(r){let e,l,t,n,s,o,u,f,i;return t=new te({props:{href:"https://data-communities.opendata.arcgis.com/datasets/communities::indices-of-multiple-deprivation-imd-2019-1/explore",$$slots:{default:[Fo]},$$scope:{ctx:r}}}),s=new te({props:{href:"http://dclgapps.communities.gov.uk/imd/iod_index.html",$$slots:{default:[Go]},$$scope:{ctx:r}}}),f=new Te({}),{c(){e=T("p"),l=v("The 2019 English IMD scores come from "),b(t.$$.fragment),n=v(`. Note the LSOAs identified are from the 2011 census. A + detailed breakdown of the score across different categories can be found `),b(s.$$.fragment),o=v("."),u=I(),b(f.$$.fragment)},m(a,c){p(a,e,c),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),p(a,u,c),k(f,a,c),i=!0},p(a,c){const $={};c&64&&($.$$scope={dirty:c,ctx:a}),t.$set($);const _={};c&64&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){i||(g(t.$$.fragment,a),g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(m(e),m(u)),w(t),w(s),w(f,a)}}}function zo(r){let e,l,t;return l=new $e({props:{$$slots:{default:[qo]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function fl(r){let e,l;return e=new Ge({props:{colorScale:r[1],limits:["Least deprived","Most deprived"]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ho(r){let e,l=r[5].LSOA11CD+"",t,n,s,o=r[5].score+"",u,f,i,a,c,$=r[5].rank.toLocaleString()+"",_,y;return{c(){e=T("p"),t=v(l),n=v(` has an IMD score of + `),s=T("b"),u=v(o),f=I(),i=T("p"),a=v("Rank: "),c=T("b"),_=v($),y=v(` + / 32,844 LSOAs`)},m(S,C){p(S,e,C),h(e,t),h(e,n),h(e,s),h(s,u),p(S,f,C),p(S,i,C),h(i,a),h(i,c),h(c,_),h(i,y)},p(S,C){C&32&&l!==(l=S[5].LSOA11CD+"")&&G(t,l),C&32&&o!==(o=S[5].score+"")&&G(u,o),C&32&&$!==($=S[5].rank.toLocaleString()+"")&&G(_,$)},d(S){S&&(m(e),m(f),m(i))}}}function Eo(r){let e,l;return e=new ce({props:{$$slots:{default:[Ho,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Bo(r){let e,l,t,n;const s=[q(Ee),{sourceLayer:Ee},{paint:{"fill-color":de(["-",10,["get","decile"]],r[2],r[1]),"fill-opacity":le(.5,.7)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let o={$$slots:{default:[Eo]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",u));let i=r[0]&&fl(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${Ee}.pmtiles`,$$slots:{default:[Bo]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&64&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=fl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ee="imd";function Wo(r,e,l){let t,n=ne.sequential_low_to_high,s=[0,2,4,6,8,10],o=he(Ee);x(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class Yo extends K{constructor(e){super(),X(this,e,Wo,Uo,V,{})}}function Jo(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + Local Authority Districts`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function Vo(r){let e;return{c(){e=v(`ONS Geography + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Qo(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://geoportal.statistics.gov.uk/maps/79a4e87783be4b6bbb96ddad6dda52a3",$$slots:{default:[Vo]},$$scope:{ctx:r}}}),o=new Te({}),{c(){e=T("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of January 2024."),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function Zo(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Qo]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Ko(r){let e,l=r[4].name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&m(e)}}}function Xo(r){let e,l;return e=new ce({props:{$$slots:{default:[Ko,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function xo(r){let e,l,t,n;const s=[q(Ct),{paint:{"fill-color":r[1],"fill-opacity":le(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[Xo]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new bt({props:{data:`${pe()}/v1/${Ct}.geojson`,$$slots:{default:[xo]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Ct="local_authority_districts";function ti(r){window.open(`https://www.ons.gov.uk/visualisations/areas/${r.detail.features[0].properties.LAD23CD}`,"_blank")}function ni(r,e,l){let t,n=ne.local_authority_districts,s=he(Ct);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class li extends K{constructor(e){super(),X(this,e,ni,ei,V,{})}}function si(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + Local Planning Authorities`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function ri(r){let e;return{c(){e=v(`local authority + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function oi(r){let e;return{c(){e=v(`national park authorit + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ii(r){let e;return{c(){e=v(`development corporation + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function fi(r){let e;return{c(){e=v("this map")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ai(r){let e;return{c(){e=v(`planning.data.gov.uk + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ui(r){let e,l,t,n,s,o,u,f,i,a,c,$,_,y,S,C,O,F,R,j,M,N;return t=new te({props:{href:"https://www.planning.data.gov.uk/dataset/local-authority",$$slots:{default:[ri]},$$scope:{ctx:r}}}),s=new te({props:{href:"https://www.planning.data.gov.uk/dataset/national-park-authority",$$slots:{default:[oi]},$$scope:{ctx:r}}}),u=new te({props:{href:"https://www.planning.data.gov.uk/dataset/development-corporation",$$slots:{default:[ii]},$$scope:{ctx:r}}}),_=new te({props:{href:"https://www.planning.data.gov.uk/map/?dataset=local-planning-authority",$$slots:{default:[fi]},$$scope:{ctx:r}}}),F=new te({props:{href:"https://www.planning.data.gov.uk/dataset/local-planning-authority",$$slots:{default:[ai]},$$scope:{ctx:r}}}),M=new Te({}),{c(){e=T("p"),l=v("LPAs may be a "),b(t.$$.fragment),n=v(", "),b(s.$$.fragment),o=v("y, or "),b(u.$$.fragment),f=v("."),i=I(),a=T("p"),c=T("strong"),$=v(`Note there are overlapping LPAs near Northhamptonshire. Only one + authority name is shown when hovering. Use `),b(_.$$.fragment),y=v(" to get more details."),S=I(),C=T("p"),O=v("Data from ONS Geography via "),b(F.$$.fragment),R=v(", as of November 2022."),j=I(),b(M.$$.fragment)},m(P,L){p(P,e,L),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),k(u,e,null),h(e,f),p(P,i,L),p(P,a,L),h(a,c),h(c,$),k(_,c,null),h(c,y),p(P,S,L),p(P,C,L),h(C,O),k(F,C,null),h(C,R),p(P,j,L),k(M,P,L),N=!0},p(P,L){const D={};L&32&&(D.$$scope={dirty:L,ctx:P}),t.$set(D);const W={};L&32&&(W.$$scope={dirty:L,ctx:P}),s.$set(W);const Q={};L&32&&(Q.$$scope={dirty:L,ctx:P}),u.$set(Q);const A={};L&32&&(A.$$scope={dirty:L,ctx:P}),_.$set(A);const Y={};L&32&&(Y.$$scope={dirty:L,ctx:P}),F.$set(Y)},i(P){N||(g(t.$$.fragment,P),g(s.$$.fragment,P),g(u.$$.fragment,P),g(_.$$.fragment,P),g(F.$$.fragment,P),g(M.$$.fragment,P),N=!0)},o(P){d(t.$$.fragment,P),d(s.$$.fragment,P),d(u.$$.fragment,P),d(_.$$.fragment,P),d(F.$$.fragment,P),d(M.$$.fragment,P),N=!1},d(P){P&&(m(e),m(i),m(a),m(S),m(C),m(j)),w(t),w(s),w(u),w(_),w(F),w(M,P)}}}function ci(r){let e,l,t;return l=new $e({props:{$$slots:{default:[ui]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function $i(r){let e,l=r[4].name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&m(e)}}}function pi(r){let e,l;return e=new ce({props:{$$slots:{default:[$i,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function mi(r){let e,l,t,n;const s=[q(Be),{sourceLayer:Be},{paint:{"fill-color":r[1],"fill-opacity":le(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let o={$$slots:{default:[pi]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Be}.pmtiles`,$$slots:{default:[mi]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Be="local_planning_authorities";function gi(r,e,l){let t,n=ne.local_planning_authorities,s=he(Be);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class di extends K{constructor(e){super(),X(this,e,gi,_i,V,{})}}function hi(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + Parliamentary constituencies`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function bi(r){let e;return{c(){e=v(`Ordnance Survey Boundary-Line + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ki(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://www.ordnancesurvey.co.uk/products/boundary-line",$$slots:{default:[bi]},$$scope:{ctx:r}}}),o=new Te({}),{c(){e=T("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of May 2023."),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function wi(r){let e,l,t;return l=new $e({props:{$$slots:{default:[ki]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function vi(r){let e,l=r[4].Name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].Name+"")&&G(t,l)},d(n){n&&m(e)}}}function yi(r){let e,l;return e=new ce({props:{$$slots:{default:[vi,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Si(r){let e,l,t,n;const s=[q(Ue),{sourceLayer:Ue},{paint:{"fill-color":r[1],"fill-opacity":le(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[yi]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Ue}.pmtiles`,$$slots:{default:[Si]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Ue="parliamentary_constituencies";function Ti(r){let e=r.detail.features[0].properties.Name;e=e.replace(/ Boro Const$/,""),e=e.replace(/ Co Const$/,""),e=encodeURIComponent(e),window.open(`https://members.parliament.uk/members/Commons?SearchText=${e}`,"_blank")}function Li(r,e,l){let t,n=ne.parliamentary_constituencies,s=he(Ue);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Ii extends K{constructor(e){super(),X(this,e,Li,Ci,V,{})}}function Mi(r){let e;return{c(){e=v("Pollution")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ni(r){let e;return{c(){e=v(`DEFRA + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Oi(r){let e,l,t,n,s,o,u,f,i;return t=new te({props:{href:"https://uk-air.defra.gov.uk/data/wms-services",$$slots:{default:[Ni]},$$scope:{ctx:r}}}),f=new Te({}),{c(){e=T("p"),l=v("Most layers show air quality data from "),b(t.$$.fragment),n=v(`. The measurements are annual means, in units of + µgm + `),s=T("sup"),s.textContent="3",o=v(` + . Note the particulate matter layers are not corrected for natural sources.`),u=I(),b(f.$$.fragment)},m(a,c){p(a,e,c),h(e,l),k(t,e,null),h(e,n),h(e,s),h(e,o),p(a,u,c),k(f,a,c),i=!0},p(a,c){const $={};c&4096&&($.$$scope={dirty:c,ctx:a}),t.$set($)},i(a){i||(g(t.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(m(e),m(u)),w(t),w(f,a)}}}function Pi(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Oi]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&4096&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function al(r){let e,l,t,n,s=r[3](r[0].pollutant)+"",o,u,f,i,a,c,$,_,y,S,C,O,F;function R(M){r[6](M)}let j={label:"Pollutant",choices:[["PM25_viridis","Background PM2.5"],["PM10_viridis","Background PM10"],["NOx_viridis","Background NOx"],["PM25Roads_viridis","Roadside PM2.5"],["PM10Roads_viridis","Roadside PM10"],["NOxRoads_viridis","Roadside NOx"]]};return r[0].pollutant!==void 0&&(j.value=r[0].pollutant),e=new dt({props:j}),H.push(()=>E(e,"value",R)),{c(){b(e.$$.fragment),t=I(),n=T("p"),o=v(s),u=I(),f=T("div"),i=T("label"),a=v(`Opacity + `),c=T("input"),$=I(),_=T("img"),z(c,"type","range"),z(c,"min","0"),z(c,"max","100"),Kt(_.src,y=r[4](r[0].pollutant))||z(_,"src",y),z(_,"width",150),z(_,"alt",S=`Legend for ${r[0].pollutant} layer`)},m(M,N){k(e,M,N),p(M,t,N),p(M,n,N),h(n,o),p(M,u,N),p(M,f,N),h(f,i),h(i,a),h(i,c),Je(c,r[0].opacity),p(M,$,N),p(M,_,N),C=!0,O||(F=[tt(c,"change",r[7]),tt(c,"input",r[7])],O=!0)},p(M,N){const P={};!l&&N&1&&(l=!0,P.value=M[0].pollutant,B(()=>l=!1)),e.$set(P),(!C||N&1)&&s!==(s=M[3](M[0].pollutant)+"")&&G(o,s),N&1&&Je(c,M[0].opacity),(!C||N&1&&!Kt(_.src,y=M[4](M[0].pollutant)))&&z(_,"src",y),(!C||N&1&&S!==(S=`Legend for ${M[0].pollutant} layer`))&&z(_,"alt",S)},i(M){C||(g(e.$$.fragment,M),C=!0)},o(M){d(e.$$.fragment,M),C=!1},d(M){M&&(m(t),m(n),m(u),m(f),m($),m(_)),w(e,M),O=!1,Ds(F)}}}function ji(r){let e,l;const t=[q("pollution"),{paint:{"raster-opacity":r[0].opacity/100}},{layout:{visibility:r[0].show?"visible":"none"}}];let n={};for(let s=0;sE(e,"checked",u));let i=r[0].show&&al(r);return s=new Nr({props:{tiles:[r[1]],tileSize:256,$$slots:{default:[ji]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&4096&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0].show,B(()=>l=!1)),e.$set($),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=al(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&2&&(_.tiles=[a[1]]),c&4097&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}function Ri(r){return r.show?`${r.pollutant}/${r.opacity}`:null}function Ai(r){let[e,l]=r.split("/");return{show:!0,pollutant:e,opacity:parseInt(l)}}function Fi(r,e,l){let t,n,s,u=kt("pollution",{show:!1,pollutant:"PM25_viridis",opacity:50},Ri,Ai);x(r,u,S=>l(0,s=S));function f(){return`https://ukair.maps.rcdo.co.uk/ukairserver/services/aq_amb_2022/${s.pollutant}/MapServer/WMSServer`}function i(S){return t[1]}function a(S){let C=new URLSearchParams({request:"GetMap",version:"1.3.0",format:"image/png",crs:"EPSG:3857",width:"256",height:"256",styles:"",layers:t[0]}).toString();return`${f()}?bbox={bbox-epsg-3857}&${C}`}function c(S){let C=new URLSearchParams({request:"GetLegendGraphic",version:"1.3.0",format:"image/png",layer:t[0]}).toString();return`${f()}?${C}`}function $(S){r.$$.not_equal(s.show,S)&&(s.show=S,u.set(s))}function _(S){r.$$.not_equal(s.pollutant,S)&&(s.pollutant=S,u.set(s))}function y(){s.opacity=Wt(this.value),u.set(s)}return r.$$.update=()=>{r.$$.dirty&1&&(t={NOx_viridis:["22","Data for 2022"],PM25_viridis:["21","Data for 2022"],PM10_viridis:["22","Data for 2022"],NOxRoads_viridis:["22","Data for 2022"],PM25Roads_viridis:["14","Data for 2022"],PM10Roads_viridis:["22","Data for 2022"]}[s.pollutant]),r.$$.dirty&1&&l(1,n=a(s.pollutant))},[s,n,u,i,c,$,_,y]}class Gi extends K{constructor(e){super(),X(this,e,Fi,Di,V,{})}}function qi(r){let e;return{c(){e=v("Road noise")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function zi(r){let e;return{c(){e=v(`DEFRA + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Hi(r){let e,l,t,n,s,o,u,f,i;return s=new te({props:{href:"https://environment.data.gov.uk/dataset/b9c6bf30-a02d-4378-94a0-2982de1bef86",$$slots:{default:[zi]},$$scope:{ctx:r}}}),f=new Te({}),{c(){e=T("p"),e.textContent=`This is the LAeq,16h dataset showing annual average noise levels in + units of decibels for the 16-hour period between 7am and 11pm. Only + roads in areas with at least 100,000 people are included.`,l=I(),t=T("p"),n=v("Data from June 2019, produced by "),b(s.$$.fragment),o=v(". See there for methodology details"),u=I(),b(f.$$.fragment)},m(a,c){p(a,e,c),p(a,l,c),p(a,t,c),h(t,n),k(s,t,null),h(t,o),p(a,u,c),k(f,a,c),i=!0},p(a,c){const $={};c&32&&($.$$scope={dirty:c,ctx:a}),s.$set($)},i(a){i||(g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(m(e),m(l),m(t),m(u)),w(s),w(f,a)}}}function Ei(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Hi]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function ul(r){let e,l;return e=new Ge({props:{colorScale:r[1],limits:["55","65","75",">"]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Bi(r){let e,l=r[4].noiseclass+"",t,n,s=cl(r[4].noiseclass)+"",o,u;return{c(){e=T("p"),t=v(l),n=v(" dB ("),o=v(s),u=v(")")},m(f,i){p(f,e,i),h(e,t),h(e,n),h(e,o),h(e,u)},p(f,i){i&16&&l!==(l=f[4].noiseclass+"")&&G(t,l),i&16&&s!==(s=cl(f[4].noiseclass)+"")&&G(o,s)},d(f){f&&m(e)}}}function Ui(r){let e,l;return e=new ce({props:{$$slots:{default:[Bi,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Wi(r){let e,l;const t=[q(Tt),{sourceLayer:Tt},{paint:{"fill-color":Ze(["get","noiseclass"],{"55.0-59.9":r[1][0],"60.0-64.9":r[1][0],"65.0-69.9":r[1][1],"70.0-74.9":r[1][1],">=75.0":r[1][2]},"red"),"fill-opacity":le(.5,.8)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[Ui]},$$scope:{ctx:r}};for(let s=0;s=75.0":s[1][2]},"red"),"fill-opacity":le(.5,.8)}},o&1&&{layout:{visibility:s[0]?"visible":"none"}},t[4],t[5]]):{};o&32&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){l||(g(e.$$.fragment,s),l=!0)},o(s){d(e.$$.fragment,s),l=!1},d(s){w(e,s)}}}function Yi(r){let e,l,t,n,s,o;function u(a){r[3](a)}let f={$$slots:{right:[Ei],default:[qi]},$$scope:{ctx:r}};r[0]!==void 0&&(f.checked=r[0]),e=new ie({props:f}),H.push(()=>E(e,"checked",u));let i=r[0]&&ul(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${Tt}.pmtiles`,$$slots:{default:[Wi]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&32&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=ul(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&33&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Tt="road_noise";function cl(r){return{"55.0-59.9":"Comfortable noise levels","60.0-64.9":"Comfortable noise levels","65.0-69.9":"Slightly noisy","70.0-74.9":"Slightly noisy",">=75.0":"Excessively noisy"}[r]}function Ji(r,e,l){let t,n=[ne.sequential_low_to_high[0],ne.sequential_low_to_high[2],ne.sequential_low_to_high[4]],s=he(Tt);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Vi extends K{constructor(e){super(),X(this,e,Ji,Yi,V,{})}}function Qi(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + Wards`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function Zi(r){let e;return{c(){e=v(`ONS Geography + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ki(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://geoportal.statistics.gov.uk/datasets/ons::wards-may-2023-boundaries-uk-bgc/explore",$$slots:{default:[Zi]},$$scope:{ctx:r}}}),o=new Te({}),{c(){e=T("p"),l=v("Data from "),b(t.$$.fragment),n=v(", as of May 2023."),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function Xi(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Ki]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function xi(r){let e,l=r[4].name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=n[4].name+"")&&G(t,l)},d(n){n&&m(e)}}}function ef(r){let e,l;return e=new ce({props:{$$slots:{default:[xi,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function tf(r){let e,l,t,n;const s=[q(We),{sourceLayer:We},{paint:{"fill-color":r[1],"fill-opacity":le(0,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let o={$$slots:{default:[ef]},$$scope:{ctx:r}};for(let i=0;iE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${We}.pmtiles`,$$slots:{default:[tf]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let We="wards";function lf(r){let e=encodeURIComponent(r.detail.features[0].properties.name);window.open(`https://www.google.com/search?q=${e}+councillor`,"_blank")}function sf(r,e,l){let t,n=ne.wards,s=he(We);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class rf extends K{constructor(e){super(),X(this,e,sf,nf,V,{})}}function of(r){let e;return{c(){e=v("Open Data Commons Open Database License")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ff(r){let e,l,t,n;return t=new te({props:{href:"https://www.openstreetmap.org/copyright",$$slots:{default:[of]},$$scope:{ctx:r}}}),{c(){e=T("p"),l=v("License: "),b(t.$$.fragment)},m(s,o){p(s,e,o),h(e,l),k(t,e,null),n=!0},p(s,[o]){const u={};o&1&&(u.$$scope={dirty:o,ctx:s}),t.$set(u)},i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&m(e),w(t)}}}class Ke extends K{constructor(e){super(),X(this,e,null,ff,V,{})}}function af(r){let e,l,t;return e=new Ce({props:{color:ne.bus_route_with_lane}}),{c(){b(e.$$.fragment),l=v(` + Bus routes`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function uf(r){let e;return{c(){e=v(`GTFS + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function cf(r){let e,l,t,n,s,o,u,f,i;return s=new te({props:{href:"https://gtfs.org",$$slots:{default:[uf]},$$scope:{ctx:r}}}),f=new Ke({}),{c(){e=T("p"),e.textContent=`This shows all roads with at least one bus route crossing them. It also + shows whether the road has a bus lane or not.`,l=I(),t=T("p"),n=v("Note this data is from OpenStreetMap (as of 9 August 2023), not "),b(s.$$.fragment),o=v(`, and doesn't include which routes are run or the + frequency of service.`),u=I(),b(f.$$.fragment)},m(a,c){p(a,e,c),p(a,l,c),p(a,t,c),h(t,n),k(s,t,null),h(t,o),p(a,u,c),k(f,a,c),i=!0},p(a,c){const $={};c&16&&($.$$scope={dirty:c,ctx:a}),s.$set($)},i(a){i||(g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(m(e),m(l),m(t),m(u)),w(s),w(f,a)}}}function $f(r){let e,l,t;return l=new $e({props:{$$slots:{default:[cf]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function pf(r){let e;return{c(){e=T("p"),e.textContent="At least one bus route crosses here, without any bus lanes"},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function mf(r){let e;return{c(){e=T("p"),e.textContent=`At least one bus route crosses here, with a bus lane in one or more + directions`},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function _f(r){let e;function l(s,o){return s[3].has_bus_lane?mf:pf}let t=l(r),n=t(r);return{c(){n.c(),e=ve()},m(s,o){n.m(s,o),p(s,e,o)},p(s,o){t!==(t=l(s))&&(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},d(s){s&&m(e),n.d(s)}}}function gf(r){let e,l;return e=new ce({props:{$$slots:{default:[_f,({props:t})=>({3:t}),({props:t})=>t?8:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&24&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function df(r){let e,l;const t=[q(Lt),{sourceLayer:Lt},{paint:{"line-color":["case",["boolean",["get","has_bus_lane"],!1],ne.bus_route_with_lane,ne.bus_route_without_lane],"line-width":5,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[gf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Lt}.pmtiles`,$$slots:{default:[df]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&16&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&17&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Lt="bus_routes";function bf(r,e,l){let t,n=he(Lt);x(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class kf extends K{constructor(e){super(),X(this,e,bf,hf,V,{})}}function $l(r){const e=Of(r[9]);r[10]=e[0],r[11]=e[1],r[12]=e[2]}function pl(r,e,l){const t=r.slice();return t[10]=e[l][0],t[13]=e[l][1],t[14]=e[l][2],t[15]=e,t[16]=l,t}function wf(r){let e;return{c(){e=v("Cycle paths")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function vf(r){let e,l,t,n,s,o,u,f;return u=new Ke({}),{c(){e=T("p"),e.textContent=`This shows different types of cycle path, according to OpenStreetMap (as + of 15 August 2023).`,l=I(),t=T("ul"),t.innerHTML=`
  • Separated tracks + include fully or partly segregated cycletracks alongside a carriageway, + stepped cycletracks, and tracks off the carriageway entirely. They're also + separated from foot traffic.
  • Unprotected lanes + are mandatory or advisory lanes on the carriageway, without any physical + protection. They do not included shared bus lanes.
  • Shared-use + paths are split between cycle and foot traffic, and are separated from + motor traffic somehow. There can be segregation between cyclists and pedestrians + or not.
  • `,n=I(),s=T("p"),s.textContent=`Note there are many known limitations with this layer. Data in + OpenStreetMap can be missing, mapped twice, or mapped incorrectly. Our + processing is also imperfect. You can click a segment to see full + OpenStreetMap data. Please do report issues with the classification or + data.`,o=I(),b(u.$$.fragment)},m(i,a){p(i,e,a),p(i,l,a),p(i,t,a),p(i,n,a),p(i,s,a),p(i,o,a),k(u,i,a),f=!0},p:ee,i(i){f||(g(u.$$.fragment,i),f=!0)},o(i){d(u.$$.fragment,i),f=!1},d(i){i&&(m(e),m(l),m(t),m(n),m(s),m(o)),w(u,i)}}}function yf(r){let e,l,t;return l=new $e({props:{$$slots:{default:[vf]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131072&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function ml(r){let e,l,t;return l=new lt({props:{$$slots:{default:[Cf]},$$scope:{ctx:r}}}),{c(){e=T("div"),b(l.$$.fragment),me(e,"border","1px solid black"),me(e,"padding","8px")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&131073&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Sf(r){let e,l,t=r[13]+"",n,s,o;return e=new Ce({props:{color:r[14]}}),{c(){b(e.$$.fragment),l=I(),n=v(t),s=I()},m(u,f){k(e,u,f),p(u,l,f),p(u,n,f),p(u,s,f),o=!0},p:ee,i(u){o||(g(e.$$.fragment,u),o=!0)},o(u){d(e.$$.fragment,u),o=!1},d(u){u&&(m(l),m(n),m(s)),w(e,u)}}}function _l(r){let e,l,t;function n(o){r[5](o,r[10])}let s={$$slots:{default:[Sf]},$$scope:{ctx:r}};return r[0][r[10]]!==void 0&&(s.checked=r[0][r[10]]),e=new ie({props:s}),H.push(()=>E(e,"checked",n)),{c(){b(e.$$.fragment)},m(o,u){k(e,o,u),t=!0},p(o,u){r=o;const f={};u&131072&&(f.$$scope={dirty:u,ctx:r}),!l&&u&5&&(l=!0,f.checked=r[0][r[10]],B(()=>l=!1)),e.$set(f)},i(o){t||(g(e.$$.fragment,o),t=!0)},o(o){d(e.$$.fragment,o),t=!1},d(o){w(e,o)}}}function Cf(r){let e,l,t=we(r[2]),n=[];for(let o=0;od(n[o],1,1,()=>{n[o]=null});return{c(){for(let o=0;o({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&131584&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function If(r){let e,l;const t=[q(It),{sourceLayer:It},{paint:{"line-color":Ze(["get","kind"],{track:ne.cycle_paths.track,lane:ne.cycle_paths.lane,shared_use_segregated:ne.cycle_paths.shared_use_segregated,shared_use_unsegregated:ne.cycle_paths.shared_use_unsegregated},"red"),"line-width":De,"line-opacity":le(1,.5)}},{layout:{visibility:r[0].show?"visible":"none"}},{filter:r[3](r[0])},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let n={$$slots:{default:[Lf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&ml(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${It}.pmtiles`,$$slots:{default:[If]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&131072&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0].show,B(()=>l=!1)),e.$set($),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=ml(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&131073&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let It="cycle_paths";function Nf(r){return{show:!0,track:r.includes("track"),lane:r.includes("lane"),shared_use_segregated:r.includes("shared_use_segregated"),shared_use_unsegregated:r.includes("shared_use_unsegregated")}}function Of(r){let e={track:"Separated track",lane:"Unprotected lane",shared_use_segregated:"Shared-use (segregated)",shared_use_unsegregated:"Shared-use (unsegregated)"}[r.kind],l={"one-way":"↑","two-way":"↕",unknown:""}[r.direction],t=r.width=="unknown"?"unknown":`${r.width} meters`;return[e,`${l} ${r.direction}`,t]}function Pf(r){window.open(`http://openstreetmap.org/way/${r.detail.features[0].properties.osm_id}`,"_blank")}function jf(r,e,l){let t,n=["track","lane","shared_use_segregated","shared_use_unsegregated"],s={show:!1,track:!0,lane:!0,shared_use_segregated:!0,shared_use_unsegregated:!0};function o($){return $.show?n.filter(_=>$[_]).join(","):null}let u=kt(It,s,o,Nf);x(r,u,$=>l(0,t=$));let f=[["track","Separated tracks",ne.cycle_paths.track],["lane","Unprotected lanes",ne.cycle_paths.lane],["shared_use_segregated","Shared-use (segregated)",ne.cycle_paths.shared_use_segregated],["shared_use_unsegregated","Shared-use (unsegregated)",ne.cycle_paths.shared_use_unsegregated]];function i($){let _=n.filter(y=>$[y]);return["in",["get","kind"],["literal",_]]}function a($){r.$$.not_equal(t.show,$)&&(t.show=$,u.set(t))}function c($,_){r.$$.not_equal(t[_],$)&&(t[_]=$,u.set(t))}return[t,u,f,i,a,c]}class Df extends K{constructor(e){super(),X(this,e,jf,Mf,V,{})}}function Rf(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + Major Road Network`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function Af(r){let e;return{c(){e=v(`Major Road Network + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ff(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://maps.dft.gov.uk/major-road-network/index.html",$$slots:{default:[Af]},$$scope:{ctx:r}}}),o=new Te({}),{c(){e=T("p"),l=v("Data from the "),b(t.$$.fragment),n=v(", as of September 2021."),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function Gf(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Ff]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function qf(r){let e,l=(r[4].name??"Unknown MRN road")+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=(n[4].name??"Unknown MRN road")+"")&&G(t,l)},d(n){n&&m(e)}}}function zf(r){let e,l;return e=new ce({props:{$$slots:{default:[qf,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Hf(r){let e,l;const t=[q(Mt),{sourceLayer:Mt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":r[1],"line-width":7,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[zf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Mt}.pmtiles`,$$slots:{default:[Hf]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Mt="mrn";function Bf(r,e,l){let t,n=ne.mrn,s=he(Mt);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class Uf extends K{constructor(e){super(),X(this,e,Bf,Ef,V,{})}}function Wf(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + Strategic Road Network`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function Yf(r){let e;return{c(){e=v(`OS Open Roads + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Jf(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://osdatahub.os.uk/downloads/open/OpenRoads",$$slots:{default:[Yf]},$$scope:{ctx:r}}}),o=new Te({}),{c(){e=T("p"),l=v("Data from "),b(t.$$.fragment),n=v(`, as of December 2023. The SRN is equivalent to trunk + roads.`),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function Vf(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Jf]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Qf(r){let e,l=(r[4].name??"Unknown SRN road")+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=(n[4].name??"Unknown SRN road")+"")&&G(t,l)},d(n){n&&m(e)}}}function Zf(r){let e,l;return e=new ce({props:{$$slots:{default:[Qf,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Kf(r){let e,l;const t=[q(Nt),{sourceLayer:Nt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":r[1],"line-width":7,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[Zf]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Nt}.pmtiles`,$$slots:{default:[Kf]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Nt="srn";function xf(r,e,l){let t,n=ne.srn,s=he(Nt);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class ea extends K{constructor(e){super(),X(this,e,xf,Xf,V,{})}}function ta(r){let e,l,t;return e=new Ce({props:{color:r[1]}}),{c(){b(e.$$.fragment),l=v(` + National Cycle Network`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function na(r){let e;return{c(){e=v(`National Cycle Network + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function la(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://data-sustrans-uk.opendata.arcgis.com/",$$slots:{default:[na]},$$scope:{ctx:r}}}),o=new Te({}),{c(){e=T("p"),l=v("Data from Sustrans about the "),b(t.$$.fragment),n=v(", downloaded on 22/01/2024."),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function sa(r){let e,l,t;return l=new $e({props:{$$slots:{default:[la]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function gl(r){let e,l,t,n=r[4].Desc_+"",s;return{c(){e=T("li"),l=v("Description: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Desc_+"")&&G(s,n)},d(o){o&&m(e)}}}function dl(r){let e,l,t,n=r[4].Greenway+"",s;return{c(){e=T("li"),l=v("Is greenway: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Greenway+"")&&G(s,n)},d(o){o&&m(e)}}}function hl(r){let e,l,t,n=r[4].RouteType+"",s;return{c(){e=T("li"),l=v("Route type: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RouteType+"")&&G(s,n)},d(o){o&&m(e)}}}function bl(r){let e,l,t,n=r[4].RouteNo+"",s;return{c(){e=T("li"),l=v("Route number: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RouteNo+"")&&G(s,n)},d(o){o&&m(e)}}}function kl(r){let e,l,t,n=r[4].RouteCat+"",s;return{c(){e=T("li"),l=v("Route Category: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RouteCat+"")&&G(s,n)},d(o){o&&m(e)}}}function wl(r){let e,l,t,n=r[4].OpenStatus+"",s;return{c(){e=T("li"),l=v("Open Status: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].OpenStatus+"")&&G(s,n)},d(o){o&&m(e)}}}function vl(r){let e,l,t,n=r[4].Surface+"",s;return{c(){e=T("li"),l=v("Surface: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Surface+"")&&G(s,n)},d(o){o&&m(e)}}}function yl(r){let e,l,t,n=r[4].Quality+"",s;return{c(){e=T("li"),l=v("Quality: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].Quality+"")&&G(s,n)},d(o){o&&m(e)}}}function Sl(r){let e,l,t,n=r[4].RoadClass+"",s;return{c(){e=T("li"),l=v("Road Class: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&16&&n!==(n=o[4].RoadClass+"")&&G(s,n)},d(o){o&&m(e)}}}function ra(r){let e,l,t,n,s,o,u,f,i,a=r[4].Desc_&&gl(r),c=r[4].Greenway&&dl(r),$=r[4].RouteType&&hl(r),_=r[4].RouteNo&&bl(r),y=r[4].RouteCat&&kl(r),S=r[4].OpenStatus&&wl(r),C=r[4].Surface&&vl(r),O=r[4].Quality&&yl(r),F=r[4].RoadClass&&Sl(r);return{c(){e=T("ul"),a&&a.c(),l=I(),c&&c.c(),t=I(),$&&$.c(),n=I(),_&&_.c(),s=I(),y&&y.c(),o=I(),S&&S.c(),u=I(),C&&C.c(),f=I(),O&&O.c(),i=I(),F&&F.c()},m(R,j){p(R,e,j),a&&a.m(e,null),h(e,l),c&&c.m(e,null),h(e,t),$&&$.m(e,null),h(e,n),_&&_.m(e,null),h(e,s),y&&y.m(e,null),h(e,o),S&&S.m(e,null),h(e,u),C&&C.m(e,null),h(e,f),O&&O.m(e,null),h(e,i),F&&F.m(e,null)},p(R,j){R[4].Desc_?a?a.p(R,j):(a=gl(R),a.c(),a.m(e,l)):a&&(a.d(1),a=null),R[4].Greenway?c?c.p(R,j):(c=dl(R),c.c(),c.m(e,t)):c&&(c.d(1),c=null),R[4].RouteType?$?$.p(R,j):($=hl(R),$.c(),$.m(e,n)):$&&($.d(1),$=null),R[4].RouteNo?_?_.p(R,j):(_=bl(R),_.c(),_.m(e,s)):_&&(_.d(1),_=null),R[4].RouteCat?y?y.p(R,j):(y=kl(R),y.c(),y.m(e,o)):y&&(y.d(1),y=null),R[4].OpenStatus?S?S.p(R,j):(S=wl(R),S.c(),S.m(e,u)):S&&(S.d(1),S=null),R[4].Surface?C?C.p(R,j):(C=vl(R),C.c(),C.m(e,f)):C&&(C.d(1),C=null),R[4].Quality?O?O.p(R,j):(O=yl(R),O.c(),O.m(e,i)):O&&(O.d(1),O=null),R[4].RoadClass?F?F.p(R,j):(F=Sl(R),F.c(),F.m(e,null)):F&&(F.d(1),F=null)},d(R){R&&m(e),a&&a.d(),c&&c.d(),$&&$.d(),_&&_.d(),y&&y.d(),S&&S.d(),C&&C.d(),O&&O.d(),F&&F.d()}}}function oa(r){let e,l;return e=new ce({props:{$$slots:{default:[ra,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function ia(r){let e,l;const t=[q(Ot),{sourceLayer:Ot},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":r[1],"line-width":4,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[oa]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Ot}.pmtiles`,$$slots:{default:[ia]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&33&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Ot="national_cycle_network";function aa(r,e,l){let t,n=ne.national_cycle_network,s=he(Ot);x(r,s,u=>l(0,t=u));function o(u){t=u,s.set(t)}return[t,n,s,o]}class ua extends K{constructor(e){super(),X(this,e,aa,fa,V,{})}}function Cl(r,e,l){const t=r.slice();return t[6]=e[l][0],t[7]=e[l][1],t[8]=e[l][2],t}function ca(r){let e;return{c(){e=v("OS Pavement widths")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function $a(r){let e;return{c(){e=v(`Public Sector Geospatial Agreement + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function pa(r){let e,l,t,n,s,o,u,f,i,a,c;return i=new te({props:{href:"https://www.ordnancesurvey.co.uk/documents/licensing/psga-member-licence.pdf",$$slots:{default:[$a]},$$scope:{ctx:r}}}),{c(){e=T("p"),e.textContent=`This shows the average and minimum pavement width (in meters) from + Ordnance Survey. Because the shape of pavement may vary along a road, + both average and minimum are reported. Measurements may be available for + the left side of the road, the right, or both. The coloring shows the + larger of the two average widths, and the line thickness has no meaning. + Hover over a line to see if there's pavement on one or both sides of the + road. (You won't be able to distinguish left and right though; use the + OS Road basemap instead.)`,l=I(),t=T("p"),t.textContent=`Note these measurements are difficult to interpret near dual + carriageways (shown as parallel lines).`,n=I(),s=T("p"),s.textContent="Data valid as of 1 January, 2024",o=I(),u=T("p"),f=v(`License: Contains OS data © Crown copyright and database right + 2023. Made available under the `),b(i.$$.fragment),a=v(".")},m($,_){p($,e,_),p($,l,_),p($,t,_),p($,n,_),p($,s,_),p($,o,_),p($,u,_),h(u,f),k(i,u,null),h(u,a),c=!0},p($,_){const y={};_&2048&&(y.$$scope={dirty:_,ctx:$}),i.$set(y)},i($){c||(g(i.$$.fragment,$),c=!0)},o($){d(i.$$.fragment,$),c=!1},d($){$&&(m(e),m(l),m(t),m(n),m(s),m(o),m(u)),w(i)}}}function ma(r){let e,l,t;return l=new $e({props:{$$slots:{default:[pa]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2048&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Tl(r){let e,l;return e=new Ge({props:{colorScale:r[1],limits:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function _a(r){let e,l,t=Xt(r[5].angle+r[8])+"",n;return{c(){e=T("p"),l=new $t(!1),n=v(` side of the road: no pavement + `),l.a=n},m(s,o){p(s,e,o),l.m(t,e),h(e,n)},p(s,o){o&32&&t!==(t=Xt(s[5].angle+s[8])+"")&&l.p(t)},d(s){s&&m(e)}}}function ga(r){let e,l,t=Xt(r[5].angle+r[8])+"",n,s,o=r[6]+"",u,f,i,a=r[7]+"",c,$;return{c(){e=T("p"),l=new $t(!1),n=v(` side of the road: + `),s=T("b"),u=v(o),f=v(` + m average, + `),i=T("b"),c=v(a),$=v(` + m minimum + `),l.a=n},m(_,y){p(_,e,y),l.m(t,e),h(e,n),h(e,s),h(s,u),h(e,f),h(e,i),h(i,c),h(e,$)},p(_,y){y&32&&t!==(t=Xt(_[5].angle+_[8])+"")&&l.p(t),y&32&&o!==(o=_[6]+"")&&G(u,o),y&32&&a!==(a=_[7]+"")&&G(c,a)},d(_){_&&m(e)}}}function Ll(r){let e;function l(s,o){return s[6]?ga:_a}let t=l(r),n=t(r);return{c(){n.c(),e=ve()},m(s,o){n.m(s,o),p(s,e,o)},p(s,o){t===(t=l(s))&&n?n.p(s,o):(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},d(s){s&&m(e),n.d(s)}}}function da(r){let e,l=we([[r[5].left_average,r[5].left_minimum,-90],[r[5].right_average,r[5].right_minimum,90]]),t=[];for(let n=0;n<2;n+=1)t[n]=Ll(Cl(r,l,n));return{c(){for(let n=0;n<2;n+=1)t[n].c();e=ve()},m(n,s){for(let o=0;o<2;o+=1)t[o]&&t[o].m(n,s);p(n,e,s)},p(n,s){if(s&32){l=we([[n[5].left_average,n[5].left_minimum,-90],[n[5].right_average,n[5].right_minimum,90]]);let o;for(o=0;o<2;o+=1){const u=Cl(n,l,o);t[o]?t[o].p(u,s):(t[o]=Ll(u),t[o].c(),t[o].m(e.parentNode,e))}for(;o<2;o+=1)t[o].d(1)}},d(n){n&&m(e),Qe(t,n)}}}function ha(r){let e,l;return e=new ce({props:{openOn:"hover",$$slots:{default:[da,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&2080&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function ba(r){let e,l;const t=[q(Pt),{sourceLayer:Pt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":de(["max",["number",["get","left_average"],0],["number",["get","right_average"],0]],r[2],r[1]),"line-width":De,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[ha]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Tl(r);return s=new _e({props:{url:`pmtiles://${Yt()}/v1/${Pt}.pmtiles`,$$slots:{default:[ba]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&2048&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Tl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&2049&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Pt="pavement_widths";function wa(r){let e=Math.floor((r+22.5)%360/45);return["N","NE","E","SE","S","SW","W","NW","N"][e]}function Xt(r){return`${wa(r)} ⬆`}function va(r,e,l){let t,n=ne.sequential_low_to_high,s=[0,2,4,6,8,13],o=he(Pt);x(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class ya extends K{constructor(e){super(),X(this,e,va,ka,V,{})}}function Sa(r){let e;return{c(){e=v("Propensity to Cycle Tool")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ca(r){let e;return{c(){e=v("the PCT website")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ta(r){let e;return{c(){e=v("2017 journal article")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function La(r){let e,l,t,n,s,o,u,f,i,a,c;return u=new te({props:{href:"https://www.pct.bike",$$slots:{default:[Ca]},$$scope:{ctx:r}}}),i=new te({props:{href:"https://www.jtlu.org/index.php/jtlu/article/view/862",$$slots:{default:[Ta]},$$scope:{ctx:r}}}),{c(){e=T("p"),e.textContent=`The PCT shows major links on the transport network on which there is + high latent demand for cycling under scenarios of change, based on the + "fastest" routes from CycleStreets. Counts approximate daily rush hour + traffic levels.`,l=I(),t=T("p"),t.textContent=`Note this layer uses 2011 census data and outdated OpenStreetMap data. + Please use this layer with caution.`,n=I(),s=T("p"),o=v("See "),b(u.$$.fragment),f=v(" and "),b(i.$$.fragment),a=v(" for details on methodology and data sources.")},m($,_){p($,e,_),p($,l,_),p($,t,_),p($,n,_),p($,s,_),h(s,o),k(u,s,null),h(s,f),k(i,s,null),h(s,a),c=!0},p($,_){const y={};_&1024&&(y.$$scope={dirty:_,ctx:$}),u.$set(y);const S={};_&1024&&(S.$$scope={dirty:_,ctx:$}),i.$set(S)},i($){c||(g(u.$$.fragment,$),g(i.$$.fragment,$),c=!0)},o($){d(u.$$.fragment,$),d(i.$$.fragment,$),c=!1},d($){$&&(m(e),m(l),m(t),m(n),m(s)),w(u),w(i)}}}function Ia(r){let e,l,t;return l=new $e({props:{$$slots:{default:[La]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&1024&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Il(r){let e,l,t,n,s,o,u,f;e=new Ge({props:{colorScale:r[1],limits:r[2]}});function i(_){r[6](_)}let a={label:"Trip purpose",choices:[["pct_commute","Commuting"],["pct_school","School"]],inlineSmall:!0};r[0].tripPurpose!==void 0&&(a.value=r[0].tripPurpose),t=new Rs({props:a}),H.push(()=>E(t,"value",i));function c(_){r[7](_)}let $={label:"Scenario",choices:[["baseline","Baseline (2011)"],["gov_target","Government target (2025)"],["go_dutch","Go Dutch"]]};return r[0].scenario!==void 0&&($.value=r[0].scenario),o=new dt({props:$}),H.push(()=>E(o,"value",c)),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),s=I(),b(o.$$.fragment)},m(_,y){k(e,_,y),p(_,l,y),k(t,_,y),p(_,s,y),k(o,_,y),f=!0},p(_,y){const S={};!n&&y&1&&(n=!0,S.value=_[0].tripPurpose,B(()=>n=!1)),t.$set(S);const C={};!u&&y&1&&(u=!0,C.value=_[0].scenario,B(()=>u=!1)),o.$set(C)},i(_){f||(g(e.$$.fragment,_),g(t.$$.fragment,_),g(o.$$.fragment,_),f=!0)},o(_){d(e.$$.fragment,_),d(t.$$.fragment,_),d(o.$$.fragment,_),f=!1},d(_){_&&(m(l),m(s)),w(e,_),w(t,_),w(o,_)}}}function Ma(r){let e,l=r[4](r[9])+"",t;return{c(){e=new $t(!1),t=ve(),e.a=t},m(n,s){e.m(l,n,s),p(n,t,s)},p(n,s){s&512&&l!==(l=n[4](n[9])+"")&&e.p(l)},d(n){n&&(m(t),e.d())}}}function Na(r){let e,l;return e=new ce({props:{$$slots:{default:[Ma,({props:t})=>({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1536&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Oa(r){let e,l;const t=[q(et),{sourceLayer:et},{paint:{"line-color":de(["get",r[0].scenario],r[2],r[1]),"line-width":De,"line-opacity":le(1,.5)}},{layout:{visibility:r[0].show&&r[0].tripPurpose==et?"visible":"none"}}];let n={$$slots:{default:[Na]},$$scope:{ctx:r}};for(let s=0;s({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1536&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Da(r){let e,l;const t=[q(ct),{sourceLayer:ct},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":de(["get",r[0].scenario],r[2],r[1]),"line-width":De,"line-opacity":le(1,.5)}},{layout:{visibility:r[0].show&&r[0].tripPurpose==ct?"visible":"none"}}];let n={$$slots:{default:[ja]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",i));let c=r[0].show&&Il(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${et}.pmtiles`,$$slots:{default:[Oa]},$$scope:{ctx:r}}}),u=new _e({props:{url:`pmtiles://${pe()}/v1/${ct}.pmtiles`,$$slots:{default:[Da]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),c&&c.c(),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment)},m($,_){k(e,$,_),p($,t,_),c&&c.m($,_),p($,n,_),k(s,$,_),p($,o,_),k(u,$,_),f=!0},p($,[_]){const y={};_&1024&&(y.$$scope={dirty:_,ctx:$}),!l&&_&1&&(l=!0,y.checked=$[0].show,B(()=>l=!1)),e.$set(y),$[0].show?c?(c.p($,_),_&1&&g(c,1)):(c=Il($),c.c(),g(c,1),c.m(n.parentNode,n)):c&&(ae(),d(c,1,1,()=>{c=null}),ue());const S={};_&1025&&(S.$$scope={dirty:_,ctx:$}),s.$set(S);const C={};_&1025&&(C.$$scope={dirty:_,ctx:$}),u.$set(C)},i($){f||(g(e.$$.fragment,$),g(c),g(s.$$.fragment,$),g(u.$$.fragment,$),f=!0)},o($){d(e.$$.fragment,$),d(c),d(s.$$.fragment,$),d(u.$$.fragment,$),f=!1},d($){$&&(m(t),m(n),m(o)),w(e,$),c&&c.d($),w(s,$),w(u,$)}}}let et="pct_commute",ct="pct_school";function Aa(r){return r.show?`${r.tripPurpose}/${r.scenario}`:null}function Fa(r){let[e,l]=r.split("/");return{show:!0,tripPurpose:e,scenario:l}}function Ga(r,e,l){let t,n=ne.sequential_low_to_high,s=[0,50,100,500,1e3,2e3],u=kt("pct",{show:!1,tripPurpose:et,scenario:"baseline"},Aa,Fa);x(r,u,$=>l(0,t=$));function f($){let _=$.baseline,y=$.gov_target,S=$.go_dutch,C=`

    Trip purpose: ${t.tripPurpose==et?"commuting":"school"}

    `;if(C+=`

    Baseline (2011): ${_.toLocaleString()}

    `,_==0)C+=`

    Government target (2025): ${y.toLocaleString()}

    `,C+=`

    Go Dutch: ${S.toLocaleString()}

    `;else{let O=(y/_).toFixed(1),F=(S/_).toFixed(1);C+=`

    Government target (2025): ${y.toLocaleString()} (${O}x of baseline)

    `,C+=`

    Go Dutch: ${S.toLocaleString()} (${F}x of baseline)

    `}return C}function i($){r.$$.not_equal(t.show,$)&&(t.show=$,u.set(t))}function a($){r.$$.not_equal(t.tripPurpose,$)&&(t.tripPurpose=$,u.set(t))}function c($){r.$$.not_equal(t.scenario,$)&&(t.scenario=$,u.set(t))}return[t,n,s,u,f,i,a,c]}class qa extends K{constructor(e){super(),X(this,e,Ga,Ra,V,{})}}function za(r){let e;return{c(){e=v("OS Speeds")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ha(r){let e;return{c(){e=v("Basemap")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ea(r){let e;return{c(){e=v(`Public Sector Geospatial Agreement + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ba(r){let e,l,t,n,s,o,u,f,i,a,c,$;return t=new te({props:{href:"https://basemap.co.uk/speed-data",$$slots:{default:[Ha]},$$scope:{ctx:r}}}),a=new te({props:{href:"https://www.ordnancesurvey.co.uk/documents/licensing/psga-member-licence.pdf",$$slots:{default:[Ea]},$$scope:{ctx:r}}}),{c(){e=T("p"),l=v("The average speed data is collected over a six-month period by "),b(t.$$.fragment),n=v(` from 135,000 vehicle telematic systems and provided through + Ordnance Survey. The averages are grouped by different time periods for weekdays + and weekends. This map shows the highest average.`),s=I(),o=T("p"),o.textContent="Data valid as of 1 September, 2023",u=I(),f=T("p"),i=v(`License: Contains OS data © Crown copyright and database right + 2023. Made available under the `),b(a.$$.fragment),c=v(".")},m(_,y){p(_,e,y),h(e,l),k(t,e,null),h(e,n),p(_,s,y),p(_,o,y),p(_,u,y),p(_,f,y),h(f,i),k(a,f,null),h(f,c),$=!0},p(_,y){const S={};y&512&&(S.$$scope={dirty:y,ctx:_}),t.$set(S);const C={};y&512&&(C.$$scope={dirty:y,ctx:_}),a.$set(C)},i(_){$||(g(t.$$.fragment,_),g(a.$$.fragment,_),$=!0)},o(_){d(t.$$.fragment,_),d(a.$$.fragment,_),$=!1},d(_){_&&(m(e),m(s),m(o),m(u),m(f)),w(t),w(a)}}}function Ua(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Ba]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&512&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Ml(r){let e,l,t,n,s;e=new Ge({props:{colorScale:r[1],limits:r[2]}});function o(f){r[6](f)}let u={label:"Show speed types",choices:[["indicative_mph","Posted speed limit"],["highest_mph","Highest measured average speed"]],inlineSmall:!0};return r[0].kind!==void 0&&(u.value=r[0].kind),t=new Rs({props:u}),H.push(()=>E(t,"value",o)),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment)},m(f,i){k(e,f,i),p(f,l,i),k(t,f,i),s=!0},p(f,i){const a={};!n&&i&1&&(n=!0,a.value=f[0].kind,B(()=>n=!1)),t.$set(a)},i(f){s||(g(e.$$.fragment,f),g(t.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(t.$$.fragment,f),s=!1},d(f){f&&m(l),w(e,f),w(t,f)}}}function Wa(r){let e,l,t=r[8].indicative_mph+"",n,s,o,u,f,i=r[8].highest_mph+"",a,c,$=r[4][r[8].highest_description]+"",_,y;return{c(){e=T("p"),l=v("Posted speed limit: "),n=v(t),s=v(" mph"),o=I(),u=T("p"),f=v("Highest average speed: "),a=v(i),c=v(" mph (during "),_=v($),y=v(")")},m(S,C){p(S,e,C),h(e,l),h(e,n),h(e,s),p(S,o,C),p(S,u,C),h(u,f),h(u,a),h(u,c),h(u,_),h(u,y)},p(S,C){C&256&&t!==(t=S[8].indicative_mph+"")&&G(n,t),C&256&&i!==(i=S[8].highest_mph+"")&&G(a,i),C&256&&$!==($=S[4][S[8].highest_description]+"")&&G(_,$)},d(S){S&&(m(e),m(o),m(u))}}}function Ya(r){let e,l;return e=new ce({props:{$$slots:{default:[Wa,({props:t})=>({8:t}),({props:t})=>t?256:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&768&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ja(r){let e,l;const t=[q(jt),{sourceLayer:jt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":de(["get",r[0].kind],r[2],r[1]),"line-width":De,"line-opacity":le(1,.5)}},{layout:{visibility:r[0].show?"visible":"none"}}];let n={$$slots:{default:[Ya]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&Ml(r);return s=new _e({props:{url:`pmtiles://${Yt()}/v1/${jt}.pmtiles`,$$slots:{default:[Ja]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&512&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0].show,B(()=>l=!1)),e.$set($),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=Ml(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&513&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let jt="road_speeds";function Qa(r){return r.show?r.kind:null}function Za(r){return{show:!0,kind:r}}function Ka(r,e,l){let t,n=ne.sequential_low_to_high,s=[0,20,30,40,50,90],u=kt(jt,{show:!1,kind:"indicative_mph"},Qa,Za);x(r,u,c=>l(0,t=c));let f={mf4to7:"Monday-Friday 4-7am",mf7to9:"Monday-Friday 7-9am",mf9to12:"Monday-Friday 9am-12pm",mf12to14:"Monday-Friday 12-2pm",mf14to16:"Monday-Friday 2-4pm",mf16to19:"Monday-Friday 4-7pm",mf19to22:"Monday-Friday 7-10pm",mf22to4:"Monday-Friday 10pm-4am",ss4to7:"Saturday-Sunday 4-7am",ss7to10:"Saturday-Sunday 7-10am",ss10to14:"Saturday-Sunday 10am-2pm",ss14to19:"Saturday-Sunday 2-7pm",ss19to22:"Saturday-Sunday 7-10pm",ss22to4:"Saturday-Sunday 10pm-4am"};function i(c){r.$$.not_equal(t.show,c)&&(t.show=c,u.set(t))}function a(c){r.$$.not_equal(t.kind,c)&&(t.kind=c,u.set(t))}return[t,n,s,u,f,i,a]}class Xa extends K{constructor(e){super(),X(this,e,Ka,Va,V,{})}}function xa(r){let e;return{c(){e=v("OS Road widths")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function eu(r){let e;return{c(){e=v(`Public Sector Geospatial Agreement + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function tu(r){let e,l,t,n,s,o,u,f,i;return u=new te({props:{href:"https://www.ordnancesurvey.co.uk/documents/licensing/psga-member-licence.pdf",$$slots:{default:[eu]},$$scope:{ctx:r}}}),{c(){e=T("p"),e.textContent=`This is average and minimum road carriageway width (in meters) from + Ordnance Survey. The coloring shows the average width, and the line + thickness has no meaning. Be careful interpreting the data near dual + carriageways and crossing islands.`,l=I(),t=T("p"),t.textContent="Data valid as of 1 September, 2023",n=I(),s=T("p"),o=v(`License: Contains OS data © Crown copyright and database right + 2023. Made available under the `),b(u.$$.fragment),f=v(".")},m(a,c){p(a,e,c),p(a,l,c),p(a,t,c),p(a,n,c),p(a,s,c),h(s,o),k(u,s,null),h(s,f),i=!0},p(a,c){const $={};c&64&&($.$$scope={dirty:c,ctx:a}),u.$set($)},i(a){i||(g(u.$$.fragment,a),i=!0)},o(a){d(u.$$.fragment,a),i=!1},d(a){a&&(m(e),m(l),m(t),m(n),m(s)),w(u)}}}function nu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[tu]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Nl(r){let e,l;return e=new Ge({props:{colorScale:r[1],limits:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function lu(r){let e,l,t,n=r[5].average+"",s,o,u,f,i,a,c=r[5].minimum+"",$,_;return{c(){e=T("p"),l=v("Average width: "),t=T("b"),s=v(n),o=v(` + meters`),u=I(),f=T("p"),i=v("Minimum width: "),a=T("b"),$=v(c),_=v(` + meters`)},m(y,S){p(y,e,S),h(e,l),h(e,t),h(t,s),h(e,o),p(y,u,S),p(y,f,S),h(f,i),h(f,a),h(a,$),h(f,_)},p(y,S){S&32&&n!==(n=y[5].average+"")&&G(s,n),S&32&&c!==(c=y[5].minimum+"")&&G($,c)},d(y){y&&(m(e),m(u),m(f))}}}function su(r){let e,l;return e=new ce({props:{$$slots:{default:[lu,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function ru(r){let e,l;const t=[q(Dt),{sourceLayer:Dt},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"line-color":de(["get","average"],r[2],r[1]),"line-width":De,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[su]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Nl(r);return s=new _e({props:{url:`pmtiles://${Yt()}/v1/${Dt}.pmtiles`,$$slots:{default:[ru]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&64&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Nl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Dt="road_widths";function iu(r,e,l){let t,n=ne.sequential_low_to_high,s=[0,5,10,15,20,100],o=he(Dt);x(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class fu extends K{constructor(e){super(),X(this,e,iu,ou,V,{})}}function au(r){let e,l,t;return e=new Ce({props:{color:ne.trams}}),{c(){b(e.$$.fragment),l=v(` + Trams`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function uu(r){let e,l,t,n;return t=new Ke({}),{c(){e=T("p"),e.textContent=`This shows all trams and light rail lines, according to OpenStreetMap + (as of 7 February 2024). When these are close to a scheme, interactions + between the modes must be designed carefully.`,l=I(),b(t.$$.fragment)},m(s,o){p(s,e,o),p(s,l,o),k(t,s,o),n=!0},p:ee,i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(m(e),m(l)),w(t,s)}}}function cu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[uu]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&8&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function $u(r){let e,l;const t=[q(Rt),{sourceLayer:Rt},{paint:{"line-color":ne.trams,"line-width":5,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0},{hoverCursor:"pointer"}];let n={};for(let s=0;sE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Rt}.pmtiles`,$$slots:{default:[$u]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&8&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&9&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Rt="trams";function mu(r){window.open(`http://openstreetmap.org/way/${r.detail.features[0].properties.osm_id}`,"_blank")}function _u(r,e,l){let t,n=he(Rt);x(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class gu extends K{constructor(e){super(),X(this,e,_u,pu,V,{})}}function du(r){let e;return{c(){e=v("Bus stops")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function hu(r){let e;return{c(){e=v(`Bus Open Data Service + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function bu(r){let e,l,t,n,s,o,u,f,i;return t=new te({props:{href:"https://data.bus-data.dft.gov.uk",$$slots:{default:[hu]},$$scope:{ctx:r}}}),f=new Te({}),{c(){e=T("p"),l=v("Data from the "),b(t.$$.fragment),n=v(`, as of 7 February 2024. To calculate frequency, every + scheduled arrival time per stop is considered, grouped by day of the + week. The total daily count is just the number of scheduled arrivals for + a day. The peak hour frequency is the highest number of buses in any one + hour window. That window might not lined up perfectly on the hour -- a + peak hour might occur from 8:25 to 9:25,for example.`),s=I(),o=T("p"),o.textContent=`There are known limitations with this layer, so please use caution when + using these numbers. Some stops may not be shown at all. Frequency could + be over- or under-counted, due to exceptions to the regular daily + schedule of a service.`,u=I(),b(f.$$.fragment)},m(a,c){p(a,e,c),h(e,l),k(t,e,null),h(e,n),p(a,s,c),p(a,o,c),p(a,u,c),k(f,a,c),i=!0},p(a,c){const $={};c&64&&($.$$scope={dirty:c,ctx:a}),t.$set($)},i(a){i||(g(t.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(m(e),m(s),m(o),m(u)),w(t),w(f,a)}}}function ku(r){let e,l,t;return l=new $e({props:{$$slots:{default:[bu]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Ol(r){let e,l,t,n;return t=new Ge({props:{colorScale:r[1],limits:r[2]}}),{c(){e=T("p"),e.textContent="Peak hourly frequency:",l=I(),b(t.$$.fragment)},m(s,o){p(s,e,o),p(s,l,o),k(t,s,o),n=!0},p:ee,i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(m(e),m(l)),w(t,s)}}}function wu(r){let e,l,t,n=r[5].stop_name+"",s,o,u,f,i,a=r[5].peak+"",c,$,_,y,S,C=r[5].peak_description+"",O,F,R,j,M,N=r[5].total+"",P,L,D=r[5].total_description+"",W,Q;return{c(){e=T("p"),l=v("Stop name: "),t=T("b"),s=v(n),o=I(),u=T("p"),f=v("Peak: "),i=T("b"),c=v(a),$=v(` + buses during the busiest hour of any day`),_=I(),y=T("p"),S=v("The peak hour is "),O=v(C),F=I(),R=T("p"),j=v("Total buses per day: "),M=T("b"),P=v(N),L=v(` + (for `),W=v(D),Q=v(", the busiest day of the week)")},m(A,Y){p(A,e,Y),h(e,l),h(e,t),h(t,s),p(A,o,Y),p(A,u,Y),h(u,f),h(u,i),h(i,c),h(u,$),p(A,_,Y),p(A,y,Y),h(y,S),h(y,O),p(A,F,Y),p(A,R,Y),h(R,j),h(R,M),h(M,P),h(R,L),h(R,W),h(R,Q)},p(A,Y){Y&32&&n!==(n=A[5].stop_name+"")&&G(s,n),Y&32&&a!==(a=A[5].peak+"")&&G(c,a),Y&32&&C!==(C=A[5].peak_description+"")&&G(O,C),Y&32&&N!==(N=A[5].total+"")&&G(P,N),Y&32&&D!==(D=A[5].total_description+"")&&G(W,D)},d(A){A&&(m(e),m(o),m(u),m(_),m(y),m(F),m(R))}}}function vu(r){let e,l;return e=new ce({props:{$$slots:{default:[wu,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function yu(r){let e,l;const t=[q(At),{sourceLayer:At},{paint:{"circle-color":de(["get","peak"],r[2],r[1]),"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,10]}},{layout:{visibility:r[0]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[vu]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Ol(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${At}.pmtiles`,$$slots:{default:[yu]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&64&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Ol(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let At="bus_stops";function Cu(r,e,l){let t,n=ne.sequential_low_to_high,s=[0,3,10,20,30,100],o=he(At);x(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class Tu extends K{constructor(e){super(),X(this,e,Cu,Su,V,{})}}function Lu(r){let e;return{c(){e=v("Crossings")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Iu(r){let e;return{c(){e=v("crossing")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Mu(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://wiki.openstreetmap.org/wiki/Key:crossing",$$slots:{default:[Iu]},$$scope:{ctx:r}}}),o=new Ke({}),{c(){e=T("p"),l=v("This shows "),b(t.$$.fragment),n=v(" data from OpenStreetMap (as of 9 August 2023)."),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&32&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function Nu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Mu]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&32&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Pl(r){let e,l;return e=new Jt({props:{rows:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Ou(r){let e,l=jl(r[4])+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&16&&l!==(l=jl(n[4])+"")&&G(t,l)},d(n){n&&m(e)}}}function Pu(r){let e,l;return e=new ce({props:{$$slots:{default:[Ou,({props:t})=>({4:t}),({props:t})=>t?16:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&48&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function ju(r){let e,l;const t=[q(Ft),{sourceLayer:Ft},{paint:{"circle-color":Ze(["get","crossing"],{traffic_signals:ne.signalized_crossing},ne.other_crossing),"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,10]}},{layout:{visibility:r[0]?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[Pu]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&Pl(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${Ft}.pmtiles`,$$slots:{default:[ju]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&32&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Pl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&33&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ft="crossings";function jl(r){return{no:"Location where crossing is impossible/illegal but where there is a clear desire line to cross",traffic_signals:"Signalised crossing",marked:"Crossing with no traffic signals",uncontrolled:"Crossing with no traffic signals",unmarked:"Crossing with no markings or signals",zebra:"Zebra crossing",island:"Crossing with an island",informal:"Informal crossing with an obvious desire line, but no official infrastructure to support it"}[r.crossing]??`Unknown crossing type (${r.crossing})`}function Ru(r){window.open(`http://openstreetmap.org/node/${r.detail.features[0].properties.osm_id}`,"_blank")}function Au(r,e,l){let t,n=he(Ft);x(r,n,u=>l(0,t=u));let s=[["Signalized",ne.signalized_crossing],["Other",ne.other_crossing]];function o(u){t=u,n.set(t)}return[t,n,s,o]}class Fu extends K{constructor(e){super(),X(this,e,Au,Du,V,{})}}function Gu(r){let e;return{c(){e=v("Gradients")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function qu(r){let e;return{c(){e=v("OS Terrain 50")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function zu(r){let e,l,t,n,s,o,u,f,i,a,c,$,_;return u=new te({props:{href:"https://www.ordnancesurvey.co.uk/products/os-terrain-50",$$slots:{default:[qu]},$$scope:{ctx:r}}}),a=new Te({}),$=new Ke({}),{c(){e=T("p"),e.textContent=`This layer shows the steepness of roads, with the arrows pointing + uphill. You have to zoom in to see all roads.`,l=I(),t=T("p"),t.textContent=`Note the gradient may be incorrect near bridges and tunnels, depending + on the underlying Digital Elevation Model used.`,n=I(),s=T("p"),o=v("This layer is built from "),b(u.$$.fragment),f=v(` and roads from OpenStreetMap. The data is valid as of 18 + February 2024.`),i=I(),b(a.$$.fragment),c=I(),b($.$$.fragment)},m(y,S){p(y,e,S),p(y,l,S),p(y,t,S),p(y,n,S),p(y,s,S),h(s,o),k(u,s,null),h(s,f),p(y,i,S),k(a,y,S),p(y,c,S),k($,y,S),_=!0},p(y,S){const C={};S&64&&(C.$$scope={dirty:S,ctx:y}),u.$set(C)},i(y){_||(g(u.$$.fragment,y),g(a.$$.fragment,y),g($.$$.fragment,y),_=!0)},o(y){d(u.$$.fragment,y),d(a.$$.fragment,y),d($.$$.fragment,y),_=!1},d(y){y&&(m(e),m(l),m(t),m(n),m(s),m(i),m(c)),w(u),w(a,y),w($,y)}}}function Hu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[zu]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Dl(r){let e,l;return e=new Ge({props:{colorScale:r[1],limits:r[2]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Eu(r){let e,l,t,n=Math.abs(r[5].gradient)/100+"",s,o;return{c(){e=T("p"),l=v("Gradient: "),t=T("b"),s=v(n),o=v(` + %`)},m(u,f){p(u,e,f),h(e,l),h(e,t),h(t,s),h(e,o)},p(u,f){f&32&&n!==(n=Math.abs(u[5].gradient)/100+"")&&G(s,n)},d(u){u&&m(e)}}}function Bu(r){let e,l;return e=new ce({props:{$$slots:{default:[Eu,({props:t})=>({5:t}),({props:t})=>t?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&96&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Uu(r){let e,l,t,n;const s=[q(Ye),{sourceLayer:Ye},{manageHoverState:!0},{paint:{"line-color":de(["/",["abs",["get","gradient"]],100],r[2],r[1]),"line-width":De,"line-opacity":le(1,.5)}},{layout:{visibility:r[0]?"visible":"none"}}];let o={$$slots:{default:[Bu]},$$scope:{ctx:r}};for(let i=0;i",["abs",["get","gradient"]],300]},{layout:{"icon-image":"chevron","icon-size":1,"symbol-placement":"line","symbol-spacing":50,"icon-allow-overlap":!0,"icon-rotate":["case",["<",["get","gradient"],0],180,0],visibility:r[0]?"visible":"none"}}];let f={};for(let i=0;iE(e,"checked",u));let i=r[0]&&Dl(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${Ye}.pmtiles`,$$slots:{default:[Uu]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&64&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=Dl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&65&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ye="gradient";function Yu(r,e,l){let t,n=ne.gradient_flat_to_steep,s=[0,3,5,8,10,20,100],o=he(Ye);x(r,o,f=>l(0,t=f));function u(f){t=f,o.set(t)}return[t,n,s,o,u]}class Ju extends K{constructor(e){super(),X(this,e,Yu,Wu,V,{})}}function Vu(r){let e,l,t;return{c(){e=T("img"),t=v(` + Cycle parking`),Kt(e.src,l=Ys)||z(e,"src",l),z(e,"alt","a logo representing cycle parking")},m(n,s){p(n,e,s),p(n,t,s)},p:ee,d(n){n&&(m(e),m(t))}}}function Qu(r){let e;return{c(){e=v("OpenStreetMap")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Zu(r){let e;return{c(){e=v("OpenStreetMap Carto")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ku(r){let e,l,t,n,s,o,u,f,i,a,c;return t=new te({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbicycle_parking",$$slots:{default:[Qu]},$$scope:{ctx:r}}}),f=new te({props:{href:"https://github.com/gravitystorm/openstreetmap-carto",$$slots:{default:[Zu]},$$scope:{ctx:r}}}),a=new Ke({}),{c(){e=T("p"),l=v("Cycle parking, according to "),b(t.$$.fragment),n=v(` (as of 9 August 2023). The type of parking, public/private + access, and whether it's covered are not shown.`),s=I(),o=T("p"),u=v("Icon from "),b(f.$$.fragment),i=I(),b(a.$$.fragment)},m($,_){p($,e,_),h(e,l),k(t,e,null),h(e,n),p($,s,_),p($,o,_),h(o,u),k(f,o,null),p($,i,_),k(a,$,_),c=!0},p($,_){const y={};_&16&&(y.$$scope={dirty:_,ctx:$}),t.$set(y);const S={};_&16&&(S.$$scope={dirty:_,ctx:$}),f.$set(S)},i($){c||(g(t.$$.fragment,$),g(f.$$.fragment,$),g(a.$$.fragment,$),c=!0)},o($){d(t.$$.fragment,$),d(f.$$.fragment,$),d(a.$$.fragment,$),c=!1},d($){$&&(m(e),m(s),m(o),m(i)),w(t),w(f),w(a,$)}}}function Xu(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Ku]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function xu(r){let e,l,t,n=(r[3].capacity??"unknown")+"",s;return{c(){e=T("p"),l=v("Capacity: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&8&&n!==(n=(o[3].capacity??"unknown")+"")&&G(s,n)},d(o){o&&m(e)}}}function ec(r){let e,l;return e=new ce({props:{$$slots:{default:[xu,({props:t})=>({3:t}),({props:t})=>t?8:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&24&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function tc(r){let e,l;const t=[q(Gt),{sourceLayer:Gt},{layout:{"icon-image":"cycle_parking","icon-size":1,"icon-allow-overlap":!0,visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[ec]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${Gt}.pmtiles`,$$slots:{default:[tc]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&16&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&17&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let Gt="cycle_parking";function lc(r,e,l){let t,n=he(Gt);x(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class sc extends K{constructor(e){super(),X(this,e,lc,nc,V,{})}}function rc(r){let e;return{c(){e=v("Education")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function oc(r){let e,l,t,n;return t=new Ke({}),{c(){e=T("p"),e.textContent=`This shows different places of education according to OpenStreetMap (as + of 07 February 2024).`,l=I(),b(t.$$.fragment)},m(s,o){p(s,e,o),p(s,l,o),k(t,s,o),n=!0},p:ee,i(s){n||(g(t.$$.fragment,s),n=!0)},o(s){d(t.$$.fragment,s),n=!1},d(s){s&&(m(e),m(l)),w(t,s)}}}function ic(r){let e,l,t;return l=new $e({props:{$$slots:{default:[oc]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2048&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Rl(r){let e,l,t;return l=new lt({props:{$$slots:{default:[cc]},$$scope:{ctx:r}}}),{c(){e=T("div"),b(l.$$.fragment),me(e,"border","1px solid black"),me(e,"padding","8px")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2049&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function fc(r){let e,l,t;return e=new Ce({props:{color:ne.education.schools}}),{c(){b(e.$$.fragment),l=v(` + Schools`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function ac(r){let e,l,t;return e=new Ce({props:{color:ne.education.colleges}}),{c(){b(e.$$.fragment),l=v(` + Colleges`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function uc(r){let e,l,t;return e=new Ce({props:{color:ne.education.universities}}),{c(){b(e.$$.fragment),l=v(` + Universities`)},m(n,s){k(e,n,s),p(n,l,s),t=!0},p:ee,i(n){t||(g(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){n&&m(l),w(e,n)}}}function cc(r){let e,l,t,n,s,o,u,f,i;function a(C){r[4](C)}let c={$$slots:{default:[fc]},$$scope:{ctx:r}};r[0].school!==void 0&&(c.checked=r[0].school),e=new ie({props:c}),H.push(()=>E(e,"checked",a));function $(C){r[5](C)}let _={$$slots:{default:[ac]},$$scope:{ctx:r}};r[0].college!==void 0&&(_.checked=r[0].college),n=new ie({props:_}),H.push(()=>E(n,"checked",$));function y(C){r[6](C)}let S={$$slots:{default:[uc]},$$scope:{ctx:r}};return r[0].university!==void 0&&(S.checked=r[0].university),u=new ie({props:S}),H.push(()=>E(u,"checked",y)),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment),o=I(),b(u.$$.fragment)},m(C,O){k(e,C,O),p(C,t,O),k(n,C,O),p(C,o,O),k(u,C,O),i=!0},p(C,O){const F={};O&2048&&(F.$$scope={dirty:O,ctx:C}),!l&&O&1&&(l=!0,F.checked=C[0].school,B(()=>l=!1)),e.$set(F);const R={};O&2048&&(R.$$scope={dirty:O,ctx:C}),!s&&O&1&&(s=!0,R.checked=C[0].college,B(()=>s=!1)),n.$set(R);const j={};O&2048&&(j.$$scope={dirty:O,ctx:C}),!f&&O&1&&(f=!0,j.checked=C[0].university,B(()=>f=!1)),u.$set(j)},i(C){i||(g(e.$$.fragment,C),g(n.$$.fragment,C),g(u.$$.fragment,C),i=!0)},o(C){d(e.$$.fragment,C),d(n.$$.fragment,C),d(u.$$.fragment,C),i=!1},d(C){C&&(m(t),m(o)),w(e,C),w(n,C),w(u,C)}}}function $c(r){let e,l=(r[10].name??"Unnamed institution")+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=(n[10].name??"Unnamed institution")+"")&&G(t,l)},d(n){n&&m(e)}}}function pc(r){let e,l;return e=new ce({props:{$$slots:{default:[$c,({props:t})=>({10:t}),({props:t})=>t?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&3072&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function mc(r){let e,l;const t=[q(qt),{sourceLayer:qt},{paint:{"fill-color":Ze(["get","type"],{school:ne.education.schools,college:ne.education.colleges,university:ne.education.universities},"grey"),"fill-opacity":le(.7,1)}},{layout:{visibility:r[0].show?"visible":"none"}},{filter:r[2](r[0])},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[pc]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&Rl(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${qt}.pmtiles`,$$slots:{default:[mc]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&2048&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0].show,B(()=>l=!1)),e.$set($),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=Rl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&2049&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let qt="education";function gc(r){return{show:!0,school:r.includes("school"),college:r.includes("college"),university:r.includes("university")}}function dc(r,e,l){let t,n=["school","college","university"],s={show:!1,school:!0,college:!0,university:!0};function o(_){return _.show?n.filter(y=>_[y]).join(","):null}let u=kt(qt,s,o,gc);x(r,u,_=>l(0,t=_));function f(_){let y=n.filter(S=>_[S]);return["in",["get","type"],["literal",y]]}function i(_){r.$$.not_equal(t.show,_)&&(t.show=_,u.set(t))}function a(_){r.$$.not_equal(t.school,_)&&(t.school=_,u.set(t))}function c(_){r.$$.not_equal(t.college,_)&&(t.college=_,u.set(t))}function $(_){r.$$.not_equal(t.university,_)&&(t.university=_,u.set(t))}return[t,u,f,i,a,c,$]}class hc extends K{constructor(e){super(),X(this,e,dc,_c,V,{})}}function bc(r){let e,l,t,n;return e=new Ce({props:{color:r[4]}}),{c(){b(e.$$.fragment),l=I(),t=v(r[2])},m(s,o){k(e,s,o),p(s,l,o),p(s,t,o),n=!0},p(s,o){(!n||o&4)&&G(t,s[2])},i(s){n||(g(e.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),n=!1},d(s){s&&(m(l),m(t)),w(e,s)}}}function kc(r){let e;const l=r[6].default,t=pt(l,r,r[8],null);return{c(){t&&t.c()},m(n,s){t&&t.m(n,s),e=!0},p(n,s){t&&t.p&&(!e||s&256)&&mt(t,l,n,n[8],e?gt(l,n[8],s,null):_t(n[8]),null)},i(n){e||(g(t,n),e=!0)},o(n){d(t,n),e=!1},d(n){t&&t.d(n)}}}function wc(r){let e,l,t;return l=new $e({props:{$$slots:{default:[kc]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&256&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function vc(r){let e,l=(r[9].name??`Unnamed ${r[1]}`)+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&514&&l!==(l=(n[9].name??`Unnamed ${n[1]}`)+"")&&G(t,l)},d(n){n&&m(e)}}}function yc(r){let e,l;return e=new ce({props:{$$slots:{default:[vc,({props:t})=>({9:t}),({props:t})=>t?512:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&770&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Sc(r){let e,l;const t=[q(r[0]),{sourceLayer:r[0]},{paint:{"fill-color":r[4],"fill-opacity":le(.7,1)}},{layout:{visibility:r[3]?"visible":"none"}},{manageHoverState:!0},{eventsIfTopMost:!0}];let n={$$slots:{default:[yc]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new _e({props:{url:`pmtiles://${pe()}/v1/${r[0]}.pmtiles`,$$slots:{default:[Sc]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&260&&(a.$$scope={dirty:i,ctx:f}),!l&&i&8&&(l=!0,a.checked=f[3],B(()=>l=!1)),e.$set(a);const c={};i&1&&(c.url=`pmtiles://${pe()}/v1/${f[0]}.pmtiles`),i&267&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}function Tc(r,e,l){let t,{$$slots:n={},$$scope:s}=e,{name:o}=e,{singularNoun:u}=e,{pluralNoun:f}=e,i=ne[o],a=he(o);x(r,a,$=>l(3,t=$));function c($){t=$,a.set(t)}return r.$$set=$=>{"name"in $&&l(0,o=$.name),"singularNoun"in $&&l(1,u=$.singularNoun),"pluralNoun"in $&&l(2,f=$.pluralNoun),"$$scope"in $&&l(8,s=$.$$scope)},[o,u,f,t,i,a,n,c,s]}class qs extends K{constructor(e){super(),X(this,e,Tc,Cc,V,{name:0,singularNoun:1,pluralNoun:2})}}function Lc(r){let e;return{c(){e=v("hospital")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Ic(r){let e,l,t,n,s,o,u;return t=new te({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dhospital",$$slots:{default:[Lc]},$$scope:{ctx:r}}}),o=new Ke({}),{c(){e=T("p"),l=v("This shows "),b(t.$$.fragment),n=v(` data from OpenStreetMap (as of 9 August 2023). It doesn't include + outpatient clinics or individual doctor's offices.`),s=I(),b(o.$$.fragment)},m(f,i){p(f,e,i),h(e,l),k(t,e,null),h(e,n),p(f,s,i),k(o,f,i),u=!0},p(f,i){const a={};i&1&&(a.$$scope={dirty:i,ctx:f}),t.$set(a)},i(f){u||(g(t.$$.fragment,f),g(o.$$.fragment,f),u=!0)},o(f){d(t.$$.fragment,f),d(o.$$.fragment,f),u=!1},d(f){f&&(m(e),m(s)),w(t),w(o,f)}}}function Mc(r){let e,l;return e=new qs({props:{name:"hospitals",singularNoun:"hospital",pluralNoun:"Hospitals",$$slots:{default:[Ic]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,[n]){const s={};n&1&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}class Nc extends K{constructor(e){super(),X(this,e,null,Mc,V,{})}}function Oc(r){let e,l,t;return{c(){e=T("img"),t=v(` + Railway Stations`),Kt(e.src,l=Js)||z(e,"src",l),z(e,"alt","A logo representing a train")},m(n,s){p(n,e,s),p(n,t,s)},p:ee,d(n){n&&(m(e),m(t))}}}function Pc(r){let e;return{c(){e=v("railway station")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function jc(r){let e;return{c(){e=v(`National Rail + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Dc(r){let e,l,t,n,s,o,u,f,i,a,c,$;return t=new te({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:railway%3Dstation",$$slots:{default:[Pc]},$$scope:{ctx:r}}}),f=new te({props:{href:"https://www.nationalrail.co.uk/",$$slots:{default:[jc]},$$scope:{ctx:r}}}),c=new Ke({}),{c(){e=T("p"),l=v("This shows "),b(t.$$.fragment),n=v(" data from OpenStreetMap (as of 9 August 2023)."),s=I(),o=T("p"),u=v("Icon from "),b(f.$$.fragment),i=v(". (Note that not all stations shown are National Rail.)"),a=I(),b(c.$$.fragment)},m(_,y){p(_,e,y),h(e,l),k(t,e,null),h(e,n),p(_,s,y),p(_,o,y),h(o,u),k(f,o,null),h(o,i),p(_,a,y),k(c,_,y),$=!0},p(_,y){const S={};y&16&&(S.$$scope={dirty:y,ctx:_}),t.$set(S);const C={};y&16&&(C.$$scope={dirty:y,ctx:_}),f.$set(C)},i(_){$||(g(t.$$.fragment,_),g(f.$$.fragment,_),g(c.$$.fragment,_),$=!0)},o(_){d(t.$$.fragment,_),d(f.$$.fragment,_),d(c.$$.fragment,_),$=!1},d(_){_&&(m(e),m(s),m(o),m(a)),w(t),w(f),w(c,_)}}}function Rc(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Dc]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&16&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Ac(r){let e,l=(r[3].name??"Unnamed railway station")+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&8&&l!==(l=(n[3].name??"Unnamed railway station")+"")&&G(t,l)},d(n){n&&m(e)}}}function Fc(r){let e,l;return e=new ce({props:{$$slots:{default:[Ac,({props:t})=>({3:t}),({props:t})=>t?8:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&24&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Gc(r){let e,l;const t=[q(xt),{layout:{"icon-image":"railway_station","icon-size":1,"icon-allow-overlap":!0,visibility:r[0]?"visible":"none"}}];let n={$$slots:{default:[Fc]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",o)),n=new bt({props:{data:`${pe()}/v1/${xt}.geojson`,$$slots:{default:[Gc]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,[i]){const a={};i&16&&(a.$$scope={dirty:i,ctx:f}),!l&&i&1&&(l=!0,a.checked=f[0],B(()=>l=!1)),e.$set(a);const c={};i&17&&(c.$$scope={dirty:i,ctx:f}),n.$set(c)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}let xt="railway_stations";function zc(r,e,l){let t,n=he(xt);x(r,n,o=>l(0,t=o));function s(o){t=o,n.set(t)}return[t,n,s]}class Hc extends K{constructor(e){super(),X(this,e,zc,qc,V,{})}}function Ec(r){let e;return{c(){e=v("sports pitches")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Bc(r){let e;return{c(){e=v("sports centres")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Uc(r){let e,l,t,n,s,o,u,f,i;return t=new te({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dpitch",$$slots:{default:[Ec]},$$scope:{ctx:r}}}),s=new te({props:{href:"https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dsports_centre",$$slots:{default:[Bc]},$$scope:{ctx:r}}}),f=new Ke({}),{c(){e=T("p"),l=v("This shows "),b(t.$$.fragment),n=v(" and "),b(s.$$.fragment),o=v(" data from OpenStreetMap (as of 9 August 2023)."),u=I(),b(f.$$.fragment)},m(a,c){p(a,e,c),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),p(a,u,c),k(f,a,c),i=!0},p(a,c){const $={};c&1&&($.$$scope={dirty:c,ctx:a}),t.$set($);const _={};c&1&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){i||(g(t.$$.fragment,a),g(s.$$.fragment,a),g(f.$$.fragment,a),i=!0)},o(a){d(t.$$.fragment,a),d(s.$$.fragment,a),d(f.$$.fragment,a),i=!1},d(a){a&&(m(e),m(u)),w(t),w(s),w(f,a)}}}function Wc(r){let e,l;return e=new qs({props:{name:"sports_spaces",singularNoun:"sports space",pluralNoun:"Sports spaces",$$slots:{default:[Uc]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,[n]){const s={};n&1&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}class Yc extends K{constructor(e){super(),X(this,e,null,Wc,V,{})}}function Jc(r){let e;return{c(){e=v("Stats19")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Vc(r){let e;return{c(){e=v("DfT stats19")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Qc(r){let e;return{c(){e=v("documented by DfT")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Zc(r){let e,l,t,n,s,o,u,f,i,a,c,$,_,y,S,C,O,F,R,j,M,N,P;return t=new te({props:{href:"https://www.data.gov.uk/dataset/cb7ae6f0-4be6-4935-9277-47e5ce24a11f/road-safety-data",$$slots:{default:[Vc]},$$scope:{ctx:r}}}),O=new te({props:{href:"https://www.gov.uk/guidance/road-accident-and-safety-statistics-guidance",$$slots:{default:[Qc]},$$scope:{ctx:r}}}),N=new Te({}),{c(){e=T("p"),l=v("This layer shows collisions recorded in the "),b(t.$$.fragment),n=v(" dataset. Please note these limitations:"),s=I(),o=T("ul"),u=T("li"),u.textContent="Only collisions between 2017 and 2022 are included",f=I(),i=T("li"),i.textContent=`This tool is intended to be used at high-zoom levels, while inspecting + a scheme or development area. Not all points are shown at lower zoom + levels. Do not use this to look for trends across a city or region + scale.`,a=I(),c=T("li"),c.textContent=`Approximately 150 collisions from the source data aren't included, due + to problems with the recorded location`,$=I(),_=T("li"),_.textContent='The "pedestrians" category also include mobility scooters',y=I(),S=T("li"),C=v("All limitations "),b(O.$$.fragment),F=v(` also apply. Not all collisions or near misses are reported. + There's nuance with the severity categories.`),R=I(),j=T("p"),j.textContent="You can click a point to open the full report, thanks to CycleStreets.",M=I(),b(N.$$.fragment)},m(L,D){p(L,e,D),h(e,l),k(t,e,null),h(e,n),p(L,s,D),p(L,o,D),h(o,u),h(o,f),h(o,i),h(o,a),h(o,c),h(o,$),h(o,_),h(o,y),h(o,S),h(S,C),k(O,S,null),h(S,F),p(L,R,D),p(L,j,D),p(L,M,D),k(N,L,D),P=!0},p(L,D){const W={};D&4194304&&(W.$$scope={dirty:D,ctx:L}),t.$set(W);const Q={};D&4194304&&(Q.$$scope={dirty:D,ctx:L}),O.$set(Q)},i(L){P||(g(t.$$.fragment,L),g(O.$$.fragment,L),g(N.$$.fragment,L),P=!0)},o(L){d(t.$$.fragment,L),d(O.$$.fragment,L),d(N.$$.fragment,L),P=!1},d(L){L&&(m(e),m(s),m(o),m(R),m(j),m(M)),w(t),w(O),w(N,L)}}}function Kc(r){let e,l,t;return l=new $e({props:{$$slots:{default:[Zc]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&4194304&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function Al(r){let e,l,t,n,s,o,u,f,i,a,c,$,_;return l=new lt({props:{small:!0,$$slots:{default:[n$]},$$scope:{ctx:r}}}),a=new Jt({props:{rows:r[9]}}),{c(){e=T("div"),b(l.$$.fragment),t=I(),n=T("div"),s=v(`Filter years: + `),o=T("input"),u=v(` + - + `),f=T("input"),i=I(),b(a.$$.fragment),z(o,"type","number"),z(o,"min",2017),z(o,"max",2022),z(o,"class","svelte-1ft65rw"),z(f,"type","number"),z(f,"min",2017),z(f,"max",2022),z(f,"class","svelte-1ft65rw"),me(e,"border","1px solid black"),me(e,"padding","8px")},m(y,S){p(y,e,S),k(l,e,null),h(e,t),h(e,n),h(n,s),h(n,o),Je(o,r[0].minYear),h(n,u),h(n,f),Je(f,r[0].maxYear),h(e,i),k(a,e,null),c=!0,$||(_=[tt(o,"input",r[15]),tt(f,"input",r[16])],$=!0)},p(y,S){const C={};S&4194305&&(C.$$scope={dirty:S,ctx:y}),l.$set(C),S&1&&Wt(o.value)!==y[0].minYear&&Je(o,y[0].minYear),S&1&&Wt(f.value)!==y[0].maxYear&&Je(f,y[0].maxYear)},i(y){c||(g(l.$$.fragment,y),g(a.$$.fragment,y),c=!0)},o(y){d(l.$$.fragment,y),d(a.$$.fragment,y),c=!1},d(y){y&&m(e),w(l),w(a),$=!1,Ds(_)}}}function Xc(r){let e;return{c(){e=v("Pedestrians")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function xc(r){let e;return{c(){e=v("Cyclists")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function e$(r){let e;return{c(){e=v("Horse riders")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function t$(r){let e;return{c(){e=v("Other")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function n$(r){let e,l,t,n,s,o,u,f,i,a,c,$;function _(M){r[11](M)}let y={$$slots:{default:[Xc]},$$scope:{ctx:r}};r[0].pedestrians!==void 0&&(y.checked=r[0].pedestrians),e=new ie({props:y}),H.push(()=>E(e,"checked",_));function S(M){r[12](M)}let C={$$slots:{default:[xc]},$$scope:{ctx:r}};r[0].cyclists!==void 0&&(C.checked=r[0].cyclists),n=new ie({props:C}),H.push(()=>E(n,"checked",S));function O(M){r[13](M)}let F={$$slots:{default:[e$]},$$scope:{ctx:r}};r[0].horseRiders!==void 0&&(F.checked=r[0].horseRiders),u=new ie({props:F}),H.push(()=>E(u,"checked",O));function R(M){r[14](M)}let j={$$slots:{default:[t$]},$$scope:{ctx:r}};return r[0].other!==void 0&&(j.checked=r[0].other),a=new ie({props:j}),H.push(()=>E(a,"checked",R)),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment),o=I(),b(u.$$.fragment),i=I(),b(a.$$.fragment)},m(M,N){k(e,M,N),p(M,t,N),k(n,M,N),p(M,o,N),k(u,M,N),p(M,i,N),k(a,M,N),$=!0},p(M,N){const P={};N&4194304&&(P.$$scope={dirty:N,ctx:M}),!l&&N&1&&(l=!0,P.checked=M[0].pedestrians,B(()=>l=!1)),e.$set(P);const L={};N&4194304&&(L.$$scope={dirty:N,ctx:M}),!s&&N&1&&(s=!0,L.checked=M[0].cyclists,B(()=>s=!1)),n.$set(L);const D={};N&4194304&&(D.$$scope={dirty:N,ctx:M}),!f&&N&1&&(f=!0,D.checked=M[0].horseRiders,B(()=>f=!1)),u.$set(D);const W={};N&4194304&&(W.$$scope={dirty:N,ctx:M}),!c&&N&1&&(c=!0,W.checked=M[0].other,B(()=>c=!1)),a.$set(W)},i(M){$||(g(e.$$.fragment,M),g(n.$$.fragment,M),g(u.$$.fragment,M),g(a.$$.fragment,M),$=!0)},o(M){d(e.$$.fragment,M),d(n.$$.fragment,M),d(u.$$.fragment,M),d(a.$$.fragment,M),$=!1},d(M){M&&(m(t),m(o),m(i)),w(e,M),w(n,M),w(u,M),w(a,M)}}}function Fl(r){let e,l,t,n=r[3][r[21].pedestrian_location]+"",s;return{c(){e=T("p"),l=v("Pedestrian location: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&2097152&&n!==(n=o[3][o[21].pedestrian_location]+"")&&G(s,n)},d(o){o&&m(e)}}}function Gl(r){let e,l,t,n=r[4][r[21].pedestrian_movement]+"",s;return{c(){e=T("p"),l=v("Pedestrian movement: "),t=T("b"),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(t,s)},p(o,u){u&2097152&&n!==(n=o[4][o[21].pedestrian_movement]+"")&&G(s,n)},d(o){o&&m(e)}}}function l$(r){let e,l,t,n=r[21].year+"",s,o,u,f,i,a=r[5][r[21].severity]+"",c,$,_,y,S,C=ql(r[21])+"",O,F,R,j,M,N=r[21].pedestrian_location&&Fl(r),P=r[21].pedestrian_movement&&Gl(r);return{c(){e=T("p"),l=v("Year: "),t=T("b"),s=v(n),o=I(),u=T("p"),f=v("Severity: "),i=T("b"),c=v(a),$=I(),_=T("p"),y=v("Casualties: "),S=T("b"),O=v(C),F=I(),N&&N.c(),R=I(),P&&P.c(),j=I(),M=T("p"),M.textContent="Click to open full report in CycleStreets"},m(L,D){p(L,e,D),h(e,l),h(e,t),h(t,s),p(L,o,D),p(L,u,D),h(u,f),h(u,i),h(i,c),p(L,$,D),p(L,_,D),h(_,y),h(_,S),h(S,O),p(L,F,D),N&&N.m(L,D),p(L,R,D),P&&P.m(L,D),p(L,j,D),p(L,M,D)},p(L,D){D&2097152&&n!==(n=L[21].year+"")&&G(s,n),D&2097152&&a!==(a=L[5][L[21].severity]+"")&&G(c,a),D&2097152&&C!==(C=ql(L[21])+"")&&G(O,C),L[21].pedestrian_location?N?N.p(L,D):(N=Fl(L),N.c(),N.m(R.parentNode,R)):N&&(N.d(1),N=null),L[21].pedestrian_movement?P?P.p(L,D):(P=Gl(L),P.c(),P.m(j.parentNode,j)):P&&(P.d(1),P=null)},d(L){L&&(m(e),m(o),m(u),m($),m(_),m(F),m(R),m(j),m(M)),N&&N.d(L),P&&P.d(L)}}}function s$(r){let e,l;return e=new ce({props:{$$slots:{default:[l$,({props:t})=>({21:t}),({props:t})=>t?2097152:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&6291456&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function r$(r){let e,l;const t=[q(zt),{sourceLayer:zt},{paint:{"circle-color":de(["get","severity"],[1,2,3],[r[6],r[7],r[8]]),"circle-opacity":.9,"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,15],"circle-stroke-color":"black","circle-stroke-width":.1}},{filter:r[1]},{layout:{visibility:r[0].show?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[s$]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0].show&&Al(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${zt}.pmtiles`,$$slots:{default:[r$]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&4194304&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0].show,B(()=>l=!1)),e.$set($),a[0].show?i?(i.p(a,c),c&1&&g(i,1)):(i=Al(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&4194307&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let zt="stats19";function i$(r){let[e,l,t]=r.split("/");return{show:!0,pedestrians:e.includes("pedestrians"),cyclists:e.includes("cyclists"),horseRiders:e.includes("horseRiders"),other:e.includes("other"),minYear:parseInt(l),maxYear:parseInt(t)}}function ql(r){let e=[];return r.pedestrian&&e.push("pedestrian"),r.cyclist&&e.push("cyclist"),r.horse_rider&&e.push("horse rider"),r.other&&e.push("other"),e.join(", ")}function f$(r){window.open(`https://www.cyclestreets.net/collisions/reports/${r.detail.features[0].properties.accident_index}`,"_blank")}function a$(r,e,l){let t,n,s=["pedestrians","cyclists","horseRiders","other"],o={show:!1,pedestrians:!0,cyclists:!0,horseRiders:!0,other:!1,minYear:2017,maxYear:2022};function u(L){return L.show?`${s.filter(W=>L[W]).join(",")}/${L.minYear}/${L.maxYear}`:null}let f=kt(zt,o,u,i$);x(r,f,L=>l(0,n=L));function i(L,D,W,Q,A,Y){let Z=["any"];return n.pedestrians&&Z.push(["get","pedestrian"]),n.cyclists&&Z.push(["get","cyclist"]),n.horseRiders&&Z.push(["get","horse_rider"]),n.other&&Z.push(["get","other"]),["all",[">=",["get","year"],n.minYear],["<=",["get","year"],n.maxYear],Z]}let a={1:"Crossing on pedestrian crossing facility",2:"Crossing in zig-zag approach lines",3:"Crossing in zig-zag exit lines",4:"Crossing elsewhere within 50m. of pedestrian crossing",5:"In carriageway, crossing elsewhere",6:"On footway or verge",7:"On refuge, central island or central reservation",8:"In centre of carriageway - not on refuge, island or central reservation",9:"In carriageway, not crossing"},c={1:"Crossing from driver's nearside",2:"Crossing from nearside - masked by parked or stationary vehicle",3:"Crossing from driver's offside",4:"Crossing from offside - masked by parked or stationary vehicle",5:"In carriageway, stationary - not crossing (standing or playing)",6:"In carriageway, stationary - not crossing (standing or playing - masked by parked or stationary vehicle)",7:"Walking along in carriageway, facing traffic",8:"Walking along in carriageway, back to traffic"},$={1:"Fatal",2:"Serious",3:"Slight"},_=ne.sequential_low_to_high[4],y=ne.sequential_low_to_high[2],S=ne.sequential_low_to_high[0],C=[["Fatal",_],["Serious",y],["Slight",S]];function O(L){r.$$.not_equal(n.show,L)&&(n.show=L,f.set(n))}function F(L){r.$$.not_equal(n.pedestrians,L)&&(n.pedestrians=L,f.set(n))}function R(L){r.$$.not_equal(n.cyclists,L)&&(n.cyclists=L,f.set(n))}function j(L){r.$$.not_equal(n.horseRiders,L)&&(n.horseRiders=L,f.set(n))}function M(L){r.$$.not_equal(n.other,L)&&(n.other=L,f.set(n))}function N(){n.minYear=Wt(this.value),f.set(n)}function P(){n.maxYear=Wt(this.value),f.set(n)}return r.$$.update=()=>{r.$$.dirty&1&&l(1,t=i(n.minYear,n.maxYear,n.pedestrians,n.cyclists,n.horseRiders,n.other))},[n,t,f,a,c,$,_,y,S,C,O,F,R,j,M,N,P]}class u$ extends K{constructor(e){super(),X(this,e,a$,o$,V,{})}}function c$(r){let e;return{c(){e=v("Vehicle counts")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function $$(r){let e;return{c(){e=v(`DfT road statistics + `)},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function p$(r){let e;return{c(){e=v("methodology")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function m$(r){let e,l,t,n,s,o,u,f,i,a,c;return t=new te({props:{href:"https://roadtraffic.dft.gov.uk/downloads",$$slots:{default:[$$]},$$scope:{ctx:r}}}),s=new te({props:{href:"https://storage.googleapis.com/dft-statistics/road-traffic/all-traffic-data-metadata.pdf",$$slots:{default:[p$]},$$scope:{ctx:r}}}),a=new Te({}),{c(){e=T("p"),l=v("AADF (annual average daily flow) data from "),b(t.$$.fragment),n=v(`. This counts the total daily number of vehicles + traveling past a count point (in both directions) on an average day of + the year. Data from the latest year available is shown. See `),b(s.$$.fragment),o=v(" for details and caveats about the measurements."),u=I(),f=T("p"),f.textContent=`The colors show motor vehicles AADF, not pedal cycles. The outline is + thicker when the latest data is a manual or automatic count, and thinner + when it's an estimate from previous years or nearby counters. Click a + point for full data.`,i=I(),b(a.$$.fragment)},m($,_){p($,e,_),h(e,l),k(t,e,null),h(e,n),k(s,e,null),h(e,o),p($,u,_),p($,f,_),p($,i,_),k(a,$,_),c=!0},p($,_){const y={};_&128&&(y.$$scope={dirty:_,ctx:$}),t.$set(y);const S={};_&128&&(S.$$scope={dirty:_,ctx:$}),s.$set(S)},i($){c||(g(t.$$.fragment,$),g(s.$$.fragment,$),g(a.$$.fragment,$),c=!0)},o($){d(t.$$.fragment,$),d(s.$$.fragment,$),d(a.$$.fragment,$),c=!1},d($){$&&(m(e),m(u),m(f),m(i)),w(t),w(s),w(a,$)}}}function _$(r){let e,l,t;return l=new $e({props:{$$slots:{default:[m$]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&128&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function zl(r){let e,l;return e=new Ge({props:{colorScale:r[1],limits:r[3]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function g$(r){let e,l=r[6].location+"",t,n,s,o,u=r[6].year+"",f,i,a,c=r[6].motor_vehicles.toLocaleString()+"",$,_,y,S,C=r[6].year+"",O,F,R,j=r[6].pedal_cycles.toLocaleString()+"",M,N,P,L,D,W=r[6].method+"",Q;return{c(){e=T("h2"),t=v(l),n=I(),s=T("p"),o=v("Total motor vehicles ("),f=v(u),i=v(` AADF): + `),a=T("b"),$=v(c),_=I(),y=T("p"),S=v("Total pedal cycles ("),O=v(C),F=v(` AADF): + `),R=T("b"),M=v(j),N=I(),P=T("p"),L=v("Count method: "),D=T("b"),Q=v(W)},m(A,Y){p(A,e,Y),h(e,t),p(A,n,Y),p(A,s,Y),h(s,o),h(s,f),h(s,i),h(s,a),h(a,$),p(A,_,Y),p(A,y,Y),h(y,S),h(y,O),h(y,F),h(y,R),h(R,M),p(A,N,Y),p(A,P,Y),h(P,L),h(P,D),h(D,Q)},p(A,Y){Y&64&&l!==(l=A[6].location+"")&&G(t,l),Y&64&&u!==(u=A[6].year+"")&&G(f,u),Y&64&&c!==(c=A[6].motor_vehicles.toLocaleString()+"")&&G($,c),Y&64&&C!==(C=A[6].year+"")&&G(O,C),Y&64&&j!==(j=A[6].pedal_cycles.toLocaleString()+"")&&G(M,j),Y&64&&W!==(W=A[6].method+"")&&G(Q,W)},d(A){A&&(m(e),m(n),m(s),m(_),m(y),m(N),m(P))}}}function d$(r){let e,l;return e=new ce({props:{$$slots:{default:[g$,({props:t})=>({6:t}),({props:t})=>t?64:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&192&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function h$(r){let e,l;const t=[q(Ht),{sourceLayer:Ht},{paint:{"circle-color":de(["get","motor_vehicles"],r[2],r[1]),"circle-opacity":.9,"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,15],"circle-stroke-color":"black","circle-stroke-width":["case",["in",["get","method"],["literal",["Manual count","Automatic counter"]]],1.5,.1]}},{layout:{visibility:r[0]?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[d$]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&zl(r);return s=new _e({props:{url:`pmtiles://${pe()}/v1/${Ht}.pmtiles`,$$slots:{default:[h$]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&128&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=zl(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&129&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let Ht="vehicle_counts";function k$(r){window.open(`https://roadtraffic.dft.gov.uk/manualcountpoints/${r.detail.features[0].properties.count_point}`,"_blank")}function w$(r,e,l){let t,n=ne.sequential_low_to_high,s=[0,4e4,8e4,12e4,16e4,205e3],o=["","40k","80k","120k","160k",""],u=he(Ht);x(r,u,i=>l(0,t=i));function f(i){t=i,u.set(t)}return[t,n,s,o,u,f]}class v$ extends K{constructor(e){super(),X(this,e,w$,b$,V,{})}}function Hl(r,e,l){const t=r.slice();return t[6]=e[l],t}function y$(r){let e;return{c(){e=v("Issues & Conflicts")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function S$(r){let e,l,t;return{c(){e=T("p"),e.textContent=`Critical issues and policy conflicts from the Design Assistance Log. + This is internally collected data.`,l=I(),t=T("p"),t.textContent=`This layer is manually copied from a copy of the DA Log. The data is + recent as of 10 June 2024.`},m(n,s){p(n,e,s),p(n,l,s),p(n,t,s)},p:ee,d(n){n&&(m(e),m(l),m(t))}}}function C$(r){let e,l,t;return l=new $e({props:{$$slots:{default:[S$]},$$scope:{ctx:r}}}),{c(){e=T("span"),b(l.$$.fragment),z(e,"slot","right")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&512&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function El(r){let e,l;return e=new Jt({props:{rows:r[3]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function T$(r){let e,l=r[5]["Issue ID"]+"",t,n,s=r[5].Code+"",o,u,f,i=r[5]["Issue Stage"]+"",a;return{c(){e=T("h2"),t=v(l),n=v(" - "),o=v(s),u=I(),f=T("p"),a=v(i)},m(c,$){p(c,e,$),h(e,t),h(e,n),h(e,o),p(c,u,$),p(c,f,$),h(f,a)},p(c,$){$&32&&l!==(l=c[5]["Issue ID"]+"")&&G(t,l),$&32&&s!==(s=c[5].Code+"")&&G(o,s),$&32&&i!==(i=c[5]["Issue Stage"]+"")&&G(a,i)},d(c){c&&(m(e),m(u),m(f))}}}function Bl(r){let e,l=r[6]+"",t,n,s,o=r[5][r[6]]+"",u,f;return{c(){e=T("p"),t=v(l),n=v(`: + `),s=T("b"),u=v(o),f=I()},m(i,a){p(i,e,a),h(e,t),h(e,n),h(e,s),h(s,u),h(e,f)},p(i,a){a&32&&o!==(o=i[5][i[6]]+"")&&G(u,o)},d(i){i&&m(e)}}}function L$(r){let e,l=we(r[2]),t=[];for(let n=0;n({5:s}),({props:s})=>s?32:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[L$,({props:s})=>({5:s}),({props:s})=>s?32:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment)},m(s,o){k(e,s,o),p(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&544&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&544&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&m(l),w(e,s),w(t,s)}}}function M$(r){let e,l;const t=[q(cn),{paint:{"circle-color":Ze(["get","Design Review Status"],Object.fromEntries(r[3]),"cyan"),"circle-opacity":.9,"circle-radius":["interpolate",["linear"],["zoom"],1,2,8,3,13,15],"circle-stroke-color":"black","circle-stroke-width":.1}},{layout:{visibility:r[0]?"visible":"none"}},{hoverCursor:"pointer"},{eventsIfTopMost:!0}];let n={$$slots:{default:[I$]},$$scope:{ctx:r}};for(let s=0;sE(e,"checked",u));let i=r[0]&&El(r);return s=new bt({props:{data:`${Yt()}/v1/problems.geojson.gz`,$$slots:{default:[M$]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),t=I(),i&&i.c(),n=I(),b(s.$$.fragment)},m(a,c){k(e,a,c),p(a,t,c),i&&i.m(a,c),p(a,n,c),k(s,a,c),o=!0},p(a,[c]){const $={};c&512&&($.$$scope={dirty:c,ctx:a}),!l&&c&1&&(l=!0,$.checked=a[0],B(()=>l=!1)),e.$set($),a[0]?i?(i.p(a,c),c&1&&g(i,1)):(i=El(a),i.c(),g(i,1),i.m(n.parentNode,n)):i&&(ae(),d(i,1,1,()=>{i=null}),ue());const _={};c&513&&(_.$$scope={dirty:c,ctx:a}),s.$set(_)},i(a){o||(g(e.$$.fragment,a),g(i),g(s.$$.fragment,a),o=!0)},o(a){d(e.$$.fragment,a),d(i),d(s.$$.fragment,a),o=!1},d(a){a&&(m(t),m(n)),w(e,a),i&&i.d(a),w(s,a)}}}let cn="problems";function O$(r,e,l){let t,n=he(cn);x(r,n,f=>l(0,t=f));let s=["Issue ID","Scheme ID","Date Logged","Inspector","Street Location","Code","Issue Description","External Inspectorate Comment for LA","Issue Stage","Resolved by Design","Design Review Status","Date of Resolution","Design Resolution"],o=[["Outstanding","red"],["Pending","yellow"],["Resolved","green"],["Not Applicable","grey"],["No Resolution Planned","black"]];function u(f){t=f,n.set(t)}return[t,n,s,o,u]}class P$ extends K{constructor(e){super(),X(this,e,O$,N$,V,{})}}function j$(r){let e;function l(s,o){return s[2]<=100?A$:R$}let t=l(r),n=t(r);return{c(){n.c(),e=ve()},m(s,o){n.m(s,o),p(s,e,o)},p(s,o){t===(t=l(s))&&n?n.p(s,o):(n.d(1),n=t(s),n&&(n.c(),n.m(e.parentNode,e)))},i:ee,o:ee,d(s){s&&m(e),n.d(s)}}}function D$(r){let e,l;return e=new nt({props:{$$slots:{default:[F$]},$$scope:{ctx:r}}}),e.$on("click",r[3]),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&64&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function R$(r){let e;return{c(){e=T("label"),e.innerHTML=`Processing scheme data + `},m(l,t){p(l,e,t)},p:ee,d(l){l&&m(e)}}}function A$(r){let e,l,t;return{c(){e=T("label"),l=v(`Downloading scheme data + `),t=T("progress"),t.value=r[2],z(t,"class","svelte-q3473n")},m(n,s){p(n,e,s),h(e,l),h(e,t)},p(n,s){s&4&&(t.value=n[2])},d(n){n&&m(e)}}}function F$(r){let e;return{c(){e=v("Load latest scheme data")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function G$(r){let e,l,t,n;const s=[D$,j$],o=[];function u(f,i){return f[0]?f[1]?1:-1:0}return~(e=u(r))&&(l=o[e]=s[e](r)),{c(){l&&l.c(),t=ve()},m(f,i){~e&&o[e].m(f,i),p(f,t,i),n=!0},p(f,[i]){let a=e;e=u(f),e===a?~e&&o[e].p(f,i):(l&&(ae(),d(o[a],1,1,()=>{o[a]=null}),ue()),~e?(l=o[e],l?l.p(f,i):(l=o[e]=s[e](f),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(f){n||(g(l),n=!0)},o(f){d(l),n=!1},d(f){f&&m(t),~e&&o[e].d(f)}}}function q$(r,e,l){let{loadFile:t}=e,n=!new URLSearchParams(window.location.search).has("disable_schemes"),s=!0,o=0;async function u(){let i=await Vs(`${Yt()}/v1/all_schemes_output.geojson.gz`,c=>{l(2,o=c)});l(2,o=100);let a=new TextDecoder().decode(i);t("all_schemes_output.geojson",a),l(1,s=!1)}As(async()=>{n&&await u()});async function f(){l(0,n=!0),await u()}return r.$$set=i=>{"loadFile"in i&&l(4,t=i.loadFile)},[n,s,o,f,t]}class z$ extends K{constructor(e){super(),X(this,e,q$,G$,V,{loadFile:4})}}const en=Ae({type:"FeatureCollection",features:[],schemes:{}}),$n=Ae(new Map),Ul=Ae(""),Wl=Ae(""),pn=Ae({type:"FeatureCollection",features:[],schemes:{}}),mn=Ae(new Map),Yl=Ae(""),Jl=Ae("");function H$(r){let e={type:"FeatureCollection",features:[],schemes:{},notes:r.notes},l=new Map,t={type:"FeatureCollection",features:[],schemes:{},notes:r.notes},n=new Map;for(let[s,o]of Object.entries(r.schemes))o.pipeline?(n.set(s,o),t.schemes[s]=o):(l.set(s,o),e.schemes[s]=o);for(let s of r.features){if(!E$(s))continue;let o=s.properties.scheme_reference,u=l.has(o),i=(u?l:n).get(o);i.browse&&(s.properties.funding_programme=i.browse.funding_programme,s.properties.current_milestone=i.browse.current_milestone);let a=u?e:t;s.id=a.features.length+1,a.features.push(s)}en.set(e),$n.set(l),pn.set(t),mn.set(n)}function E$(r){return!["eb0ad8ed183c137da4bae66afa944da9","0a568f07241be96f0a70aa73a0de80c8","6c4a5d57176eaeb3296eba790f869909","475e9a43749ce09c7edaaffa0ae57a2f","117b783cb2916a1bb4262960e523acc5","7a600e6342b226aa0983c8dfed19254f","84cc5eb1b52a4e49188058373e587ff0"].includes(r.properties.id)}let Et={ATF2:"#66c2a5","ATF2 or ATF3":"#fc8d62",ATF3:"#8da0cb",ATF4:"#e78ac3",ATF4E:"#a6d854"},_n={removed:"grey","no data":"grey","not progressed":"red",superseded:"red","preliminary design completed":"#fbb862","feasability design completed":"#eddc76","detailed design completed":"#dafd9d","consruction started":"#76c384","construction completed":"#488f31"};function Vl(r,e,l){const t=r.slice();return t[28]=e[l],t[29]=e,t[30]=l,t}function B$(r){let e;return{c(){e=v("Filters")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function U$(r){let e;return{c(){e=v("Reset all filters")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function W$(r){let e,l,t,n,s,o,u,f;e=new an({props:{label:"Intervention name or description",id:"filterInterventionText",$$slots:{default:[V$]},$$scope:{ctx:r}}});function i(_){r[23](_)}let a={label:"Scheme name or reference",options:tn(r[3])};r[0]!==void 0&&(a.value=r[0]),t=new Gs({props:a}),H.push(()=>E(t,"value",i));function c(_){r[24](_)}let $={label:"Authority or region",choices:r[10],emptyOption:!0};return r[4]!==void 0&&($.value=r[4]),o=new dt({props:$}),H.push(()=>E(o,"value",c)),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),s=I(),b(o.$$.fragment)},m(_,y){k(e,_,y),p(_,l,y),k(t,_,y),p(_,s,y),k(o,_,y),f=!0},p(_,y){const S={};y[0]&2|y[1]&1&&(S.$$scope={dirty:y,ctx:_}),e.$set(S);const C={};y[0]&8&&(C.options=tn(_[3])),!n&&y[0]&1&&(n=!0,C.value=_[0],B(()=>n=!1)),t.$set(C);const O={};y[0]&1024&&(O.choices=_[10]),!u&&y[0]&16&&(u=!0,O.value=_[4],B(()=>u=!1)),o.$set(O)},i(_){f||(g(e.$$.fragment,_),g(t.$$.fragment,_),g(o.$$.fragment,_),f=!0)},o(_){d(e.$$.fragment,_),d(t.$$.fragment,_),d(o.$$.fragment,_),f=!1},d(_){_&&(m(l),m(s)),w(e,_),w(t,_),w(o,_)}}}function Y$(r){let e,l,t,n,s,o,u,f,i,a,c,$,_,y,S,C;t=new an({props:{label:"Intervention name or description",id:"filterInterventionText",$$slots:{default:[Z$]},$$scope:{ctx:r}}});function O(P){r[17](P)}let F={label:"Scheme name or reference",options:tn(r[3])};r[0]!==void 0&&(F.value=r[0]),s=new Gs({props:F}),H.push(()=>E(s,"value",O));function R(P){r[18](P)}let j={label:"Authority or region",choices:r[10],emptyOption:!0};r[4]!==void 0&&(j.value=r[4]),f=new dt({props:j}),H.push(()=>E(f,"value",R)),$=new an({props:{label:"Funding programmes",id:"filterFundingProgrammes",$$slots:{default:[x$]},$$scope:{ctx:r}}});function M(P){r[20](P)}let N={label:"Current milestone",choices:r[11],emptyOption:!0};return r[6]!==void 0&&(N.value=r[6]),y=new dt({props:N}),H.push(()=>E(y,"value",M)),{c(){e=T("div"),l=T("div"),b(t.$$.fragment),n=I(),b(s.$$.fragment),u=I(),b(f.$$.fragment),a=I(),c=T("div"),b($.$$.fragment),_=I(),b(y.$$.fragment),z(l,"class","govuk-grid-column-one-half"),z(c,"class","govuk-grid-column-one-half"),z(e,"class","govuk-grid-row")},m(P,L){p(P,e,L),h(e,l),k(t,l,null),h(l,n),k(s,l,null),h(l,u),k(f,l,null),h(e,a),h(e,c),k($,c,null),h(c,_),k(y,c,null),C=!0},p(P,L){const D={};L[0]&2|L[1]&1&&(D.$$scope={dirty:L,ctx:P}),t.$set(D);const W={};L[0]&8&&(W.options=tn(P[3])),!o&&L[0]&1&&(o=!0,W.value=P[0],B(()=>o=!1)),s.$set(W);const Q={};L[0]&1024&&(Q.choices=P[10]),!i&&L[0]&16&&(i=!0,Q.value=P[4],B(()=>i=!1)),f.$set(Q);const A={};L[0]&32|L[1]&1&&(A.$$scope={dirty:L,ctx:P}),$.$set(A);const Y={};!S&&L[0]&64&&(S=!0,Y.value=P[6],B(()=>S=!1)),y.$set(Y)},i(P){C||(g(t.$$.fragment,P),g(s.$$.fragment,P),g(f.$$.fragment,P),g($.$$.fragment,P),g(y.$$.fragment,P),C=!0)},o(P){d(t.$$.fragment,P),d(s.$$.fragment,P),d(f.$$.fragment,P),d($.$$.fragment,P),d(y.$$.fragment,P),C=!1},d(P){P&&m(e),w(t),w(s),w(f),w($),w(y)}}}function J$(r){let e;return{c(){e=v("Clear")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function V$(r){let e,l,t,n,s,o;return t=new nt({props:{$$slots:{default:[J$]},$$scope:{ctx:r}}}),t.$on("click",r[22]),{c(){e=T("input"),l=I(),b(t.$$.fragment),z(e,"type","text"),z(e,"class","govuk-input govuk-input--width-10"),z(e,"id","filterInterventionText")},m(u,f){p(u,e,f),Je(e,r[1]),p(u,l,f),k(t,u,f),n=!0,s||(o=tt(e,"input",r[21]),s=!0)},p(u,f){f[0]&2&&e.value!==u[1]&&Je(e,u[1]);const i={};f[1]&1&&(i.$$scope={dirty:f,ctx:u}),t.$set(i)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){d(t.$$.fragment,u),n=!1},d(u){u&&(m(e),m(l)),w(t,u),s=!1,o()}}}function Q$(r){let e;return{c(){e=v("Clear")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Z$(r){let e,l,t,n,s,o;return t=new nt({props:{$$slots:{default:[Q$]},$$scope:{ctx:r}}}),t.$on("click",r[16]),{c(){e=T("input"),l=I(),b(t.$$.fragment),z(e,"type","text"),z(e,"class","govuk-input govuk-input--width-10"),z(e,"id","filterInterventionText")},m(u,f){p(u,e,f),Je(e,r[1]),p(u,l,f),k(t,u,f),n=!0,s||(o=tt(e,"input",r[15]),s=!0)},p(u,f){f[0]&2&&e.value!==u[1]&&Je(e,u[1]);const i={};f[1]&1&&(i.$$scope={dirty:f,ctx:u}),t.$set(i)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){d(t.$$.fragment,u),n=!1},d(u){u&&(m(e),m(l)),w(t,u),s=!1,o()}}}function K$(r){let e=r[28]+"",l,t;return{c(){l=v(e),t=I()},m(n,s){p(n,l,s),p(n,t,s)},p:ee,d(n){n&&(m(l),m(t))}}}function Ql(r){let e,l,t;function n(o){r[19](o,r[28])}let s={$$slots:{default:[K$]},$$scope:{ctx:r}};return r[5][r[28]]!==void 0&&(s.checked=r[5][r[28]]),e=new ie({props:s}),H.push(()=>E(e,"checked",n)),{c(){b(e.$$.fragment)},m(o,u){k(e,o,u),t=!0},p(o,u){r=o;const f={};u[1]&1&&(f.$$scope={dirty:u,ctx:r}),!l&&u[0]&32&&(l=!0,f.checked=r[5][r[28]],B(()=>l=!1)),e.$set(f)},i(o){t||(g(e.$$.fragment,o),t=!0)},o(o){d(e.$$.fragment,o),t=!1},d(o){w(e,o)}}}function X$(r){let e,l,t=we(Object.keys(Et)),n=[];for(let o=0;od(n[o],1,1,()=>{n[o]=null});return{c(){for(let o=0;o{A[je]=null}),ue(),P=A[N],P?P.p(Z,U):(P=A[N]=Q[N](Z),P.c()),g(P,1),P.m(L.parentNode,L));const J={};U[1]&1&&(J.$$scope={dirty:U,ctx:Z}),D.$set(J)},i(Z){W||(g(j.$$.fragment,Z),g(P),g(D.$$.fragment,Z),W=!0)},o(Z){d(j.$$.fragment,Z),d(P),d(D.$$.fragment,Z),W=!1},d(Z){Z&&(m(e),m(l),m(t),m(R),m(M),m(L)),w(j,Z),A[N].d(Z),w(D,Z)}}}function np(r){let e,l,t,n,s;e=new nt({props:{$$slots:{default:[B$]},$$scope:{ctx:r}}}),e.$on("click",r[14]);function o(f){r[26](f)}let u={title:`Filter ${r[2]} schemes`,$$slots:{default:[tp]},$$scope:{ctx:r}};return r[7]!==void 0&&(u.open=r[7]),t=new Is({props:u}),H.push(()=>E(t,"open",o)),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment)},m(f,i){k(e,f,i),p(f,l,i),k(t,f,i),s=!0},p(f,i){const a={};i[1]&1&&(a.$$scope={dirty:i,ctx:f}),e.$set(a);const c={};i[0]&4&&(c.title=`Filter ${f[2]} schemes`),i[0]&2047|i[1]&1&&(c.$$scope={dirty:i,ctx:f}),!n&&i[0]&128&&(n=!0,c.open=f[7],B(()=>n=!1)),t.$set(c)},i(f){s||(g(e.$$.fragment,f),g(t.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(t.$$.fragment,f),s=!1},d(f){f&&m(l),w(e,f),w(t,f)}}}function lp(r){var t;let e=new Set;for(let n of r.values())(t=n.browse)!=null&&t.authority_or_region&&e.add(n.browse.authority_or_region);let l=Array.from(e.entries());return l.sort(),l}function Zl(r){return r*621371e-9}function tn(r){let e=[];for(let l of r.values())e.push([l.scheme_reference,l.scheme_reference]),l.scheme_name&&e.push([l.scheme_name,l.scheme_name]);return e}function sp(r,e,l){let t,{source:n}=e,{schemes:s}=e,{schemesGj:o}=e,{filterSchemeText:u}=e,{filterInterventionText:f}=e,i=!1,a=new Set,c={interventions:0,totalLength:0},$=Object.keys(_n).map(U=>[U,U]),_="",y=Object.fromEntries(Object.keys(Et).map(U=>[U,!0])),S="";function C(U,Le,je,J,at){let Ie=U.toLowerCase(),ut=Le.toLowerCase(),Vt=ke=>{var Xe,st,vt,Bt;if(Ie&&!((Xe=ke.properties.name)!=null&&Xe.toLowerCase().includes(Ie))&&!((st=ke.properties.description)!=null&&st.toLowerCase().includes(Ie)))return!1;let qe=s.get(ke.properties.scheme_reference);return!(je&&((vt=qe.browse)==null?void 0:vt.authority_or_region)!=je||n=="ATF"&&!J[qe.browse.funding_programme]||at&&((Bt=qe.browse)==null?void 0:Bt.current_milestone)!=at||ut&&!qe.scheme_reference.toLowerCase().includes(ut)&&!(qe.scheme_name??"").toLowerCase().includes(ut))};l(8,a=new Set(o.features.filter(Vt).map(ke=>ke.properties.scheme_reference))),l(9,c={interventions:0,totalLength:0});let wt=ke=>{var qe,Xe;return!(!a.has(ke.properties.scheme_reference)||Ie&&!((qe=ke.properties.name)!=null&&qe.toLowerCase().includes(Ie))&&!((Xe=ke.properties.description)!=null&&Xe.toLowerCase().includes(Ie)))};for(let ke of o.features)wt(ke)?(delete ke.properties.hide_while_editing,l(9,c.interventions++,c),ke.geometry.type=="LineString"&&ke.properties.length_meters&&l(9,c.totalLength+=ke.properties.length_meters,c)):ke.properties.hide_while_editing=!0;l(13,o),l(9,c)}function O(){l(4,_=""),l(5,y=Object.fromEntries(Object.keys(Et).map(U=>[U,!0]))),l(6,S=""),l(1,f=""),l(0,u="")}const F=()=>l(7,i=!0);function R(){f=this.value,l(1,f)}const j=()=>l(1,f="");function M(U){u=U,l(0,u)}function N(U){_=U,l(4,_)}function P(U,Le){r.$$.not_equal(y[Le],U)&&(y[Le]=U,l(5,y))}function L(U){S=U,l(6,S)}function D(){f=this.value,l(1,f)}const W=()=>l(1,f="");function Q(U){u=U,l(0,u)}function A(U){_=U,l(4,_)}const Y=()=>l(7,i=!1);function Z(U){i=U,l(7,i)}return r.$$set=U=>{"source"in U&&l(2,n=U.source),"schemes"in U&&l(3,s=U.schemes),"schemesGj"in U&&l(13,o=U.schemesGj),"filterSchemeText"in U&&l(0,u=U.filterSchemeText),"filterInterventionText"in U&&l(1,f=U.filterInterventionText)},r.$$.update=()=>{r.$$.dirty[0]&8&&l(10,t=lp(s)),r.$$.dirty[0]&115&&C(f,u,_,y,S)},[u,f,n,s,_,y,S,i,a,c,t,$,O,o,F,R,j,M,N,P,L,D,W,Q,A,Y,Z]}class zs extends K{constructor(e){super(),X(this,e,sp,np,V,{source:2,schemes:3,schemesGj:13,filterSchemeText:0,filterInterventionText:1},null,[-1,-1])}}function Kl(r){let e,l,t,n=r[0].status+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Status",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].status+"")&&G(s,n)},d(o){o&&m(e)}}}function Xl(r){let e,l,t,n=r[0].timescale+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Timescale",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].timescale+"")&&G(s,n)},d(o){o&&m(e)}}}function xl(r){let e,l,t,n=r[0].timescale_year+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Estimated completion year",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].timescale_year+"")&&G(s,n)},d(o){o&&m(e)}}}function es(r){let e,l,t,n=r[0].year_published+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Scheme most recently published",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].year_published+"")&&G(s,n)},d(o){o&&m(e)}}}function ts(r){let e,l,t,n=r[0].year_consulted+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Scheme most recently consulted on",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&1&&n!==(n=o[0].year_consulted+"")&&G(s,n)},d(o){o&&m(e)}}}function rp(r){let e,l,t,n,s,o=r[0].status&&Kl(r),u=r[0].timescale&&Xl(r),f=r[0].timescale_year&&xl(r),i=r[0].year_published&&es(r),a=r[0].year_consulted&&ts(r);return{c(){o&&o.c(),e=I(),u&&u.c(),l=I(),f&&f.c(),t=I(),i&&i.c(),n=I(),a&&a.c(),s=ve()},m(c,$){o&&o.m(c,$),p(c,e,$),u&&u.m(c,$),p(c,l,$),f&&f.m(c,$),p(c,t,$),i&&i.m(c,$),p(c,n,$),a&&a.m(c,$),p(c,s,$)},p(c,[$]){c[0].status?o?o.p(c,$):(o=Kl(c),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[0].timescale?u?u.p(c,$):(u=Xl(c),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),c[0].timescale_year?f?f.p(c,$):(f=xl(c),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null),c[0].year_published?i?i.p(c,$):(i=es(c),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null),c[0].year_consulted?a?a.p(c,$):(a=ts(c),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i:ee,o:ee,d(c){c&&(m(e),m(l),m(t),m(n),m(s)),o&&o.d(c),u&&u.d(c),f&&f.d(c),i&&i.d(c),a&&a.d(c)}}}function op(r,e,l){let{props:t}=e;return r.$$set=n=>{"props"in n&&l(0,t=n.props)},[t]}class Hs extends K{constructor(e){super(),X(this,e,op,rp,V,{props:0})}}function ns(r){let e,l,t,n=r[0].budget.toLocaleString()+"",s,o;return{c(){e=T("p"),l=T("b"),l.textContent="Cost",t=v(` + : `),s=v(n),o=v(` + GBP`)},m(u,f){p(u,e,f),h(e,l),h(e,t),h(e,s),h(e,o)},p(u,f){f&1&&n!==(n=u[0].budget.toLocaleString()+"")&&G(s,n)},d(u){u&&m(e)}}}function ls(r){let e;return{c(){e=T("p"),e.textContent="Development is fully funded"},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ss(r){let e;return{c(){e=T("p"),e.textContent="Construction is fully funded"},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function rs(r){let e,l,t,n;return{c(){e=T("p"),l=T("b"),l.textContent="Funding sources",t=v(` + : `),n=v(r[1])},m(s,o){p(s,e,o),h(e,l),h(e,t),h(e,n)},p(s,o){o&2&&G(n,s[1])},d(s){s&&m(e)}}}function ip(r){let e,l,t,n,s=r[0].budget&&ns(r),o=r[0].development_funded&&ls(),u=r[0].construction_funded&&ss(),f=r[1]&&rs(r);return{c(){s&&s.c(),e=I(),o&&o.c(),l=I(),u&&u.c(),t=I(),f&&f.c(),n=ve()},m(i,a){s&&s.m(i,a),p(i,e,a),o&&o.m(i,a),p(i,l,a),u&&u.m(i,a),p(i,t,a),f&&f.m(i,a),p(i,n,a)},p(i,[a]){i[0].budget?s?s.p(i,a):(s=ns(i),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),i[0].development_funded?o||(o=ls(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),i[0].construction_funded?u||(u=ss(),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),i[1]?f?f.p(i,a):(f=rs(i),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null)},i:ee,o:ee,d(i){i&&(m(e),m(l),m(t),m(n)),s&&s.d(i),o&&o.d(i),u&&u.d(i),f&&f.d(i)}}}function fp(r){if(!r.funding_sources)return"";let e=[];for(let l of["atf2","atf3","atf4","atf4e","crsts","luf"])r.funding_sources[l]&&e.push(l.toUpperCase());return r.funding_sources.other&&e.push(r.funding_sources.other),e.join(", ")}function ap(r,e,l){let t,{props:n}=e;return r.$$set=s=>{"props"in s&&l(0,n=s.props)},r.$$.update=()=>{r.$$.dirty&1&&l(1,t=fp(n))},[n,t]}class Es extends K{constructor(e){super(),X(this,e,ap,ip,V,{props:0})}}function rn(r){const e=r.slice(),l=e[5].pipeline;return e[12]=l,e}function on(r){const e=r.slice(),l=e[1].pipeline;return e[12]=l,e}function os(r){let e,l,t,n=Fn(r[1].length_meters)+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Length",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&2&&n!==(n=Fn(o[1].length_meters)+"")&&G(s,n)},d(o){o&&m(e)}}}function is(r){let e,l=it(r[1].description,r[3])+"";return{c(){e=T("p")},m(t,n){p(t,e,n),e.innerHTML=l},p(t,n){n&10&&l!==(l=it(t[1].description,t[3])+"")&&(e.innerHTML=l)},d(t){t&&m(e)}}}function fs(r){let e,l,t,n,s,o,u,f=r[12].atf4_type&&as(r),i=r[12].accuracy&&us(r),a=r[12].is_alternative&&cs();return n=new Es({props:{props:r[12]}}),o=new Hs({props:{props:r[12]}}),{c(){f&&f.c(),e=I(),i&&i.c(),l=I(),a&&a.c(),t=I(),b(n.$$.fragment),s=I(),b(o.$$.fragment)},m(c,$){f&&f.m(c,$),p(c,e,$),i&&i.m(c,$),p(c,l,$),a&&a.m(c,$),p(c,t,$),k(n,c,$),p(c,s,$),k(o,c,$),u=!0},p(c,$){c[12].atf4_type?f?f.p(c,$):(f=as(c),f.c(),f.m(e.parentNode,e)):f&&(f.d(1),f=null),c[12].accuracy?i?i.p(c,$):(i=us(c),i.c(),i.m(l.parentNode,l)):i&&(i.d(1),i=null),c[12].is_alternative?a||(a=cs(),a.c(),a.m(t.parentNode,t)):a&&(a.d(1),a=null);const _={};$&2&&(_.props=c[12]),n.$set(_);const y={};$&2&&(y.props=c[12]),o.$set(y)},i(c){u||(g(n.$$.fragment,c),g(o.$$.fragment,c),u=!0)},o(c){d(n.$$.fragment,c),d(o.$$.fragment,c),u=!1},d(c){c&&(m(e),m(l),m(t),m(s)),f&&f.d(c),i&&i.d(c),a&&a.d(c),w(n,c),w(o,c)}}}function as(r){let e,l,t,n=r[12].atf4_type+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="ATF4 type",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&2&&n!==(n=o[12].atf4_type+"")&&G(s,n)},d(o){o&&m(e)}}}function us(r){let e,l,t,n=r[12].accuracy+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Accuracy",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&2&&n!==(n=o[12].accuracy+"")&&G(s,n)},d(o){o&&m(e)}}}function cs(r){let e;return{c(){e=T("p"),e.textContent="Represents an alternative route"},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function $s(r){var o;let e,l,t,n=((o=r[5].browse)==null?void 0:o.capital_scheme_id)+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Capital scheme ID",t=v(` + : `),s=v(n)},m(u,f){p(u,e,f),h(e,l),h(e,t),h(e,s)},p(u,f){var i;f&32&&n!==(n=((i=u[5].browse)==null?void 0:i.capital_scheme_id)+"")&&G(s,n)},d(u){u&&m(e)}}}function ps(r){var o;let e,l,t,n=((o=r[5].browse)==null?void 0:o.current_milestone)+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Current milestone",t=v(` + : `),s=v(n)},m(u,f){p(u,e,f),h(e,l),h(e,t),h(e,s)},p(u,f){var i;f&32&&n!==(n=((i=u[5].browse)==null?void 0:i.current_milestone)+"")&&G(s,n)},d(u){u&&m(e)}}}function ms(r){let e,l,t,n,s,o,u,f=r[12].scheme_type&&_s(r),i=r[12].atf4_lead_type&&gs(r),a=r[12].scheme_description&&ds(r);return n=new Es({props:{props:r[12]}}),o=new Hs({props:{props:r[12]}}),{c(){f&&f.c(),e=I(),i&&i.c(),l=I(),a&&a.c(),t=I(),b(n.$$.fragment),s=I(),b(o.$$.fragment)},m(c,$){f&&f.m(c,$),p(c,e,$),i&&i.m(c,$),p(c,l,$),a&&a.m(c,$),p(c,t,$),k(n,c,$),p(c,s,$),k(o,c,$),u=!0},p(c,$){c[12].scheme_type?f?f.p(c,$):(f=_s(c),f.c(),f.m(e.parentNode,e)):f&&(f.d(1),f=null),c[12].atf4_lead_type?i?i.p(c,$):(i=gs(c),i.c(),i.m(l.parentNode,l)):i&&(i.d(1),i=null),c[12].scheme_description?a?a.p(c,$):(a=ds(c),a.c(),a.m(t.parentNode,t)):a&&(a.d(1),a=null);const _={};$&32&&(_.props=c[12]),n.$set(_);const y={};$&32&&(y.props=c[12]),o.$set(y)},i(c){u||(g(n.$$.fragment,c),g(o.$$.fragment,c),u=!0)},o(c){d(n.$$.fragment,c),d(o.$$.fragment,c),u=!1},d(c){c&&(m(e),m(l),m(t),m(s)),f&&f.d(c),i&&i.d(c),a&&a.d(c),w(n,c),w(o,c)}}}function _s(r){let e,l,t,n=r[12].scheme_type+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Scheme type",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&32&&n!==(n=o[12].scheme_type+"")&&G(s,n)},d(o){o&&m(e)}}}function gs(r){let e,l,t,n=r[12].atf4_lead_type+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="ATF4 lead type",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&32&&n!==(n=o[12].atf4_lead_type+"")&&G(s,n)},d(o){o&&m(e)}}}function ds(r){let e,l,t,n=r[12].scheme_description+"",s;return{c(){e=T("p"),l=T("b"),l.textContent="Descripton",t=v(` + : `),s=v(n)},m(o,u){p(o,e,u),h(e,l),h(e,t),h(e,s)},p(o,u){u&32&&n!==(n=o[12].scheme_description+"")&&G(s,n)},d(o){o&&m(e)}}}function up(r){let e;return{c(){e=v("Zoom to show entire scheme")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function cp(r){let e;return{c(){e=v("Edit a copy of this scheme")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function hs(r){var Sn,Cn,Tn,Ln;let e,l,t,n,s,o,u,f=it(r[1].name,r[3])+"",i,a=r[1].intervention_type+"",c,$,_,y,S,C,O,F,R,j=r[0].toUpperCase()+"",M,N,P,L,D,W,Q,A=it(r[5].scheme_name??"",r[2])+"",Y,Z,U,Le,je,J=it(r[1].scheme_reference,r[2])+"",at,Ie,ut,Vt,wt=((Sn=r[5].browse)==null?void 0:Sn.authority_or_region)+"",ke,qe,Xe,st,vt,Bt,Qt=((Cn=r[5].browse)==null?void 0:Cn.funding_programme)+"",nn,vn,ln,sn,rt,yn,ot,ze,Me=r[1].length_meters&&os(r),Ne=r[1].description&&is(r),ye=r[1].pipeline&&fs(on(r)),Oe=((Tn=r[5].browse)==null?void 0:Tn.capital_scheme_id)&&$s(r),Pe=((Ln=r[5].browse)==null?void 0:Ln.current_milestone)&&ps(r),Se=r[5].pipeline&&ms(rn(r));return rt=new nt({props:{$$slots:{default:[up]},$$scope:{ctx:r}}}),rt.$on("click",r[6]),ot=new nt({props:{$$slots:{default:[cp]},$$scope:{ctx:r}}}),ot.$on("click",r[7]),{c(){e=T("div"),l=T("h2"),l.textContent="Intervention",t=I(),n=T("p"),s=T("b"),s.textContent="Name",o=v(` + : `),u=new $t(!1),i=v(" ("),c=v(a),$=v(")"),_=I(),Me&&Me.c(),y=I(),Ne&&Ne.c(),S=I(),ye&&ye.c(),C=I(),O=T("hr"),F=I(),R=T("h2"),M=v(j),N=v(" Scheme"),P=I(),L=T("p"),D=T("b"),D.textContent="Scheme name",W=v(` + : `),Q=new $t(!1),Y=I(),Z=T("p"),U=T("b"),U.textContent="Scheme reference",Le=v(` + : `),je=new $t(!1),at=I(),Ie=T("p"),ut=T("b"),ut.textContent="Authority or region",Vt=v(` + : `),ke=v(wt),qe=I(),Oe&&Oe.c(),Xe=I(),st=T("p"),vt=T("b"),vt.textContent="Funding programme",Bt=v(` + : `),nn=v(Qt),vn=I(),Pe&&Pe.c(),ln=I(),Se&&Se.c(),sn=I(),b(rt.$$.fragment),yn=I(),b(ot.$$.fragment),u.a=i,Q.a=null,je.a=null,me(e,"max-width","30vw"),me(e,"max-height","60vh"),me(e,"overflow","auto")},m(fe,be){p(fe,e,be),h(e,l),h(e,t),h(e,n),h(n,s),h(n,o),u.m(f,n),h(n,i),h(n,c),h(n,$),h(e,_),Me&&Me.m(e,null),h(e,y),Ne&&Ne.m(e,null),h(e,S),ye&&ye.m(e,null),h(e,C),h(e,O),h(e,F),h(e,R),h(R,M),h(R,N),h(e,P),h(e,L),h(L,D),h(L,W),Q.m(A,L),h(e,Y),h(e,Z),h(Z,U),h(Z,Le),je.m(J,Z),h(e,at),h(e,Ie),h(Ie,ut),h(Ie,Vt),h(Ie,ke),h(e,qe),Oe&&Oe.m(e,null),h(e,Xe),h(e,st),h(st,vt),h(st,Bt),h(st,nn),h(e,vn),Pe&&Pe.m(e,null),h(e,ln),Se&&Se.m(e,null),h(e,sn),k(rt,e,null),h(e,yn),k(ot,e,null),r[10](e),ze=!0},p(fe,be){var Nn,On,Pn,jn;(!ze||be&10)&&f!==(f=it(fe[1].name,fe[3])+"")&&u.p(f),(!ze||be&2)&&a!==(a=fe[1].intervention_type+"")&&G(c,a),fe[1].length_meters?Me?Me.p(fe,be):(Me=os(fe),Me.c(),Me.m(e,y)):Me&&(Me.d(1),Me=null),fe[1].description?Ne?Ne.p(fe,be):(Ne=is(fe),Ne.c(),Ne.m(e,S)):Ne&&(Ne.d(1),Ne=null),fe[1].pipeline?ye?(ye.p(on(fe),be),be&2&&g(ye,1)):(ye=fs(on(fe)),ye.c(),g(ye,1),ye.m(e,C)):ye&&(ae(),d(ye,1,1,()=>{ye=null}),ue()),(!ze||be&1)&&j!==(j=fe[0].toUpperCase()+"")&&G(M,j),(!ze||be&36)&&A!==(A=it(fe[5].scheme_name??"",fe[2])+"")&&Q.p(A),(!ze||be&6)&&J!==(J=it(fe[1].scheme_reference,fe[2])+"")&&je.p(J),(!ze||be&32)&&wt!==(wt=((Nn=fe[5].browse)==null?void 0:Nn.authority_or_region)+"")&&G(ke,wt),(On=fe[5].browse)!=null&&On.capital_scheme_id?Oe?Oe.p(fe,be):(Oe=$s(fe),Oe.c(),Oe.m(e,Xe)):Oe&&(Oe.d(1),Oe=null),(!ze||be&32)&&Qt!==(Qt=((Pn=fe[5].browse)==null?void 0:Pn.funding_programme)+"")&&G(nn,Qt),(jn=fe[5].browse)!=null&&jn.current_milestone?Pe?Pe.p(fe,be):(Pe=ps(fe),Pe.c(),Pe.m(e,ln)):Pe&&(Pe.d(1),Pe=null),fe[5].pipeline?Se?(Se.p(rn(fe),be),be&32&&g(Se,1)):(Se=ms(rn(fe)),Se.c(),g(Se,1),Se.m(e,sn)):Se&&(ae(),d(Se,1,1,()=>{Se=null}),ue());const In={};be&8192&&(In.$$scope={dirty:be,ctx:fe}),rt.$set(In);const Mn={};be&8192&&(Mn.$$scope={dirty:be,ctx:fe}),ot.$set(Mn)},i(fe){ze||(g(ye),g(Se),g(rt.$$.fragment,fe),g(ot.$$.fragment,fe),ze=!0)},o(fe){d(ye),d(Se),d(rt.$$.fragment,fe),d(ot.$$.fragment,fe),ze=!1},d(fe){fe&&m(e),Me&&Me.d(),Ne&&Ne.d(),ye&&ye.d(),Oe&&Oe.d(),Pe&&Pe.d(),Se&&Se.d(),w(rt),w(ot),r[10](null)}}}function $p(r){let e=r[1],l,t,n=hs(r);return{c(){n.c(),l=ve()},m(s,o){n.m(s,o),p(s,l,o),t=!0},p(s,[o]){o&2&&V(e,e=s[1])?(ae(),d(n,1,1,ee),ue(),n=hs(s),n.c(),g(n,1),n.m(l.parentNode,l)):n.p(s,o)},i(s){t||(g(n),t=!0)},o(s){d(n),t=!1},d(s){s&&m(l),n.d(s)}}}function it(r,e){return e?r.replace(new RegExp(e,"gi"),l=>`${l}`):r}function pp(r,e,l){let t,n;x(r,hn,S=>l(11,n=S));let{source:s}=e,{props:o}=e,{schemes:u}=e,{schemesGj:f}=e,{filterSchemeText:i}=e,{filterInterventionText:a}=e,c;Zs(()=>{c&&l(4,c.scrollTop=0,c)});function $(){let S={type:"FeatureCollection",features:f.features.filter(C=>C.properties.scheme_reference==t.scheme_reference)};n==null||n.fitBounds(ir(S),{padding:20,animate:!1})}function _(){var F,R;let S={type:"FeatureCollection",features:f.features.filter(j=>j.properties.scheme_reference==t.scheme_reference),schemes:{}};S.schemes[t.scheme_reference]=t;let C=((F=t.browse)==null?void 0:F.authority_or_region)||"unknown authority",O=t.pipeline?"pipeline":"v1";O=="pipeline"&&(C+="_pipeline"),Ks(C,JSON.stringify(S)),window.open(`scheme.html?authority=${(R=t.browse)==null?void 0:R.authority_or_region}&schema=${O}`,"_blank")}function y(S){H[S?"unshift":"push"](()=>{c=S,l(4,c)})}return r.$$set=S=>{"source"in S&&l(0,s=S.source),"props"in S&&l(1,o=S.props),"schemes"in S&&l(8,u=S.schemes),"schemesGj"in S&&l(9,f=S.schemesGj),"filterSchemeText"in S&&l(2,i=S.filterSchemeText),"filterInterventionText"in S&&l(3,a=S.filterInterventionText)},r.$$.update=()=>{r.$$.dirty&258&&l(5,t=u.get(o.scheme_reference))},[s,o,i,a,c,t,$,_,u,f,y]}class wn extends K{constructor(e){super(),X(this,e,pp,$p,V,{source:0,props:1,schemes:8,schemesGj:9,filterSchemeText:2,filterInterventionText:3})}}function mp(r){let e,l=r[10].name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=n[10].name+"")&&G(t,l)},d(n){n&&m(e)}}}function _p(r){let e,l;return e=new wn({props:{source:r[0],props:r[10],schemesGj:r[3],schemes:r[2],filterSchemeText:r[4],filterInterventionText:r[5]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1&&(s.source=t[0]),n&1024&&(s.props=t[10]),n&8&&(s.schemesGj=t[3]),n&4&&(s.schemes=t[2]),n&16&&(s.filterSchemeText=t[4]),n&32&&(s.filterInterventionText=t[5]),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function gp(r){let e,l,t,n;return e=new ce({props:{popupClass:"border-popup",$$slots:{default:[mp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[_p,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment)},m(s,o){k(e,s,o),p(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&3072&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&3133&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&m(l),w(e,s),w(t,s)}}}function dp(r){let e,l=r[10].name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=n[10].name+"")&&G(t,l)},d(n){n&&m(e)}}}function hp(r){let e,l;return e=new wn({props:{source:r[0],props:r[10],schemesGj:r[3],schemes:r[2],filterSchemeText:r[4],filterInterventionText:r[5]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1&&(s.source=t[0]),n&1024&&(s.props=t[10]),n&8&&(s.schemesGj=t[3]),n&4&&(s.schemes=t[2]),n&16&&(s.filterSchemeText=t[4]),n&32&&(s.filterInterventionText=t[5]),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function bp(r){let e,l,t,n;return e=new ce({props:{popupClass:"border-popup",$$slots:{default:[dp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[hp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment)},m(s,o){k(e,s,o),p(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&3072&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&3133&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&m(l),w(e,s),w(t,s)}}}function kp(r){let e,l=r[10].name+"",t;return{c(){e=T("p"),t=v(l)},m(n,s){p(n,e,s),h(e,t)},p(n,s){s&1024&&l!==(l=n[10].name+"")&&G(t,l)},d(n){n&&m(e)}}}function wp(r){let e,l;return e=new wn({props:{source:r[0],props:r[10],schemesGj:r[3],schemes:r[2],filterSchemeText:r[4],filterInterventionText:r[5]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&1&&(s.source=t[0]),n&1024&&(s.props=t[10]),n&8&&(s.schemesGj=t[3]),n&4&&(s.schemes=t[2]),n&16&&(s.filterSchemeText=t[4]),n&32&&(s.filterInterventionText=t[5]),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function vp(r){let e,l,t,n;return e=new ce({props:{popupClass:"border-popup",$$slots:{default:[kp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),t=new ce({props:{openOn:"click",popupClass:"border-popup",$$slots:{default:[wp,({props:s})=>({10:s}),({props:s})=>s?1024:0]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment)},m(s,o){k(e,s,o),p(s,l,o),k(t,s,o),n=!0},p(s,o){const u={};o&3072&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const f={};o&3133&&(f.$$scope={dirty:o,ctx:s}),t.$set(f)},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&m(l),w(e,s),w(t,s)}}}function yp(r){let e,l,t,n,s,o,u,f,i,a;const c=[q(`${r[0]}-interventions-points`),{filter:["all",Gn,r[8],r[9]]},{manageHoverState:!0},{eventsIfTopMost:!0},{paint:{"circle-color":r[6],"circle-radius":qn,"circle-opacity":le(1,.5)}},{layout:{visibility:r[1]?"visible":"none"}},{hoverCursor:"pointer"}];let $={$$slots:{default:[gp]},$$scope:{ctx:r}};for(let M=0;M{"source"in _&&l(0,n=_.source),"show"in _&&l(1,s=_.show),"schemes"in _&&l(2,o=_.schemes),"schemesGj"in _&&l(3,u=_.schemesGj),"filterSchemeText"in _&&l(4,f=_.filterSchemeText),"filterInterventionText"in _&&l(5,i=_.filterInterventionText),"color"in _&&l(6,a=_.color)},r.$$.update=()=>{r.$$.dirty&8&&l(7,t=fr(u))},[n,s,o,u,f,i,a,t,c,$]}class bs extends K{constructor(e){super(),X(this,e,Cp,Sp,V,{source:0,show:1,schemes:2,schemesGj:3,filterSchemeText:4,filterInterventionText:5,color:6})}}function Tp(r){return Ze(["get","intervention_type"],{area:Ve.area,route:Ve.route,crossing:Ve.crossing,other:Ve.other},"white")}function Lp(r){return[["Areas",Ve.area],["Routes",Ve.route],["Crossings",Ve.crossing],["Other",Ve.other]]}function ks(r,e,l){const t=r.slice();return t[31]=e[l],t}function ws(r,e,l){const t=r.slice();return t[31]=e[l],t}function Ip(r){let e,l;return e=new z$({props:{loadFile:r[17]}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p:ee,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function vs(r){let e,l,t,n,s,o,u,f,i,a,c,$,_,y;function S(L){r[18](L)}let C={$$slots:{right:[Op],default:[Mp]},$$scope:{ctx:r}};r[3]!==void 0&&(C.checked=r[3]),e=new ie({props:C}),H.push(()=>E(e,"checked",S));function O(L){r[19](L)}function F(L){r[20](L)}function R(L){r[21](L)}function j(L){r[22](L)}let M={source:"ATF"};r[10]!==void 0&&(M.schemesGj=r[10]),r[9]!==void 0&&(M.schemes=r[9]),r[11]!==void 0&&(M.filterSchemeText=r[11]),r[12]!==void 0&&(M.filterInterventionText=r[12]),n=new zs({props:M}),H.push(()=>E(n,"schemesGj",O)),H.push(()=>E(n,"schemes",F)),H.push(()=>E(n,"filterSchemeText",R)),H.push(()=>E(n,"filterInterventionText",j));function N(L){r[23](L)}let P={label:"Colour interventions",choices:[["fundingProgramme","By funding programme"],["interventionType","By intervention type"],["currentMilestone","By current milestone"]]};return r[0]!==void 0&&(P.value=r[0]),a=new dt({props:P}),H.push(()=>E(a,"value",N)),_=new Jt({props:{rows:r[7]}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment),i=I(),b(a.$$.fragment),$=I(),b(_.$$.fragment)},m(L,D){k(e,L,D),p(L,t,D),k(n,L,D),p(L,i,D),k(a,L,D),p(L,$,D),k(_,L,D),y=!0},p(L,D){const W={};D[0]&1024|D[1]&32&&(W.$$scope={dirty:D,ctx:L}),!l&&D[0]&8&&(l=!0,W.checked=L[3],B(()=>l=!1)),e.$set(W);const Q={};!s&&D[0]&1024&&(s=!0,Q.schemesGj=L[10],B(()=>s=!1)),!o&&D[0]&512&&(o=!0,Q.schemes=L[9],B(()=>o=!1)),!u&&D[0]&2048&&(u=!0,Q.filterSchemeText=L[11],B(()=>u=!1)),!f&&D[0]&4096&&(f=!0,Q.filterInterventionText=L[12],B(()=>f=!1)),n.$set(Q);const A={};!c&&D[0]&1&&(c=!0,A.value=L[0],B(()=>c=!1)),a.$set(A);const Y={};D[0]&128&&(Y.rows=L[7]),_.$set(Y)},i(L){y||(g(e.$$.fragment,L),g(n.$$.fragment,L),g(a.$$.fragment,L),g(_.$$.fragment,L),y=!0)},o(L){d(e.$$.fragment,L),d(n.$$.fragment,L),d(a.$$.fragment,L),d(_.$$.fragment,L),y=!1},d(L){L&&(m(t),m(i),m($)),w(e,L),w(n,L),w(a,L),w(_,L)}}}function Mp(r){let e;return{c(){e=v("ATF schemes")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function ys(r){let e,l,t=r[31]+"",n;return{c(){e=T("li"),l=T("p"),n=v(t)},m(s,o){p(s,e,o),h(e,l),h(l,n)},p(s,o){o[0]&1024&&t!==(t=s[31]+"")&&G(n,t)},d(s){s&&m(e)}}}function Np(r){let e,l,t,n,s,o;l=new Fs({props:{text:"Scheme data caveats"}});let u=we(r[10].notes??[]),f=[];for(let i=0;iE(e,"checked",S));function O(L){r[25](L)}function F(L){r[26](L)}function R(L){r[27](L)}function j(L){r[28](L)}let M={source:"LCWIP"};r[14]!==void 0&&(M.schemesGj=r[14]),r[13]!==void 0&&(M.schemes=r[13]),r[15]!==void 0&&(M.filterSchemeText=r[15]),r[16]!==void 0&&(M.filterInterventionText=r[16]),n=new zs({props:M}),H.push(()=>E(n,"schemesGj",O)),H.push(()=>E(n,"schemes",F)),H.push(()=>E(n,"filterSchemeText",R)),H.push(()=>E(n,"filterInterventionText",j));function N(L){r[29](L)}let P={label:"Colour interventions",choices:[["interventionType","By intervention type"]]};return r[1]!==void 0&&(P.value=r[1]),a=new dt({props:P}),H.push(()=>E(a,"value",N)),_=new Jt({props:{rows:r[5]}}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment),i=I(),b(a.$$.fragment),$=I(),b(_.$$.fragment)},m(L,D){k(e,L,D),p(L,t,D),k(n,L,D),p(L,i,D),k(a,L,D),p(L,$,D),k(_,L,D),y=!0},p(L,D){const W={};D[0]&16384|D[1]&32&&(W.$$scope={dirty:D,ctx:L}),!l&&D[0]&16&&(l=!0,W.checked=L[4],B(()=>l=!1)),e.$set(W);const Q={};!s&&D[0]&16384&&(s=!0,Q.schemesGj=L[14],B(()=>s=!1)),!o&&D[0]&8192&&(o=!0,Q.schemes=L[13],B(()=>o=!1)),!u&&D[0]&32768&&(u=!0,Q.filterSchemeText=L[15],B(()=>u=!1)),!f&&D[0]&65536&&(f=!0,Q.filterInterventionText=L[16],B(()=>f=!1)),n.$set(Q);const A={};!c&&D[0]&2&&(c=!0,A.value=L[1],B(()=>c=!1)),a.$set(A);const Y={};D[0]&32&&(Y.rows=L[5]),_.$set(Y)},i(L){y||(g(e.$$.fragment,L),g(n.$$.fragment,L),g(a.$$.fragment,L),g(_.$$.fragment,L),y=!0)},o(L){d(e.$$.fragment,L),d(n.$$.fragment,L),d(a.$$.fragment,L),d(_.$$.fragment,L),y=!1},d(L){L&&(m(t),m(i),m($)),w(e,L),w(n,L),w(a,L),w(_,L)}}}function Pp(r){let e;return{c(){e=v("LCWIP schemes")},m(l,t){p(l,e,t)},d(l){l&&m(e)}}}function Cs(r){let e,l,t=r[31]+"",n;return{c(){e=T("li"),l=T("p"),n=v(t)},m(s,o){p(s,e,o),h(e,l),h(l,n)},p(s,o){o[0]&16384&&t!==(t=s[31]+"")&&G(n,t)},d(s){s&&m(e)}}}function jp(r){let e,l,t,n,s,o;l=new Fs({props:{text:"Scheme data caveats"}});let u=we(r[14].notes??[]),f=[];for(let i=0;i0&&vs(r),c=r[13].size>0&&Ss(r);return s=new Xs({props:{label:"Load schemes from GeoJSON",onLoad:r[17]}}),u=new xs({props:{errorMessage:r[2]}}),{c(){i&&i.c(),l=I(),a&&a.c(),t=I(),c&&c.c(),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment)},m($,_){i&&i.m($,_),p($,l,_),a&&a.m($,_),p($,t,_),c&&c.m($,_),p($,n,_),k(s,$,_),p($,o,_),k(u,$,_),f=!0},p($,_){e&&i.p($,_),$[9].size>0?a?(a.p($,_),_[0]&512&&g(a,1)):(a=vs($),a.c(),g(a,1),a.m(t.parentNode,t)):a&&(ae(),d(a,1,1,()=>{a=null}),ue()),$[13].size>0?c?(c.p($,_),_[0]&8192&&g(c,1)):(c=Ss($),c.c(),g(c,1),c.m(n.parentNode,n)):c&&(ae(),d(c,1,1,()=>{c=null}),ue());const y={};_[0]&4&&(y.errorMessage=$[2]),u.$set(y)},i($){f||(g(i),g(a),g(c),g(s.$$.fragment,$),g(u.$$.fragment,$),f=!0)},o($){d(i),d(a),d(c),d(s.$$.fragment,$),d(u.$$.fragment,$),f=!1},d($){$&&(m(l),m(t),m(n),m(o)),i&&i.d($),a&&a.d($),c&&c.d($),w(s,$),w(u,$)}}}function Ap(r){let e,l,t,n,s,o;return e=new xe({props:{label:"Schemes",open:!0,$$slots:{default:[Rp]},$$scope:{ctx:r}}}),t=new bs({props:{source:"atf",show:r[3],schemesGj:r[10],schemes:r[9],filterSchemeText:r[11],filterInterventionText:r[12],color:r[8]}}),s=new bs({props:{source:"lcwip",show:r[4],schemesGj:r[14],schemes:r[13],filterSchemeText:r[15],filterInterventionText:r[16],color:r[6]}}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),n=I(),b(s.$$.fragment)},m(u,f){k(e,u,f),p(u,l,f),k(t,u,f),p(u,n,f),k(s,u,f),o=!0},p(u,f){const i={};f[0]&130751|f[1]&32&&(i.$$scope={dirty:f,ctx:u}),e.$set(i);const a={};f[0]&8&&(a.show=u[3]),f[0]&1024&&(a.schemesGj=u[10]),f[0]&512&&(a.schemes=u[9]),f[0]&2048&&(a.filterSchemeText=u[11]),f[0]&4096&&(a.filterInterventionText=u[12]),f[0]&256&&(a.color=u[8]),t.$set(a);const c={};f[0]&16&&(c.show=u[4]),f[0]&16384&&(c.schemesGj=u[14]),f[0]&8192&&(c.schemes=u[13]),f[0]&32768&&(c.filterSchemeText=u[15]),f[0]&65536&&(c.filterInterventionText=u[16]),f[0]&64&&(c.color=u[6]),s.$set(c)},i(u){o||(g(e.$$.fragment,u),g(t.$$.fragment,u),g(s.$$.fragment,u),o=!0)},o(u){d(e.$$.fragment,u),d(t.$$.fragment,u),d(s.$$.fragment,u),o=!1},d(u){u&&(m(l),m(n)),w(e,u),w(t,u),w(s,u)}}}function Fp(r,e,l){let t,n,s,o,u,f,i,a,c,$,_,y;x(r,$n,J=>l(9,u=J)),x(r,en,J=>l(10,f=J)),x(r,Wl,J=>l(11,i=J)),x(r,Ul,J=>l(12,a=J)),x(r,mn,J=>l(13,c=J)),x(r,pn,J=>l(14,$=J)),x(r,Jl,J=>l(15,_=J)),x(r,Yl,J=>l(16,y=J));let S="",C=!0,O=!0,F="fundingProgramme",R="interventionType";function j(J,at){try{H$(JSON.parse(at)),l(2,S="")}catch(Ie){l(2,S=`The file you loaded is broken: ${Ie}`)}}function M(J){return J=="interventionType"?[Tp(),Lp()]:J=="fundingProgramme"?[Ze(["get","funding_programme"],Et,"grey"),Object.entries(Et)]:J=="currentMilestone"?[Ze(["get","current_milestone"],_n,"grey"),Object.entries(_n)]:["red",[]]}function N(J){C=J,l(3,C)}function P(J){f=J,en.set(f)}function L(J){u=J,$n.set(u)}function D(J){i=J,Wl.set(i)}function W(J){a=J,Ul.set(a)}function Q(J){F=J,l(0,F)}function A(J){O=J,l(4,O)}function Y(J){$=J,pn.set($)}function Z(J){c=J,mn.set(c)}function U(J){_=J,Jl.set(_)}function Le(J){y=J,Yl.set(y)}function je(J){R=J,l(1,R)}return r.$$.update=()=>{r.$$.dirty[0]&1&&l(8,[t,n]=M(F),t,(l(7,n),l(0,F))),r.$$.dirty[0]&2&&l(6,[s,o]=M(R),s,(l(5,o),l(1,R)))},[F,R,S,C,O,o,s,n,t,u,f,i,a,c,$,_,y,j,N,P,L,D,W,Q,A,Y,Z,U,Le,je]}class Gp extends K{constructor(e){super(),X(this,e,Fp,Ap,V,{},null,[-1,-1])}}const Ts=Ae(!0);let gn=Ae(null);function qp(r){let e,l,t,n,s,o,u,f;return e=new hc({}),t=new Nc({}),s=new Yc({}),u=new Hc({}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment)},m(i,a){k(e,i,a),p(i,l,a),k(t,i,a),p(i,n,a),k(s,i,a),p(i,o,a),k(u,i,a),f=!0},i(i){f||(g(e.$$.fragment,i),g(t.$$.fragment,i),g(s.$$.fragment,i),g(u.$$.fragment,i),f=!0)},o(i){d(e.$$.fragment,i),d(t.$$.fragment,i),d(s.$$.fragment,i),d(u.$$.fragment,i),f=!1},d(i){i&&(m(l),m(n),m(o)),w(e,i),w(t,i),w(s,i),w(u,i)}}}function zp(r){let e,l;return e=new lt({props:{small:!0,$$slots:{default:[qp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Hp(r){let e,l,t,n,s,o,u,f,i,a,c,$;return e=new Df({}),t=new ua({}),s=new Uf({}),u=new ea({}),i=new sc({}),c=new Fu({}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment),f=I(),b(i.$$.fragment),a=I(),b(c.$$.fragment)},m(_,y){k(e,_,y),p(_,l,y),k(t,_,y),p(_,n,y),k(s,_,y),p(_,o,y),k(u,_,y),p(_,f,y),k(i,_,y),p(_,a,y),k(c,_,y),$=!0},i(_){$||(g(e.$$.fragment,_),g(t.$$.fragment,_),g(s.$$.fragment,_),g(u.$$.fragment,_),g(i.$$.fragment,_),g(c.$$.fragment,_),$=!0)},o(_){d(e.$$.fragment,_),d(t.$$.fragment,_),d(s.$$.fragment,_),d(u.$$.fragment,_),d(i.$$.fragment,_),d(c.$$.fragment,_),$=!1},d(_){_&&(m(l),m(n),m(o),m(f),m(a)),w(e,_),w(t,_),w(s,_),w(u,_),w(i,_),w(c,_)}}}function Ep(r){let e,l;return e=new lt({props:{small:!0,$$slots:{default:[Hp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Bp(r){let e,l,t,n,s,o;return e=new kf({}),t=new gu({}),s=new Tu({}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),n=I(),b(s.$$.fragment)},m(u,f){k(e,u,f),p(u,l,f),k(t,u,f),p(u,n,f),k(s,u,f),o=!0},i(u){o||(g(e.$$.fragment,u),g(t.$$.fragment,u),g(s.$$.fragment,u),o=!0)},o(u){d(e.$$.fragment,u),d(t.$$.fragment,u),d(s.$$.fragment,u),o=!1},d(u){u&&(m(l),m(n)),w(e,u),w(t,u),w(s,u)}}}function Up(r){let e,l,t,n,s,o,u,f,i,a;return e=new Ii({}),t=new rf({}),s=new Ro({}),u=new li({}),i=new di({}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment),f=I(),b(i.$$.fragment)},m(c,$){k(e,c,$),p(c,l,$),k(t,c,$),p(c,n,$),k(s,c,$),p(c,o,$),k(u,c,$),p(c,f,$),k(i,c,$),a=!0},i(c){a||(g(e.$$.fragment,c),g(t.$$.fragment,c),g(s.$$.fragment,c),g(u.$$.fragment,c),g(i.$$.fragment,c),a=!0)},o(c){d(e.$$.fragment,c),d(t.$$.fragment,c),d(s.$$.fragment,c),d(u.$$.fragment,c),d(i.$$.fragment,c),a=!1},d(c){c&&(m(l),m(n),m(o),m(f)),w(e,c),w(t,c),w(s,c),w(u,c),w(i,c)}}}function Wp(r){let e,l;return e=new lt({props:{small:!0,$$slots:{default:[Up]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Yp(r){let e,l,t,n;return e=new So({}),t=new Yo({}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment)},m(s,o){k(e,s,o),p(s,l,o),k(t,s,o),n=!0},i(s){n||(g(e.$$.fragment,s),g(t.$$.fragment,s),n=!0)},o(s){d(e.$$.fragment,s),d(t.$$.fragment,s),n=!1},d(s){s&&m(l),w(e,s),w(t,s)}}}function Jp(r){let e,l;return e=new lt({props:{small:!0,$$slots:{default:[Yp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Vp(r){let e,l,t,n,s,o,u,f;return e=new fu({}),t=new ya({}),s=new Xa({}),u=new P$({}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment)},m(i,a){k(e,i,a),p(i,l,a),k(t,i,a),p(i,n,a),k(s,i,a),p(i,o,a),k(u,i,a),f=!0},i(i){f||(g(e.$$.fragment,i),g(t.$$.fragment,i),g(s.$$.fragment,i),g(u.$$.fragment,i),f=!0)},o(i){d(e.$$.fragment,i),d(t.$$.fragment,i),d(s.$$.fragment,i),d(u.$$.fragment,i),f=!1},d(i){i&&(m(l),m(n),m(o)),w(e,i),w(t,i),w(s,i),w(u,i)}}}function Qp(r){let e,l,t,n,s,o,u,f,i=bn()=="Private (development)",a,c,$,_,y;e=new v$({}),t=new u$({}),s=new qa({}),u=new Ju({});let S=i&&Vp();return c=new Gi({}),_=new Vi({}),{c(){b(e.$$.fragment),l=I(),b(t.$$.fragment),n=I(),b(s.$$.fragment),o=I(),b(u.$$.fragment),f=I(),S&&S.c(),a=I(),b(c.$$.fragment),$=I(),b(_.$$.fragment)},m(C,O){k(e,C,O),p(C,l,O),k(t,C,O),p(C,n,O),k(s,C,O),p(C,o,O),k(u,C,O),p(C,f,O),S&&S.m(C,O),p(C,a,O),k(c,C,O),p(C,$,O),k(_,C,O),y=!0},p:ee,i(C){y||(g(e.$$.fragment,C),g(t.$$.fragment,C),g(s.$$.fragment,C),g(u.$$.fragment,C),g(S),g(c.$$.fragment,C),g(_.$$.fragment,C),y=!0)},o(C){d(e.$$.fragment,C),d(t.$$.fragment,C),d(s.$$.fragment,C),d(u.$$.fragment,C),d(S),d(c.$$.fragment,C),d(_.$$.fragment,C),y=!1},d(C){C&&(m(l),m(n),m(o),m(f),m(a),m($)),w(e,C),w(t,C),w(s,C),w(u,C),S&&S.d(C),w(c,C),w(_,C)}}}function Zp(r){let e,l;return e=new lt({props:{small:!0,$$slots:{default:[Qp]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,n){const s={};n&256&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function Kp(r){let e,l,t,n,s;function o(f){r[6](f)}let u={cfg:r[5],map:r[3]};return r[0]!==void 0&&(u.enabled=r[0]),e=new ur({props:u}),H.push(()=>E(e,"enabled",o)),n=new Wr({}),{c(){b(e.$$.fragment),t=I(),b(n.$$.fragment)},m(f,i){k(e,f,i),p(f,t,i),k(n,f,i),s=!0},p(f,i){const a={};i&8&&(a.map=f[3]),!l&&i&1&&(l=!0,a.enabled=f[0],B(()=>l=!1)),e.$set(a)},i(f){s||(g(e.$$.fragment,f),g(n.$$.fragment,f),s=!0)},o(f){d(e.$$.fragment,f),d(n.$$.fragment,f),s=!1},d(f){f&&m(t),w(e,f),w(n,f)}}}function Xp(r){let e,l;const t=[q("cover-interactive-layers"),{paint:{"fill-color":"black","fill-opacity":0}},{layout:{visibility:r[1]?"none":"visible"}}];let n={};for(let s=0;sl(1,n=c)),x(r,gn,c=>l(2,s=c)),x(r,hn,c=>l(3,o=c));let u={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]}},f={getStreetViewRoadLayerNames:c=>cr(c,er(un))};function i(c){t=c,l(0,t),l(1,n)}function a(c){H[c?"unshift":"push"](()=>{s=c,gn.set(s)})}return r.$$.update=()=>{r.$$.dirty&2&&l(0,t=!n),r.$$.dirty&1&&Ts.set(!t)},[t,n,s,o,u,f,i,a]}class tm extends K{constructor(e){super(),X(this,e,em,xp,V,{})}}function nm(r){let e,l,t,n,s,o,u,f,i,a,c,$,_,y;return l=new $r({}),u=new pr({props:{boundaryGeojson:r[3]}}),i=new tr({}),{c(){e=T("div"),b(l.$$.fragment),t=I(),n=T("div"),s=T("h1"),s.textContent="Browse schemes",o=I(),b(u.$$.fragment),f=I(),b(i.$$.fragment),a=I(),c=T("p"),c.textContent=`App version: ${bn()}`,$=I(),_=T("div"),me(n,"display","flex"),me(n,"justify-content","space-between"),z(e,"slot","sidebar"),z(e,"class","govuk-prose")},m(S,C){p(S,e,C),k(l,e,null),h(e,t),h(e,n),h(n,s),h(n,o),k(u,n,null),h(e,f),k(i,e,null),h(e,a),h(e,c),h(e,$),h(e,_),r[6](_),y=!0},p(S,C){const O={};C&8&&(O.boundaryGeojson=S[3]),u.$set(O)},i(S){y||(g(l.$$.fragment,S),g(u.$$.fragment,S),g(i.$$.fragment,S),y=!0)},o(S){d(l.$$.fragment,S),d(u.$$.fragment,S),d(i.$$.fragment,S),y=!1},d(S){S&&m(e),w(l),w(u),w(i),r[6](null)}}}function Ls(r){let e,l;return e=new tm({}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function lm(r){let e,l,t,n;e=new mr({});let s=r[2]&&Ls();return{c(){b(e.$$.fragment),l=I(),s&&s.c(),t=ve()},m(o,u){k(e,o,u),p(o,l,u),s&&s.m(o,u),p(o,t,u),n=!0},p(o,u){o[2]?s?u&4&&g(s,1):(s=Ls(),s.c(),g(s,1),s.m(t.parentNode,t)):s&&(ae(),d(s,1,1,()=>{s=null}),ue())},i(o){n||(g(e.$$.fragment,o),g(s),n=!0)},o(o){d(e.$$.fragment,o),d(s),n=!1},d(o){o&&(m(l),m(t)),w(e,o),s&&s.d(o)}}}function sm(r){let e,l,t;return l=new nr({props:{style:r[1],startBounds:[-5.96,49.89,2.31,55.94],$$slots:{default:[lm]},$$scope:{ctx:r}}}),{c(){e=T("div"),b(l.$$.fragment),z(e,"slot","main")},m(n,s){p(n,e,s),k(l,e,null),t=!0},p(n,s){const o={};s&2&&(o.style=n[1]),s&260&&(o.$$scope={dirty:s,ctx:n}),l.$set(o)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){d(l.$$.fragment,n),t=!1},d(n){n&&m(e),w(l)}}}function rm(r){let e,l;return e=new Cr({props:{$$slots:{main:[sm],sidebar:[nm]},$$scope:{ctx:r}}}),{c(){b(e.$$.fragment)},m(t,n){k(e,t,n),l=!0},p(t,[n]){const s={};n&271&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){d(e.$$.fragment,t),l=!1},d(t){w(e,t)}}}function om(r,e,l){let t,n,s,o,u;x(r,gn,c=>l(4,t=c)),x(r,hn,c=>l(5,n=c)),x(r,un,c=>l(1,s=c)),x(r,Hn,c=>l(2,o=c)),x(r,en,c=>l(3,u=c)),As(()=>{lr()});const f=new URLSearchParams(window.location.search);un.set(f.get("style")||"dataviz");let i;function a(c){H[c?"unshift":"push"](()=>{i=c,l(0,i),l(4,t)})}return r.$$.update=()=>{r.$$.dirty&32&&n&&Hn.set(n),r.$$.dirty&17&&i&&t&&(l(0,i.innerHTML="",i),i.appendChild(t))},[i,s,o,u,t,n,a]}class im extends K{constructor(e){super(),X(this,e,om,rm,V,{})}}document.body.className+=" js-enabled"+("noModule"in HTMLScriptElement.prototype?" govuk-frontend-supported":"");new im({target:document.getElementById("app")}); diff --git a/browse_layout_v3/browse.html b/browse_layout_v3/browse.html index 8b918ebf..b2b37ff0 100644 --- a/browse_layout_v3/browse.html +++ b/browse_layout_v3/browse.html @@ -7,10 +7,10 @@ content="initial-scale=1,maximum-scale=1,user-scalable=no" /> ATIP v2 scheme browser - - - - + + + + diff --git a/browse_layout_v3/index.html b/browse_layout_v3/index.html index bca2368c..ca7d6dae 100644 --- a/browse_layout_v3/index.html +++ b/browse_layout_v3/index.html @@ -7,10 +7,10 @@ content="initial-scale=1,maximum-scale=1,user-scalable=no" /> Active Travel Infrastructure Platform v2 - - - - + + + + diff --git a/browse_layout_v3/scheme.html b/browse_layout_v3/scheme.html index b04a2128..046806fd 100644 --- a/browse_layout_v3/scheme.html +++ b/browse_layout_v3/scheme.html @@ -7,10 +7,10 @@ content="initial-scale=1,maximum-scale=1,user-scalable=no" /> ATIP v2 Scheme Sketcher - - - - + + + +