PageSourceSearch

https://poliscope.de/_next/static/chunks/8039.e16a7c1d5519d6d1.js

js poliscope.de collected 2026-10-08 06:56:47 UTC 13,963 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{2895:function(e,t,r){r.d(t,{I:function(){return u},S:function(){return s}});var n=r(23221),l=r(61878),o=r.n(l),a=r(92422);let i=(0,a.createContext)(),u=e=>{let{children:t,entities:r=[],selectedEntities:l=[],customStyles:u={},selectionEnabled:s=!0,refreshGeoJson:c=!1}=e,[f,d]=(0,a.useState)(null),[p,h]=(0,a.useState)({});return(0,a.useEffect)(()=>{(async()=>{let e={};for(let t of r)if(t.rs){let r=await o().getItem(t.rs);r&&(e[t.rs]=r)}h(e)})()},[r,c]),(0,n.jsx)(i.Provider,{value:{entities:r,selectedEntities:l,hoveredEntity:f,setHoveredEntity:d,loadedGeoJsons:p,customStyles:u,selectionEnabled:s,refreshGeoJson:c},children:t})},s=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("useMap must be used within a MapProvider");return e}},78039:function(e,t,r){r.r(t),r.d(t,{default:function(){return P}});var n=r(7523),l=r(2895),o=r(92422),a=r(32410),i=r(55830),u=r(39896);function s(e){let t=e>0?'<span style="'.concat("position:absolute;top:-5px;right:-5px;background:var(--chakra-colors-brand-500);color:#fff;border-radius:9999px;min-width:15px;padding:0 4px;font-size:9px;font-weight:600;line-height:15px;text-align:center;",'">').concat(e,"</span>"):"";return'<div style="'.concat("display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;position:relative;background:rgba(255,255,255,0.92);backdrop-filter:blur(3px);border-radius:9999px;box-shadow:0 1px 4px rgba(0,0,0,0.3);color:#1e5c89;cursor:pointer;transform:translate(-50%,-50%);",'">').concat('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path><path d="M13 13l6 6"></path></svg>').concat(t,"</div>")}var c=r(27144);class f{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,n=t[e];for(;e>0;){let l=e-1>>1,o=t[l];if(r(n,o)>=0)break;t[e]=o,e=l}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,l=t[e];for(;e<n;){let n=(e<<1)+1,o=n+1;if(o<this.length&&0>r(t[o],t[n])&&(n=o),r(t[n],l)>=0)break;t[e]=t[n],e=n}t[e]=l}}function d(e,t,r,n,l,o,a,i){this.x=e,this.y=t,this.h=r,this.nsx1=0,this.nsy1=0,this.nsx2=0,this.nsy2=0,this.d=function(e,t,r,n,l,o){let a=e.x,i=e.y,u=!1,s=1/0,c=l>0?l*l:-1;if(null!==o&&(e.nsx1=o.nsx1,e.nsy1=o.nsy1,e.nsx2=o.nsx2,e.nsy2=o.nsy2,(s=p(a,i,o.nsx1,o.nsy1,o.nsx2,o.nsy2))<=c))return l;let f=r.length,d=0,h=0;for(let o=0;o<f;o++){let f=r[o],y=t[f-2],v=t[f-1];for(let r=h;r<f;r+=64,d+=4){let o=r+64;o>f&&(o=f);let h=n[d],g=n[d+1],b=n[d+2],w=n[d+3],x=a<h?h-a:a>b?a-b:0,m=i<g?g-i:i>w?i-w:0,k=x*x+m*m>=s,C=i<g||i>=w||a>b;if(k&&C){y=t[o-2],v=t[o-1];continue}for(let n=r;n<o;n+=2){let r=t[n],o=t[n+1];if(!C&&o>i!=v>i&&a<(y-r)*(i-o)/(v-o)+r&&(u=!u),!k){let t=p(a,i,r,o,y,v);if(t<s&&(s=t,e.nsx1=r,e.nsy1=o,e.nsx2=y,e.nsy2=v,s<=c))return l}y=r,v=o}}h=f}return 0===s?0:(u?1:-1)*Math.sqrt(s)}(this,n,l,o,a,i),this.max=this.d+r*Math.SQRT2}function p(e,t,r,n,l,o){let a=l-r,i=o-n;if(0!==a||0!==i){let u=((e-r)*a+(t-n)*i)/(a*a+i*i);u>1?(r=l,n=o):u>0&&(r+=a*u,n+=i*u)}return(a=e-r)*a+(i=t-n)*i}let h={weight:1,color:"#0d70b7",opacity:.5,fillOpacity:.1},y={weight:2,color:"#087E17",opacity:.7,fillOpacity:.15},v={weight:3,opacity:1,color:"#1e5c89",fill:!0,fillOpacity:.6},g="#aaaaaa",b={weight:3,opacity:1,fillOpacity:.6},w={weight:1,color:"#aaaaaa",opacity:.4,fillOpacity:.08},x={weight:2,opacity:.6,fillOpacity:.15},m={weight:1.5,color:"#0d70b7",dashArray:"6 4",opacity:.6,fillColor:"#0d70b7",fillOpacity:.05},k={...m,opacity:.9,fillOpacity:.15};function C(e,t,r,n){var l,o;if(n)return r?{weight:1,color:null!==(l=r.get(e))&&void 0!==l?l:g,opacity:.3,fillOpacity:.1}:w;if(!r)return t?y:h;let a=null!==(o=r.get(e))&&void 0!==o?o:g;return t?{weight:3,color:a,opacity:1,fillOpacity:.5}:{weight:1,color:a,opacity:.7,fillOpacity:.4}}var E=r(9486),R=r(88498);let S=["10","pr","40"],M={10:[],pr:[],40:[],50:[],60:[]};for(let e of a){let t=(0,i.ak)(e);t&&t in M&&M[t].push(e)}
1function O(){return{10:new Map,pr:new Map,40:new Map,50:new Map,60:new Map}}function L(e,t){let r=M[e].filter(e=>e.startsWith(t));return 0===r.length&&"60"===e?M["50"].filter(e=>e.startsWith(t)):r}function _(e,t,r){let n=0;for(let l of L(e,t))r.has(l)&&n++;return n}function P(e){let{onEntityClick:t,onHover:a,colorOverrides:i,inaccessibleEntities:p}=e,h=(0,n.Sx)(),{refreshGeoJson:y}=(0,l.S)();return!function(e){let{map:t,onEntityClick:n,onHover:l,colorOverrides:a=null,inaccessibleEntities:i=null,refreshKey:p}=e,h=(0,u.Rp)(e=>e.activeLevel),y=(0,u.Rp)(e=>e.detailBundesland),g=(0,u.Rp)(e=>e.selectedEntities),w=(0,u.Rp)(e=>e.highlightedEntity),[P,F]=(0,o.useState)(!1);(0,o.useEffect)(()=>{(0,E.ot)().then(()=>F(!0))},[]);let j=(0,o.useRef)(g);j.current=g;let I=(0,o.useRef)(n);I.current=n;let K=(0,o.useRef)(l);K.current=l;let N=(0,o.useRef)(a);N.current=a;let z=(0,o.useRef)(i);z.current=i;let B=(0,o.useRef)(y);B.current=y;let T=(0,o.useRef)(t);T.current=t;let A=(0,o.useRef)(null),J=(0,o.useRef)(O()),$=(0,o.useRef)(new Set),q=(0,o.useRef)({}),W=(0,o.useRef)({50:new Map,60:new Map}),Q=(0,o.useRef)(null),D=(0,o.useRef)(null),G=(0,o.useCallback)(e=>(0,E.Rc)(e,j.current),[]),H=(0,o.useRef)(p);(0,o.useEffect)(()=>{if(H.current!==p){for(let e of(H.current=p,$.current.clear(),q.current={},Object.values(W.current)))e.clear();if(t&&A.current){for(let e of u.oo){let r=A.current[e];t.hasLayer(r)&&t.removeLayer(r),r.clearLayers()}J.current=O(),A.current=null}}},[p,t]),(0,o.useEffect)(()=>{(0,R.nW)()},[]);let U=(0,o.useCallback)(async()=>{if(A.current)return A.current;let e=(await r.e(6002).then(r.t.bind(r,26344,23))).default,t={};for(let r of u.oo)t[r]=e.layerGroup();return A.current=t,A.current},[]),V=(0,o.useCallback)(async(e,t,n)=>{let l=(await r.e(6002).then(r.t.bind(r,26344,23))).default,o=J.current[t],a=await (0,c.K)(e,n);return n.aborted?null:l.geoJSON({type:"FeatureCollection",features:a},{pane:"level-".concat(t),style:e=>{var t,r,n;let l=null==e?void 0:null===(t=e.properties)||void 0===t?void 0:t.rs;return C(l,G(l),N.current,null!==(n=null===(r=z.current)||void 0===r?void 0:r.has(l))&&void 0!==n&&n)},onEachFeature:(e,t)=>{var r;let n=null===(r=e.properties)||void 0===r?void 0:r.rs,l=o.get(n);l?l.push(t):o.set(n,[t]),t.on({click:e=>{var t;let r=e.originalEvent;if((null==r?void 0:r.ctrlKey)||(null==r?void 0:r.metaKey)){window.open("/app/entity/".concat(n),"_blank","noopener");return}null!==(t=z.current)&&void 0!==t&&t.has(n)||I.current(n)},mouseover:()=>{var e,t;let r=N.current,l=null!==(t=null===(e=z.current)||void 0===e?void 0:e.has(n))&&void 0!==t&&t,a=C(n,G(n),r,l),i=l?x:r?b:v,u={...a,...i},s=o.get(n);if(s)for(let e of s)e.setStyle(u);K.current(n)},mouseout:()=>{var e,t;let r=C(n,G(n),N.current,null!==(t=null===(e=z.current)||void 0===e?void 0:e.has(n))&&void 0!==t&&t),l=o.get(n);if(l)for(let e of l)e.setStyle(r);K.current(null)}})}})},[G]),X=(0,o.useCallback)(async(e,t)=>{if($.current.has(e))return;let r=await U();if(t.aborted)return;let n=await V(M[e],e,t);n&&!t.aborted&&(r[e].addLayer(n),$.current.add(e))},[U,V]),Y=(0,o.useCallback)(async(e,t)=>{let n=B.current;if(q.current[e]===n)return;let l=await U();if(t.aborted)return;let o=(await r.e(6002).then(r.t.bind(r,26344,23))).default,a=l[e];a.clearLayers(),J.current[e].clear();let i=W.current[e];if(i.clear(),n){let r=await V(L(e,n),e,t);if(!r||t.aborted)return;a.addLayer(r)}let p=M["10"].filter(e=>e!==n),h=await (0,c.K)(p,t);if(t.aborted)return;let y=(e,t)=>{var r;u.Rp.getState().setDetailBundesland(e),null===(r=T.current)||void 0===r||r.flyToBounds(t,{padding:[24,24]})},v=o.geoJSON({type:"FeatureCollection",features:h},{pane:"level-".concat(e),style:()=>m,onEachFeature:(e,t)=>{var r;let n=null===(r=e.properties)||void 0===r?void 0:r.rs;t.on({click:()=>y(n,t.getBounds()),mouseover:()=>{t.setStyle(k),K.current(n)},mouseout:()=>{t.setStyle(m),K.current(null)}})}});for(let t of(a.addLayer(v),p)){if(i.has(t))continue;let r=h.filter(e=>{var r;return(null===(r=e.properties)||void 0===r?void 0:r.rs)===t});if(0===r.length)continue;let n={type:"FeatureCollection",features:r},l=o.geoJSON(n).getBounds(),u=function(e){let t=null,r=0;for(let l of e){var n;for(let e of"Polygon"===(n=l.geometry).type?[n.coordinates]:"MultiPolygon"===n.type?n.coordinates:[]){let n=function(e){let t=0;for(let r=0,n=e.length-1;r<e.length;n=r++)t+=(e[n][0]+e[r][0])*(e[n][1]-e[r][1]);return Math.abs(t/2)}(e[0]);n>r&&(r=n,t=e)}}if(!t)return null;let[l,o]=function(e,t=1,r=!1){let n=1/0,l=1/0,o=-1/0,a=-1/0;for(let[t,r]of e[0])t<n&&(n=t),r<l&&(l=r),t>o&&(o=t),r>a&&(a=r);let i=o-n,u=a-l,s=Math.max(t,Math.min(i,u));if(s===t){let e=[n,l];return e.distance=0,e}let c=0;for(let t of e)c+=t.length;let p=new Float64Array(2*c),h=[],y=0;for(let t of e){for(let e=0;e<t.length;e++)p[y++]=t[e][0],p[y++]=t[e][1];h.push(y)}let v=function(e,t){let r=0,n=0;for(let e=0;e<t.length;e++)r+=Math.ceil((t[e]-n)/64),n=t[e];let l=new Float64Array(4*r),o=0;n=0;for(let r=0;r<t.length;r++){let a=t[r];for(let t=n;t<a;t+=64,o+=4){let r=t+64<a?t+64:a,i=t===n?a-2:t-2,u=e[i],s=e[i+1],c=u,f=s;for(let n=t;n<r;n+=2){let t=e[n],r=e[n+1];t<u?u=t:t>c&&(c=t),r<s?s=r:r>f&&(f=r)}l[o]=u,l[o+1]=s,l[o+2]=c,l[o+3]=f}n=a}return l}(p,h),g=new f([],(e,t)=>t.max-e.max),b=function(e,t,r){let n=0,l=0,o=0,a=t[0];for(let t=0,r=a-2;t<a;r=t,t+=2){let a=e[t],i=e[t+1],u=e[r],s=e[r+1],c=a*s-u*i;l+=(a+u)*c,o+=(i+s)*c,n+=3*c}let i=new d(l/n,o/n,0,e,t,r,-1/0,null);return 0===n||i.d<0?new d(e[0],e[1],0,e,t,r,-1/0,null):i}(p,h,v),w=new d(n+i/2,l+u/2,0,p,h,v,-1/0,null);w.d>b.d&&(b=w);let x=2;function m(e,n,l,o){let a=b.d-Math.max(0,l*Math.SQRT2-t),i=new d(e,n,l,p,h,v,a,o);x++,i.max>b.d+t&&g.push(i),i.d>b.d&&(b=i,r&&console.log(`found best ${Math.round(1e4*i.d)/1e4} after ${x} probes`))}let k=s/2;for(let e=n;e<o;e+=s)for(let t=l;t<a;t+=s)m(e+k,t+k,k,null);for(;g.length;){let e=g.pop();if(e.max-b.d<=t)break;k=e.h/2,m(e.x-k,e.y-k,k,e),m(e.x+k,e.y-k,k,e),m(e.x-k,e.y+k,k,e),m(e.x+k,e.y+k,k,e)}r&&console.log(`num probes: ${x}
1
2best distance: ${b.d}`);let C=[b.x,b.y];return C.distance=b.d,C}(t,.01);return[o,l]}(r),c=o.marker(u?o.latLng(u[0],u[1]):l.getCenter(),{pane:"level-".concat(e),icon:o.divIcon({className:"",html:s(_(e,t,j.current)),iconSize:void 0}),keyboard:!1});c.on("click",()=>y(t,l)),i.set(t,c),a.addLayer(c)}q.current[e]=n},[U,V]),Z=(0,o.useCallback)((e,t)=>(0,u.KA)(e)?Y(e,t):X(e,t),[Y,X]);(0,o.useEffect)(()=>{var e;if(!t)return;null===(e=Q.current)||void 0===e||e.abort();let r=new AbortController;for(let e of(Q.current=r,u.oo)){let r="level-".concat(e);if(!t.getPane(r)){let e=t.createPane(r);e.style.zIndex="350",e.style.opacity="0",e.style.pointerEvents="none",e.style.transition="opacity 0.2s ease-in-out"}}return async function(){if(await Z(h,r.signal),r.signal.aborted)return;let e=A.current;t.hasLayer(e[h])||e[h].addTo(t);let n=t.getPane("level-".concat(h));for(let l of(n&&(n.style.opacity="1",n.style.pointerEvents="auto"),S))if(l!==h){if(await X(l,r.signal),r.signal.aborted)return;t.hasLayer(e[l])||e[l].addTo(t)}}(),()=>{r.abort()}},[t,h,y,Z,X,p]),(0,o.useEffect)(()=>{if(t)for(let e of u.oo){let r=t.getPane("level-".concat(e));if(r){let t=e===h;r.style.opacity=t?"1":"0",r.style.pointerEvents=t?"auto":"none"}}},[t,h]),(0,o.useEffect)(()=>{let e=N.current,t=z.current;for(let n of u.oo)for(let[l,o]of J.current[n]){var r;let n=C(l,(0,E.Rc)(l,g),e,null!==(r=null==t?void 0:t.has(l))&&void 0!==r&&r);for(let e of o)e.setStyle(n)}for(let[e,t]of Object.entries(W.current))for(let[r,n]of t){let t=n.options.icon;t.options.html=s(_(e,r,g)),n.setIcon(t)}},[g,P]),(0,o.useEffect)(()=>{var e,t;let r=D.current;if(r===w)return;let n=N.current,l=z.current;if(null!==r)for(let t of u.oo){let o=J.current[t].get(r);if(o){let t=C(r,G(r),n,null!==(e=null==l?void 0:l.has(r))&&void 0!==e&&e);for(let e of o)e.setStyle(t)}}if(null!==w)for(let e of u.oo){let r=J.current[e].get(w);if(r){let e=null!==(t=null==l?void 0:l.has(w))&&void 0!==t&&t,o=C(w,G(w),n,e),a=e?x:n?b:v;for(let e of r)e.setStyle({...o,...a})}}D.current=w},[w,G]),(0,o.useEffect)(()=>{let e=z.current;for(let r of u.oo)for(let[n,l]of J.current[r]){var t;let r=C(n,G(n),a,null!==(t=null==e?void 0:e.has(n))&&void 0!==t&&t);for(let e of l)e.setStyle(r)}},[a,i,G]),(0,o.useCallback)(e=>(0,R.gh)(e),[])}({map:h,onEntityClick:t,onHover:a,colorOverrides:i,inaccessibleEntities:p,refreshKey:y}),null}},27144:function(e,t,r){r.d(t,{K:function(){return o}});var n=r(61878),l=r.n(n);async function o(e,t){let r=[];for(let n=0;n<e.length&&!t.aborted;n+=80){let o=e.slice(n,n+80),a=await Promise.all(o.map(async e=>{let t=await l().getItem(e);return t?{rs:e,geoJson:t}:null}));if(t.aborted)break;for(let e of a){if(!e)continue;let{rs:t,geoJson:n}=e;if("FeatureCollection"===n.type)for(let e of n.features)r.push({...e,properties:{...e.properties,rs:t}});else"Feature"===n.type?r.push({...n,properties:{...n.properties,rs:t}}):r.push({type:"Feature",geometry:n,properties:{rs:t}})}n+80<e.length&&await new Promise(e=>{"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>e()):setTimeout(e,0)})}return r}},66487:function(e,t,r){r.d(t,{Hb:function(){return l},UO:function(){return i},mE:function(){return u},sj:function(){return o}});var n=r(92422);function l(e){return Object.freeze({__version:1,map:e})}function o(e,t){return Object.freeze({...e,...t})}let a=(0,n.createContext)(null),i=a.Provider;function u(){let e=(0,n.useContext)(a);if(null==e)throw Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}},7523:function(e,t,r){r.d(t,{Sx:function(){return l}});var n=r(66487);function l(){return(0,n.mE)().map}r(92422)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.