kollapsminoriteten/wp-content/plugins/jetpack/_inc/blocks/map/view.js

1 line
12 KiB
JavaScript
Raw Normal View History

2025-12-12 13:13:07 +01:00
(()=>{var t={13750:(t,i,e)=>{"use strict";function o(t){const i=t.ownerDocument;return{currentDoc:i,currentWindow:i.defaultView||i.parentWindow}}function s(t,i,s){let n;try{n=new URL("editor-assets",e.p)}catch{return}const a=n.href,{currentDoc:r}=o(s),l=r.getElementsByTagName("head")[0];t.forEach(t=>{const[e,o]=t.file.split("/").pop().split(".");if("css"===o){if(r.getElementById(t.id))return;const i=r.createElement("link");i.id=t.id,i.rel="stylesheet",i.href=`${a}/${e}-${t.version}.${o}`,l.appendChild(i)}if("js"===o){const s=i[t.id]?i[t.id]:null;if(r.getElementById(t.id))return s();const n=r.createElement("script");n.id=t.id,n.type="text/javascript",n.src=`${a}/${e}-${t.version}.${o}`,n.onload=s,l.appendChild(n)}})}function n(t,i){return new Promise(e=>{const o=()=>{t[i]?e(t[i]):t.requestAnimationFrame(o)};o()})}e.d(i,{Cu:()=>n,a$:()=>s,sG:()=>o})},35358:(t,i,e)=>{"use strict";e.d(i,{BY:()=>r,ES:()=>s,_t:()=>n,iU:()=>a,jF:()=>o});const o=t=>Object.hasOwn(t,"lat")&&Object.hasOwn(t,"lng")?t:{lat:t.latitude||0,lng:t.longitude||0};function s(t,i){const e=new t.LngLatBounds;return i.forEach(t=>{e.extend([t.coordinates.longitude,t.coordinates.latitude])}),e}function n(t,i){t.fitBounds(i,{padding:{top:80,bottom:80,left:40,right:40}})}function a(t,i){t.innerHTML=`\n\t\t<?xml version="1.0" encoding="UTF-8"?>\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n\t\t\t<g fill-rule="evenodd">\n\t\t\t\t<path id="d" d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z" fill="${i}"/>\n\t\t\t</g>\n\t\t</svg>\n\t`}function r(t){return new t.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}},47368:(t,i,e)=>{"use strict";e.d(i,{i:()=>s.A,p:()=>o.A});var o=e(61921),s=e(96736)},55740:t=>{"use strict";t.exports=JSON.parse('[{"id":"mapbox-gl-js","file":"node_modules/mapbox-gl/dist/mapbox-gl.js","version":"1.13.0"},{"id":"mapbox-gl-css","file":"node_modules/mapbox-gl/dist/mapbox-gl.css","version":"1.13.0"}]')},55994:(t,i,e)=>{"use strict";function o(t,i){return{default:{details:"mapbox://styles/automattic/cjolkhmez0qdd2ro82dwog1in",no_details:"mapbox://styles/automattic/cjolkci3905d82soef4zlmkdo"},black_and_white:{details:"mapbox://styles/automattic/cjolkixvv0ty42spgt2k4j434",no_details:"mapbox://styles/automattic/cjolkgc540tvj2spgzzoq37k4"},satellite:{details:"mapbox://styles/mapbox/satellite-streets-v10",no_details:"mapbox://styles/mapbox/satellite-v9"},terrain:{details:"mapbox://styles/automattic/cjolkf8p405fh2soet2rdt96b",no_details:"mapbox://styles/automattic/cjolke6fz12ys2rpbpvgl12ha"}}[t][i?"details":"no_details"]}e.d(i,{o:()=>o})},61299:(t,i,e)=>{"use strict";function o(t,i){let e;return function(...o){clearTimeout(e),e=setTimeout(()=>t.apply(this,o),i)}}e.d(i,{s:()=>o})},61921:(t,i,e)=>{"use strict";e.d(i,{A:()=>c});var o=e(13750),s=e(61299),n=e(55740),a=e(55994),r=e(35358),l=e(65609);const c=class{constructor(t,i=()=>{}){this.root=t;const{currentDoc:e,currentWindow:s}=(0,o.sG)(this.root);this.document=e,this.window=s,this.onError=i,this.mapStyle=this.root.getAttribute("data-map-style")||"default",this.mapDetails="true"===this.root.getAttribute("data-map-details"),this.apiKey=this.root.getAttribute("data-api-key")||null,this.scrollToZoom="true"===this.root.getAttribute("data-scroll-to-zoom"),this.showFullscreenButton="true"===this.root.getAttribute("data-show-fullscreen-button"),this.points=JSON.parse(this.root.getAttribute("data-points")||"[]"),this.mapCenter=JSON.parse(this.root.getAttribute("data-map-center")||"{}"),this.mapHeight=this.root.getAttribute("data-map-height")||null,this.markerColor=this.root.getAttribute("data-marker-color")||"red";const n=this.root.getAttribute("data-zoom");this.zoom=n&&n.length?parseInt(this.root.getAttribute("data-zoom"),10):13,this.activeMarker=null;const a=this.root.querySelector("ul");if(a&&(a.style.display="none"),!this.apiKey||!this.apiKey.length)throw new Error("API key missing")}initDOM(){this.root.innerHTML='<div class="wp-block-jetpack-map__gm-container"><