leaflet-html 0.8.1 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -293,3 +293,12 @@ To build the source code run.
293
293
  ```sh
294
294
  yarn build
295
295
  ```
296
+
297
+ ## Contributing
298
+
299
+ Leaflet HTML, while a simple idea,
300
+ requires contributions from talented and generous people.
301
+ Please see our contributing guide for how to help make this library better.
302
+
303
+ [CONTRIBUTING.md](CONTRIBUTING.md)
304
+
@@ -1,2 +1,2 @@
1
- import*as t from"leaflet";import{control as e,layerGroup as n,tileLayer as r,imageOverlay as a,videoOverlay as i,geoJSON as o,icon as l,divIcon as s,tooltip as u,Circle as c,Rectangle as p,Polygon as f,Polyline as b,circle as h,polyline as v,polygon as d,rectangle as m}from"leaflet";function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function g(){return g=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},g.apply(null,arguments)}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}function C(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,w(t,e)}function L(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(L=function(){return!!t})()}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function A(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function O(t){var e="function"==typeof Map?new Map:void 0;return O=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(L())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return n&&w(a,n.prototype),a}(t,arguments,E(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),w(n,t)},O(t)}var k="l:layer:connected",S="l:popup:connected",N="l:icon:connected",T="l:layer:removed",M="l:latlngbounds:connected",j="l:latlngbounds:changed",J="l:tooltip:connected",P="l:pane:connected",H=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(k,function(t){t.detail.type="base"})},e}(/*#__PURE__*/O(HTMLElement)),_=/*#__PURE__*/function(t){function n(){return t.call(this)||this}return C(n,t),n.prototype.connectedCallback=function(){var t=e.layers({},{});this.addEventListener(k,function(e){var n=e.detail,r=n.type,a=n.name,i=n.layer;"overlay"===r?t.addOverlay(i,a):"base"===r&&t.addBaseLayer(i,a),e.preventDefault()});var n=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:t}});this.dispatchEvent(n)},n}(/*#__PURE__*/O(HTMLElement)),z=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e}(/*#__PURE__*/O(HTMLElement)),I=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("name"),e=n();this.layer=e;var r=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:e,name:t}});this.dispatchEvent(r),this.addEventListener(k,function(t){t.stopPropagation(),e.addLayer(t.detail.layer)}),new MutationObserver(function(t){t.forEach(function(t){t.removedNodes.forEach(function(t){if(t instanceof HTMLElement){var n=t.getAttribute("leaflet-id");if(null!==n){var r=e.getLayer(parseInt(n));void 0!==r&&e.removeLayer(r)}}})})}).observe(this,{childList:!0})},e}(z),F=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this)||this).issues=[],n.name="LeafletHTMLError",n.issues=e,n}return C(e,t),n=e,(r=[{key:"message",get:function(){return JSON.stringify(this.issues,null,2)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,A(r.key),r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(/*#__PURE__*/O(Error)),B=function(t,e){var n=t(function(t){return{status:"clean",issues:[],value:t}}(e));if("clean"!==n.status)throw new F(n.issues);return n.value},U=function(t){return function(e){for(var n=e.issues,r="clean",a={},i=0,o=Object.keys(t);i<o.length;i++){var l=o[i],s=t[l](e);"clean"!==s.status&&(r=s.status),null===s.value&&"clean"===s.status||(n=[].concat(n,s.issues),a[l]=s.value)}return{status:r,issues:n,value:a}}},x=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length&&"abort"!==(e=t[n](e)).status;n++);return e}},R=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length;n++)e=t[n](e);return e}},V=function(t){return function(e){return null===e.value?e:t(e)}},D=function(t){return function(e){return null===(e=t(e)).value?{status:"clean",issues:[],value:null}:e}},W=function(t){return function(e){var n=e.value,r=n.getAttribute(t);return null===r?{status:"abort",issues:[].concat(e.issues,[G(n,t)]),value:null}:g({},e,{value:r})}},Z=function(){return function(t){var e;try{e=JSON.parse(t.value)}catch(e){return{status:"abort",issues:[].concat(t.issues,[q(e)]),value:null}}return g({},t,{value:e})}},$=function(t){return x.apply(void 0,[W(t)].concat([].slice.call(arguments,1)))},q=function(t){return{code:"parse_json",message:t.message}},G=function(t,e){return{code:"missing_attribute",message:t.tagName.toLowerCase()+" missing attribute '"+e+"'"}},K=/*#__PURE__*/function(e){function n(){var t;(t=e.call(this)||this).map=null;var r=function(e){var n=e.detail;null!==t.map&&t.map[n.method](n.bounds)};return t.addEventListener(M,r),t.addEventListener(j,r),t.addEventListener(P,function(e){t.map.createPane(e.detail.name)}),new MutationObserver(function(t){t.forEach(function(t){if(t.target instanceof n){var e=t.target;t.removedNodes.forEach(function(t){t instanceof z&&null!==e.map&&null!==t.layer&&(e.dispatchEvent(new CustomEvent(T,{bubbles:!0,detail:{layer:t.layer}})),e.map.removeLayer(t.layer))})}})}).observe(t,{childList:!0}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e,n=this;if(this.map=t.map(this,{zoomControl:this.hasAttribute("zoom-control")}),this.map.whenReady(function(){n.dispatchEvent(new CustomEvent("ready",{bubbles:!0,cancelable:!0,detail:n.map}))}),this.hasAttribute("on")){var r=this.getAttribute("on");null!==r&&r.split(/\s+/).forEach(function(t){null!==n.map&&n.map.on(t,function(e){n.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))})})}if(this.hasAttribute("fit-world"))this.map.fitWorld();else{var a=(e={zoom:$("zoom",function(t){var e,n=parseInt(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_int",message:'could not parse int given: "'+e+'"'})]),value:n}:g({},t,{value:n})}),center:$("center",Z())},function(t){for(var n=t.status,r=t.issues,a={},i=0,o=Object.keys(e);i<o.length;i++){var l=o[i],s=e[l](t);"abort"===s.status&&(n="abort",r=[].concat(r,s.issues)),a[l]=s.value}return{status:n,issues:r,value:a}}),i=B(a,this);this.map.setView(i.center,i.zoom)}if(this.hasAttribute("locate")){var o=$("locate",Z());this.map.locate(B(o,this))}this.addEventListener(k,function(t){t.detail.layer.addTo(n.map)}),this.addEventListener(T,function(t){null!==n.map&&n.map.removeLayer(t.detail.layer)})},r.attributeChangedCallback=function(t,e,n){null!==this.map&&("zoom"===t?this.map.setZoom(parseInt(n)):"center"===t&&this.map.setView(JSON.parse(n)))},n}(/*#__PURE__*/O(HTMLElement));K.observedAttributes=["zoom","center","zoom-control"];var Q=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t.addEventListener(N,function(e){e.stopPropagation(),t.layer.setIcon(e.detail.icon)}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e=this,n=B($("lat-lng",Z()),this),r=B(U({opacity:R(D(W("opacity")),V(function(t){var e,n=parseFloat(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_float",message:'could not parse float given: "'+e+'"'})]),value:n}:g({},t,{value:n})}))}),this),a=this.closest("l-pane");if(null!==a&&(r.pane=a.getAttribute("name")),this.layer=t.marker(n,r),this.hasAttribute("icon")){var i=t.icon(JSON.parse(this.getAttribute("icon")));this.layer.setIcon(i)}this.setAttribute("leaflet-id",t.stamp(this.layer)),this.addEventListener(S,function(t){var n=t.detail,r=n.openPopup,a=e.layer.bindPopup(n.content);r&&a.openPopup()});var o=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(o)},r.attributeChangedCallback=function(e,n,r){null!==this.layer&&("lat-lng"===e&&this.layer.setLatLng(JSON.parse(r)),"opacity"===e&&this.layer.setOpacity(parseFloat(r)),"icon"===e&&this.layer.setIcon(t.icon(JSON.parse(r))))},n}(z);Q.observedAttributes=["lat-lng","opacity","icon"];var X=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(k,function(t){t.detail.type="overlay"})},e}(/*#__PURE__*/O(HTMLElement)),Y=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("content"),e=!1,n=this.getAttribute("open-popup");null!==n&&(e="false"!==n);var r=new CustomEvent(S,{cancelable:!0,bubbles:!0,detail:{content:t,openPopup:e}});this.dispatchEvent(r)},e}(/*#__PURE__*/O(HTMLElement)),tt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){for(var t,n=B(W("url-template"),this),a={},i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return y(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}(t))){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.parseTemplateAttributes(n));!(t=i()).done;){var o=t.value,l=this.getAttribute(o);null!==l&&(a[o]=l)}var s={};"l-pane"===this.parentElement.tagName.toLowerCase()&&(s.pane=this.parentElement.getAttribute("name"));var u=this.getAttribute("name"),c=U({attribution:D(W("attribution")),errorTileUrl:D(W("error-tile-url"))}),p=B(c,this);this.layer=r(n,g({},a,s,p));var f=new CustomEvent(k,{detail:{name:u,layer:this.layer},bubbles:!0});this.dispatchEvent(f)},e.parseTemplateAttributes=function(t){return[].concat(t.matchAll(/{(.*?)}/g)).map(function(t){return t[1]})},e}(z),et=/*#__PURE__*/function(t){function e(){return t.call(this)||this}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("bounds");null!==t&&this.dispatchEvent(this.getEvent(M,JSON.parse(t)))},n.attributeChangedCallback=function(t,e,n){this.dispatchEvent(this.getEvent(j,JSON.parse(n)))},n.getEvent=function(t,e){return new CustomEvent(t,{bubbles:!0,detail:{bounds:e,method:this.getAttribute("method")||"fitBounds"}})},e}(/*#__PURE__*/O(HTMLElement));et.observedAttributes=["bounds"];var nt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("url");if(null!==t){var e=this.getAttribute("bounds");if(null!==e){var n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||""},r=this.closest("l-pane");null!==r&&(n.pane=r.getAttribute("name")),this.layer=a(t,JSON.parse(e),n),this.dispatchEvent(new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}}))}else console.warn("attribute 'bounds' not set")}else console.warn("attribute 'url' not set")},n.disconnectedCallback=function(){var t;null==(t=this.layer)||t.remove()},n.attributeChangedCallback=function(t,e,n){null!==this.layer&&("url"===t?this.layer.setUrl(n):"bounds"===t?this.layer.setBounds(JSON.parse(n)):"opacity"===t&&this.layer.setOpacity(parseFloat(n)))},e}(z);nt.observedAttributes=["url","bounds","opacity"];var rt=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=JSON.parse(this.getAttribute("url")),e=JSON.parse(this.getAttribute("bounds")),n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||"",autoplay:!0,muted:!0,playsInline:!0},r=i(t,e,n);this.dispatchEvent(new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:r}}))},e}(z),at=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("geojson"),e={},n=this.closest("l-pane");null!==n&&(e.pane=n.getAttribute("name")),null!==t&&(this.layer=o(JSON.parse(t),e),this.dispatchEvent(new CustomEvent(k,{bubbles:!0,cancelable:!0,detail:{layer:this.layer}})))},e}(/*#__PURE__*/O(HTMLElement)),it=function(t){return t.replace(/-./g,function(t){return t[1].toUpperCase()})},ot=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t={};["icon-url","icon-retina-url","shadow-url","shadow-retina-url","class-name"].forEach(function(e){t[it(e)]=D(W(e))}),["icon-anchor","icon-size","shadow-anchor","shadow-size","tooltip-anchor","popup-anchor"].forEach(function(e){t[it(e)]=R(D(W(e)),V(Z()))}),t.crossOrigin=R(D(W("cross-origin")),V(function(t){return g({},t,{value:"true"===t.value.toLowerCase()})}));var e=U(t),n=B(e,this);this.icon=l(n);var r=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(r)},e}(/*#__PURE__*/O(HTMLElement)),lt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t={html:this.innerHTML},e=this.getAttribute("class-name");null!==e&&(t.className=e),this.icon=s(t),this.dispatchEvent(new CustomEvent(N,{bubbles:!0,cancelable:!0,detail:{icon:this.icon}}))},e}(/*#__PURE__*/O(HTMLElement)),st=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).tooltip=u(),e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=new CustomEvent(J,{cancelable:!0,bubbles:!0,detail:{tooltip:this.tooltip}});this.dispatchEvent(t)},n.attributeChangedCallback=function(t,e,n){"content"===t&&this.tooltip.setContent(n)},e}(/*#__PURE__*/O(HTMLElement));st.observedAttributes=["content"];var ut=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.dispatchEvent(new CustomEvent(P,{bubbles:!0,cancelable:!0,detail:{name:this.getAttribute("name")}}))},e}(/*#__PURE__*/O(HTMLElement)),ct=function(t){switch(t){case"circle":return[pt("latLng","latlng",null)];case"rectangle":return[pt("latLngBounds","latlngbounds",null)];case"polygon":case"polyline":return[pt("latLngs","latlng",null)]}},pt=function(t,e,n){return{camel:t,kebab:(r=t,r.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")),parser:ft(e),defaultValue:n};var r},ft=function(t){switch(t.toLowerCase()){case"boolean":return function(t){return"true"===t};case"number":return parseFloat;case"latlng":case"latlngbounds":return JSON.parse;default:return function(t){return t}}},bt=function(t){var e={circle:[pt("radius","number",null)],path:[pt("stroke","boolean",!0),pt("color","string","#3388ff"),pt("weight","number",3),pt("opacity","number",1),pt("lineCap","string","round"),pt("lineJoin","string","round"),pt("dashArray","string",null),pt("dashOffset","string",null),pt("fill","boolean",!0),pt("fillColor","string","#3388ff"),pt("fillOpacity","number",.2)],polyline:[pt("smoothFactor","number",1),pt("noClip","boolean",!1)],polygon:[],rectangle:[],interactiveLayer:[pt("interactive","boolean",!0)]};return vt(t).flatMap(function(t){return e[t]})},ht={circle:["path"],polyline:["path"],polygon:["polyline"],rectangle:["polygon"],path:["interactiveLayer"],interactiveLayer:[]},vt=function(t){for(var e=t,n=[t];ht[e].length>0;){var r=ht[e][0];n.push(r),e=r}return n},dt=function(t,e){var n={};return bt(e).forEach(function(e){t.hasAttribute(e.kebab)&&(n[e.camel]=e.parser(t.getAttribute(e.kebab)))}),n},mt=function(t,e){var n=/*#__PURE__*/function(n){function r(){var t;return(t=n.call(this)||this).layer=null,t.addEventListener(J,function(e){null!==t.layer&&t.layer.bindTooltip(e.detail.tooltip)}),t}C(r,n);var a=r.prototype;return a.connectedCallback=function(){var n=function(t,e){return ct(e).map(function(e){var n=W(e.kebab),r=B(n,t);return e.parser(r)})}(this,e),r=dt(this,e);this.layer=t.apply(void 0,n.concat([r]));var a=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(a)},a.attributeChangedCallback=function(t,n,r){null!==this.layer&&function(t,e,n,r){var a=[].concat(ct(e),bt(e)).find(function(t){return t.kebab===n});if(void 0!==a){var i=a.parser(r);if(t instanceof c)switch(n){case"lat-lng":t.setLatLng(JSON.parse(r));break;case"radius":t.setRadius(parseFloat(r))}else if(t instanceof p)switch(n){case"lat-lngs":t.setLatLngs(JSON.parse(r));break;case"lat-lng-bounds":t.setBounds(JSON.parse(r))}else t instanceof f?"lat-lngs"===n&&t.setLatLngs(JSON.parse(r)):t instanceof b&&"lat-lngs"===n&&t.setLatLngs(JSON.parse(r));var o,l=bt("polyline").find(function(t){return t.kebab===n});void 0!==l&&t.setStyle(((o={})[l.camel]=i,o))}}(this.layer,e,t,r)},r}(/*#__PURE__*/O(HTMLElement));return n.observedAttributes=function(t){var e=ct(t).map(function(t){return t.kebab}),n=bt(t).map(function(t){return t.kebab});return[].concat(e,n)}(e),n},yt=(customElements.define("l-map",K),customElements.define("l-pane",ut),customElements.define("l-control-layers",_),customElements.define("l-base-layers",H),customElements.define("l-overlay-layers",X),customElements.define("l-layer-group",I),customElements.define("l-tile-layer",tt),customElements.define("l-marker",Q),customElements.define("l-popup",Y),customElements.define("l-lat-lng-bounds",et),customElements.define("l-image-overlay",nt),customElements.define("l-video-overlay",rt),customElements.define("l-geojson",at),customElements.define("l-icon",ot),customElements.define("l-circle",mt(h,"circle")),customElements.define("l-polyline",mt(v,"polyline")),customElements.define("l-polygon",mt(d,"polygon")),customElements.define("l-rectangle",mt(m,"rectangle")),customElements.define("l-tooltip",st),void customElements.define("l-div-icon",lt));export{yt as default};
1
+ import*as t from"leaflet";import{control as e,layerGroup as n,tileLayer as r,imageOverlay as a,videoOverlay as i,geoJSON as o,icon as l,divIcon as s,tooltip as u,Circle as c,Rectangle as p,Polygon as f,Polyline as b,circle as h,polyline as v,polygon as d,rectangle as m}from"leaflet";function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function g(){return g=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},g.apply(null,arguments)}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}function C(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,w(t,e)}function L(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(L=function(){return!!t})()}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function A(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function O(t){var e="function"==typeof Map?new Map:void 0;return O=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(L())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return n&&w(a,n.prototype),a}(t,arguments,E(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),w(n,t)},O(t)}var k="l:layer:connected",S="l:popup:connected",N="l:icon:connected",T="l:layer:removed",M="l:latlngbounds:connected",j="l:latlngbounds:changed",J="l:tooltip:connected",P="l:pane:connected",H=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(k,function(t){t.detail.type="base"})},e}(/*#__PURE__*/O(HTMLElement)),_=/*#__PURE__*/function(t){function n(){return t.call(this)||this}return C(n,t),n.prototype.connectedCallback=function(){var t=e.layers({},{});this.addEventListener(k,function(e){var n=e.detail,r=n.type,a=n.name,i=n.layer;"overlay"===r?t.addOverlay(i,a):"base"===r&&t.addBaseLayer(i,a),e.preventDefault()});var n=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:t}});this.dispatchEvent(n)},n}(/*#__PURE__*/O(HTMLElement)),z=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.disconnectedCallback=function(){var t;null==(t=this.layer)||t.remove()},e}(/*#__PURE__*/O(HTMLElement)),I=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("name"),e=n();this.layer=e;var r=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:e,name:t}});this.dispatchEvent(r),this.addEventListener(k,function(t){t.stopPropagation(),e.addLayer(t.detail.layer)}),new MutationObserver(function(t){t.forEach(function(t){t.removedNodes.forEach(function(t){if(t instanceof HTMLElement){var n=t.getAttribute("leaflet-id");if(null!==n){var r=e.getLayer(parseInt(n));void 0!==r&&e.removeLayer(r)}}})})}).observe(this,{childList:!0})},e}(z),F=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this)||this).issues=[],n.name="LeafletHTMLError",n.issues=e,n}return C(e,t),n=e,(r=[{key:"message",get:function(){return JSON.stringify(this.issues,null,2)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,A(r.key),r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(/*#__PURE__*/O(Error)),B=function(t,e){var n=t(function(t){return{status:"clean",issues:[],value:t}}(e));if("clean"!==n.status)throw new F(n.issues);return n.value},U=function(t){return function(e){for(var n=e.issues,r="clean",a={},i=0,o=Object.keys(t);i<o.length;i++){var l=o[i],s=t[l](e);"clean"!==s.status&&(r=s.status),null===s.value&&"clean"===s.status||(n=[].concat(n,s.issues),a[l]=s.value)}return{status:r,issues:n,value:a}}},x=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length&&"abort"!==(e=t[n](e)).status;n++);return e}},R=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length;n++)e=t[n](e);return e}},V=function(t){return function(e){return null===e.value?e:t(e)}},D=function(t){return function(e){return null===(e=t(e)).value?{status:"clean",issues:[],value:null}:e}},W=function(t){return function(e){var n=e.value,r=n.getAttribute(t);return null===r?{status:"abort",issues:[].concat(e.issues,[G(n,t)]),value:null}:g({},e,{value:r})}},Z=function(){return function(t){var e;try{e=JSON.parse(t.value)}catch(e){return{status:"abort",issues:[].concat(t.issues,[q(e)]),value:null}}return g({},t,{value:e})}},$=function(t){return x.apply(void 0,[W(t)].concat([].slice.call(arguments,1)))},q=function(t){return{code:"parse_json",message:t.message}},G=function(t,e){return{code:"missing_attribute",message:t.tagName.toLowerCase()+" missing attribute '"+e+"'"}},K=/*#__PURE__*/function(e){function n(){var t;(t=e.call(this)||this).map=null;var r=function(e){var n=e.detail;null!==t.map&&t.map[n.method](n.bounds)};return t.addEventListener(M,r),t.addEventListener(j,r),t.addEventListener(P,function(e){t.map.createPane(e.detail.name)}),new MutationObserver(function(t){t.forEach(function(t){if(t.target instanceof n){var e=t.target;t.removedNodes.forEach(function(t){t instanceof z&&null!==e.map&&null!==t.layer&&(e.dispatchEvent(new CustomEvent(T,{bubbles:!0,detail:{layer:t.layer}})),e.map.removeLayer(t.layer))})}})}).observe(t,{childList:!0}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e,n=this;if(this.map=t.map(this,{zoomControl:this.hasAttribute("zoom-control")}),this.map.whenReady(function(){n.dispatchEvent(new CustomEvent("ready",{bubbles:!0,cancelable:!0,detail:n.map}))}),this.hasAttribute("on")){var r=this.getAttribute("on");null!==r&&r.split(/\s+/).forEach(function(t){null!==n.map&&n.map.on(t,function(e){n.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))})})}if(this.hasAttribute("fit-world"))this.map.fitWorld();else{var a=(e={zoom:$("zoom",function(t){var e,n=parseInt(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_int",message:'could not parse int given: "'+e+'"'})]),value:n}:g({},t,{value:n})}),center:$("center",Z())},function(t){for(var n=t.status,r=t.issues,a={},i=0,o=Object.keys(e);i<o.length;i++){var l=o[i],s=e[l](t);"abort"===s.status&&(n="abort",r=[].concat(r,s.issues)),a[l]=s.value}return{status:n,issues:r,value:a}}),i=B(a,this);this.map.setView(i.center,i.zoom)}if(this.hasAttribute("locate")){var o=$("locate",Z());this.map.locate(B(o,this))}this.addEventListener(k,function(t){t.detail.layer.addTo(n.map)}),this.addEventListener(T,function(t){null!==n.map&&n.map.removeLayer(t.detail.layer)})},r.attributeChangedCallback=function(t,e,n){null!==this.map&&("zoom"===t?this.map.setZoom(parseInt(n)):"center"===t&&this.map.setView(JSON.parse(n)))},n}(/*#__PURE__*/O(HTMLElement));K.observedAttributes=["zoom","center","zoom-control"];var Q=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t.addEventListener(N,function(e){e.stopPropagation(),t.layer.setIcon(e.detail.icon)}),t.addEventListener(J,function(e){e.stopPropagation(),t.layer.bindTooltip(e.detail.tooltip)}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e=this,n=B($("lat-lng",Z()),this),r=B(U({opacity:R(D(W("opacity")),V(function(t){var e,n=parseFloat(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_float",message:'could not parse float given: "'+e+'"'})]),value:n}:g({},t,{value:n})}))}),this),a=this.closest("l-pane");if(null!==a&&(r.pane=a.getAttribute("name")),this.layer=t.marker(n,r),this.hasAttribute("icon")){var i=t.icon(JSON.parse(this.getAttribute("icon")));this.layer.setIcon(i)}this.setAttribute("leaflet-id",t.stamp(this.layer)),this.addEventListener(S,function(t){var n=t.detail,r=n.openPopup,a=e.layer.bindPopup(n.content);r&&a.openPopup()});var o=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(o)},r.attributeChangedCallback=function(e,n,r){null!==this.layer&&("lat-lng"===e&&this.layer.setLatLng(JSON.parse(r)),"opacity"===e&&this.layer.setOpacity(parseFloat(r)),"icon"===e&&this.layer.setIcon(t.icon(JSON.parse(r))))},n}(z);Q.observedAttributes=["lat-lng","opacity","icon"];var X=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(k,function(t){t.detail.type="overlay"})},e}(/*#__PURE__*/O(HTMLElement)),Y=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("content"),e=!1,n=this.getAttribute("open-popup");null!==n&&(e="false"!==n);var r=new CustomEvent(S,{cancelable:!0,bubbles:!0,detail:{content:t,openPopup:e}});this.dispatchEvent(r)},e}(/*#__PURE__*/O(HTMLElement)),tt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){for(var t,n=B(W("url-template"),this),a={},i=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,e){if(t){if("string"==typeof t)return y(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}(t))){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.parseTemplateAttributes(n));!(t=i()).done;){var o=t.value,l=this.getAttribute(o);null!==l&&(a[o]=l)}var s={};"l-pane"===this.parentElement.tagName.toLowerCase()&&(s.pane=this.parentElement.getAttribute("name"));var u=this.getAttribute("name"),c=U({attribution:D(W("attribution")),errorTileUrl:D(W("error-tile-url"))}),p=B(c,this);this.layer=r(n,g({},a,s,p));var f=new CustomEvent(k,{detail:{name:u,layer:this.layer},bubbles:!0});this.dispatchEvent(f)},e.parseTemplateAttributes=function(t){return[].concat(t.matchAll(/{(.*?)}/g)).map(function(t){return t[1]})},e}(z),et=/*#__PURE__*/function(t){function e(){return t.call(this)||this}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("bounds");null!==t&&this.dispatchEvent(this.getEvent(M,JSON.parse(t)))},n.attributeChangedCallback=function(t,e,n){this.dispatchEvent(this.getEvent(j,JSON.parse(n)))},n.getEvent=function(t,e){return new CustomEvent(t,{bubbles:!0,detail:{bounds:e,method:this.getAttribute("method")||"fitBounds"}})},e}(/*#__PURE__*/O(HTMLElement));et.observedAttributes=["bounds"];var nt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("url");if(null!==t){var e=this.getAttribute("bounds");if(null!==e){var n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||""},r=this.closest("l-pane");null!==r&&(n.pane=r.getAttribute("name")),this.layer=a(t,JSON.parse(e),n),this.dispatchEvent(new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}}))}else console.warn("attribute 'bounds' not set")}else console.warn("attribute 'url' not set")},n.attributeChangedCallback=function(t,e,n){null!==this.layer&&("url"===t?this.layer.setUrl(n):"bounds"===t?this.layer.setBounds(JSON.parse(n)):"opacity"===t&&this.layer.setOpacity(parseFloat(n)))},e}(z);nt.observedAttributes=["url","bounds","opacity"];var rt=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=JSON.parse(this.getAttribute("url")),e=JSON.parse(this.getAttribute("bounds")),n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||"",autoplay:!0,muted:!0,playsInline:!0},r=i(t,e,n);this.dispatchEvent(new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:r}}))},e}(z),at=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("geojson"),e={},n=this.closest("l-pane");null!==n&&(e.pane=n.getAttribute("name")),null!==t&&(this.layer=o(JSON.parse(t),e),this.dispatchEvent(new CustomEvent(k,{bubbles:!0,cancelable:!0,detail:{layer:this.layer}})))},e}(/*#__PURE__*/O(HTMLElement)),it=function(t){return t.replace(/-./g,function(t){return t[1].toUpperCase()})},ot=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t={};["icon-url","icon-retina-url","shadow-url","shadow-retina-url","class-name"].forEach(function(e){t[it(e)]=D(W(e))}),["icon-anchor","icon-size","shadow-anchor","shadow-size","tooltip-anchor","popup-anchor"].forEach(function(e){t[it(e)]=R(D(W(e)),V(Z()))}),t.crossOrigin=R(D(W("cross-origin")),V(function(t){return g({},t,{value:"true"===t.value.toLowerCase()})}));var e=U(t),n=B(e,this);this.icon=l(n);var r=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(r)},e}(/*#__PURE__*/O(HTMLElement)),lt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t={html:this.innerHTML},e=this.getAttribute("class-name");null!==e&&(t.className=e),this.icon=s(t),this.dispatchEvent(new CustomEvent(N,{bubbles:!0,cancelable:!0,detail:{icon:this.icon}}))},e}(/*#__PURE__*/O(HTMLElement)),st=/*#__PURE__*/function(t){function e(){var e,n;return(n=t.call(this)||this).tooltip=u({permanent:n.hasAttribute("permanent"),direction:null!=(e=n.getAttribute("direction"))?e:"auto"}),n}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=new CustomEvent(J,{cancelable:!0,bubbles:!0,detail:{tooltip:this.tooltip}});this.dispatchEvent(t)},n.attributeChangedCallback=function(t,e,n){"content"===t&&this.tooltip.setContent(n)},e}(/*#__PURE__*/O(HTMLElement));st.observedAttributes=["content","permanent","direction"];var ut=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.dispatchEvent(new CustomEvent(P,{bubbles:!0,cancelable:!0,detail:{name:this.getAttribute("name")}}))},e}(/*#__PURE__*/O(HTMLElement)),ct=function(t){switch(t){case"circle":return[pt("latLng","latlng",null)];case"rectangle":return[pt("latLngBounds","latlngbounds",null)];case"polygon":case"polyline":return[pt("latLngs","latlng",null)]}},pt=function(t,e,n){return{camel:t,kebab:(r=t,r.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")),parser:ft(e),defaultValue:n};var r},ft=function(t){switch(t.toLowerCase()){case"boolean":return function(t){return"true"===t};case"number":return parseFloat;case"latlng":case"latlngbounds":return JSON.parse;default:return function(t){return t}}},bt=function(t){var e={circle:[pt("radius","number",null)],path:[pt("stroke","boolean",!0),pt("color","string","#3388ff"),pt("weight","number",3),pt("opacity","number",1),pt("lineCap","string","round"),pt("lineJoin","string","round"),pt("dashArray","string",null),pt("dashOffset","string",null),pt("fill","boolean",!0),pt("fillColor","string","#3388ff"),pt("fillOpacity","number",.2)],polyline:[pt("smoothFactor","number",1),pt("noClip","boolean",!1)],polygon:[],rectangle:[],interactiveLayer:[pt("interactive","boolean",!0)]};return vt(t).flatMap(function(t){return e[t]})},ht={circle:["path"],polyline:["path"],polygon:["polyline"],rectangle:["polygon"],path:["interactiveLayer"],interactiveLayer:[]},vt=function(t){for(var e=t,n=[t];ht[e].length>0;){var r=ht[e][0];n.push(r),e=r}return n},dt=function(t,e){var n={};return bt(e).forEach(function(e){t.hasAttribute(e.kebab)&&(n[e.camel]=e.parser(t.getAttribute(e.kebab)))}),n},mt=function(t,e){var n=/*#__PURE__*/function(n){function r(){var t;return(t=n.call(this)||this).layer=null,t.addEventListener(J,function(e){null!==t.layer&&t.layer.bindTooltip(e.detail.tooltip)}),t}C(r,n);var a=r.prototype;return a.connectedCallback=function(){var n=function(t,e){return ct(e).map(function(e){var n=W(e.kebab),r=B(n,t);return e.parser(r)})}(this,e),r=dt(this,e);this.layer=t.apply(void 0,n.concat([r]));var a=new CustomEvent(k,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(a)},a.attributeChangedCallback=function(t,n,r){null!==this.layer&&function(t,e,n,r){var a=[].concat(ct(e),bt(e)).find(function(t){return t.kebab===n});if(void 0!==a){var i=a.parser(r);if(t instanceof c)switch(n){case"lat-lng":t.setLatLng(JSON.parse(r));break;case"radius":t.setRadius(parseFloat(r))}else if(t instanceof p)switch(n){case"lat-lngs":t.setLatLngs(JSON.parse(r));break;case"lat-lng-bounds":t.setBounds(JSON.parse(r))}else t instanceof f?"lat-lngs"===n&&t.setLatLngs(JSON.parse(r)):t instanceof b&&"lat-lngs"===n&&t.setLatLngs(JSON.parse(r));var o,l=bt("polyline").find(function(t){return t.kebab===n});void 0!==l&&t.setStyle(((o={})[l.camel]=i,o))}}(this.layer,e,t,r)},r}(/*#__PURE__*/O(HTMLElement));return n.observedAttributes=function(t){var e=ct(t).map(function(t){return t.kebab}),n=bt(t).map(function(t){return t.kebab});return[].concat(e,n)}(e),n},yt=(customElements.define("l-map",K),customElements.define("l-pane",ut),customElements.define("l-control-layers",_),customElements.define("l-base-layers",H),customElements.define("l-overlay-layers",X),customElements.define("l-layer-group",I),customElements.define("l-tile-layer",tt),customElements.define("l-marker",Q),customElements.define("l-popup",Y),customElements.define("l-lat-lng-bounds",et),customElements.define("l-image-overlay",nt),customElements.define("l-video-overlay",rt),customElements.define("l-geojson",at),customElements.define("l-icon",ot),customElements.define("l-circle",mt(h,"circle")),customElements.define("l-polyline",mt(v,"polyline")),customElements.define("l-polygon",mt(d,"polygon")),customElements.define("l-rectangle",mt(m,"rectangle")),customElements.define("l-tooltip",st),void customElements.define("l-div-icon",lt));export{yt as default};
2
2
  //# sourceMappingURL=leaflet-html.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"leaflet-html.js","sources":["../src/events.js","../src/l-base-layers.js","../src/l-control-layers.js","../src/l-layer.js","../src/l-layer-group.js","../src/parse.js","../src/l-map.js","../src/l-marker.js","../src/l-overlay-layers.js","../src/l-popup.js","../src/l-tile-layer.js","../src/l-lat-lng-bounds.js","../src/l-image-overlay.js","../src/l-video-overlay.js","../src/l-geojson.js","../src/util.js","../src/l-icon.js","../src/l-div-icon.js","../src/l-tooltip.js","../src/l-pane.js","../src/generator.js","../src/index.js"],"sourcesContent":["// NOTE: These event keys are part of the public API of leaflet-html\nexport const layerConnected = \"l:layer:connected\";\nexport const popupConnected = \"l:popup:connected\";\nexport const iconConnected = \"l:icon:connected\";\nexport const layerRemoved = \"l:layer:removed\";\nexport const latLngBoundsConnected = \"l:latlngbounds:connected\";\nexport const latLngBoundsChanged = \"l:latlngbounds:changed\";\nexport const tooltipConnected = \"l:tooltip:connected\";\nexport const paneConnected = \"l:pane:connected\";\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LBaseLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"base\";\n });\n }\n}\n\nexport default LBaseLayers;\n","// @ts-check\n/** @typedef {import(\"leaflet\").Layer} Layer */\nimport { control } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LControlLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n /** @type {{ [key: string]: Layer }} */\n const base = {};\n /** @type {{ [key: string]: Layer }} */\n const overlay = {};\n const controlLayers = control.layers(base, overlay);\n\n this.addEventListener(layerConnected, (ev) => {\n const { type, name, layer } = ev.detail;\n if (type === \"overlay\") {\n controlLayers.addOverlay(layer, name);\n } else if (type === \"base\") {\n controlLayers.addBaseLayer(layer, name);\n }\n ev.preventDefault();\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: controlLayers,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LControlLayers;\n","class LLayer extends HTMLElement {\n constructor() {\n super()\n this.layer = null\n }\n}\n\nexport default LLayer\n","// @ts-check\nimport { layerGroup } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LLayerGroup extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const group = layerGroup();\n this.layer = group;\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: group,\n name,\n },\n });\n this.dispatchEvent(event);\n\n this.addEventListener(layerConnected, (ev) => {\n ev.stopPropagation();\n group.addLayer(ev.detail.layer);\n });\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const leafletId = node.getAttribute(\"leaflet-id\");\n if (leafletId !== null) {\n const layer = group.getLayer(parseInt(leafletId));\n if (typeof layer !== \"undefined\") {\n group.removeLayer(layer);\n }\n }\n }\n });\n });\n });\n observer.observe(this, { childList: true });\n }\n}\n\nexport default LLayerGroup;\n","/// <reference path=\"./parser.d.ts\" />\n \nexport class LeafletHTMLError extends Error {\n /** @type {Issue[]} */\n issues = [];\n\n /**\n * @param {Issue[]} issues\n */\n constructor(issues) {\n super();\n this.name = \"LeafletHTMLError\";\n this.issues = issues;\n }\n\n get message() {\n return JSON.stringify(this.issues, null, 2);\n }\n}\n\n/**\n * @template T\n * @param {T} value\n * @returns {Context<T>}\n */\nconst wrap = (value) => {\n return {\n status: \"clean\",\n issues: [],\n value,\n };\n};\n\n/**\n * @template T\n * @param {Context<T>} value\n * @returns {T}\n */\nconst unwrap = ({ value }) => value;\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {S}\n */\nexport const parse = (schema, value) => {\n const result = schema(wrap(value));\n if (result.status !== \"clean\") {\n throw new LeafletHTMLError(result.issues);\n } else {\n return unwrap(result);\n }\n};\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {Context<S>}\n */\nexport const safeParse = (schema, value) => schema(wrap(value));\n\n/**\n * @param {Object} obj\n * @returns {(ctx: Context<Object>) => Context<Object>}\n */\nexport const object = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n if (key in ctx.value) {\n result[key] = obj[key](wrap(ctx.value[key])).value;\n } else {\n status = \"abort\";\n issues = [...issues, missingKeyIssue(key)];\n }\n }\n return { status, issues, value: result };\n};\n\n// CONNECTORS\n\n/**\n * @template T\n * @param {Object} obj\n * @returns {(ctx: Context<T>) => Context<Object>}\n */\nexport const distribute = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status === \"abort\") {\n status = \"abort\";\n issues = [...issues, ...localCtx.issues];\n }\n result[key] = localCtx.value;\n }\n return { status, issues, value: result };\n};\n\nexport const partial = (obj) => (ctx) => {\n let { issues } = ctx;\n let status = \"clean\"\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status !== \"clean\") {\n status = localCtx.status\n }\n \n if ((localCtx.value === null) && (localCtx.status === \"clean\")) {\n continue\n } else {\n issues = [...issues, ...localCtx.issues];\n result[key] = localCtx.value;\n }\n }\n return { status, issues, value: result };\n};\n\nexport const pipe =\n (...parsers) =>\n (ctx) => {\n for (let i = 0; i < parsers.length; i++) {\n ctx = parsers[i](ctx);\n if (ctx.status === \"abort\") {\n break;\n }\n }\n return ctx;\n };\n\nexport const chain = (...parsers) => (ctx) => {\n for (let i=0; i<parsers.length; i++) {\n ctx = parsers[i](ctx)\n }\n return ctx\n}\n\n\n// PRIMITIVES\nexport const nullable = (parser) => (ctx) => {\n if (ctx.value === null) {\n return ctx\n }\n return parser(ctx)\n}\n\nexport const optional = (parser) => (ctx) => {\n ctx = parser(ctx)\n if (ctx.value === null) {\n return {status: \"clean\", issues: [], value: null}\n } else {\n return ctx\n }\n}\n\n/**\n * @param {string} attributeName\n * @returns {Parser<HTMLElement, string>}\n */\nexport const htmlAttribute = (attributeName) => (ctx) => {\n const el = ctx.value;\n let result = el.getAttribute(attributeName);\n if (result === null) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, htmlAttributeIssue(el, attributeName)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const int = () => (ctx) => {\n let result = parseInt(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, intIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const float = () => (ctx) => {\n let result = parseFloat(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, floatIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const json = () => (ctx) => {\n let result;\n try {\n result = JSON.parse(ctx.value);\n } catch (e) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, jsonIssue(e)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<boolean>}\n */\nexport const bool = () => (ctx) => {\n return { ...ctx, value: ctx.value.toLowerCase() === \"true\" };\n};\n\n/**\n * @template T\n * @template S\n * @param {string} key\n * @param {Parser<T, S>[]} fns\n */\nexport const option = (key, ...fns) => pipe(htmlAttribute(key), ...fns);\n\n\n// ISSUES\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const intIssue = (value) => {\n return {\n code: \"parse_int\",\n message: `could not parse int given: \"${value}\"`,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const floatIssue = (value) => {\n return {\n code: \"parse_float\",\n message: `could not parse float given: \"${value}\"`,\n };\n};\n\n/**\n * @param {SyntaxError} e\n * @returns {Issue}\n */\nexport const jsonIssue = (e) => {\n return {\n code: \"parse_json\",\n message: e.message,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const missingKeyIssue = (value) => {\n return {\n code: \"missing_key\",\n message: `key not found: ${value}`,\n };\n};\n\n/**\n * @param {HTMLElement} el\n * @param {string} attributeName\n * @returns {Issue}\n */\nexport const htmlAttributeIssue = (el, attributeName) => {\n return {\n code: \"missing_attribute\",\n message: `${el.tagName.toLowerCase()} missing attribute '${attributeName}'`,\n };\n};\n","// @ts-check\nimport * as L from \"leaflet\";\nimport { layerRemoved, layerConnected, latLngBoundsConnected, latLngBoundsChanged, paneConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { distribute, int, json, option, parse } from \"./parse.js\";\n\nclass LMap extends HTMLElement {\n static observedAttributes = [\"zoom\", \"center\", \"zoom-control\"];\n\n constructor() {\n super();\n\n this.map = null;\n\n // Handle <l-lat-lng-bounds> connection and modification(s)\n const boundsListener = (ev) => {\n const { bounds, method } = ev.detail;\n if (this.map !== null) {\n this.map[method](bounds);\n }\n };\n this.addEventListener(latLngBoundsConnected, boundsListener);\n this.addEventListener(latLngBoundsChanged, boundsListener);\n\n // Observe l-pane\n this.addEventListener(paneConnected, (ev) => {\n const { name } = ev.detail\n this.map.createPane(name)\n })\n\n // Observe removed l-tile-layers\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n if (mutation.target instanceof LMap) {\n const el = mutation.target;\n mutation.removedNodes.forEach((node) => {\n if (node instanceof LLayer) {\n if (el.map !== null && node.layer !== null) {\n // Notify listeners of layer removal\n el.dispatchEvent(new CustomEvent(layerRemoved, {\n bubbles: true,\n detail: {\n layer: node.layer\n }\n }))\n el.map.removeLayer(node.layer);\n }\n }\n });\n }\n });\n });\n observer.observe(this, { childList: true });\n }\n\n connectedCallback() {\n this.map = L.map(this, { zoomControl: this.hasAttribute(\"zoom-control\") });\n\n // Allow listeners to know when the map is \"ready\"\n this.map.whenReady(() => {\n this.dispatchEvent(\n new CustomEvent(\"ready\", {\n bubbles: true,\n cancelable: true,\n detail: this.map\n })\n )\n })\n\n // Connect Leaflet events\n if (this.hasAttribute(\"on\")) {\n const on = this.getAttribute(\"on\");\n if (on !== null) {\n on.split(/\\s+/).forEach((eventName) => {\n if (this.map !== null) {\n this.map.on(eventName, (e) => {\n this.dispatchEvent(\n new CustomEvent(eventName, { bubbles: true, detail: e })\n );\n });\n }\n });\n }\n }\n\n if (this.hasAttribute(\"fit-world\")) {\n this.map.fitWorld();\n } else {\n const schema = distribute({\n zoom: option(\"zoom\", int()),\n center: option(\"center\", json())\n })\n const { zoom, center } = parse(schema, this)\n this.map.setView(center, zoom);\n }\n\n if (this.hasAttribute(\"locate\")) {\n const schema = option(\"locate\", json())\n this.map.locate(parse(schema, this));\n }\n\n this.addEventListener(layerConnected, (ev) => {\n const layer = ev.detail.layer;\n layer.addTo(this.map);\n });\n\n this.addEventListener(layerRemoved, (ev) => {\n if (this.map !== null) {\n this.map.removeLayer(ev.detail.layer);\n }\n });\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.map !== null) {\n if (name === \"zoom\") {\n this.map.setZoom(parseInt(newValue));\n } else if (name === \"center\") {\n this.map.setView(JSON.parse(newValue));\n }\n }\n }\n}\n\nexport default LMap;\n","import * as L from \"leaflet\";\nimport { layerConnected, popupConnected, iconConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport {\n chain,\n float,\n json,\n option,\n optional,\n htmlAttribute,\n parse,\n partial,\n nullable,\n} from \"./parse.js\";\n\nclass LMarker extends LLayer {\n static observedAttributes = [\"lat-lng\", \"opacity\", \"icon\"];\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(iconConnected, (ev) => {\n ev.stopPropagation();\n this.layer.setIcon(ev.detail.icon);\n });\n }\n\n connectedCallback() {\n // Experimental parse/validate API\n const latLng = parse(option(\"lat-lng\", json()), this);\n const options = parse(\n partial({\n opacity: chain(optional(htmlAttribute(\"opacity\")), nullable(float())),\n }),\n this\n );\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = L.marker(latLng, options);\n\n if (this.hasAttribute(\"icon\")) {\n const icon = L.icon(JSON.parse(this.getAttribute(\"icon\")));\n this.layer.setIcon(icon);\n }\n\n this.setAttribute(\"leaflet-id\", L.stamp(this.layer));\n\n this.addEventListener(popupConnected, (ev) => {\n const { content, openPopup } = ev.detail;\n const popup = this.layer.bindPopup(content);\n if (openPopup) {\n popup.openPopup();\n }\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"lat-lng\") {\n this.layer.setLatLng(JSON.parse(newValue));\n }\n if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n if (name === \"icon\") {\n this.layer.setIcon(L.icon(JSON.parse(newValue)));\n }\n }\n }\n}\n\nexport default LMarker;\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LOverlayLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"overlay\";\n });\n }\n}\n\nexport default LOverlayLayers;\n","// @ts-check\nimport { popupConnected } from \"./events.js\";\n\nclass LPopup extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const content = this.getAttribute(\"content\");\n let openPopup = false;\n const openPopupAttribute = this.getAttribute(\"open-popup\");\n if (openPopupAttribute !== null) {\n openPopup = openPopupAttribute !== \"false\";\n }\n const event = new CustomEvent(popupConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n content,\n openPopup,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LPopup;\n","// @ts-check\nimport { tileLayer } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { htmlAttribute, optional, parse, partial } from \"./parse.js\";\n\nclass LTileLayer extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const urlTemplate = parse(htmlAttribute(\"url-template\"), this)\n \n // Template attributes\n const urlAttributes = LTileLayer.parseTemplateAttributes(urlTemplate)\n const templateOptions = {}\n for (const attribute of urlAttributes) {\n const value = this.getAttribute(attribute)\n if (value !== null) {\n templateOptions[attribute] = value\n }\n }\n\n // Pane options\n const paneOptions = {}\n // Support <l-pane> parent element\n if (this.parentElement.tagName.toLowerCase() === \"l-pane\") {\n paneOptions[\"pane\"] = this.parentElement.getAttribute(\"name\")\n }\n \n // Options\n const name = this.getAttribute(\"name\");\n const schema = partial({\n attribution: optional(htmlAttribute(\"attribution\")),\n errorTileUrl: optional(htmlAttribute(\"error-tile-url\"))\n })\n const options = parse(schema, this)\n this.layer = tileLayer(urlTemplate, { ...templateOptions, ...paneOptions, ...options });\n const event = new CustomEvent(layerConnected, {\n detail: { name, layer: this.layer },\n bubbles: true,\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} urlTemplate\n * @returns {string[]}\n */\n static parseTemplateAttributes(urlTemplate) {\n const regex = /{(.*?)}/g\n return [...urlTemplate.matchAll(regex)].map(match => match[1])\n }\n}\n\nexport default LTileLayer;\n","// @ts-check\nimport { LatLngBounds } from \"leaflet\";\nimport { latLngBoundsChanged, latLngBoundsConnected } from \"./events\"; \n\nclass LLatLngBounds extends HTMLElement {\n static observedAttributes = [\"bounds\"];\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n let value = this.getAttribute(\"bounds\")\n if (value !== null) {\n this.dispatchEvent(this.getEvent(latLngBoundsConnected, JSON.parse(value)))\n }\n }\n\n attributeChangedCallback(_name, _oldValue, newValue) {\n this.dispatchEvent(this.getEvent(latLngBoundsChanged, JSON.parse(newValue)));\n }\n\n /**\n * @param {LatLngBounds} bounds\n */\n getEvent(key, bounds) {\n return new CustomEvent(key, {\n bubbles: true,\n detail: {\n bounds,\n method: this.getAttribute(\"method\") || \"fitBounds\",\n },\n });\n }\n}\n\nexport default LLatLngBounds;\n","// @ts-check\nimport { imageOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LImageOverlay extends LLayer {\n static observedAttributes = [\"url\", \"bounds\", \"opacity\"];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const url = this.getAttribute(\"url\");\n if (url === null) {\n console.warn(\"attribute 'url' not set\");\n return;\n }\n let bounds = this.getAttribute(\"bounds\");\n if (bounds === null) {\n console.warn(\"attribute 'bounds' not set\");\n return;\n }\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n };\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = imageOverlay(url, JSON.parse(bounds), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n\n disconnectedCallback() {\n this.layer?.remove();\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"url\") {\n this.layer.setUrl(newValue);\n } else if (name === \"bounds\") {\n this.layer.setBounds(JSON.parse(newValue));\n } else if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n }\n }\n}\n\nexport default LImageOverlay;\n","// @ts-check\nimport { videoOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LVideoOverlay extends LLayer {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const url = JSON.parse(this.getAttribute(\"url\"));\n const bounds = JSON.parse(this.getAttribute(\"bounds\"));\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n autoplay: true,\n muted: true,\n playsInline: true,\n };\n const layer = videoOverlay(url, bounds, options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer,\n },\n }),\n );\n }\n}\n\nexport default LVideoOverlay;\n","// @ts-check\nimport { geoJSON } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LGeoJSON extends HTMLElement {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const value = this.getAttribute(\"geojson\");\n const options = {};\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n if (value !== null) {\n this.layer = geoJSON(JSON.parse(value), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n }\n}\n\nexport default LGeoJSON;\n","// Utility functions\nexport const kebabToCamel = (kebab) => kebab.replace(/-./g, (x) => x[1].toUpperCase());\nexport const camelToKebab = (s) => {\n return s.split('').map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter;\n }).join('');\n}\n\n","import { icon } from \"leaflet\";\nimport { iconConnected } from \"./events.js\";\nimport {\n bool,\n chain,\n htmlAttribute,\n json,\n nullable,\n optional,\n parse,\n partial,\n} from \"./parse.js\";\nimport { kebabToCamel } from \"./util.js\";\n\nclass LIcon extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n // Experimental parse/validate API\n const obj = {};\n const keys = [\n \"icon-url\",\n \"icon-retina-url\",\n \"shadow-url\",\n \"shadow-retina-url\",\n \"class-name\",\n ];\n keys.forEach((key) => {\n obj[kebabToCamel(key)] = optional(htmlAttribute(key));\n });\n let points = [\n \"icon-anchor\",\n \"icon-size\",\n \"shadow-anchor\",\n \"shadow-size\",\n \"tooltip-anchor\",\n \"popup-anchor\",\n ];\n points.forEach((key) => {\n obj[kebabToCamel(key)] = chain(\n optional(htmlAttribute(key)),\n nullable(json())\n );\n });\n obj[\"crossOrigin\"] = chain(\n optional(htmlAttribute(\"cross-origin\")),\n nullable(bool())\n );\n const schema = partial(obj);\n const options = parse(schema, this);\n\n this.icon = icon(options);\n\n const event = new CustomEvent(iconConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LIcon;\n","import { divIcon } from \"leaflet\";\nimport { iconConnected } from \"./events\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n // Leaflet JS DivIcon options\n const options = {\n html: this.innerHTML,\n };\n const className = this.getAttribute(\"class-name\");\n if (className !== null) {\n options[\"className\"] = className;\n }\n\n this.icon = divIcon(options);\n this.dispatchEvent(\n new CustomEvent(iconConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n icon: this.icon,\n },\n })\n );\n }\n}\n","// @ts-check\n\nimport { tooltip } from \"leaflet\";\nimport { tooltipConnected } from \"./events\";\n\nclass LTooltip extends HTMLElement {\n static observedAttributes = [\"content\"];\n\n constructor() {\n super();\n this.tooltip = tooltip();\n }\n\n connectedCallback() {\n const event = new CustomEvent(tooltipConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n tooltip: this.tooltip,\n },\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (attName === \"content\") {\n this.tooltip.setContent(newValue);\n }\n }\n}\n\nexport default LTooltip;\n","import { paneConnected } from \"./events.js\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.dispatchEvent(\n new CustomEvent(paneConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n name: this.getAttribute(\"name\"),\n },\n })\n );\n }\n}\n","// @ts-check\nimport { Circle, LatLng, Polygon, Polyline, Rectangle } from \"leaflet\";\nimport { camelToKebab } from \"./util.js\";\nimport { htmlAttribute, parse } from \"./parse.js\";\nimport { layerConnected, tooltipConnected } from \"./events.js\";\n\n/**\n * @typedef {Object} TagOption\n * @property {string} camel\n * @property {string} kebab\n * @property {(s: string) => AttributeValue} parser\n * @property {AttributeValue | null} defaultValue\n */\n/**\n * @typedef {(\"circle\"|\"rectangle\"|\"polygon\"|\"polyline\")} MethodName\n * @typedef {(\"path\"|\"interactiveLayer\")} LayerName\n * @typedef {(\"boolean\"|\"number\"|\"string\"|\"latlng\"|\"latlngbounds\")} AttributeType\n * @typedef {(boolean|number|string|LatLng)} AttributeValue\n */\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst positionalArguments = (methodName) => {\n switch (methodName) {\n case \"circle\":\n return [option(\"latLng\", \"latlng\", null)];\n case \"rectangle\":\n return [option(\"latLngBounds\", \"latlngbounds\", null)];\n case \"polygon\":\n return [option(\"latLngs\", \"latlng\", null)];\n case \"polyline\":\n return [option(\"latLngs\", \"latlng\", null)];\n }\n};\n\n/**\n * @param {string} name\n * @param {AttributeType} type\n * @param {AttributeValue | null} defaultValue\n * @returns {TagOption}\n */\nconst option = (name, type, defaultValue) => {\n return {\n camel: name,\n kebab: camelToKebab(name),\n parser: inferParser(type),\n defaultValue,\n };\n};\n\n/**\n * @param {AttributeType} type\n * @returns {(s: string) => AttributeValue}\n */\nconst inferParser = (type) => {\n switch (type.toLowerCase()) {\n case \"boolean\":\n return (s) => s === \"true\";\n case \"number\":\n return parseFloat;\n case \"latlng\":\n case \"latlngbounds\":\n return JSON.parse;\n case \"string\":\n return (s) => s;\n default:\n return (s) => s;\n }\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst options = (methodName) => {\n const _OPTIONS = {\n circle: [option(\"radius\", \"number\", null)],\n path: [\n option(\"stroke\", \"boolean\", true),\n option(\"color\", \"string\", \"#3388ff\"),\n option(\"weight\", \"number\", 3),\n option(\"opacity\", \"number\", 1.0),\n option(\"lineCap\", \"string\", \"round\"),\n option(\"lineJoin\", \"string\", \"round\"),\n option(\"dashArray\", \"string\", null),\n option(\"dashOffset\", \"string\", null),\n option(\"fill\", \"boolean\", true),\n option(\"fillColor\", \"string\", \"#3388ff\"),\n option(\"fillOpacity\", \"number\", 0.2),\n ],\n polyline: [\n option(\"smoothFactor\", \"number\", 1.0),\n option(\"noClip\", \"boolean\", false),\n ],\n polygon: [],\n rectangle: [],\n interactiveLayer: [option(\"interactive\", \"boolean\", true)],\n };\n return inheritance(methodName).flatMap((parent) => _OPTIONS[parent]);\n};\n\n/**\n * @type {Object.<string, (MethodName | LayerName)[]>}\n */\nconst INHERITS = {\n circle: [\"path\"],\n polyline: [\"path\"],\n polygon: [\"polyline\"],\n rectangle: [\"polygon\"],\n path: [\"interactiveLayer\"],\n interactiveLayer: [],\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {(MethodName | LayerName)[]}\n */\nconst inheritance = (methodName) => {\n /** @type {(MethodName | LayerName)} */\n let name = methodName;\n let chain = [methodName];\n while (INHERITS[name].length > 0) {\n let parent = INHERITS[name][0];\n chain.push(parent);\n name = parent;\n }\n return chain;\n};\n\n/**\n * @param {MethodName} methodName\n * @param {string} newValue\n * @param {string} name\n * @param {(Circle | Rectangle | Polygon | Polyline)} layer\n */\nconst setter = (layer, methodName, name, newValue) => {\n // Parse\n const allOptions = [\n ...positionalArguments(methodName),\n ...options(methodName),\n ];\n let _opt = allOptions.find((o) => o.kebab === name);\n if (typeof _opt === \"undefined\") {\n return;\n }\n const parsedValue = _opt.parser(newValue);\n\n // Update\n if (layer instanceof Circle) {\n switch (name) {\n case \"lat-lng\":\n layer.setLatLng(JSON.parse(newValue));\n break;\n case \"radius\":\n layer.setRadius(parseFloat(newValue));\n break;\n }\n } else if (layer instanceof Rectangle) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n case \"lat-lng-bounds\":\n layer.setBounds(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polygon) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polyline) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n }\n\n // setStyle options\n let opt = options(\"polyline\").find((o) => o.kebab === name);\n if (typeof opt !== \"undefined\") {\n layer.setStyle({ [opt.camel]: parsedValue });\n }\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst attributes = (methodName) => {\n let args = positionalArguments(methodName).map((o) => o.kebab);\n let opts = options(methodName).map((o) => o.kebab);\n return [...args, ...opts];\n};\n\n/**\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst settings = (el, methodName) => {\n // Gather settings\n let result = {};\n\n // Process inheritance chain\n options(methodName).forEach((o) => {\n if (el.hasAttribute(o.kebab)) {\n result[o.camel] = o.parser(el.getAttribute(o.kebab));\n }\n });\n return result;\n};\n\n/**\n * Read positional arguments from HTMLElement\n *\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst positional = (el, methodName) => {\n return positionalArguments(methodName).map(option => {\n const schema = htmlAttribute(option.kebab)\n const value = parse(schema, el)\n return option.parser(value);\n })\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst generator = (method, methodName) => {\n class cls extends HTMLElement {\n static observedAttributes = attributes(methodName);\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(tooltipConnected, (ev) => {\n if (this.layer !== null) {\n this.layer.bindTooltip(ev.detail.tooltip);\n }\n });\n }\n\n connectedCallback() {\n const args = positional(this, methodName);\n const options = settings(this, methodName);\n this.layer = method(...args, options);\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (this.layer !== null) {\n setter(this.layer, methodName, attName, newValue);\n }\n }\n }\n return cls;\n};\n\nexport default generator;\n","// @ts-check\nimport LBaseLayers from \"./l-base-layers.js\";\nimport LControlLayers from \"./l-control-layers.js\";\nimport LLayerGroup from \"./l-layer-group.js\";\nimport LMap from \"./l-map.js\";\nimport LMarker from \"./l-marker.js\";\nimport LOverlayLayers from \"./l-overlay-layers.js\";\nimport LPopup from \"./l-popup.js\";\nimport LTileLayer from \"./l-tile-layer.js\";\nimport LLatLngBounds from \"./l-lat-lng-bounds.js\";\nimport LImageOverlay from \"./l-image-overlay.js\";\nimport LVideoOverlay from \"./l-video-overlay.js\";\nimport LGeoJSON from \"./l-geojson.js\";\nimport LIcon from \"./l-icon.js\";\nimport LDivIcon from \"./l-div-icon.js\";\nimport LTooltip from \"./l-tooltip.js\";\nimport LPane from \"./l-pane.js\";\nimport generator from \"./generator.js\";\nimport { circle, polyline, polygon, rectangle } from \"leaflet\";\n\nconst init = (() => {\n // Custom elements (order of definition is important)\n customElements.define(\"l-map\", LMap);\n customElements.define(\"l-pane\", LPane);\n customElements.define(\"l-control-layers\", LControlLayers);\n customElements.define(\"l-base-layers\", LBaseLayers);\n customElements.define(\"l-overlay-layers\", LOverlayLayers);\n customElements.define(\"l-layer-group\", LLayerGroup);\n customElements.define(\"l-tile-layer\", LTileLayer);\n customElements.define(\"l-marker\", LMarker);\n customElements.define(\"l-popup\", LPopup);\n customElements.define(\"l-lat-lng-bounds\", LLatLngBounds);\n customElements.define(\"l-image-overlay\", LImageOverlay);\n customElements.define(\"l-video-overlay\", LVideoOverlay);\n customElements.define(\"l-geojson\", LGeoJSON);\n customElements.define(\"l-icon\", LIcon);\n customElements.define(\"l-circle\", generator(circle, \"circle\"));\n customElements.define(\"l-polyline\", generator(polyline, \"polyline\"));\n customElements.define(\"l-polygon\", generator(polygon, \"polygon\"));\n customElements.define(\"l-rectangle\", generator(rectangle, \"rectangle\"));\n customElements.define(\"l-tooltip\", LTooltip);\n customElements.define(\"l-div-icon\", LDivIcon);\n})();\n\nexport default init;\n"],"names":["layerConnected","popupConnected","iconConnected","layerRemoved","latLngBoundsConnected","latLngBoundsChanged","tooltipConnected","paneConnected","LBaseLayers","_HTMLElement","call","this","_inheritsLoose","prototype","connectedCallback","addEventListener","ev","detail","_wrapNativeSuper","HTMLElement","LControlLayers","controlLayers","control","layers","_ev$detail","type","name","layer","addOverlay","addBaseLayer","preventDefault","event","CustomEvent","cancelable","bubbles","dispatchEvent","LLayer","_this","LLayerGroup","_LLayer","getAttribute","group","layerGroup","stopPropagation","addLayer","MutationObserver","mutations","forEach","mutation","removedNodes","node","leafletId","getLayer","parseInt","removeLayer","observe","childList","LeafletHTMLError","_Error","issues","key","get","JSON","stringify","Error","parse","schema","value","result","status","wrap","partial","obj","ctx","_i3","_Object$keys3","Object","keys","length","localCtx","concat","pipe","parsers","slice","arguments","i","chain","nullable","parser","optional","htmlAttribute","attributeName","el","htmlAttributeIssue","_extends","json","e","jsonIssue","option","apply","code","message","tagName","toLowerCase","LMap","map","boundsListener","method","bounds","createPane","target","_proto","_this2","L","zoomControl","hasAttribute","whenReady","on","split","eventName","fitWorld","zoom","isNaN","center","_i2","_Object$keys2","_parse","setView","locate","addTo","attributeChangedCallback","_oldValue","newValue","setZoom","observedAttributes","LMarker","setIcon","icon","latLng","options","opacity","parseFloat","pane","closest","marker","setAttribute","stamp","openPopup","popup","bindPopup","content","setLatLng","setOpacity","LOverlayLayers","LPopup","openPopupAttribute","LTileLayer","_step","urlTemplate","templateOptions","_iterator","_createForOfIteratorHelperLoose","parseTemplateAttributes","done","attribute","paneOptions","parentElement","attribution","errorTileUrl","tileLayer","matchAll","match","LLatLngBounds","getEvent","_name","LImageOverlay","url","alt","imageOverlay","console","warn","disconnectedCallback","_this$layer","remove","setUrl","setBounds","LVideoOverlay","autoplay","muted","playsInline","videoOverlay","LGeoJSON","geoJSON","kebabToCamel","kebab","replace","x","toUpperCase","LIcon","CustomElement","html","innerHTML","className","divIcon","LTooltip","tooltip","attName","_","setContent","positionalArguments","methodName","defaultValue","camel","s","letter","idx","join","inferParser","_OPTIONS","circle","path","polyline","polygon","rectangle","interactiveLayer","inheritance","flatMap","parent","INHERITS","push","settings","o","generator","cls","bindTooltip","args","positional","_opt","find","parsedValue","Circle","setRadius","Rectangle","setLatLngs","Polygon","Polyline","_layer$setStyle","opt","setStyle","setter","opts","attributes","init","customElements","define","LPane","LDivIcon"],"mappings":"2iEACO,IAAMA,EAAiB,oBACjBC,EAAiB,oBACjBC,EAAgB,mBAChBC,EAAe,kBACfC,EAAwB,2BACxBC,EAAsB,yBACtBC,EAAmB,sBACnBC,EAAgB,mBCLvBC,eAAWC,SAAAA,GACf,SAAAD,IAAc,OACZC,EAAAC,KAAAC,OAAOA,IACT,CAMC,OANAC,EAAAJ,EAAAC,GAAAD,EAAAK,UAEDC,kBAAA,WACEH,KAAKI,iBAAiBf,EAAgB,SAACgB,GACrCA,EAAGC,OAAa,KAAI,MACtB,EACF,EAACT,CAAA,CATcC,cASdS,EATuBC,cCEpBC,eAAc,SAAAX,GAClB,SAAAW,IAAc,OACZX,EAAAC,KAAMC,WACR,CA2BC,OA3BAC,EAAAQ,EAAAX,GAAAW,EAAAP,UAEDC,kBAAA,WAEE,IAGMO,EAAgBC,EAAQC,OAHjB,CAAA,EAEG,CAAE,GAGlBZ,KAAKI,iBAAiBf,EAAgB,SAACgB,GACrC,IAAAQ,EAA8BR,EAAGC,OAAzBQ,EAAID,EAAJC,KAAMC,EAAIF,EAAJE,KAAMC,EAAKH,EAALG,MACP,YAATF,EACFJ,EAAcO,WAAWD,EAAOD,GACd,SAATD,GACTJ,EAAcQ,aAAaF,EAAOD,GAEpCV,EAAGc,gBACL,GAEA,IAAMC,EAAQ,IAAIC,YAAYhC,EAAgB,CAC5CiC,YAAY,EACZC,SAAS,EACTjB,OAAQ,CACNU,MAAON,KAGXV,KAAKwB,cAAcJ,EACrB,EAACX,CAAA,CA9BiB,cA8BjBF,EA9B0BC,cCLvBiB,eAAM3B,SAAAA,GACV,SAAA2B,IAAcC,IAAAA,EAE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AAUV,EAAS,YACtD+B,eAAeC,OAAO,cAAetB,GAAUT,EAAW,cAC1D8B,eAAeC,OAAO,YAAalD,SACnCiD,eAAeC,OAAO,aAAcE"}
1
+ {"version":3,"file":"leaflet-html.js","sources":["../src/events.js","../src/l-base-layers.js","../src/l-control-layers.js","../src/l-layer.js","../src/l-layer-group.js","../src/parse.js","../src/l-map.js","../src/l-marker.js","../src/l-overlay-layers.js","../src/l-popup.js","../src/l-tile-layer.js","../src/l-lat-lng-bounds.js","../src/l-image-overlay.js","../src/l-video-overlay.js","../src/l-geojson.js","../src/util.js","../src/l-icon.js","../src/l-div-icon.js","../src/l-tooltip.js","../src/l-pane.js","../src/generator.js","../src/index.js"],"sourcesContent":["// NOTE: These event keys are part of the public API of leaflet-html\nexport const layerConnected = \"l:layer:connected\";\nexport const popupConnected = \"l:popup:connected\";\nexport const iconConnected = \"l:icon:connected\";\nexport const layerRemoved = \"l:layer:removed\";\nexport const latLngBoundsConnected = \"l:latlngbounds:connected\";\nexport const latLngBoundsChanged = \"l:latlngbounds:changed\";\nexport const tooltipConnected = \"l:tooltip:connected\";\nexport const paneConnected = \"l:pane:connected\";\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LBaseLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"base\";\n });\n }\n}\n\nexport default LBaseLayers;\n","// @ts-check\n/** @typedef {import(\"leaflet\").Layer} Layer */\nimport { control } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LControlLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n /** @type {{ [key: string]: Layer }} */\n const base = {};\n /** @type {{ [key: string]: Layer }} */\n const overlay = {};\n const controlLayers = control.layers(base, overlay);\n\n this.addEventListener(layerConnected, (ev) => {\n const { type, name, layer } = ev.detail;\n if (type === \"overlay\") {\n controlLayers.addOverlay(layer, name);\n } else if (type === \"base\") {\n controlLayers.addBaseLayer(layer, name);\n }\n ev.preventDefault();\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: controlLayers,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LControlLayers;\n","class LLayer extends HTMLElement {\n constructor() {\n super()\n this.layer = null\n }\n\n disconnectedCallback() {\n this.layer?.remove();\n }\n}\n\nexport default LLayer\n","// @ts-check\nimport { layerGroup } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LLayerGroup extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const group = layerGroup();\n this.layer = group;\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: group,\n name,\n },\n });\n this.dispatchEvent(event);\n\n this.addEventListener(layerConnected, (ev) => {\n ev.stopPropagation();\n group.addLayer(ev.detail.layer);\n });\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const leafletId = node.getAttribute(\"leaflet-id\");\n if (leafletId !== null) {\n const layer = group.getLayer(parseInt(leafletId));\n if (typeof layer !== \"undefined\") {\n group.removeLayer(layer);\n }\n }\n }\n });\n });\n });\n observer.observe(this, { childList: true });\n }\n}\n\nexport default LLayerGroup;\n","/// <reference path=\"./parser.d.ts\" />\n \nexport class LeafletHTMLError extends Error {\n /** @type {Issue[]} */\n issues = [];\n\n /**\n * @param {Issue[]} issues\n */\n constructor(issues) {\n super();\n this.name = \"LeafletHTMLError\";\n this.issues = issues;\n }\n\n get message() {\n return JSON.stringify(this.issues, null, 2);\n }\n}\n\n/**\n * @template T\n * @param {T} value\n * @returns {Context<T>}\n */\nconst wrap = (value) => {\n return {\n status: \"clean\",\n issues: [],\n value,\n };\n};\n\n/**\n * @template T\n * @param {Context<T>} value\n * @returns {T}\n */\nconst unwrap = ({ value }) => value;\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {S}\n */\nexport const parse = (schema, value) => {\n const result = schema(wrap(value));\n if (result.status !== \"clean\") {\n throw new LeafletHTMLError(result.issues);\n } else {\n return unwrap(result);\n }\n};\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {Context<S>}\n */\nexport const safeParse = (schema, value) => schema(wrap(value));\n\n/**\n * @param {Object} obj\n * @returns {(ctx: Context<Object>) => Context<Object>}\n */\nexport const object = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n if (key in ctx.value) {\n result[key] = obj[key](wrap(ctx.value[key])).value;\n } else {\n status = \"abort\";\n issues = [...issues, missingKeyIssue(key)];\n }\n }\n return { status, issues, value: result };\n};\n\n// CONNECTORS\n\n/**\n * @template T\n * @param {Object} obj\n * @returns {(ctx: Context<T>) => Context<Object>}\n */\nexport const distribute = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status === \"abort\") {\n status = \"abort\";\n issues = [...issues, ...localCtx.issues];\n }\n result[key] = localCtx.value;\n }\n return { status, issues, value: result };\n};\n\nexport const partial = (obj) => (ctx) => {\n let { issues } = ctx;\n let status = \"clean\"\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status !== \"clean\") {\n status = localCtx.status\n }\n \n if ((localCtx.value === null) && (localCtx.status === \"clean\")) {\n continue\n } else {\n issues = [...issues, ...localCtx.issues];\n result[key] = localCtx.value;\n }\n }\n return { status, issues, value: result };\n};\n\nexport const pipe =\n (...parsers) =>\n (ctx) => {\n for (let i = 0; i < parsers.length; i++) {\n ctx = parsers[i](ctx);\n if (ctx.status === \"abort\") {\n break;\n }\n }\n return ctx;\n };\n\nexport const chain = (...parsers) => (ctx) => {\n for (let i=0; i<parsers.length; i++) {\n ctx = parsers[i](ctx)\n }\n return ctx\n}\n\n\n// PRIMITIVES\nexport const nullable = (parser) => (ctx) => {\n if (ctx.value === null) {\n return ctx\n }\n return parser(ctx)\n}\n\nexport const optional = (parser) => (ctx) => {\n ctx = parser(ctx)\n if (ctx.value === null) {\n return {status: \"clean\", issues: [], value: null}\n } else {\n return ctx\n }\n}\n\n/**\n * @param {string} attributeName\n * @returns {Parser<HTMLElement, string>}\n */\nexport const htmlAttribute = (attributeName) => (ctx) => {\n const el = ctx.value;\n let result = el.getAttribute(attributeName);\n if (result === null) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, htmlAttributeIssue(el, attributeName)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const int = () => (ctx) => {\n let result = parseInt(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, intIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const float = () => (ctx) => {\n let result = parseFloat(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, floatIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const json = () => (ctx) => {\n let result;\n try {\n result = JSON.parse(ctx.value);\n } catch (e) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, jsonIssue(e)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<boolean>}\n */\nexport const bool = () => (ctx) => {\n return { ...ctx, value: ctx.value.toLowerCase() === \"true\" };\n};\n\n/**\n * @template T\n * @template S\n * @param {string} key\n * @param {Parser<T, S>[]} fns\n */\nexport const option = (key, ...fns) => pipe(htmlAttribute(key), ...fns);\n\n\n// ISSUES\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const intIssue = (value) => {\n return {\n code: \"parse_int\",\n message: `could not parse int given: \"${value}\"`,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const floatIssue = (value) => {\n return {\n code: \"parse_float\",\n message: `could not parse float given: \"${value}\"`,\n };\n};\n\n/**\n * @param {SyntaxError} e\n * @returns {Issue}\n */\nexport const jsonIssue = (e) => {\n return {\n code: \"parse_json\",\n message: e.message,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const missingKeyIssue = (value) => {\n return {\n code: \"missing_key\",\n message: `key not found: ${value}`,\n };\n};\n\n/**\n * @param {HTMLElement} el\n * @param {string} attributeName\n * @returns {Issue}\n */\nexport const htmlAttributeIssue = (el, attributeName) => {\n return {\n code: \"missing_attribute\",\n message: `${el.tagName.toLowerCase()} missing attribute '${attributeName}'`,\n };\n};\n","// @ts-check\nimport * as L from \"leaflet\";\nimport { layerRemoved, layerConnected, latLngBoundsConnected, latLngBoundsChanged, paneConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { distribute, int, json, option, parse } from \"./parse.js\";\n\nclass LMap extends HTMLElement {\n static observedAttributes = [\"zoom\", \"center\", \"zoom-control\"];\n\n constructor() {\n super();\n\n this.map = null;\n\n // Handle <l-lat-lng-bounds> connection and modification(s)\n const boundsListener = (ev) => {\n const { bounds, method } = ev.detail;\n if (this.map !== null) {\n this.map[method](bounds);\n }\n };\n this.addEventListener(latLngBoundsConnected, boundsListener);\n this.addEventListener(latLngBoundsChanged, boundsListener);\n\n // Observe l-pane\n this.addEventListener(paneConnected, (ev) => {\n const { name } = ev.detail\n this.map.createPane(name)\n })\n\n // Observe removed l-tile-layers\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n if (mutation.target instanceof LMap) {\n const el = mutation.target;\n mutation.removedNodes.forEach((node) => {\n if (node instanceof LLayer) {\n if (el.map !== null && node.layer !== null) {\n // Notify listeners of layer removal\n el.dispatchEvent(new CustomEvent(layerRemoved, {\n bubbles: true,\n detail: {\n layer: node.layer\n }\n }))\n el.map.removeLayer(node.layer);\n }\n }\n });\n }\n });\n });\n observer.observe(this, { childList: true });\n }\n\n connectedCallback() {\n this.map = L.map(this, { zoomControl: this.hasAttribute(\"zoom-control\") });\n\n // Allow listeners to know when the map is \"ready\"\n this.map.whenReady(() => {\n this.dispatchEvent(\n new CustomEvent(\"ready\", {\n bubbles: true,\n cancelable: true,\n detail: this.map\n })\n )\n })\n\n // Connect Leaflet events\n if (this.hasAttribute(\"on\")) {\n const on = this.getAttribute(\"on\");\n if (on !== null) {\n on.split(/\\s+/).forEach((eventName) => {\n if (this.map !== null) {\n this.map.on(eventName, (e) => {\n this.dispatchEvent(\n new CustomEvent(eventName, { bubbles: true, detail: e })\n );\n });\n }\n });\n }\n }\n\n if (this.hasAttribute(\"fit-world\")) {\n this.map.fitWorld();\n } else {\n const schema = distribute({\n zoom: option(\"zoom\", int()),\n center: option(\"center\", json())\n })\n const { zoom, center } = parse(schema, this)\n this.map.setView(center, zoom);\n }\n\n if (this.hasAttribute(\"locate\")) {\n const schema = option(\"locate\", json())\n this.map.locate(parse(schema, this));\n }\n\n this.addEventListener(layerConnected, (ev) => {\n const layer = ev.detail.layer;\n layer.addTo(this.map);\n });\n\n this.addEventListener(layerRemoved, (ev) => {\n if (this.map !== null) {\n this.map.removeLayer(ev.detail.layer);\n }\n });\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.map !== null) {\n if (name === \"zoom\") {\n this.map.setZoom(parseInt(newValue));\n } else if (name === \"center\") {\n this.map.setView(JSON.parse(newValue));\n }\n }\n }\n}\n\nexport default LMap;\n","import * as L from \"leaflet\";\nimport { layerConnected, popupConnected, iconConnected, tooltipConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport {\n chain,\n float,\n json,\n option,\n optional,\n htmlAttribute,\n parse,\n partial,\n nullable,\n} from \"./parse.js\";\n\nclass LMarker extends LLayer {\n static observedAttributes = [\"lat-lng\", \"opacity\", \"icon\"];\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(iconConnected, (ev) => {\n ev.stopPropagation();\n this.layer.setIcon(ev.detail.icon);\n });\n this.addEventListener(tooltipConnected, (ev) => {\n ev.stopPropagation();\n this.layer.bindTooltip(ev.detail.tooltip);\n });\n }\n\n connectedCallback() {\n // Experimental parse/validate API\n const latLng = parse(option(\"lat-lng\", json()), this);\n const options = parse(\n partial({\n opacity: chain(optional(htmlAttribute(\"opacity\")), nullable(float())),\n }),\n this\n );\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = L.marker(latLng, options);\n\n if (this.hasAttribute(\"icon\")) {\n const icon = L.icon(JSON.parse(this.getAttribute(\"icon\")));\n this.layer.setIcon(icon);\n }\n\n this.setAttribute(\"leaflet-id\", L.stamp(this.layer));\n\n this.addEventListener(popupConnected, (ev) => {\n const { content, openPopup } = ev.detail;\n const popup = this.layer.bindPopup(content);\n if (openPopup) {\n popup.openPopup();\n }\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"lat-lng\") {\n this.layer.setLatLng(JSON.parse(newValue));\n }\n if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n if (name === \"icon\") {\n this.layer.setIcon(L.icon(JSON.parse(newValue)));\n }\n }\n }\n}\n\nexport default LMarker;\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LOverlayLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"overlay\";\n });\n }\n}\n\nexport default LOverlayLayers;\n","// @ts-check\nimport { popupConnected } from \"./events.js\";\n\nclass LPopup extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const content = this.getAttribute(\"content\");\n let openPopup = false;\n const openPopupAttribute = this.getAttribute(\"open-popup\");\n if (openPopupAttribute !== null) {\n openPopup = openPopupAttribute !== \"false\";\n }\n const event = new CustomEvent(popupConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n content,\n openPopup,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LPopup;\n","// @ts-check\nimport { tileLayer } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { htmlAttribute, optional, parse, partial } from \"./parse.js\";\n\nclass LTileLayer extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const urlTemplate = parse(htmlAttribute(\"url-template\"), this)\n \n // Template attributes\n const urlAttributes = LTileLayer.parseTemplateAttributes(urlTemplate)\n const templateOptions = {}\n for (const attribute of urlAttributes) {\n const value = this.getAttribute(attribute)\n if (value !== null) {\n templateOptions[attribute] = value\n }\n }\n\n // Pane options\n const paneOptions = {}\n // Support <l-pane> parent element\n if (this.parentElement.tagName.toLowerCase() === \"l-pane\") {\n paneOptions[\"pane\"] = this.parentElement.getAttribute(\"name\")\n }\n \n // Options\n const name = this.getAttribute(\"name\");\n const schema = partial({\n attribution: optional(htmlAttribute(\"attribution\")),\n errorTileUrl: optional(htmlAttribute(\"error-tile-url\"))\n })\n const options = parse(schema, this)\n this.layer = tileLayer(urlTemplate, { ...templateOptions, ...paneOptions, ...options });\n const event = new CustomEvent(layerConnected, {\n detail: { name, layer: this.layer },\n bubbles: true,\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} urlTemplate\n * @returns {string[]}\n */\n static parseTemplateAttributes(urlTemplate) {\n const regex = /{(.*?)}/g\n return [...urlTemplate.matchAll(regex)].map(match => match[1])\n }\n}\n\nexport default LTileLayer;\n","// @ts-check\nimport { LatLngBounds } from \"leaflet\";\nimport { latLngBoundsChanged, latLngBoundsConnected } from \"./events\"; \n\nclass LLatLngBounds extends HTMLElement {\n static observedAttributes = [\"bounds\"];\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n let value = this.getAttribute(\"bounds\")\n if (value !== null) {\n this.dispatchEvent(this.getEvent(latLngBoundsConnected, JSON.parse(value)))\n }\n }\n\n attributeChangedCallback(_name, _oldValue, newValue) {\n this.dispatchEvent(this.getEvent(latLngBoundsChanged, JSON.parse(newValue)));\n }\n\n /**\n * @param {LatLngBounds} bounds\n */\n getEvent(key, bounds) {\n return new CustomEvent(key, {\n bubbles: true,\n detail: {\n bounds,\n method: this.getAttribute(\"method\") || \"fitBounds\",\n },\n });\n }\n}\n\nexport default LLatLngBounds;\n","// @ts-check\nimport { imageOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LImageOverlay extends LLayer {\n static observedAttributes = [\"url\", \"bounds\", \"opacity\"];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const url = this.getAttribute(\"url\");\n if (url === null) {\n console.warn(\"attribute 'url' not set\");\n return;\n }\n let bounds = this.getAttribute(\"bounds\");\n if (bounds === null) {\n console.warn(\"attribute 'bounds' not set\");\n return;\n }\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n };\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = imageOverlay(url, JSON.parse(bounds), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"url\") {\n this.layer.setUrl(newValue);\n } else if (name === \"bounds\") {\n this.layer.setBounds(JSON.parse(newValue));\n } else if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n }\n }\n}\n\nexport default LImageOverlay;\n","// @ts-check\nimport { videoOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LVideoOverlay extends LLayer {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const url = JSON.parse(this.getAttribute(\"url\"));\n const bounds = JSON.parse(this.getAttribute(\"bounds\"));\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n autoplay: true,\n muted: true,\n playsInline: true,\n };\n const layer = videoOverlay(url, bounds, options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer,\n },\n }),\n );\n }\n}\n\nexport default LVideoOverlay;\n","// @ts-check\nimport { geoJSON } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LGeoJSON extends HTMLElement {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const value = this.getAttribute(\"geojson\");\n const options = {};\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n if (value !== null) {\n this.layer = geoJSON(JSON.parse(value), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n }\n}\n\nexport default LGeoJSON;\n","// Utility functions\nexport const kebabToCamel = (kebab) => kebab.replace(/-./g, (x) => x[1].toUpperCase());\nexport const camelToKebab = (s) => {\n return s.split('').map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter;\n }).join('');\n}\n\n","import { icon } from \"leaflet\";\nimport { iconConnected } from \"./events.js\";\nimport {\n bool,\n chain,\n htmlAttribute,\n json,\n nullable,\n optional,\n parse,\n partial,\n} from \"./parse.js\";\nimport { kebabToCamel } from \"./util.js\";\n\nclass LIcon extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n // Experimental parse/validate API\n const obj = {};\n const keys = [\n \"icon-url\",\n \"icon-retina-url\",\n \"shadow-url\",\n \"shadow-retina-url\",\n \"class-name\",\n ];\n keys.forEach((key) => {\n obj[kebabToCamel(key)] = optional(htmlAttribute(key));\n });\n let points = [\n \"icon-anchor\",\n \"icon-size\",\n \"shadow-anchor\",\n \"shadow-size\",\n \"tooltip-anchor\",\n \"popup-anchor\",\n ];\n points.forEach((key) => {\n obj[kebabToCamel(key)] = chain(\n optional(htmlAttribute(key)),\n nullable(json())\n );\n });\n obj[\"crossOrigin\"] = chain(\n optional(htmlAttribute(\"cross-origin\")),\n nullable(bool())\n );\n const schema = partial(obj);\n const options = parse(schema, this);\n\n this.icon = icon(options);\n\n const event = new CustomEvent(iconConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LIcon;\n","import { divIcon } from \"leaflet\";\nimport { iconConnected } from \"./events\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n // Leaflet JS DivIcon options\n const options = {\n html: this.innerHTML,\n };\n const className = this.getAttribute(\"class-name\");\n if (className !== null) {\n options[\"className\"] = className;\n }\n\n this.icon = divIcon(options);\n this.dispatchEvent(\n new CustomEvent(iconConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n icon: this.icon,\n },\n })\n );\n }\n}\n","// @ts-check\n\nimport { tooltip } from \"leaflet\";\nimport { tooltipConnected } from \"./events\";\nimport { json, option, parse } from \"./parse.js\";\n\nclass LTooltip extends HTMLElement {\n static observedAttributes = [\"content\", \"permanent\", \"direction\"];\n\n constructor() {\n super();\n this.tooltip = tooltip({\n permanent: this.hasAttribute(\"permanent\"),\n direction: this.getAttribute(\"direction\") ?? \"auto\"\n });\n }\n\n connectedCallback() {\n const event = new CustomEvent(tooltipConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n tooltip: this.tooltip\n }\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (attName === \"content\") {\n this.tooltip.setContent(newValue);\n }\n }\n}\n\nexport default LTooltip;\n","import { paneConnected } from \"./events.js\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.dispatchEvent(\n new CustomEvent(paneConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n name: this.getAttribute(\"name\"),\n },\n })\n );\n }\n}\n","// @ts-check\nimport { Circle, LatLng, Polygon, Polyline, Rectangle } from \"leaflet\";\nimport { camelToKebab } from \"./util.js\";\nimport { htmlAttribute, parse } from \"./parse.js\";\nimport { layerConnected, tooltipConnected } from \"./events.js\";\n\n/**\n * @typedef {Object} TagOption\n * @property {string} camel\n * @property {string} kebab\n * @property {(s: string) => AttributeValue} parser\n * @property {AttributeValue | null} defaultValue\n */\n/**\n * @typedef {(\"circle\"|\"rectangle\"|\"polygon\"|\"polyline\")} MethodName\n * @typedef {(\"path\"|\"interactiveLayer\")} LayerName\n * @typedef {(\"boolean\"|\"number\"|\"string\"|\"latlng\"|\"latlngbounds\")} AttributeType\n * @typedef {(boolean|number|string|LatLng)} AttributeValue\n */\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst positionalArguments = (methodName) => {\n switch (methodName) {\n case \"circle\":\n return [option(\"latLng\", \"latlng\", null)];\n case \"rectangle\":\n return [option(\"latLngBounds\", \"latlngbounds\", null)];\n case \"polygon\":\n return [option(\"latLngs\", \"latlng\", null)];\n case \"polyline\":\n return [option(\"latLngs\", \"latlng\", null)];\n }\n};\n\n/**\n * @param {string} name\n * @param {AttributeType} type\n * @param {AttributeValue | null} defaultValue\n * @returns {TagOption}\n */\nconst option = (name, type, defaultValue) => {\n return {\n camel: name,\n kebab: camelToKebab(name),\n parser: inferParser(type),\n defaultValue,\n };\n};\n\n/**\n * @param {AttributeType} type\n * @returns {(s: string) => AttributeValue}\n */\nconst inferParser = (type) => {\n switch (type.toLowerCase()) {\n case \"boolean\":\n return (s) => s === \"true\";\n case \"number\":\n return parseFloat;\n case \"latlng\":\n case \"latlngbounds\":\n return JSON.parse;\n case \"string\":\n return (s) => s;\n default:\n return (s) => s;\n }\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst options = (methodName) => {\n const _OPTIONS = {\n circle: [option(\"radius\", \"number\", null)],\n path: [\n option(\"stroke\", \"boolean\", true),\n option(\"color\", \"string\", \"#3388ff\"),\n option(\"weight\", \"number\", 3),\n option(\"opacity\", \"number\", 1.0),\n option(\"lineCap\", \"string\", \"round\"),\n option(\"lineJoin\", \"string\", \"round\"),\n option(\"dashArray\", \"string\", null),\n option(\"dashOffset\", \"string\", null),\n option(\"fill\", \"boolean\", true),\n option(\"fillColor\", \"string\", \"#3388ff\"),\n option(\"fillOpacity\", \"number\", 0.2),\n ],\n polyline: [\n option(\"smoothFactor\", \"number\", 1.0),\n option(\"noClip\", \"boolean\", false),\n ],\n polygon: [],\n rectangle: [],\n interactiveLayer: [option(\"interactive\", \"boolean\", true)],\n };\n return inheritance(methodName).flatMap((parent) => _OPTIONS[parent]);\n};\n\n/**\n * @type {Object.<string, (MethodName | LayerName)[]>}\n */\nconst INHERITS = {\n circle: [\"path\"],\n polyline: [\"path\"],\n polygon: [\"polyline\"],\n rectangle: [\"polygon\"],\n path: [\"interactiveLayer\"],\n interactiveLayer: [],\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {(MethodName | LayerName)[]}\n */\nconst inheritance = (methodName) => {\n /** @type {(MethodName | LayerName)} */\n let name = methodName;\n let chain = [methodName];\n while (INHERITS[name].length > 0) {\n let parent = INHERITS[name][0];\n chain.push(parent);\n name = parent;\n }\n return chain;\n};\n\n/**\n * @param {MethodName} methodName\n * @param {string} newValue\n * @param {string} name\n * @param {(Circle | Rectangle | Polygon | Polyline)} layer\n */\nconst setter = (layer, methodName, name, newValue) => {\n // Parse\n const allOptions = [\n ...positionalArguments(methodName),\n ...options(methodName),\n ];\n let _opt = allOptions.find((o) => o.kebab === name);\n if (typeof _opt === \"undefined\") {\n return;\n }\n const parsedValue = _opt.parser(newValue);\n\n // Update\n if (layer instanceof Circle) {\n switch (name) {\n case \"lat-lng\":\n layer.setLatLng(JSON.parse(newValue));\n break;\n case \"radius\":\n layer.setRadius(parseFloat(newValue));\n break;\n }\n } else if (layer instanceof Rectangle) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n case \"lat-lng-bounds\":\n layer.setBounds(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polygon) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polyline) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n }\n\n // setStyle options\n let opt = options(\"polyline\").find((o) => o.kebab === name);\n if (typeof opt !== \"undefined\") {\n layer.setStyle({ [opt.camel]: parsedValue });\n }\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst attributes = (methodName) => {\n let args = positionalArguments(methodName).map((o) => o.kebab);\n let opts = options(methodName).map((o) => o.kebab);\n return [...args, ...opts];\n};\n\n/**\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst settings = (el, methodName) => {\n // Gather settings\n let result = {};\n\n // Process inheritance chain\n options(methodName).forEach((o) => {\n if (el.hasAttribute(o.kebab)) {\n result[o.camel] = o.parser(el.getAttribute(o.kebab));\n }\n });\n return result;\n};\n\n/**\n * Read positional arguments from HTMLElement\n *\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst positional = (el, methodName) => {\n return positionalArguments(methodName).map(option => {\n const schema = htmlAttribute(option.kebab)\n const value = parse(schema, el)\n return option.parser(value);\n })\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst generator = (method, methodName) => {\n class cls extends HTMLElement {\n static observedAttributes = attributes(methodName);\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(tooltipConnected, (ev) => {\n if (this.layer !== null) {\n this.layer.bindTooltip(ev.detail.tooltip);\n }\n });\n }\n\n connectedCallback() {\n const args = positional(this, methodName);\n const options = settings(this, methodName);\n this.layer = method(...args, options);\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (this.layer !== null) {\n setter(this.layer, methodName, attName, newValue);\n }\n }\n }\n return cls;\n};\n\nexport default generator;\n","// @ts-check\nimport LBaseLayers from \"./l-base-layers.js\";\nimport LControlLayers from \"./l-control-layers.js\";\nimport LLayerGroup from \"./l-layer-group.js\";\nimport LMap from \"./l-map.js\";\nimport LMarker from \"./l-marker.js\";\nimport LOverlayLayers from \"./l-overlay-layers.js\";\nimport LPopup from \"./l-popup.js\";\nimport LTileLayer from \"./l-tile-layer.js\";\nimport LLatLngBounds from \"./l-lat-lng-bounds.js\";\nimport LImageOverlay from \"./l-image-overlay.js\";\nimport LVideoOverlay from \"./l-video-overlay.js\";\nimport LGeoJSON from \"./l-geojson.js\";\nimport LIcon from \"./l-icon.js\";\nimport LDivIcon from \"./l-div-icon.js\";\nimport LTooltip from \"./l-tooltip.js\";\nimport LPane from \"./l-pane.js\";\nimport generator from \"./generator.js\";\nimport { circle, polyline, polygon, rectangle } from \"leaflet\";\n\nconst init = (() => {\n // Custom elements (order of definition is important)\n customElements.define(\"l-map\", LMap);\n customElements.define(\"l-pane\", LPane);\n customElements.define(\"l-control-layers\", LControlLayers);\n customElements.define(\"l-base-layers\", LBaseLayers);\n customElements.define(\"l-overlay-layers\", LOverlayLayers);\n customElements.define(\"l-layer-group\", LLayerGroup);\n customElements.define(\"l-tile-layer\", LTileLayer);\n customElements.define(\"l-marker\", LMarker);\n customElements.define(\"l-popup\", LPopup);\n customElements.define(\"l-lat-lng-bounds\", LLatLngBounds);\n customElements.define(\"l-image-overlay\", LImageOverlay);\n customElements.define(\"l-video-overlay\", LVideoOverlay);\n customElements.define(\"l-geojson\", LGeoJSON);\n customElements.define(\"l-icon\", LIcon);\n customElements.define(\"l-circle\", generator(circle, \"circle\"));\n customElements.define(\"l-polyline\", generator(polyline, \"polyline\"));\n customElements.define(\"l-polygon\", generator(polygon, \"polygon\"));\n customElements.define(\"l-rectangle\", generator(rectangle, \"rectangle\"));\n customElements.define(\"l-tooltip\", LTooltip);\n customElements.define(\"l-div-icon\", LDivIcon);\n})();\n\nexport default init;\n"],"names":["layerConnected","popupConnected","iconConnected","layerRemoved","latLngBoundsConnected","latLngBoundsChanged","tooltipConnected","paneConnected","LBaseLayers","_HTMLElement","call","this","_inheritsLoose","prototype","connectedCallback","addEventListener","ev","detail","_wrapNativeSuper","HTMLElement","LControlLayers","controlLayers","control","layers","_ev$detail","type","name","layer","addOverlay","addBaseLayer","preventDefault","event","CustomEvent","cancelable","bubbles","dispatchEvent","LLayer","_this","disconnectedCallback","_this$layer","remove","LLayerGroup","_LLayer","getAttribute","group","layerGroup","stopPropagation","addLayer","MutationObserver","mutations","forEach","mutation","removedNodes","node","leafletId","getLayer","parseInt","removeLayer","observe","childList","LeafletHTMLError","_Error","issues","key","get","JSON","stringify","Error","parse","schema","value","result","status","wrap","partial","obj","ctx","_i3","_Object$keys3","Object","keys","length","localCtx","concat","pipe","parsers","slice","arguments","i","chain","nullable","parser","optional","htmlAttribute","attributeName","el","htmlAttributeIssue","_extends","json","e","jsonIssue","option","apply","code","message","tagName","toLowerCase","LMap","map","boundsListener","method","bounds","createPane","target","_proto","_this2","L","zoomControl","hasAttribute","whenReady","on","split","eventName","fitWorld","zoom","isNaN","center","_i2","_Object$keys2","_parse","setView","locate","addTo","attributeChangedCallback","_oldValue","newValue","setZoom","observedAttributes","LMarker","setIcon","icon","bindTooltip","tooltip","latLng","options","opacity","parseFloat","pane","closest","marker","setAttribute","stamp","openPopup","popup","bindPopup","content","setLatLng","setOpacity","LOverlayLayers","LPopup","openPopupAttribute","LTileLayer","_step","urlTemplate","templateOptions","_iterator","_createForOfIteratorHelperLoose","parseTemplateAttributes","done","attribute","paneOptions","parentElement","attribution","errorTileUrl","tileLayer","matchAll","match","LLatLngBounds","getEvent","_name","LImageOverlay","url","alt","imageOverlay","console","warn","setUrl","setBounds","LVideoOverlay","autoplay","muted","playsInline","videoOverlay","LGeoJSON","geoJSON","kebabToCamel","kebab","replace","x","toUpperCase","LIcon","CustomElement","html","innerHTML","className","divIcon","LTooltip","_this$getAttribute","permanent","direction","attName","_","setContent","positionalArguments","methodName","defaultValue","camel","s","letter","idx","join","inferParser","_OPTIONS","circle","path","polyline","polygon","rectangle","interactiveLayer","inheritance","flatMap","parent","INHERITS","push","settings","o","generator","cls","args","positional","_opt","find","parsedValue","Circle","setRadius","Rectangle","setLatLngs","Polygon","Polyline","_layer$setStyle","opt","setStyle","setter","opts","attributes","init","customElements","define","LPane","LDivIcon"],"mappings":"yiEACO,IAAMA,EAAiB,oBACjBC,EAAiB,oBACjBC,EAAgB,mBAChBC,EAAe,kBACfC,EAAwB,2BACxBC,EAAsB,yBACtBC,EAAmB,sBACnBC,EAAgB,mBCLvBC,eAAWC,SAAAA,GACf,SAAAD,IAAc,OACZC,EAAAC,KAAAC,OAAOA,IACT,CAMC,OANAC,EAAAJ,EAAAC,GAAAD,EAAAK,UAEDC,kBAAA,WACEH,KAAKI,iBAAiBf,EAAgB,SAACgB,GACrCA,EAAGC,OAAa,KAAI,MACtB,EACF,EAACT,CAAA,CATcC,cASdS,EATuBC,cCEpBC,eAAc,SAAAX,GAClB,SAAAW,IAAc,OACZX,EAAAC,KAAMC,WACR,CA2BC,OA3BAC,EAAAQ,EAAAX,GAAAW,EAAAP,UAEDC,kBAAA,WAEE,IAGMO,EAAgBC,EAAQC,OAHjB,CAAA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,OAAKA,EAAEvC,KAAK,GACzDyD,EAAO7G,GAAQsE,GAAY1G,IAAI,SAAC+H,GAAM,OAAAA,EAAEvC,KAAK,GACjD,MAAAjH,GAAAA,OAAW2J,EAASe,EACtB,CAsCgCC,CAAWxC,GAoClCuB,CACT,EC3PMkB,IAEJC,eAAeC,OAAO,QAAStJ,GAC/BqJ,eAAeC,OAAO,SAAUC,IAChCF,eAAeC,OAAO,mBAAoB7O,GAC1C4O,eAAeC,OAAO,gBAAiBzP,GACvCwP,eAAeC,OAAO,mBAAoBnG,GAC1CkG,eAAeC,OAAO,gBAAiBxN,GACvCuN,eAAeC,OAAO,eAAgBhG,IACtC+F,eAAeC,OAAO,WAAYvH,GAClCsH,eAAeC,OAAO,UAAWlG,GACjCiG,eAAeC,OAAO,mBAAoBhF,IAC1C+E,eAAeC,OAAO,kBAAmB7E,IACzC4E,eAAeC,OAAO,kBAAmBrE,IACzCoE,eAAeC,OAAO,YAAahE,IACnC+D,eAAeC,OAAO,SAAUzD,IAChCwD,eAAeC,OAAO,WAAYrB,GAAUb,EAAQ,WACpDiC,eAAeC,OAAO,aAAcrB,GAAUX,EAAU,aACxD+B,eAAeC,OAAO,YAAarB,GAAUV,EAAS,YACtD8B,eAAeC,OAAO,cAAerB,GAAUT,EAAW,cAC1D6B,eAAeC,OAAO,YAAanD,SACnCkD,eAAeC,OAAO,aAAcE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "leaflet-html",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.3",
5
5
  "description": "Leaflet expressed in HTML",
6
6
  "keywords": [
7
7
  "leaflet",