-
-(function(l, r) { if (l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (window.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(window.document);
-(function () {
- 'use strict';
-
- function noop() { }
- function add_location(element, file, line, column, char) {
- element.__svelte_meta = {
- loc: { file, line, column, char }
- };
- }
- function run(fn) {
- return fn();
- }
- function blank_object() {
- return Object.create(null);
- }
- function run_all(fns) {
- fns.forEach(run);
- }
- function is_function(thing) {
- return typeof thing === 'function';
- }
- function safe_not_equal(a, b) {
- return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
- }
- function is_empty(obj) {
- return Object.keys(obj).length === 0;
- }
- function subscribe(store, ...callbacks) {
- if (store == null) {
- return noop;
- }
- const unsub = store.subscribe(...callbacks);
- return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
- }
- function get_store_value(store) {
- let value;
- subscribe(store, _ => value = _)();
- return value;
- }
- function action_destroyer(action_result) {
- return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
- }
-
- function append(target, node) {
- target.appendChild(node);
- }
- function insert(target, node, anchor) {
- target.insertBefore(node, anchor || null);
- }
- function detach(node) {
- node.parentNode.removeChild(node);
- }
- function destroy_each(iterations, detaching) {
- for (let i = 0; i < iterations.length; i += 1) {
- if (iterations[i])
- iterations[i].d(detaching);
- }
- }
- function element(name) {
- return document.createElement(name);
- }
- function text(data) {
- return document.createTextNode(data);
- }
- function space() {
- return text(' ');
- }
- function empty() {
- return text('');
- }
- function listen(node, event, handler, options) {
- node.addEventListener(event, handler, options);
- return () => node.removeEventListener(event, handler, options);
- }
- function prevent_default(fn) {
- return function (event) {
- event.preventDefault();
- // @ts-ignore
- return fn.call(this, event);
- };
- }
- function stop_propagation(fn) {
- return function (event) {
- event.stopPropagation();
- // @ts-ignore
- return fn.call(this, event);
- };
- }
- function attr(node, attribute, value) {
- if (value == null)
- node.removeAttribute(attribute);
- else if (node.getAttribute(attribute) !== value)
- node.setAttribute(attribute, value);
- }
- function children(element) {
- return Array.from(element.childNodes);
- }
- function set_style(node, key, value, important) {
- node.style.setProperty(key, value, important ? 'important' : '');
- }
- function select_option(select, value) {
- for (let i = 0; i < select.options.length; i += 1) {
- const option = select.options[i];
- if (option.__value === value) {
- option.selected = true;
- return;
- }
- }
- }
- function toggle_class(element, name, toggle) {
- element.classList[toggle ? 'add' : 'remove'](name);
- }
- function custom_event(type, detail) {
- const e = document.createEvent('CustomEvent');
- e.initCustomEvent(type, false, false, detail);
- return e;
- }
-
- let current_component;
- function set_current_component(component) {
- current_component = component;
- }
- function get_current_component() {
- if (!current_component)
- throw new Error('Function called outside component initialization');
- return current_component;
- }
- function onMount(fn) {
- get_current_component().$$.on_mount.push(fn);
- }
-
- const dirty_components = [];
- const binding_callbacks = [];
- const render_callbacks = [];
- const flush_callbacks = [];
- const resolved_promise = Promise.resolve();
- let update_scheduled = false;
- function schedule_update() {
- if (!update_scheduled) {
- update_scheduled = true;
- resolved_promise.then(flush);
- }
- }
- function add_render_callback(fn) {
- render_callbacks.push(fn);
- }
- let flushing = false;
- const seen_callbacks = new Set();
- function flush() {
- if (flushing)
- return;
- flushing = true;
- do {
- // first, call beforeUpdate functions
- // and update components
- for (let i = 0; i < dirty_components.length; i += 1) {
- const component = dirty_components[i];
- set_current_component(component);
- update(component.$$);
- }
- set_current_component(null);
- dirty_components.length = 0;
- while (binding_callbacks.length)
- binding_callbacks.pop()();
- // then, once components are updated, call
- // afterUpdate functions. This may cause
- // subsequent updates...
- for (let i = 0; i < render_callbacks.length; i += 1) {
- const callback = render_callbacks[i];
- if (!seen_callbacks.has(callback)) {
- // ...so guard against infinite loops
- seen_callbacks.add(callback);
- callback();
- }
- }
- render_callbacks.length = 0;
- } while (dirty_components.length);
- while (flush_callbacks.length) {
- flush_callbacks.pop()();
- }
- update_scheduled = false;
- flushing = false;
- seen_callbacks.clear();
- }
- function update($$) {
- if ($$.fragment !== null) {
- $$.update();
- run_all($$.before_update);
- const dirty = $$.dirty;
- $$.dirty = [-1];
- $$.fragment && $$.fragment.p($$.ctx, dirty);
- $$.after_update.forEach(add_render_callback);
- }
- }
- const outroing = new Set();
- let outros;
- function group_outros() {
- outros = {
- r: 0,
- c: [],
- p: outros // parent group
- };
- }
- function check_outros() {
- if (!outros.r) {
- run_all(outros.c);
- }
- outros = outros.p;
- }
- function transition_in(block, local) {
- if (block && block.i) {
- outroing.delete(block);
- block.i(local);
- }
- }
- function transition_out(block, local, detach, callback) {
- if (block && block.o) {
- if (outroing.has(block))
- return;
- outroing.add(block);
- outros.c.push(() => {
- outroing.delete(block);
- if (callback) {
- if (detach)
- block.d(1);
- callback();
- }
- });
- block.o(local);
- }
- }
-
- const globals = (typeof window !== 'undefined'
- ? window
- : typeof globalThis !== 'undefined'
- ? globalThis
- : global);
- function create_component(block) {
- block && block.c();
- }
- function mount_component(component, target, anchor) {
- const { fragment, on_mount, on_destroy, after_update } = component.$$;
- fragment && fragment.m(target, anchor);
- // onMount happens before the initial afterUpdate
- add_render_callback(() => {
- const new_on_destroy = on_mount.map(run).filter(is_function);
- if (on_destroy) {
- on_destroy.push(...new_on_destroy);
- }
- else {
- // Edge case - component was destroyed immediately,
- // most likely as a result of a binding initialising
- run_all(new_on_destroy);
- }
- component.$$.on_mount = [];
- });
- after_update.forEach(add_render_callback);
- }
- function destroy_component(component, detaching) {
- const $$ = component.$$;
- if ($$.fragment !== null) {
- run_all($$.on_destroy);
- $$.fragment && $$.fragment.d(detaching);
- // TODO null out other refs, including component.$$ (but need to
- // preserve final state?)
- $$.on_destroy = $$.fragment = null;
- $$.ctx = [];
- }
- }
- function make_dirty(component, i) {
- if (component.$$.dirty[0] === -1) {
- dirty_components.push(component);
- schedule_update();
- component.$$.dirty.fill(0);
- }
- component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
- }
- function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
- const parent_component = current_component;
- set_current_component(component);
- const prop_values = options.props || {};
- const $$ = component.$$ = {
- fragment: null,
- ctx: null,
- // state
- props,
- update: noop,
- not_equal,
- bound: blank_object(),
- // lifecycle
- on_mount: [],
- on_destroy: [],
- before_update: [],
- after_update: [],
- context: new Map(parent_component ? parent_component.$$.context : []),
- // everything else
- callbacks: blank_object(),
- dirty,
- skip_bound: false
- };
- let ready = false;
- $$.ctx = instance
- ? instance(component, prop_values, (i, ret, ...rest) => {
- const value = rest.length ? rest[0] : ret;
- if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
- if (!$$.skip_bound && $$.bound[i])
- $$.bound[i](value);
- if (ready)
- make_dirty(component, i);
- }
- return ret;
- })
- : [];
- $$.update();
- ready = true;
- run_all($$.before_update);
- // `false` as a special case of no DOM component
- $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
- if (options.target) {
- if (options.hydrate) {
- const nodes = children(options.target);
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- $$.fragment && $$.fragment.l(nodes);
- nodes.forEach(detach);
- }
- else {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- $$.fragment && $$.fragment.c();
- }
- if (options.intro)
- transition_in(component.$$.fragment);
- mount_component(component, options.target, options.anchor);
- flush();
- }
- set_current_component(parent_component);
- }
- /**
- * Base class for Svelte components. Used when dev=false.
- */
- class SvelteComponent {
- $destroy() {
- destroy_component(this, 1);
- this.$destroy = noop;
- }
- $on(type, callback) {
- const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
- callbacks.push(callback);
- return () => {
- const index = callbacks.indexOf(callback);
- if (index !== -1)
- callbacks.splice(index, 1);
- };
- }
- $set($$props) {
- if (this.$$set && !is_empty($$props)) {
- this.$$.skip_bound = true;
- this.$$set($$props);
- this.$$.skip_bound = false;
- }
- }
- }
-
- function dispatch_dev(type, detail) {
- document.dispatchEvent(custom_event(type, Object.assign({ version: '3.31.2' }, detail)));
- }
- function append_dev(target, node) {
- dispatch_dev('SvelteDOMInsert', { target, node });
- append(target, node);
- }
- function insert_dev(target, node, anchor) {
- dispatch_dev('SvelteDOMInsert', { target, node, anchor });
- insert(target, node, anchor);
- }
- function detach_dev(node) {
- dispatch_dev('SvelteDOMRemove', { node });
- detach(node);
- }
- function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
- const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
- if (has_prevent_default)
- modifiers.push('preventDefault');
- if (has_stop_propagation)
- modifiers.push('stopPropagation');
- dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
- const dispose = listen(node, event, handler, options);
- return () => {
- dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
- dispose();
- };
- }
- function attr_dev(node, attribute, value) {
- attr(node, attribute, value);
- if (value == null)
- dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });
- else
- dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });
- }
- function prop_dev(node, property, value) {
- node[property] = value;
- dispatch_dev('SvelteDOMSetProperty', { node, property, value });
- }
- function set_data_dev(text, data) {
- data = '' + data;
- if (text.wholeText === data)
- return;
- dispatch_dev('SvelteDOMSetData', { node: text, data });
- text.data = data;
- }
- function validate_each_argument(arg) {
- if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
- let msg = '{#each} only iterates over array-like objects.';
- if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
- msg += ' You can use a spread to convert this iterable into an array.';
- }
- throw new Error(msg);
- }
- }
- function validate_slots(name, slot, keys) {
- for (const slot_key of Object.keys(slot)) {
- if (!~keys.indexOf(slot_key)) {
- console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
- }
- }
- }
- /**
- * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
- */
- class SvelteComponentDev extends SvelteComponent {
- constructor(options) {
- if (!options || (!options.target && !options.$$inline)) {
- throw new Error("'target' is a required option");
- }
- super();
- }
- $destroy() {
- super.$destroy();
- this.$destroy = () => {
- console.warn('Component was already destroyed'); // eslint-disable-line no-console
- };
- }
- $capture_state() { }
- $inject_state() { }
- }
-
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
- function createCommonjsModule(fn) {
- var module = { exports: {} };
- return fn(module, module.exports), module.exports;
- }
-
- /*!
- * jQuery JavaScript Library v3.5.1
+!function(){"use strict";function t(){}function e(t,e){for(const n in e)t[n]=e[n];return t}function n(t){return t()}function i(){return Object.create(null)}function o(t){t.forEach(n)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(e,...n){if(null==e)return t;const i=e.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}function l(t){let e;return a(t,(t=>e=t))(),e}function u(t,e,n){t.$$.on_destroy.push(a(e,n))}function c(t,e,n,i){if(t){const o=h(t,e,n,i);return t[0](o)}}function h(t,n,i,o){return t[1]&&o?e(i.ctx.slice(),t[1](o(n))):i.ctx}function d(t,e,n,i,o,r,s){const a=function(t,e,n,i){if(t[2]&&i){const o=t[2](i(n));if(void 0===e.dirty)return o;if("object"==typeof o){const t=[],n=Math.max(e.dirty.length,o.length);for(let i=0;i<n;i+=1)t[i]=e.dirty[i]|o[i];return t}return e.dirty|o}return e.dirty}(e,i,o,r);if(a){const o=h(e,n,i,s);t.p(o,a)}}function f(t,e){t.appendChild(e)}function p(t,e,n){t.insertBefore(e,n||null)}function m(t){t.parentNode.removeChild(t)}function g(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function _(t){return document.createElement(t)}function v(t){return document.createTextNode(t)}function y(){return v(" ")}function b(){return v("")}function x(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function w(t){return function(e){return e.preventDefault(),t.call(this,e)}}function T(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function E(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function $(t,e){t.value=null==e?"":e}function k(t,e){for(let n=0;n<t.options.length;n+=1){const i=t.options[n];if(i.__value===e)return void(i.selected=!0)}}function P(t,e,n){t.classList[n?"add":"remove"](e)}class S{constructor(t=null){this.a=t,this.e=this.n=null}m(t,e,n=null){this.e||(this.e=_(e.nodeName),this.t=e,this.h(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)p(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(m)}}let M;function A(t){M=t}function N(t){(function(){if(!M)throw new Error("Function called outside component initialization");return M})().$$.on_mount.push(t)}const D=[],I=[],O=[],z=[],B=Promise.resolve();let j=!1;function R(t){O.push(t)}function Z(t){z.push(t)}let H=!1;const q=new Set;function F(){if(!H){H=!0;do{for(let t=0;t<D.length;t+=1){const e=D[t];A(e),W(e.$$)}for(A(null),D.length=0;I.length;)I.pop()();for(let t=0;t<O.length;t+=1){const e=O[t];q.has(e)||(q.add(e),e())}O.length=0}while(D.length);for(;z.length;)z.pop()();j=!1,H=!1,q.clear()}}function W(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(R)}}const U=new Set;let V;function G(){V={r:0,c:[],p:V}}function K(){V.r||o(V.c),V=V.p}function Y(t,e){t&&t.i&&(U.delete(t),t.i(e))}function X(t,e,n,i){if(t&&t.o){if(U.has(t))return;U.add(t),V.c.push((()=>{U.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function Q(t,e,n){const i=t.$$.props[e];void 0!==i&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function J(t){t&&t.c()}function tt(t,e,i,s){const{fragment:a,on_mount:l,on_destroy:u,after_update:c}=t.$$;a&&a.m(e,i),s||R((()=>{const e=l.map(n).filter(r);u?u.push(...e):o(e),t.$$.on_mount=[]})),c.forEach(R)}function et(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function nt(t,e){-1===t.$$.dirty[0]&&(D.push(t),j||(j=!0,B.then(F)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function it(e,n,r,s,a,l,u=[-1]){const c=M;A(e);const h=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c?c.$$.context:n.context||[]),callbacks:i(),dirty:u,skip_bound:!1};let d=!1;if(h.ctx=r?r(e,n.props||{},((t,n,...i)=>{const o=i.length?i[0]:n;return h.ctx&&a(h.ctx[t],h.ctx[t]=o)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](o),d&&nt(e,t)),n})):[],h.update(),d=!0,o(h.before_update),h.fragment=!!s&&s(h.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);h.fragment&&h.fragment.l(t),t.forEach(m)}else h.fragment&&h.fragment.c();n.intro&&Y(e.$$.fragment),tt(e,n.target,n.anchor,n.customElement),F()}A(c)}class ot{$destroy(){et(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var rt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function st(t){var e={exports:{}};return t(e,e.exports),e.exports
+/*!
+ * jQuery JavaScript Library v3.6.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
- * Copyright JS Foundation and other contributors
+ * Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
- * Date: 2020-05-04T22:49Z
- */
-
- var jquery = createCommonjsModule(function (module) {
- ( function( global, factory ) {
-
- {
-
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get jQuery.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
- module.exports = global.document ?
- factory( global, true ) :
- function( w ) {
- if ( !w.document ) {
- throw new Error( "jQuery requires a window with a document" );
- }
- return factory( w );
- };
- }
-
- // Pass this if window is not defined yet
- } )( typeof window !== "undefined" ? window : commonjsGlobal, function( window, noGlobal ) {
-
- var arr = [];
-
- var getProto = Object.getPrototypeOf;
-
- var slice = arr.slice;
-
- var flat = arr.flat ? function( array ) {
- return arr.flat.call( array );
- } : function( array ) {
- return arr.concat.apply( [], array );
- };
-
-
- var push = arr.push;
-
- var indexOf = arr.indexOf;
-
- var class2type = {};
-
- var toString = class2type.toString;
-
- var hasOwn = class2type.hasOwnProperty;
-
- var fnToString = hasOwn.toString;
-
- var ObjectFunctionString = fnToString.call( Object );
-
- var support = {};
-
- var isFunction = function isFunction( obj ) {
-
- // Support: Chrome <=57, Firefox <=52
- // In some browsers, typeof returns "function" for HTML <object> elements
- // (i.e., `typeof document.createElement( "object" ) === "function"`).
- // We don't want to classify *any* DOM node as a function.
- return typeof obj === "function" && typeof obj.nodeType !== "number";
- };
-
-
- var isWindow = function isWindow( obj ) {
- return obj != null && obj === obj.window;
- };
-
-
- var document = window.document;
-
-
-
- var preservedScriptAttributes = {
- type: true,
- src: true,
- nonce: true,
- noModule: true
- };
-
- function DOMEval( code, node, doc ) {
- doc = doc || document;
-
- var i, val,
- script = doc.createElement( "script" );
-
- script.text = code;
- if ( node ) {
- for ( i in preservedScriptAttributes ) {
-
- // Support: Firefox 64+, Edge 18+
- // Some browsers don't support the "nonce" property on scripts.
- // On the other hand, just using `getAttribute` is not enough as
- // the `nonce` attribute is reset to an empty string whenever it
- // becomes browsing-context connected.
- // See https://github.com/whatwg/html/issues/2369
- // See https://html.spec.whatwg.org/#nonce-attributes
- // The `node.getAttribute` check was added for the sake of
- // `jQuery.globalEval` so that it can fake a nonce-containing node
- // via an object.
- val = node[ i ] || node.getAttribute && node.getAttribute( i );
- if ( val ) {
- script.setAttribute( i, val );
- }
- }
- }
- doc.head.appendChild( script ).parentNode.removeChild( script );
- }
-
-
- function toType( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
-
- // Support: Android <=2.3 only (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call( obj ) ] || "object" :
- typeof obj;
- }
- /* global Symbol */
- // Defining this global in .eslintrc.json would create a danger of using the global
- // unguarded in another place, it seems safer to define global only for this module
-
-
-
- var
- version = "3.5.1",
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
-
- // The jQuery object is actually just the init constructor 'enhanced'
- // Need init if jQuery is called (just allow error to be thrown if not included)
- return new jQuery.fn.init( selector, context );
- };
-
- jQuery.fn = jQuery.prototype = {
-
- // The current version of jQuery being used
- jquery: version,
-
- constructor: jQuery,
-
- // The default length of a jQuery object is 0
- length: 0,
-
- toArray: function() {
- return slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
-
- // Return all the elements in a clean array
- if ( num == null ) {
- return slice.call( this );
- }
-
- // Return just the one element from the set
- return num < 0 ? this[ num + this.length ] : this[ num ];
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- each: function( callback ) {
- return jQuery.each( this, callback );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map( this, function( elem, i ) {
- return callback.call( elem, i, elem );
- } ) );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- even: function() {
- return this.pushStack( jQuery.grep( this, function( _elem, i ) {
- return ( i + 1 ) % 2;
- } ) );
- },
-
- odd: function() {
- return this.pushStack( jQuery.grep( this, function( _elem, i ) {
- return i % 2;
- } ) );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
- },
-
- end: function() {
- return this.prevObject || this.constructor();
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: arr.sort,
- splice: arr.splice
- };
-
- jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[ 0 ] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
-
- // Skip the boolean and the target
- target = arguments[ i ] || {};
- i++;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !isFunction( target ) ) {
- target = {};
- }
-
- // Extend jQuery itself if only one argument is passed
- if ( i === length ) {
- target = this;
- i--;
- }
-
- for ( ; i < length; i++ ) {
-
- // Only deal with non-null/undefined values
- if ( ( options = arguments[ i ] ) != null ) {
-
- // Extend the base object
- for ( name in options ) {
- copy = options[ name ];
-
- // Prevent Object.prototype pollution
- // Prevent never-ending loop
- if ( name === "__proto__" || target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
- ( copyIsArray = Array.isArray( copy ) ) ) ) {
- src = target[ name ];
-
- // Ensure proper type for the source value
- if ( copyIsArray && !Array.isArray( src ) ) {
- clone = [];
- } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
- clone = {};
- } else {
- clone = src;
- }
- copyIsArray = false;
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
- };
-
- jQuery.extend( {
-
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
- // Assume jQuery is ready without the ready module
- isReady: true,
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- noop: function() {},
-
- isPlainObject: function( obj ) {
- var proto, Ctor;
-
- // Detect obvious negatives
- // Use toString instead of jQuery.type to catch host objects
- if ( !obj || toString.call( obj ) !== "[object Object]" ) {
- return false;
- }
-
- proto = getProto( obj );
-
- // Objects with no prototype (e.g., `Object.create( null )`) are plain
- if ( !proto ) {
- return true;
- }
-
- // Objects with prototype are plain iff they were constructed by a global Object function
- Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
- return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
- },
-
- isEmptyObject: function( obj ) {
- var name;
-
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- // Evaluates a script in a provided context; falls back to the global one
- // if not specified.
- globalEval: function( code, options, doc ) {
- DOMEval( code, { nonce: options && options.nonce }, doc );
- },
-
- each: function( obj, callback ) {
- var length, i = 0;
-
- if ( isArrayLike( obj ) ) {
- length = obj.length;
- for ( ; i < length; i++ ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- }
-
- return obj;
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArrayLike( Object( arr ) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- return arr == null ? -1 : indexOf.call( arr, elem, i );
- },
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- merge: function( first, second ) {
- var len = +second.length,
- j = 0,
- i = first.length;
-
- for ( ; j < len; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, invert ) {
- var callbackInverse,
- matches = [],
- i = 0,
- length = elems.length,
- callbackExpect = !invert;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- callbackInverse = !callback( elems[ i ], i );
- if ( callbackInverse !== callbackExpect ) {
- matches.push( elems[ i ] );
- }
- }
-
- return matches;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var length, value,
- i = 0,
- ret = [];
-
- // Go through the array, translating each of the items to their new values
- if ( isArrayLike( elems ) ) {
- length = elems.length;
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
- }
-
- // Flatten any nested arrays
- return flat( ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support: support
- } );
-
- if ( typeof Symbol === "function" ) {
- jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
- }
-
- // Populate the class2type map
- jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
- function( _i, name ) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
- } );
-
- function isArrayLike( obj ) {
-
- // Support: real iOS 8.2 only (not reproducible in simulator)
- // `in` check used to prevent JIT error (gh-2145)
- // hasOwn isn't used here due to false negatives
- // regarding Nodelist length in IE
- var length = !!obj && "length" in obj && obj.length,
- type = toType( obj );
-
- if ( isFunction( obj ) || isWindow( obj ) ) {
- return false;
- }
-
- return type === "array" || length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj;
- }
- var Sizzle =
- /*!
- * Sizzle CSS Selector Engine v2.3.5
+ * Date: 2021-03-02T17:08Z
+ */}var at=st((function(t){!function(e,n){t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}}("undefined"!=typeof window?window:rt,(function(t,e){var n=[],i=Object.getPrototypeOf,o=n.slice,r=n.flat?function(t){return n.flat.call(t)}:function(t){return n.concat.apply([],t)},s=n.push,a=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,h=c.toString,d=h.call(Object),f={},p=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},m=function(t){return null!=t&&t===t.window},g=t.document,_={type:!0,src:!0,nonce:!0,noModule:!0};function v(t,e,n){var i,o,r=(n=n||g).createElement("script");if(r.text=t,e)for(i in _)(o=e[i]||e.getAttribute&&e.getAttribute(i))&&r.setAttribute(i,o);n.head.appendChild(r).parentNode.removeChild(r)}function y(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?l[u.call(t)]||"object":typeof t}var b="3.6.0",x=function(t,e){return new x.fn.init(t,e)};function w(t){var e=!!t&&"length"in t&&t.length,n=y(t);return!p(t)&&!m(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}x.fn=x.prototype={jquery:b,constructor:x,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=x.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return x.each(this,t)},map:function(t){return this.pushStack(x.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},x.extend=x.fn.extend=function(){var t,e,n,i,o,r,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||p(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)i=t[e],"__proto__"!==e&&s!==i&&(u&&i&&(x.isPlainObject(i)||(o=Array.isArray(i)))?(n=s[e],r=o&&!Array.isArray(n)?[]:o||x.isPlainObject(n)?n:{},o=!1,s[e]=x.extend(u,r,i)):void 0!==i&&(s[e]=i));return s},x.extend({expando:"jQuery"+(b+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==u.call(t))&&(!(e=i(t))||"function"==typeof(n=c.call(e,"constructor")&&e.constructor)&&h.call(n)===d)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){v(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(w(t))for(n=t.length;i<n&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(w(Object(t))?x.merge(n,"string"==typeof t?[t]:t):s.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:a.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,o=t.length;i<n;i++)t[o++]=e[i];return t.length=o,t},grep:function(t,e,n){for(var i=[],o=0,r=t.length,s=!n;o<r;o++)!e(t[o],o)!==s&&i.push(t[o]);return i},map:function(t,e,n){var i,o,s=0,a=[];if(w(t))for(i=t.length;s<i;s++)null!=(o=e(t[s],s,n))&&a.push(o);else for(s in t)null!=(o=e(t[s],s,n))&&a.push(o);return r(a)},guid:1,support:f}),"function"==typeof Symbol&&(x.fn[Symbol.iterator]=n[Symbol.iterator]),x.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){l["[object "+e+"]"]=e.toLowerCase()}));var T=
+/*!
+ * Sizzle CSS Selector Engine v2.3.6
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
- * Date: 2020-03-14
- */
- ( function( window ) {
- var i,
- support,
- Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
- outermostContext,
- sortInput,
- hasDuplicate,
-
- // Local document vars
- setDocument,
- document,
- docElem,
- documentIsHTML,
- rbuggyQSA,
- rbuggyMatches,
- matches,
- contains,
-
- // Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
- dirruns = 0,
- done = 0,
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
- nonnativeSelectorCache = createCache(),
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- }
- return 0;
- },
-
- // Instance methods
- hasOwn = ( {} ).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- pushNative = arr.push,
- push = arr.push,
- slice = arr.slice,
-
- // Use a stripped-down indexOf as it's faster than native
- // https://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[ i ] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
- "ismap|loop|multiple|open|readonly|required|scoped",
-
- // Regular expressions
-
- // http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
-
- // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
- identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
- "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
-
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
-
- // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace +
-
- // "Attribute values must be CSS identifiers [capture 5]
- // or strings [capture 3 or capture 4]"
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
- whitespace + "*\\]",
-
- pseudos = ":(" + identifier + ")(?:\\((" +
-
- // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
- // 1. quoted (capture 3; capture 4 or capture 5)
- "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
-
- // 2. simple (capture 6)
- "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
-
- // 3. anything else (capture 2)
- ".*" +
- ")\\)|)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
- whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
- "*" ),
- rdescend = new RegExp( whitespace + "|>" ),
-
- rpseudo = new RegExp( pseudos ),
- ridentifier = new RegExp( "^" + identifier + "$" ),
-
- matchExpr = {
- "ID": new RegExp( "^#(" + identifier + ")" ),
- "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
- "TAG": new RegExp( "^(" + identifier + "|[*])" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
- whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
- whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
-
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace +
- "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
- "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
- },
-
- rhtml = /HTML$/i,
- rinputs = /^(?:input|select|textarea|button)$/i,
- rheader = /^h\d$/i,
-
- rnative = /^[^{]+\{\s*\[native \w/,
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[+~]/,
-
- // CSS escapes
- // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
- funescape = function( escape, nonHex ) {
- var high = "0x" + escape.slice( 1 ) - 0x10000;
-
- return nonHex ?
-
- // Strip the backslash prefix from a non-hex escape sequence
- nonHex :
-
- // Replace a hexadecimal escape sequence with the encoded Unicode code point
- // Support: IE <=11+
- // For values outside the Basic Multilingual Plane (BMP), manually construct a
- // surrogate pair
- high < 0 ?
- String.fromCharCode( high + 0x10000 ) :
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // CSS string/identifier serialization
- // https://drafts.csswg.org/cssom/#common-serializing-idioms
- rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
- fcssescape = function( ch, asCodePoint ) {
- if ( asCodePoint ) {
-
- // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
- if ( ch === "\0" ) {
- return "\uFFFD";
- }
-
- // Control characters and (dependent upon position) numbers get escaped as code points
- return ch.slice( 0, -1 ) + "\\" +
- ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
- }
-
- // Other potentially-special ASCII characters get backslash-escaped
- return "\\" + ch;
- },
-
- // Used for iframes
- // See setDocument()
- // Removing the function wrapper causes a "Permission Denied"
- // error in IE
- unloadHandler = function() {
- setDocument();
- },
-
- inDisabledFieldset = addCombinator(
- function( elem ) {
- return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
- },
- { dir: "parentNode", next: "legend" }
- );
-
- // Optimize for push.apply( _, NodeList )
- try {
- push.apply(
- ( arr = slice.call( preferredDoc.childNodes ) ),
- preferredDoc.childNodes
- );
-
- // Support: Android<4.0
- // Detect silently failing push.apply
- // eslint-disable-next-line no-unused-expressions
- arr[ preferredDoc.childNodes.length ].nodeType;
- } catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
- pushNative.apply( target, slice.call( els ) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
-
- // Can't trust NodeList.length
- while ( ( target[ j++ ] = els[ i++ ] ) ) {}
- target.length = j - 1;
- }
- };
- }
-
- function Sizzle( selector, context, results, seed ) {
- var m, i, elem, nid, match, groups, newSelector,
- newContext = context && context.ownerDocument,
-
- // nodeType defaults to 9, since context defaults to document
- nodeType = context ? context.nodeType : 9;
-
- results = results || [];
-
- // Return early from calls with invalid selector or context
- if ( typeof selector !== "string" || !selector ||
- nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
- return results;
- }
-
- // Try to shortcut find operations (as opposed to filters) in HTML documents
- if ( !seed ) {
- setDocument( context );
- context = context || document;
-
- if ( documentIsHTML ) {
-
- // If the selector is sufficiently simple, try using a "get*By*" DOM method
- // (excepting DocumentFragment context, where the methods don't exist)
- if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
-
- // ID selector
- if ( ( m = match[ 1 ] ) ) {
-
- // Document context
- if ( nodeType === 9 ) {
- if ( ( elem = context.getElementById( m ) ) ) {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
-
- // Element context
- } else {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( newContext && ( elem = newContext.getElementById( m ) ) &&
- contains( context, elem ) &&
- elem.id === m ) {
-
- results.push( elem );
- return results;
- }
- }
-
- // Type selector
- } else if ( match[ 2 ] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Class selector
- } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
- context.getElementsByClassName ) {
-
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // Take advantage of querySelectorAll
- if ( support.qsa &&
- !nonnativeSelectorCache[ selector + " " ] &&
- ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
-
- // Support: IE 8 only
- // Exclude object elements
- ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
-
- newSelector = selector;
- newContext = context;
-
- // qSA considers elements outside a scoping root when evaluating child or
- // descendant combinators, which is not what we want.
- // In such cases, we work around the behavior by prefixing every selector in the
- // list with an ID selector referencing the scope context.
- // The technique has to be used as well when a leading combinator is used
- // as such selectors are not recognized by querySelectorAll.
- // Thanks to Andrew Dupont for this technique.
- if ( nodeType === 1 &&
- ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
-
- // Expand context for sibling selectors
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
- context;
-
- // We can use :scope instead of the ID hack if the browser
- // supports it & if we're not changing the context.
- if ( newContext !== context || !support.scope ) {
-
- // Capture the context ID, setting it first if necessary
- if ( ( nid = context.getAttribute( "id" ) ) ) {
- nid = nid.replace( rcssescape, fcssescape );
- } else {
- context.setAttribute( "id", ( nid = expando ) );
- }
- }
-
- // Prefix every selector in the list
- groups = tokenize( selector );
- i = groups.length;
- while ( i-- ) {
- groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
- toSelector( groups[ i ] );
- }
- newSelector = groups.join( "," );
- }
-
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch ( qsaError ) {
- nonnativeSelectorCache( selector, true );
- } finally {
- if ( nid === expando ) {
- context.removeAttribute( "id" );
- }
- }
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
- }
-
- /**
- * Create key-value caches of limited size
- * @returns {function(string, object)} Returns the Object data after storing it on itself with
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- * deleting the oldest entry
- */
- function createCache() {
- var keys = [];
-
- function cache( key, value ) {
-
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
- if ( keys.push( key + " " ) > Expr.cacheLength ) {
-
- // Only keep the most recent entries
- delete cache[ keys.shift() ];
- }
- return ( cache[ key + " " ] = value );
- }
- return cache;
- }
-
- /**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
- function markFunction( fn ) {
- fn[ expando ] = true;
- return fn;
- }
-
- /**
- * Support testing using an element
- * @param {Function} fn Passed the created element and returns a boolean result
- */
- function assert( fn ) {
- var el = document.createElement( "fieldset" );
-
- try {
- return !!fn( el );
- } catch ( e ) {
- return false;
- } finally {
-
- // Remove from its parent by default
- if ( el.parentNode ) {
- el.parentNode.removeChild( el );
- }
-
- // release memory in IE
- el = null;
- }
- }
-
- /**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
- function addHandle( attrs, handler ) {
- var arr = attrs.split( "|" ),
- i = arr.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[ i ] ] = handler;
- }
- }
-
- /**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
- function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- a.sourceIndex - b.sourceIndex;
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( ( cur = cur.nextSibling ) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
- }
-
- /**
- * Returns a function to use in pseudos for input types
- * @param {String} type
+ * Date: 2021-02-16
*/
- function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
- }
-
- /**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
- function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return ( name === "input" || name === "button" ) && elem.type === type;
- };
- }
-
- /**
- * Returns a function to use in pseudos for :enabled/:disabled
- * @param {Boolean} disabled true for :disabled; false for :enabled
- */
- function createDisabledPseudo( disabled ) {
-
- // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
- return function( elem ) {
-
- // Only certain elements can match :enabled or :disabled
- // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
- // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
- if ( "form" in elem ) {
-
- // Check for inherited disabledness on relevant non-disabled elements:
- // * listed form-associated elements in a disabled fieldset
- // https://html.spec.whatwg.org/multipage/forms.html#category-listed
- // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
- // * option elements in a disabled optgroup
- // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
- // All such elements have a "form" property.
- if ( elem.parentNode && elem.disabled === false ) {
-
- // Option elements defer to a parent optgroup if present
- if ( "label" in elem ) {
- if ( "label" in elem.parentNode ) {
- return elem.parentNode.disabled === disabled;
- } else {
- return elem.disabled === disabled;
- }
- }
-
- // Support: IE 6 - 11
- // Use the isDisabled shortcut property to check for disabled fieldset ancestors
- return elem.isDisabled === disabled ||
-
- // Where there is no isDisabled, check manually
- /* jshint -W018 */
- elem.isDisabled !== !disabled &&
- inDisabledFieldset( elem ) === disabled;
- }
-
- return elem.disabled === disabled;
-
- // Try to winnow out elements that can't be disabled before trusting the disabled property.
- // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
- // even exist on them, let alone have a boolean value.
- } else if ( "label" in elem ) {
- return elem.disabled === disabled;
- }
-
- // Remaining elements are neither :enabled nor :disabled
- return false;
- };
- }
-
- /**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
- function createPositionalPseudo( fn ) {
- return markFunction( function( argument ) {
- argument = +argument;
- return markFunction( function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
- seed[ j ] = !( matches[ j ] = seed[ j ] );
- }
- }
- } );
- } );
- }
-
- /**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
- function testContext( context ) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
- }
-
- // Expose support vars for convenience
- support = Sizzle.support = {};
-
- /**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
- isXML = Sizzle.isXML = function( elem ) {
- var namespace = elem.namespaceURI,
- docElem = ( elem.ownerDocument || elem ).documentElement;
-
- // Support: IE <=8
- // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
- // https://bugs.jquery.com/ticket/4833
- return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
- };
-
- /**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
- setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, subWindow,
- doc = node ? node.ownerDocument || node : preferredDoc;
-
- // Return early if doc is invalid or already selected
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
- return document;
- }
-
- // Update global variables
- document = doc;
- docElem = document.documentElement;
- documentIsHTML = !isXML( document );
-
- // Support: IE 9 - 11+, Edge 12 - 18+
- // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- if ( preferredDoc != document &&
- ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
-
- // Support: IE 11, Edge
- if ( subWindow.addEventListener ) {
- subWindow.addEventListener( "unload", unloadHandler, false );
-
- // Support: IE 9 - 10 only
- } else if ( subWindow.attachEvent ) {
- subWindow.attachEvent( "onunload", unloadHandler );
- }
- }
-
- // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
- // Safari 4 - 5 only, Opera <=11.6 - 12.x only
- // IE/Edge & older browsers don't support the :scope pseudo-class.
- // Support: Safari 6.0 only
- // Safari 6.0 supports :scope but it's an alias of :root there.
- support.scope = assert( function( el ) {
- docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
- return typeof el.querySelectorAll !== "undefined" &&
- !el.querySelectorAll( ":scope fieldset div" ).length;
- } );
-
- /* Attributes
- ---------------------------------------------------------------------- */
-
- // Support: IE<8
- // Verify that getAttribute really returns attributes and not properties
- // (excepting IE8 booleans)
- support.attributes = assert( function( el ) {
- el.className = "i";
- return !el.getAttribute( "className" );
- } );
-
- /* getElement(s)By*
- ---------------------------------------------------------------------- */
-
- // Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert( function( el ) {
- el.appendChild( document.createComment( "" ) );
- return !el.getElementsByTagName( "*" ).length;
- } );
-
- // Support: IE<9
- support.getElementsByClassName = rnative.test( document.getElementsByClassName );
-
- // Support: IE<10
- // Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programmatically-set names,
- // so use a roundabout getElementsByName test
- support.getById = assert( function( el ) {
- docElem.appendChild( el ).id = expando;
- return !document.getElementsByName || !document.getElementsByName( expando ).length;
- } );
-
- // ID filter and find
- if ( support.getById ) {
- Expr.filter[ "ID" ] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- return elem.getAttribute( "id" ) === attrId;
- };
- };
- Expr.find[ "ID" ] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var elem = context.getElementById( id );
- return elem ? [ elem ] : [];
- }
- };
- } else {
- Expr.filter[ "ID" ] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== "undefined" &&
- elem.getAttributeNode( "id" );
- return node && node.value === attrId;
- };
- };
-
- // Support: IE 6 - 7 only
- // getElementById is not reliable as a find shortcut
- Expr.find[ "ID" ] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var node, i, elems,
- elem = context.getElementById( id );
-
- if ( elem ) {
-
- // Verify the id attribute
- node = elem.getAttributeNode( "id" );
- if ( node && node.value === id ) {
- return [ elem ];
- }
-
- // Fall back on getElementsByName
- elems = context.getElementsByName( id );
- i = 0;
- while ( ( elem = elems[ i++ ] ) ) {
- node = elem.getAttributeNode( "id" );
- if ( node && node.value === id ) {
- return [ elem ];
- }
- }
- }
-
- return [];
- }
- };
- }
-
- // Tag
- Expr.find[ "TAG" ] = support.getElementsByTagName ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( tag );
-
- // DocumentFragment nodes don't have gEBTN
- } else if ( support.qsa ) {
- return context.querySelectorAll( tag );
- }
- } :
-
- function( tag, context ) {
- var elem,
- tmp = [],
- i = 0,
-
- // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
- results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- while ( ( elem = results[ i++ ] ) ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- };
-
- // Class
- Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
- if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
- return context.getElementsByClassName( className );
- }
- };
-
- /* QSA/matchesSelector
- ---------------------------------------------------------------------- */
-
- // QSA and matchesSelector support
-
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- rbuggyMatches = [];
-
- // qSa(:focus) reports false when true (Chrome 21)
- // We allow this because of a bug in IE8/9 that throws an error
- // whenever `document.activeElement` is accessed on an iframe
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See https://bugs.jquery.com/ticket/13378
- rbuggyQSA = [];
-
- if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
-
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert( function( el ) {
-
- var input;
-
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explicitly
- // setting a boolean content attribute,
- // since its presence should be enough
- // https://bugs.jquery.com/ticket/12359
- docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
- "<select id='" + expando + "-\r\\' msallowcapture=''>" +
- "<option selected=''></option></select>";
-
- // Support: IE8, Opera 11-12.16
- // Nothing should be selected when empty strings follow ^= or $= or *=
- // The test attribute must be unknown in Opera but "safe" for WinRT
- // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
- }
-
- // Support: IE8
- // Boolean attributes and "value" are not treated correctly
- if ( !el.querySelectorAll( "[selected]" ).length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
- }
-
- // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
- if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
- rbuggyQSA.push( "~=" );
- }
-
- // Support: IE 11+, Edge 15 - 18+
- // IE 11/Edge don't find elements on a `[name='']` query in some cases.
- // Adding a temporary attribute to the document before the selection works
- // around the issue.
- // Interestingly, IE 10 & older don't seem to have the issue.
- input = document.createElement( "input" );
- input.setAttribute( "name", "" );
- el.appendChild( input );
- if ( !el.querySelectorAll( "[name='']" ).length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
- whitespace + "*(?:''|\"\")" );
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here and will not see later tests
- if ( !el.querySelectorAll( ":checked" ).length ) {
- rbuggyQSA.push( ":checked" );
- }
-
- // Support: Safari 8+, iOS 8+
- // https://bugs.webkit.org/show_bug.cgi?id=136851
- // In-page `selector#id sibling-combinator selector` fails
- if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
- rbuggyQSA.push( ".#.+[+~]" );
- }
-
- // Support: Firefox <=3.6 - 5 only
- // Old Firefox doesn't throw on a badly-escaped identifier.
- el.querySelectorAll( "\\\f" );
- rbuggyQSA.push( "[\\r\\n\\f]" );
- } );
-
- assert( function( el ) {
- el.innerHTML = "<a href='' disabled='disabled'></a>" +
- "<select disabled='disabled'><option/></select>";
-
- // Support: Windows 8 Native Apps
- // The type and name attributes are restricted during .innerHTML assignment
- var input = document.createElement( "input" );
- input.setAttribute( "type", "hidden" );
- el.appendChild( input ).setAttribute( "name", "D" );
-
- // Support: IE8
- // Enforce case-sensitivity of name attribute
- if ( el.querySelectorAll( "[name=d]" ).length ) {
- rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here and will not see later tests
- if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Support: IE9-11+
- // IE's :disabled selector does not pick up the children of disabled fieldsets
- docElem.appendChild( el ).disabled = true;
- if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Support: Opera 10 - 11 only
- // Opera 10-11 does not throw on post-comma invalid pseudos
- el.querySelectorAll( "*,:x" );
- rbuggyQSA.push( ",.*:" );
- } );
- }
-
- if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
- docElem.webkitMatchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector ) ) ) ) {
-
- assert( function( el ) {
-
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- support.disconnectedMatch = matches.call( el, "*" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( el, "[s!='']:x" );
- rbuggyMatches.push( "!=", pseudos );
- } );
- }
-
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
-
- /* Contains
- ---------------------------------------------------------------------- */
- hasCompare = rnative.test( docElem.compareDocumentPosition );
-
- // Element contains another
- // Purposefully self-exclusive
- // As in, an element does not contain itself
- contains = hasCompare || rnative.test( docElem.contains ) ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && (
- adown.contains ?
- adown.contains( bup ) :
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
- ) );
- } :
- function( a, b ) {
- if ( b ) {
- while ( ( b = b.parentNode ) ) {
- if ( b === a ) {
- return true;
- }
- }
- }
- return false;
- };
-
- /* Sorting
- ---------------------------------------------------------------------- */
-
- // Document order sorting
- sortOrder = hasCompare ?
- function( a, b ) {
-
- // Flag for duplicate removal
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- // Sort on method existence if only one input has compareDocumentPosition
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if ( compare ) {
- return compare;
- }
-
- // Calculate position if both inputs belong to the same document
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
- a.compareDocumentPosition( b ) :
-
- // Otherwise we know they are disconnected
- 1;
-
- // Disconnected nodes
- if ( compare & 1 ||
- ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
-
- // Choose the first element that is related to our preferred document
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- if ( a == document || a.ownerDocument == preferredDoc &&
- contains( preferredDoc, a ) ) {
- return -1;
- }
-
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- if ( b == document || b.ownerDocument == preferredDoc &&
- contains( preferredDoc, b ) ) {
- return 1;
- }
-
- // Maintain original order
- return sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
- }
-
- return compare & 4 ? -1 : 1;
- } :
- function( a, b ) {
-
- // Exit early if the nodes are identical
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- var cur,
- i = 0,
- aup = a.parentNode,
- bup = b.parentNode,
- ap = [ a ],
- bp = [ b ];
-
- // Parentless nodes are either documents or disconnected
- if ( !aup || !bup ) {
-
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- /* eslint-disable eqeqeq */
- return a == document ? -1 :
- b == document ? 1 :
- /* eslint-enable eqeqeq */
- aup ? -1 :
- bup ? 1 :
- sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
-
- // If the nodes are siblings, we can do a quick check
- } else if ( aup === bup ) {
- return siblingCheck( a, b );
- }
-
- // Otherwise we need full lists of their ancestors for comparison
- cur = a;
- while ( ( cur = cur.parentNode ) ) {
- ap.unshift( cur );
- }
- cur = b;
- while ( ( cur = cur.parentNode ) ) {
- bp.unshift( cur );
- }
-
- // Walk down the tree looking for a discrepancy
- while ( ap[ i ] === bp[ i ] ) {
- i++;
- }
-
- return i ?
-
- // Do a sibling check if the nodes have a common ancestor
- siblingCheck( ap[ i ], bp[ i ] ) :
-
- // Otherwise nodes in our document sort first
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- /* eslint-disable eqeqeq */
- ap[ i ] == preferredDoc ? -1 :
- bp[ i ] == preferredDoc ? 1 :
- /* eslint-enable eqeqeq */
- 0;
- };
-
- return document;
- };
-
- Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
- };
-
- Sizzle.matchesSelector = function( elem, expr ) {
- setDocument( elem );
-
- if ( support.matchesSelector && documentIsHTML &&
- !nonnativeSelectorCache[ expr + " " ] &&
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
-
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || support.disconnectedMatch ||
-
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch ( e ) {
- nonnativeSelectorCache( expr, true );
- }
- }
-
- return Sizzle( expr, document, null, [ elem ] ).length > 0;
- };
-
- Sizzle.contains = function( context, elem ) {
-
- // Set document vars if needed
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- if ( ( context.ownerDocument || context ) != document ) {
- setDocument( context );
- }
- return contains( context, elem );
- };
-
- Sizzle.attr = function( elem, name ) {
-
- // Set document vars if needed
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- if ( ( elem.ownerDocument || elem ) != document ) {
- setDocument( elem );
- }
-
- var fn = Expr.attrHandle[ name.toLowerCase() ],
-
- // Don't get fooled by Object.prototype properties (jQuery #13807)
- val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
- fn( elem, name, !documentIsHTML ) :
- undefined;
-
- return val !== undefined ?
- val :
- support.attributes || !documentIsHTML ?
- elem.getAttribute( name ) :
- ( val = elem.getAttributeNode( name ) ) && val.specified ?
- val.value :
- null;
- };
-
- Sizzle.escape = function( sel ) {
- return ( sel + "" ).replace( rcssescape, fcssescape );
- };
-
- Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
- };
-
- /**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
- Sizzle.uniqueSort = function( results ) {
- var elem,
- duplicates = [],
- j = 0,
- i = 0;
-
- // Unless we *know* we can detect duplicates, assume their presence
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice( 0 );
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- while ( ( elem = results[ i++ ] ) ) {
- if ( elem === results[ i ] ) {
- j = duplicates.push( i );
- }
- }
- while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
- }
- }
-
- // Clear input after sorting to release objects
- // See https://github.com/jquery/sizzle/pull/225
- sortInput = null;
-
- return results;
- };
-
- /**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
- getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( !nodeType ) {
-
- // If no nodeType, this is expected to be an array
- while ( ( node = elem[ i++ ] ) ) {
-
- // Do not traverse comment nodes
- ret += getText( node );
- }
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (jQuery #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
-
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
-
- // Do not include comment or processing instruction nodes
-
- return ret;
- };
-
- Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- attrHandle: {},
-
- find: {},
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[ 1 ] = match[ 1 ].replace( runescape, funescape );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
- match[ 5 ] || "" ).replace( runescape, funescape );
-
- if ( match[ 2 ] === "~=" ) {
- match[ 3 ] = " " + match[ 3 ] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
-
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 what (child|of-type)
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 4 xn-component of xn+y argument ([+-]?\d*n|)
- 5 sign of xn-component
- 6 x of xn-component
- 7 sign of y-component
- 8 y of y-component
- */
- match[ 1 ] = match[ 1 ].toLowerCase();
-
- if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
-
- // nth-* requires argument
- if ( !match[ 3 ] ) {
- Sizzle.error( match[ 0 ] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[ 4 ] = +( match[ 4 ] ?
- match[ 5 ] + ( match[ 6 ] || 1 ) :
- 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
- match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[ 3 ] ) {
- Sizzle.error( match[ 0 ] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var excess,
- unquoted = !match[ 6 ] && match[ 2 ];
-
- if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
- return null;
- }
-
- // Accept quoted arguments as-is
- if ( match[ 3 ] ) {
- match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
-
- // Strip excess characters from unquoted arguments
- } else if ( unquoted && rpseudo.test( unquoted ) &&
-
- // Get excess from tokenize (recursively)
- ( excess = tokenize( unquoted, true ) ) &&
-
- // advance to the next closing parenthesis
- ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
-
- // excess is a negative index
- match[ 0 ] = match[ 0 ].slice( 0, excess );
- match[ 2 ] = unquoted.slice( 0, excess );
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
-
- "TAG": function( nodeNameSelector ) {
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
- return nodeNameSelector === "*" ?
- function() {
- return true;
- } :
- function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ className + " " ];
-
- return pattern ||
- ( pattern = new RegExp( "(^|" + whitespace +
- ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
- className, function( elem ) {
- return pattern.test(
- typeof elem.className === "string" && elem.className ||
- typeof elem.getAttribute !== "undefined" &&
- elem.getAttribute( "class" ) ||
- ""
- );
- } );
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- /* eslint-disable max-len */
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
- false;
- /* eslint-enable max-len */
-
- };
- },
-
- "CHILD": function( type, what, _argument, first, last ) {
- var simple = type.slice( 0, 3 ) !== "nth",
- forward = type.slice( -4 ) !== "last",
- ofType = what === "of-type";
-
- return first === 1 && last === 0 ?
-
- // Shortcut for :nth-*(n)
- function( elem ) {
- return !!elem.parentNode;
- } :
-
- function( elem, _context, xml ) {
- var cache, uniqueCache, outerCache, node, nodeIndex, start,
- dir = simple !== forward ? "nextSibling" : "previousSibling",
- parent = elem.parentNode,
- name = ofType && elem.nodeName.toLowerCase(),
- useCache = !xml && !ofType,
- diff = false;
-
- if ( parent ) {
-
- // :(first|last|only)-(child|of-type)
- if ( simple ) {
- while ( dir ) {
- node = elem;
- while ( ( node = node[ dir ] ) ) {
- if ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) {
-
- return false;
- }
- }
-
- // Reverse direction for :only-* (if we haven't yet done so)
- start = dir = type === "only" && !start && "nextSibling";
- }
- return true;
- }
-
- start = [ forward ? parent.firstChild : parent.lastChild ];
-
- // non-xml :nth-child(...) stores cache data on `parent`
- if ( forward && useCache ) {
-
- // Seek `elem` from a previously-cached index
-
- // ...in a gzip-friendly way
- node = parent;
- outerCache = node[ expando ] || ( node[ expando ] = {} );
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- ( outerCache[ node.uniqueID ] = {} );
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex && cache[ 2 ];
- node = nodeIndex && parent.childNodes[ nodeIndex ];
-
- while ( ( node = ++nodeIndex && node && node[ dir ] ||
-
- // Fallback to seeking `elem` from the start
- ( diff = nodeIndex = 0 ) || start.pop() ) ) {
-
- // When found, cache indexes on `parent` and break
- if ( node.nodeType === 1 && ++diff && node === elem ) {
- uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
- break;
- }
- }
-
- } else {
-
- // Use previously-cached element index if available
- if ( useCache ) {
-
- // ...in a gzip-friendly way
- node = elem;
- outerCache = node[ expando ] || ( node[ expando ] = {} );
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- ( outerCache[ node.uniqueID ] = {} );
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex;
- }
-
- // xml :nth-child(...)
- // or :nth-last-child(...) or :nth(-last)?-of-type(...)
- if ( diff === false ) {
-
- // Use the same loop as above to seek `elem` from the start
- while ( ( node = ++nodeIndex && node && node[ dir ] ||
- ( diff = nodeIndex = 0 ) || start.pop() ) ) {
-
- if ( ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) &&
- ++diff ) {
-
- // Cache the index of each encountered element
- if ( useCache ) {
- outerCache = node[ expando ] ||
- ( node[ expando ] = {} );
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- ( outerCache[ node.uniqueID ] = {} );
-
- uniqueCache[ type ] = [ dirruns, diff ];
- }
-
- if ( node === elem ) {
- break;
- }
- }
- }
- }
- }
-
- // Incorporate the offset, then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
-
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction( function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf( seed, matched[ i ] );
- seed[ idx ] = !( matches[ idx ] = matched[ i ] );
- }
- } ) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
-
- // Potentially complex pseudos
- "not": markFunction( function( selector ) {
-
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction( function( seed, matches, _context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( ( elem = unmatched[ i ] ) ) {
- seed[ i ] = !( matches[ i ] = elem );
- }
- }
- } ) :
- function( elem, _context, xml ) {
- input[ 0 ] = elem;
- matcher( input, null, xml, results );
-
- // Don't keep the element (issue #299)
- input[ 0 ] = null;
- return !results.pop();
- };
- } ),
-
- "has": markFunction( function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- } ),
-
- "contains": markFunction( function( text ) {
- text = text.replace( runescape, funescape );
- return function( elem ) {
- return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
- };
- } ),
-
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // http://www.w3.org/TR/selectors/#lang-pseudo
- "lang": markFunction( function( lang ) {
-
- // lang value must be a valid identifier
- if ( !ridentifier.test( lang || "" ) ) {
- Sizzle.error( "unsupported lang: " + lang );
- }
- lang = lang.replace( runescape, funescape ).toLowerCase();
- return function( elem ) {
- var elemLang;
- do {
- if ( ( elemLang = documentIsHTML ?
- elem.lang :
- elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
-
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
- }
- } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
- return false;
- };
- } ),
-
- // Miscellaneous
- "target": function( elem ) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice( 1 ) === elem.id;
- },
-
- "root": function( elem ) {
- return elem === docElem;
- },
-
- "focus": function( elem ) {
- return elem === document.activeElement &&
- ( !document.hasFocus || document.hasFocus() ) &&
- !!( elem.type || elem.href || ~elem.tabIndex );
- },
-
- // Boolean properties
- "enabled": createDisabledPseudo( false ),
- "disabled": createDisabledPseudo( true ),
-
- "checked": function( elem ) {
-
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return ( nodeName === "input" && !!elem.checked ) ||
- ( nodeName === "option" && !!elem.selected );
- },
-
- "selected": function( elem ) {
-
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- // eslint-disable-next-line no-unused-expressions
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- // Contents
- "empty": function( elem ) {
-
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
- // but not by others (comment: 8; processing instruction: 7; etc.)
- // nodeType < 6 works because attributes (2) do not appear as children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- if ( elem.nodeType < 6 ) {
- return false;
- }
- }
- return true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos[ "empty" ]( elem );
- },
-
- // Element/input types
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "text": function( elem ) {
- var attr;
- return elem.nodeName.toLowerCase() === "input" &&
- elem.type === "text" &&
-
- // Support: IE<8
- // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
- ( ( attr = elem.getAttribute( "type" ) ) == null ||
- attr.toLowerCase() === "text" );
- },
-
- // Position-in-collection
- "first": createPositionalPseudo( function() {
- return [ 0 ];
- } ),
-
- "last": createPositionalPseudo( function( _matchIndexes, length ) {
- return [ length - 1 ];
- } ),
-
- "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- } ),
-
- "even": createPositionalPseudo( function( matchIndexes, length ) {
- var i = 0;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- } ),
-
- "odd": createPositionalPseudo( function( matchIndexes, length ) {
- var i = 1;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- } ),
-
- "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
- var i = argument < 0 ?
- argument + length :
- argument > length ?
- length :
- argument;
- for ( ; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- } ),
-
- "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- } )
- }
- };
-
- Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
-
- // Add button/input type pseudos
- for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
- Expr.pseudos[ i ] = createInputPseudo( i );
- }
- for ( i in { submit: true, reset: true } ) {
- Expr.pseudos[ i ] = createButtonPseudo( i );
- }
-
- // Easy API for creating new setFilters
- function setFilters() {}
- setFilters.prototype = Expr.filters = Expr.pseudos;
- Expr.setFilters = new setFilters();
-
- tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, preFilters,
- cached = tokenCache[ selector + " " ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
- if ( match ) {
-
- // Don't consume trailing commas as valid
- soFar = soFar.slice( match[ 0 ].length ) || soFar;
- }
- groups.push( ( tokens = [] ) );
- }
-
- matched = false;
-
- // Combinators
- if ( ( match = rcombinators.exec( soFar ) ) ) {
- matched = match.shift();
- tokens.push( {
- value: matched,
-
- // Cast descendant combinators to space
- type: match[ 0 ].replace( rtrim, " " )
- } );
- soFar = soFar.slice( matched.length );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
- ( match = preFilters[ type ]( match ) ) ) ) {
- matched = match.shift();
- tokens.push( {
- value: matched,
- type: type,
- matches: match
- } );
- soFar = soFar.slice( matched.length );
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
-
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
- };
-
- function toSelector( tokens ) {
- var i = 0,
- len = tokens.length,
- selector = "";
- for ( ; i < len; i++ ) {
- selector += tokens[ i ].value;
- }
- return selector;
- }
-
- function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- skip = combinator.next,
- key = skip || dir,
- checkNonElements = base && key === "parentNode",
- doneName = done++;
-
- return combinator.first ?
-
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( ( elem = elem[ dir ] ) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- return matcher( elem, context, xml );
- }
- }
- return false;
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- var oldCache, uniqueCache, outerCache,
- newCache = [ dirruns, doneName ];
-
- // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
- if ( xml ) {
- while ( ( elem = elem[ dir ] ) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- if ( matcher( elem, context, xml ) ) {
- return true;
- }
- }
- }
- } else {
- while ( ( elem = elem[ dir ] ) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- outerCache = elem[ expando ] || ( elem[ expando ] = {} );
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ elem.uniqueID ] ||
- ( outerCache[ elem.uniqueID ] = {} );
-
- if ( skip && skip === elem.nodeName.toLowerCase() ) {
- elem = elem[ dir ] || elem;
- } else if ( ( oldCache = uniqueCache[ key ] ) &&
- oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
- // Assign to newCache so results back-propagate to previous elements
- return ( newCache[ 2 ] = oldCache[ 2 ] );
- } else {
-
- // Reuse newcache so results back-propagate to previous elements
- uniqueCache[ key ] = newCache;
-
- // A match means we're done; a fail means we have to keep checking
- if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
- return true;
- }
- }
- }
- }
- }
- return false;
- };
- }
-
- function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[ i ]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[ 0 ];
- }
-
- function multipleContexts( selector, contexts, results ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[ i ], results );
- }
- return results;
- }
-
- function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( ( elem = unmatched[ i ] ) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
- }
-
- function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction( function( seed, results, context, xml ) {
- var temp, i, elem,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts(
- selector || "*",
- context.nodeType ? [ context ] : context,
- []
- ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
-
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- temp = condense( matcherOut, postMap );
- postFilter( temp, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = temp.length;
- while ( i-- ) {
- if ( ( elem = temp[ i ] ) ) {
- matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
- }
- }
- }
-
- if ( seed ) {
- if ( postFinder || preFilter ) {
- if ( postFinder ) {
-
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
- temp = [];
- i = matcherOut.length;
- while ( i-- ) {
- if ( ( elem = matcherOut[ i ] ) ) {
-
- // Restore matcherIn since elem is not yet a final match
- temp.push( ( matcherIn[ i ] = elem ) );
- }
- }
- postFinder( null, ( matcherOut = [] ), temp, xml );
- }
-
- // Move matched elements from seed to results to keep them synchronized
- i = matcherOut.length;
- while ( i-- ) {
- if ( ( elem = matcherOut[ i ] ) &&
- ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
-
- seed[ temp ] = !( results[ temp ] = elem );
- }
- }
- }
-
- // Add elements to results, through postFinder if defined
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- } );
- }
-
- function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[ 0 ].type ],
- implicitRelative = leadingRelative || Expr.relative[ " " ],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- ( checkContext = context ).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
-
- // Avoid hanging onto element (issue #299)
- checkContext = null;
- return ret;
- } ];
-
- for ( ; i < len; i++ ) {
- if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
- matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
- } else {
- matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
-
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[ j ].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && toSelector(
-
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens
- .slice( 0, i - 1 )
- .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
- ).replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
- j < len && toSelector( tokens )
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
- }
-
- function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, outermost ) {
- var elem, j, matcher,
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- setMatched = [],
- contextBackup = outermostContext,
-
- // We must always have either seed elements or outermost context
- elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
-
- // Use integer dirruns iff this is the outermost matcher
- dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
- len = elems.length;
-
- if ( outermost ) {
-
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- outermostContext = context == document || context || outermost;
- }
-
- // Add elements passing elementMatchers directly to results
- // Support: IE<9, Safari
- // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
- for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
- if ( byElement && elem ) {
- j = 0;
-
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- if ( !context && elem.ownerDocument != document ) {
- setDocument( elem );
- xml = !documentIsHTML;
- }
- while ( ( matcher = elementMatchers[ j++ ] ) ) {
- if ( matcher( elem, context || document, xml ) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
-
- // They will have gone through all possible matchers
- if ( ( elem = !matcher && elem ) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // `i` is now the count of elements visited above, and adding it to `matchedCount`
- // makes the latter nonnegative.
- matchedCount += i;
-
- // Apply set filters to unmatched elements
- // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
- // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
- // no element matchers and no seed.
- // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
- // case, which will result in a "00" `matchedCount` that differs from `i` but is also
- // numerically zero.
- if ( bySet && i !== matchedCount ) {
- j = 0;
- while ( ( matcher = setMatchers[ j++ ] ) ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
-
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
- setMatched[ i ] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
- }
-
- compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ selector + " " ];
-
- if ( !cached ) {
-
- // Generate a function of recursive functions that can be used to check each element
- if ( !match ) {
- match = tokenize( selector );
- }
- i = match.length;
- while ( i-- ) {
- cached = matcherFromTokens( match[ i ] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache(
- selector,
- matcherFromGroupMatchers( elementMatchers, setMatchers )
- );
-
- // Save selector and tokenization
- cached.selector = selector;
- }
- return cached;
- };
-
- /**
- * A low-level selection function that works with Sizzle's compiled
- * selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- * selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
- select = Sizzle.select = function( selector, context, results, seed ) {
- var i, tokens, token, type, find,
- compiled = typeof selector === "function" && selector,
- match = !seed && tokenize( ( selector = compiled.selector || selector ) );
-
- results = results || [];
-
- // Try to minimize operations if there is only one selector in the list and no seed
- // (the latter of which guarantees us context)
- if ( match.length === 1 ) {
-
- // Reduce context if the leading compound selector is an ID
- tokens = match[ 0 ] = match[ 0 ].slice( 0 );
- if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
- context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
-
- context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
- .replace( runescape, funescape ), context ) || [] )[ 0 ];
- if ( !context ) {
- return results;
-
- // Precompiled matchers will still verify ancestry, so step up a level
- } else if ( compiled ) {
- context = context.parentNode;
- }
-
- selector = selector.slice( tokens.shift().value.length );
- }
-
- // Fetch a seed set for right-to-left matching
- i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
- while ( i-- ) {
- token = tokens[ i ];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ ( type = token.type ) ] ) {
- break;
- }
- if ( ( find = Expr.find[ type ] ) ) {
-
- // Search, expanding context for leading sibling combinators
- if ( ( seed = find(
- token.matches[ 0 ].replace( runescape, funescape ),
- rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
- context
- ) ) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && toSelector( tokens );
- if ( !selector ) {
- push.apply( results, seed );
- return results;
- }
-
- break;
- }
- }
- }
- }
-
- // Compile and execute a filtering function if one is not provided
- // Provide `match` to avoid retokenization if we modified the selector above
- ( compiled || compile( selector, match ) )(
- seed,
- context,
- !documentIsHTML,
- results,
- !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
- );
- return results;
- };
-
- // One-time assignments
-
- // Sort stability
- support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
-
- // Support: Chrome 14-35+
- // Always assume duplicates if they aren't passed to the comparison function
- support.detectDuplicates = !!hasDuplicate;
-
- // Initialize against the default document
- setDocument();
-
- // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
- // Detached nodes confoundingly follow *each other*
- support.sortDetached = assert( function( el ) {
-
- // Should return 1, but returns 4 (following)
- return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
- } );
-
- // Support: IE<8
- // Prevent attribute/property "interpolation"
- // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
- if ( !assert( function( el ) {
- el.innerHTML = "<a href='#'></a>";
- return el.firstChild.getAttribute( "href" ) === "#";
- } ) ) {
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
- }
- } );
- }
-
- // Support: IE<9
- // Use defaultValue in place of getAttribute("value")
- if ( !support.attributes || !assert( function( el ) {
- el.innerHTML = "<input/>";
- el.firstChild.setAttribute( "value", "" );
- return el.firstChild.getAttribute( "value" ) === "";
- } ) ) {
- addHandle( "value", function( elem, _name, isXML ) {
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
- return elem.defaultValue;
- }
- } );
- }
-
- // Support: IE<9
- // Use getAttributeNode to fetch booleans when getAttribute lies
- if ( !assert( function( el ) {
- return el.getAttribute( "disabled" ) == null;
- } ) ) {
- addHandle( booleans, function( elem, name, isXML ) {
- var val;
- if ( !isXML ) {
- return elem[ name ] === true ? name.toLowerCase() :
- ( val = elem.getAttributeNode( name ) ) && val.specified ?
- val.value :
- null;
- }
- } );
- }
-
- return Sizzle;
-
- } )( window );
-
-
-
- jQuery.find = Sizzle;
- jQuery.expr = Sizzle.selectors;
-
- // Deprecated
- jQuery.expr[ ":" ] = jQuery.expr.pseudos;
- jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
- jQuery.text = Sizzle.getText;
- jQuery.isXMLDoc = Sizzle.isXML;
- jQuery.contains = Sizzle.contains;
- jQuery.escapeSelector = Sizzle.escape;
-
-
-
-
- var dir = function( elem, dir, until ) {
- var matched = [],
- truncate = until !== undefined;
-
- while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
- if ( elem.nodeType === 1 ) {
- if ( truncate && jQuery( elem ).is( until ) ) {
- break;
- }
- matched.push( elem );
- }
- }
- return matched;
- };
-
-
- var siblings = function( n, elem ) {
- var matched = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- matched.push( n );
- }
- }
-
- return matched;
- };
-
-
- var rneedsContext = jQuery.expr.match.needsContext;
-
-
-
- function nodeName( elem, name ) {
-
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-
- }var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
-
-
-
- // Implement the identical functionality for filter and not
- function winnow( elements, qualifier, not ) {
- if ( isFunction( qualifier ) ) {
- return jQuery.grep( elements, function( elem, i ) {
- return !!qualifier.call( elem, i, elem ) !== not;
- } );
- }
-
- // Single element
- if ( qualifier.nodeType ) {
- return jQuery.grep( elements, function( elem ) {
- return ( elem === qualifier ) !== not;
- } );
- }
-
- // Arraylike of elements (jQuery, arguments, Array)
- if ( typeof qualifier !== "string" ) {
- return jQuery.grep( elements, function( elem ) {
- return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
- } );
- }
-
- // Filtered directly for both simple and complex selectors
- return jQuery.filter( qualifier, elements, not );
- }
-
- jQuery.filter = function( expr, elems, not ) {
- var elem = elems[ 0 ];
-
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- if ( elems.length === 1 && elem.nodeType === 1 ) {
- return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
- }
-
- return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
- return elem.nodeType === 1;
- } ) );
- };
-
- jQuery.fn.extend( {
- find: function( selector ) {
- var i, ret,
- len = this.length,
- self = this;
-
- if ( typeof selector !== "string" ) {
- return this.pushStack( jQuery( selector ).filter( function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- } ) );
- }
-
- ret = this.pushStack( [] );
-
- for ( i = 0; i < len; i++ ) {
- jQuery.find( selector, self[ i ], ret );
- }
-
- return len > 1 ? jQuery.uniqueSort( ret ) : ret;
- },
- filter: function( selector ) {
- return this.pushStack( winnow( this, selector || [], false ) );
- },
- not: function( selector ) {
- return this.pushStack( winnow( this, selector || [], true ) );
- },
- is: function( selector ) {
- return !!winnow(
- this,
-
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test( selector ) ?
- jQuery( selector ) :
- selector || [],
- false
- ).length;
- }
- } );
-
-
- // Initialize a jQuery object
-
-
- // A central reference to the root jQuery(document)
- var rootjQuery,
-
- // A simple way to check for HTML strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
- // Shortcut simple #id case for speed
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
-
- init = jQuery.fn.init = function( selector, context, root ) {
- var match, elem;
-
- // HANDLE: $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Method init() accepts an alternate rootjQuery
- // so migrate can support jQuery.sub (gh-2101)
- root = root || rootjQuery;
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector[ 0 ] === "<" &&
- selector[ selector.length - 1 ] === ">" &&
- selector.length >= 3 ) {
-
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && ( match[ 1 ] || !context ) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[ 1 ] ) {
- context = context instanceof jQuery ? context[ 0 ] : context;
-
- // Option to run scripts is true for back-compat
- // Intentionally let the error be thrown if parseHTML is not present
- jQuery.merge( this, jQuery.parseHTML(
- match[ 1 ],
- context && context.nodeType ? context.ownerDocument || context : document,
- true
- ) );
-
- // HANDLE: $(html, props)
- if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
- for ( match in context ) {
-
- // Properties of context are called as methods if possible
- if ( isFunction( this[ match ] ) ) {
- this[ match ]( context[ match ] );
-
- // ...and otherwise set as attributes
- } else {
- this.attr( match, context[ match ] );
- }
- }
- }
-
- return this;
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[ 2 ] );
-
- if ( elem ) {
-
- // Inject the element directly into the jQuery object
- this[ 0 ] = elem;
- this.length = 1;
- }
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || root ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(DOMElement)
- } else if ( selector.nodeType ) {
- this[ 0 ] = selector;
- this.length = 1;
- return this;
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( isFunction( selector ) ) {
- return root.ready !== undefined ?
- root.ready( selector ) :
-
- // Execute immediately if ready is not present
- selector( jQuery );
- }
-
- return jQuery.makeArray( selector, this );
- };
-
- // Give the init function the jQuery prototype for later instantiation
- init.prototype = jQuery.fn;
-
- // Initialize central reference
- rootjQuery = jQuery( document );
-
-
- var rparentsprev = /^(?:parents|prev(?:Until|All))/,
-
- // Methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
- jQuery.fn.extend( {
- has: function( target ) {
- var targets = jQuery( target, this ),
- l = targets.length;
-
- return this.filter( function() {
- var i = 0;
- for ( ; i < l; i++ ) {
- if ( jQuery.contains( this, targets[ i ] ) ) {
- return true;
- }
- }
- } );
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- matched = [],
- targets = typeof selectors !== "string" && jQuery( selectors );
-
- // Positional selectors never match, since there's no _selection_ context
- if ( !rneedsContext.test( selectors ) ) {
- for ( ; i < l; i++ ) {
- for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
-
- // Always skip document fragments
- if ( cur.nodeType < 11 && ( targets ?
- targets.index( cur ) > -1 :
-
- // Don't pass non-elements to Sizzle
- cur.nodeType === 1 &&
- jQuery.find.matchesSelector( cur, selectors ) ) ) {
-
- matched.push( cur );
- break;
- }
- }
- }
- }
-
- return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
- },
-
- // Determine the position of an element within the set
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
- }
-
- // Index in selector
- if ( typeof elem === "string" ) {
- return indexOf.call( jQuery( elem ), this[ 0 ] );
- }
-
- // Locate the position of the desired element
- return indexOf.call( this,
-
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[ 0 ] : elem
- );
- },
-
- add: function( selector, context ) {
- return this.pushStack(
- jQuery.uniqueSort(
- jQuery.merge( this.get(), jQuery( selector, context ) )
- )
- );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter( selector )
- );
- }
- } );
-
- function sibling( cur, dir ) {
- while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
- return cur;
- }
-
- jQuery.each( {
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, _i, until ) {
- return dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, _i, until ) {
- return dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, _i, until ) {
- return dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return siblings( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return siblings( elem.firstChild );
- },
- contents: function( elem ) {
- if ( elem.contentDocument != null &&
-
- // Support: IE 11+
- // <object> elements with no `data` attribute has an object
- // `contentDocument` with a `null` prototype.
- getProto( elem.contentDocument ) ) {
-
- return elem.contentDocument;
- }
-
- // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
- // Treat the template element as a regular one in browsers that
- // don't support it.
- if ( nodeName( elem, "template" ) ) {
- elem = elem.content || elem;
- }
-
- return jQuery.merge( [], elem.childNodes );
- }
- }, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var matched = jQuery.map( this, fn, until );
-
- if ( name.slice( -5 ) !== "Until" ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- matched = jQuery.filter( selector, matched );
- }
-
- if ( this.length > 1 ) {
-
- // Remove duplicates
- if ( !guaranteedUnique[ name ] ) {
- jQuery.uniqueSort( matched );
- }
-
- // Reverse order for parents* and prev-derivatives
- if ( rparentsprev.test( name ) ) {
- matched.reverse();
- }
- }
-
- return this.pushStack( matched );
- };
- } );
- var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
-
-
-
- // Convert String-formatted options into Object-formatted ones
- function createOptions( options ) {
- var object = {};
- jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
- object[ flag ] = true;
- } );
- return object;
- }
-
- /*
- * Create a callback list using the following parameters:
- *
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
- jQuery.Callbacks = function( options ) {
-
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- createOptions( options ) :
- jQuery.extend( {}, options );
-
- var // Flag to know if list is currently firing
- firing,
-
- // Last fire value for non-forgettable lists
- memory,
-
- // Flag to know if list was already fired
- fired,
-
- // Flag to prevent firing
- locked,
-
- // Actual callback list
- list = [],
-
- // Queue of execution data for repeatable lists
- queue = [],
-
- // Index of currently firing callback (modified by add/remove as needed)
- firingIndex = -1,
-
- // Fire callbacks
- fire = function() {
-
- // Enforce single-firing
- locked = locked || options.once;
-
- // Execute callbacks for all pending executions,
- // respecting firingIndex overrides and runtime changes
- fired = firing = true;
- for ( ; queue.length; firingIndex = -1 ) {
- memory = queue.shift();
- while ( ++firingIndex < list.length ) {
-
- // Run callback and check for early termination
- if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
- options.stopOnFalse ) {
-
- // Jump to end and forget the data so .add doesn't re-fire
- firingIndex = list.length;
- memory = false;
- }
- }
- }
-
- // Forget the data if we're done with it
- if ( !options.memory ) {
- memory = false;
- }
-
- firing = false;
-
- // Clean up if we're done firing for good
- if ( locked ) {
-
- // Keep an empty list if we have data for future add calls
- if ( memory ) {
- list = [];
-
- // Otherwise, this object is spent
- } else {
- list = "";
- }
- }
- },
-
- // Actual Callbacks object
- self = {
-
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
-
- // If we have memory from a past run, we should fire after adding
- if ( memory && !firing ) {
- firingIndex = list.length - 1;
- queue.push( memory );
- }
-
- ( function add( args ) {
- jQuery.each( args, function( _, arg ) {
- if ( isFunction( arg ) ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && toType( arg ) !== "string" ) {
-
- // Inspect recursively
- add( arg );
- }
- } );
- } )( arguments );
-
- if ( memory && !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Remove a callback from the list
- remove: function() {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
-
- // Handle firing indexes
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- } );
- return this;
- },
-
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function( fn ) {
- return fn ?
- jQuery.inArray( fn, list ) > -1 :
- list.length > 0;
- },
-
- // Remove all callbacks from the list
- empty: function() {
- if ( list ) {
- list = [];
- }
- return this;
- },
-
- // Disable .fire and .add
- // Abort any current/pending executions
- // Clear all callbacks and values
- disable: function() {
- locked = queue = [];
- list = memory = "";
- return this;
- },
- disabled: function() {
- return !list;
- },
-
- // Disable .fire
- // Also disable .add unless we have memory (since it would have no effect)
- // Abort any pending executions
- lock: function() {
- locked = queue = [];
- if ( !memory && !firing ) {
- list = memory = "";
- }
- return this;
- },
- locked: function() {
- return !!locked;
- },
-
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( !locked ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- queue.push( args );
- if ( !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
-
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
- };
-
-
- function Identity( v ) {
- return v;
- }
- function Thrower( ex ) {
- throw ex;
- }
-
- function adoptValue( value, resolve, reject, noValue ) {
- var method;
-
- try {
-
- // Check for promise aspect first to privilege synchronous behavior
- if ( value && isFunction( ( method = value.promise ) ) ) {
- method.call( value ).done( resolve ).fail( reject );
-
- // Other thenables
- } else if ( value && isFunction( ( method = value.then ) ) ) {
- method.call( value, resolve, reject );
-
- // Other non-thenables
- } else {
-
- // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
- // * false: [ value ].slice( 0 ) => resolve( value )
- // * true: [ value ].slice( 1 ) => resolve()
- resolve.apply( undefined, [ value ].slice( noValue ) );
- }
-
- // For Promises/A+, convert exceptions into rejections
- // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
- // Deferred#then to conditionally suppress rejection.
- } catch ( value ) {
-
- // Support: Android 4.0 only
- // Strict mode functions invoked without .call/.apply get global-object context
- reject.apply( undefined, [ value ] );
- }
- }
-
- jQuery.extend( {
-
- Deferred: function( func ) {
- var tuples = [
-
- // action, add listener, callbacks,
- // ... .then handlers, argument index, [final state]
- [ "notify", "progress", jQuery.Callbacks( "memory" ),
- jQuery.Callbacks( "memory" ), 2 ],
- [ "resolve", "done", jQuery.Callbacks( "once memory" ),
- jQuery.Callbacks( "once memory" ), 0, "resolved" ],
- [ "reject", "fail", jQuery.Callbacks( "once memory" ),
- jQuery.Callbacks( "once memory" ), 1, "rejected" ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- "catch": function( fn ) {
- return promise.then( null, fn );
- },
-
- // Keep pipe for back-compat
- pipe: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
-
- return jQuery.Deferred( function( newDefer ) {
- jQuery.each( tuples, function( _i, tuple ) {
-
- // Map tuples (progress, done, fail) to arguments (done, fail, progress)
- var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
-
- // deferred.progress(function() { bind to newDefer or newDefer.notify })
- // deferred.done(function() { bind to newDefer or newDefer.resolve })
- // deferred.fail(function() { bind to newDefer or newDefer.reject })
- deferred[ tuple[ 1 ] ]( function() {
- var returned = fn && fn.apply( this, arguments );
- if ( returned && isFunction( returned.promise ) ) {
- returned.promise()
- .progress( newDefer.notify )
- .done( newDefer.resolve )
- .fail( newDefer.reject );
- } else {
- newDefer[ tuple[ 0 ] + "With" ](
- this,
- fn ? [ returned ] : arguments
- );
- }
- } );
- } );
- fns = null;
- } ).promise();
- },
- then: function( onFulfilled, onRejected, onProgress ) {
- var maxDepth = 0;
- function resolve( depth, deferred, handler, special ) {
- return function() {
- var that = this,
- args = arguments,
- mightThrow = function() {
- var returned, then;
-
- // Support: Promises/A+ section 2.3.3.3.3
- // https://promisesaplus.com/#point-59
- // Ignore double-resolution attempts
- if ( depth < maxDepth ) {
- return;
- }
-
- returned = handler.apply( that, args );
-
- // Support: Promises/A+ section 2.3.1
- // https://promisesaplus.com/#point-48
- if ( returned === deferred.promise() ) {
- throw new TypeError( "Thenable self-resolution" );
- }
-
- // Support: Promises/A+ sections 2.3.3.1, 3.5
- // https://promisesaplus.com/#point-54
- // https://promisesaplus.com/#point-75
- // Retrieve `then` only once
- then = returned &&
-
- // Support: Promises/A+ section 2.3.4
- // https://promisesaplus.com/#point-64
- // Only check objects and functions for thenability
- ( typeof returned === "object" ||
- typeof returned === "function" ) &&
- returned.then;
-
- // Handle a returned thenable
- if ( isFunction( then ) ) {
-
- // Special processors (notify) just wait for resolution
- if ( special ) {
- then.call(
- returned,
- resolve( maxDepth, deferred, Identity, special ),
- resolve( maxDepth, deferred, Thrower, special )
- );
-
- // Normal processors (resolve) also hook into progress
- } else {
-
- // ...and disregard older resolution values
- maxDepth++;
-
- then.call(
- returned,
- resolve( maxDepth, deferred, Identity, special ),
- resolve( maxDepth, deferred, Thrower, special ),
- resolve( maxDepth, deferred, Identity,
- deferred.notifyWith )
- );
- }
-
- // Handle all other returned values
- } else {
-
- // Only substitute handlers pass on context
- // and multiple values (non-spec behavior)
- if ( handler !== Identity ) {
- that = undefined;
- args = [ returned ];
- }
-
- // Process the value(s)
- // Default process is resolve
- ( special || deferred.resolveWith )( that, args );
- }
- },
-
- // Only normal processors (resolve) catch and reject exceptions
- process = special ?
- mightThrow :
- function() {
- try {
- mightThrow();
- } catch ( e ) {
-
- if ( jQuery.Deferred.exceptionHook ) {
- jQuery.Deferred.exceptionHook( e,
- process.stackTrace );
- }
-
- // Support: Promises/A+ section 2.3.3.3.4.1
- // https://promisesaplus.com/#point-61
- // Ignore post-resolution exceptions
- if ( depth + 1 >= maxDepth ) {
-
- // Only substitute handlers pass on context
- // and multiple values (non-spec behavior)
- if ( handler !== Thrower ) {
- that = undefined;
- args = [ e ];
- }
-
- deferred.rejectWith( that, args );
- }
- }
- };
-
- // Support: Promises/A+ section 2.3.3.3.1
- // https://promisesaplus.com/#point-57
- // Re-resolve promises immediately to dodge false rejection from
- // subsequent errors
- if ( depth ) {
- process();
- } else {
-
- // Call an optional hook to record the stack, in case of exception
- // since it's otherwise lost when execution goes async
- if ( jQuery.Deferred.getStackHook ) {
- process.stackTrace = jQuery.Deferred.getStackHook();
- }
- window.setTimeout( process );
- }
- };
- }
-
- return jQuery.Deferred( function( newDefer ) {
-
- // progress_handlers.add( ... )
- tuples[ 0 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- isFunction( onProgress ) ?
- onProgress :
- Identity,
- newDefer.notifyWith
- )
- );
-
- // fulfilled_handlers.add( ... )
- tuples[ 1 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- isFunction( onFulfilled ) ?
- onFulfilled :
- Identity
- )
- );
-
- // rejected_handlers.add( ... )
- tuples[ 2 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- isFunction( onRejected ) ?
- onRejected :
- Thrower
- )
- );
- } ).promise();
- },
-
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 5 ];
-
- // promise.progress = list.add
- // promise.done = list.add
- // promise.fail = list.add
- promise[ tuple[ 1 ] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add(
- function() {
-
- // state = "resolved" (i.e., fulfilled)
- // state = "rejected"
- state = stateString;
- },
-
- // rejected_callbacks.disable
- // fulfilled_callbacks.disable
- tuples[ 3 - i ][ 2 ].disable,
-
- // rejected_handlers.disable
- // fulfilled_handlers.disable
- tuples[ 3 - i ][ 3 ].disable,
-
- // progress_callbacks.lock
- tuples[ 0 ][ 2 ].lock,
-
- // progress_handlers.lock
- tuples[ 0 ][ 3 ].lock
- );
- }
-
- // progress_handlers.fire
- // fulfilled_handlers.fire
- // rejected_handlers.fire
- list.add( tuple[ 3 ].fire );
-
- // deferred.notify = function() { deferred.notifyWith(...) }
- // deferred.resolve = function() { deferred.resolveWith(...) }
- // deferred.reject = function() { deferred.rejectWith(...) }
- deferred[ tuple[ 0 ] ] = function() {
- deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
- return this;
- };
-
- // deferred.notifyWith = list.fireWith
- // deferred.resolveWith = list.fireWith
- // deferred.rejectWith = list.fireWith
- deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
- } );
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( singleValue ) {
- var
-
- // count of uncompleted subordinates
- remaining = arguments.length,
-
- // count of unprocessed arguments
- i = remaining,
-
- // subordinate fulfillment data
- resolveContexts = Array( i ),
- resolveValues = slice.call( arguments ),
-
- // the master Deferred
- master = jQuery.Deferred(),
-
- // subordinate callback factory
- updateFunc = function( i ) {
- return function( value ) {
- resolveContexts[ i ] = this;
- resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
- if ( !( --remaining ) ) {
- master.resolveWith( resolveContexts, resolveValues );
- }
- };
- };
-
- // Single- and empty arguments are adopted like Promise.resolve
- if ( remaining <= 1 ) {
- adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
- !remaining );
-
- // Use .then() to unwrap secondary thenables (cf. gh-3000)
- if ( master.state() === "pending" ||
- isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
-
- return master.then();
- }
- }
-
- // Multiple arguments are aggregated like Promise.all array elements
- while ( i-- ) {
- adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
- }
-
- return master.promise();
- }
- } );
-
-
- // These usually indicate a programmer mistake during development,
- // warn about them ASAP rather than swallowing them by default.
- var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
-
- jQuery.Deferred.exceptionHook = function( error, stack ) {
-
- // Support: IE 8 - 9 only
- // Console exists when dev tools are open, which can happen at any time
- if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
- window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
- }
- };
-
-
-
-
- jQuery.readyException = function( error ) {
- window.setTimeout( function() {
- throw error;
- } );
- };
-
-
-
-
- // The deferred used on DOM ready
- var readyList = jQuery.Deferred();
-
- jQuery.fn.ready = function( fn ) {
-
- readyList
- .then( fn )
-
- // Wrap jQuery.readyException in a function so that the lookup
- // happens at the time of error handling instead of callback
- // registration.
- .catch( function( error ) {
- jQuery.readyException( error );
- } );
-
- return this;
- };
-
- jQuery.extend( {
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
- }
- } );
-
- jQuery.ready.then = readyList.then;
-
- // The ready event handler and self cleanup method
- function completed() {
- document.removeEventListener( "DOMContentLoaded", completed );
- window.removeEventListener( "load", completed );
- jQuery.ready();
- }
-
- // Catch cases where $(document).ready() is called
- // after the browser event has already occurred.
- // Support: IE <=9 - 10 only
- // Older IE sometimes signals "interactive" too soon
- if ( document.readyState === "complete" ||
- ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
-
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- window.setTimeout( jQuery.ready );
-
- } else {
-
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", completed );
- }
-
-
-
-
- // Multifunctional method to get and set values of a collection
- // The value/s can optionally be executed if it's a function
- var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
- var i = 0,
- len = elems.length,
- bulk = key == null;
-
- // Sets many values
- if ( toType( key ) === "object" ) {
- chainable = true;
- for ( i in key ) {
- access( elems, fn, i, key[ i ], true, emptyGet, raw );
- }
-
- // Sets one value
- } else if ( value !== undefined ) {
- chainable = true;
-
- if ( !isFunction( value ) ) {
- raw = true;
- }
-
- if ( bulk ) {
-
- // Bulk operations run against the entire set
- if ( raw ) {
- fn.call( elems, value );
- fn = null;
-
- // ...except when executing function values
- } else {
- bulk = fn;
- fn = function( elem, _key, value ) {
- return bulk.call( jQuery( elem ), value );
- };
- }
- }
-
- if ( fn ) {
- for ( ; i < len; i++ ) {
- fn(
- elems[ i ], key, raw ?
- value :
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
- );
- }
- }
- }
-
- if ( chainable ) {
- return elems;
- }
-
- // Gets
- if ( bulk ) {
- return fn.call( elems );
- }
-
- return len ? fn( elems[ 0 ], key ) : emptyGet;
- };
-
-
- // Matches dashed string for camelizing
- var rmsPrefix = /^-ms-/,
- rdashAlpha = /-([a-z])/g;
-
- // Used by camelCase as callback to replace()
- function fcamelCase( _all, letter ) {
- return letter.toUpperCase();
- }
-
- // Convert dashed to camelCase; used by the css and data modules
- // Support: IE <=9 - 11, Edge 12 - 15
- // Microsoft forgot to hump their vendor prefix (#9572)
- function camelCase( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- }
- var acceptData = function( owner ) {
-
- // Accepts only:
- // - Node
- // - Node.ELEMENT_NODE
- // - Node.DOCUMENT_NODE
- // - Object
- // - Any
- return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
- };
-
-
-
-
- function Data() {
- this.expando = jQuery.expando + Data.uid++;
- }
-
- Data.uid = 1;
-
- Data.prototype = {
-
- cache: function( owner ) {
-
- // Check if the owner object already has a cache
- var value = owner[ this.expando ];
-
- // If not, create one
- if ( !value ) {
- value = {};
-
- // We can accept data for non-element nodes in modern browsers,
- // but we should not, see #8335.
- // Always return an empty object.
- if ( acceptData( owner ) ) {
-
- // If it is a node unlikely to be stringify-ed or looped over
- // use plain assignment
- if ( owner.nodeType ) {
- owner[ this.expando ] = value;
-
- // Otherwise secure it in a non-enumerable property
- // configurable must be true to allow the property to be
- // deleted when data is removed
- } else {
- Object.defineProperty( owner, this.expando, {
- value: value,
- configurable: true
- } );
- }
- }
- }
-
- return value;
- },
- set: function( owner, data, value ) {
- var prop,
- cache = this.cache( owner );
-
- // Handle: [ owner, key, value ] args
- // Always use camelCase key (gh-2257)
- if ( typeof data === "string" ) {
- cache[ camelCase( data ) ] = value;
-
- // Handle: [ owner, { properties } ] args
- } else {
-
- // Copy the properties one-by-one to the cache object
- for ( prop in data ) {
- cache[ camelCase( prop ) ] = data[ prop ];
- }
- }
- return cache;
- },
- get: function( owner, key ) {
- return key === undefined ?
- this.cache( owner ) :
-
- // Always use camelCase key (gh-2257)
- owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
- },
- access: function( owner, key, value ) {
-
- // In cases where either:
- //
- // 1. No key was specified
- // 2. A string key was specified, but no value provided
- //
- // Take the "read" path and allow the get method to determine
- // which value to return, respectively either:
- //
- // 1. The entire cache object
- // 2. The data stored at the key
- //
- if ( key === undefined ||
- ( ( key && typeof key === "string" ) && value === undefined ) ) {
-
- return this.get( owner, key );
- }
-
- // When the key is not a string, or both a key and value
- // are specified, set or extend (existing objects) with either:
- //
- // 1. An object of properties
- // 2. A key and value
- //
- this.set( owner, key, value );
-
- // Since the "set" path can have two possible entry points
- // return the expected data based on which path was taken[*]
- return value !== undefined ? value : key;
- },
- remove: function( owner, key ) {
- var i,
- cache = owner[ this.expando ];
-
- if ( cache === undefined ) {
- return;
- }
-
- if ( key !== undefined ) {
-
- // Support array or space separated string of keys
- if ( Array.isArray( key ) ) {
-
- // If key is an array of keys...
- // We always set camelCase keys, so remove that.
- key = key.map( camelCase );
- } else {
- key = camelCase( key );
-
- // If a key with the spaces exists, use it.
- // Otherwise, create an array by matching non-whitespace
- key = key in cache ?
- [ key ] :
- ( key.match( rnothtmlwhite ) || [] );
- }
-
- i = key.length;
-
- while ( i-- ) {
- delete cache[ key[ i ] ];
- }
- }
-
- // Remove the expando if there's no more data
- if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
-
- // Support: Chrome <=35 - 45
- // Webkit & Blink performance suffers when deleting properties
- // from DOM nodes, so set to undefined instead
- // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
- if ( owner.nodeType ) {
- owner[ this.expando ] = undefined;
- } else {
- delete owner[ this.expando ];
- }
- }
- },
- hasData: function( owner ) {
- var cache = owner[ this.expando ];
- return cache !== undefined && !jQuery.isEmptyObject( cache );
- }
- };
- var dataPriv = new Data();
-
- var dataUser = new Data();
-
-
-
- // Implementation Summary
- //
- // 1. Enforce API surface and semantic compatibility with 1.9.x branch
- // 2. Improve the module's maintainability by reducing the storage
- // paths to a single mechanism.
- // 3. Use the same single mechanism to support "private" and "user" data.
- // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
- // 5. Avoid exposing implementation details on user objects (eg. expando properties)
- // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
-
- var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- rmultiDash = /[A-Z]/g;
-
- function getData( data ) {
- if ( data === "true" ) {
- return true;
- }
-
- if ( data === "false" ) {
- return false;
- }
-
- if ( data === "null" ) {
- return null;
- }
-
- // Only convert to a number if it doesn't change the string
- if ( data === +data + "" ) {
- return +data;
- }
-
- if ( rbrace.test( data ) ) {
- return JSON.parse( data );
- }
-
- return data;
- }
-
- function dataAttr( elem, key, data ) {
- var name;
-
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
- name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = getData( data );
- } catch ( e ) {}
-
- // Make sure we set the data so it isn't changed later
- dataUser.set( elem, key, data );
- } else {
- data = undefined;
- }
- }
- return data;
- }
-
- jQuery.extend( {
- hasData: function( elem ) {
- return dataUser.hasData( elem ) || dataPriv.hasData( elem );
- },
-
- data: function( elem, name, data ) {
- return dataUser.access( elem, name, data );
- },
-
- removeData: function( elem, name ) {
- dataUser.remove( elem, name );
- },
-
- // TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to dataPriv methods, these can be deprecated.
- _data: function( elem, name, data ) {
- return dataPriv.access( elem, name, data );
- },
-
- _removeData: function( elem, name ) {
- dataPriv.remove( elem, name );
- }
- } );
-
- jQuery.fn.extend( {
- data: function( key, value ) {
- var i, name, data,
- elem = this[ 0 ],
- attrs = elem && elem.attributes;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = dataUser.get( elem );
-
- if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
- i = attrs.length;
- while ( i-- ) {
-
- // Support: IE 11 only
- // The attrs elements can be null (#14894)
- if ( attrs[ i ] ) {
- name = attrs[ i ].name;
- if ( name.indexOf( "data-" ) === 0 ) {
- name = camelCase( name.slice( 5 ) );
- dataAttr( elem, name, data[ name ] );
- }
- }
- }
- dataPriv.set( elem, "hasDataAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each( function() {
- dataUser.set( this, key );
- } );
- }
-
- return access( this, function( value ) {
- var data;
-
- // The calling jQuery object (element matches) is not empty
- // (and therefore has an element appears at this[ 0 ]) and the
- // `value` parameter was not undefined. An empty jQuery object
- // will result in `undefined` for elem = this[ 0 ] which will
- // throw an exception if an attempt to read a data cache is made.
- if ( elem && value === undefined ) {
-
- // Attempt to get data from the cache
- // The key will always be camelCased in Data
- data = dataUser.get( elem, key );
- if ( data !== undefined ) {
- return data;
- }
-
- // Attempt to "discover" the data in
- // HTML5 custom data-* attrs
- data = dataAttr( elem, key );
- if ( data !== undefined ) {
- return data;
- }
-
- // We tried really hard, but the data doesn't exist.
- return;
- }
-
- // Set the data...
- this.each( function() {
-
- // We always store the camelCased key
- dataUser.set( this, key, value );
- } );
- }, null, value, arguments.length > 1, null, true );
- },
-
- removeData: function( key ) {
- return this.each( function() {
- dataUser.remove( this, key );
- } );
- }
- } );
-
-
- jQuery.extend( {
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = dataPriv.get( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || Array.isArray( data ) ) {
- queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // Clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // Not public - generate a queueHooks object, or return the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
- empty: jQuery.Callbacks( "once memory" ).add( function() {
- dataPriv.remove( elem, [ type + "queue", key ] );
- } )
- } );
- }
- } );
-
- jQuery.fn.extend( {
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[ 0 ], type );
- }
-
- return data === undefined ?
- this :
- this.each( function() {
- var queue = jQuery.queue( this, type, data );
-
- // Ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- } );
- },
- dequeue: function( type ) {
- return this.each( function() {
- jQuery.dequeue( this, type );
- } );
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
-
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while ( i-- ) {
- tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
- } );
- var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
-
- var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
-
-
- var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
- var documentElement = document.documentElement;
-
-
-
- var isAttached = function( elem ) {
- return jQuery.contains( elem.ownerDocument, elem );
- },
- composed = { composed: true };
-
- // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
- // Check attachment across shadow DOM boundaries when possible (gh-3504)
- // Support: iOS 10.0-10.2 only
- // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
- // leading to errors. We need to check for `getRootNode`.
- if ( documentElement.getRootNode ) {
- isAttached = function( elem ) {
- return jQuery.contains( elem.ownerDocument, elem ) ||
- elem.getRootNode( composed ) === elem.ownerDocument;
- };
- }
- var isHiddenWithinTree = function( elem, el ) {
-
- // isHiddenWithinTree might be called from jQuery#filter function;
- // in that case, element will be second argument
- elem = el || elem;
-
- // Inline style trumps all
- return elem.style.display === "none" ||
- elem.style.display === "" &&
-
- // Otherwise, check computed style
- // Support: Firefox <=43 - 45
- // Disconnected elements can have computed display: none, so first confirm that elem is
- // in the document.
- isAttached( elem ) &&
-
- jQuery.css( elem, "display" ) === "none";
- };
-
-
-
- function adjustCSS( elem, prop, valueParts, tween ) {
- var adjusted, scale,
- maxIterations = 20,
- currentValue = tween ?
- function() {
- return tween.cur();
- } :
- function() {
- return jQuery.css( elem, prop, "" );
- },
- initial = currentValue(),
- unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
- // Starting value computation is required for potential unit mismatches
- initialInUnit = elem.nodeType &&
- ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
- rcssNum.exec( jQuery.css( elem, prop ) );
-
- if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
-
- // Support: Firefox <=54
- // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
- initial = initial / 2;
-
- // Trust units reported by jQuery.css
- unit = unit || initialInUnit[ 3 ];
-
- // Iteratively approximate from a nonzero starting point
- initialInUnit = +initial || 1;
-
- while ( maxIterations-- ) {
-
- // Evaluate and update our best guess (doubling guesses that zero out).
- // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
- jQuery.style( elem, prop, initialInUnit + unit );
- if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
- maxIterations = 0;
- }
- initialInUnit = initialInUnit / scale;
-
- }
-
- initialInUnit = initialInUnit * 2;
- jQuery.style( elem, prop, initialInUnit + unit );
-
- // Make sure we update the tween properties later on
- valueParts = valueParts || [];
- }
-
- if ( valueParts ) {
- initialInUnit = +initialInUnit || +initial || 0;
-
- // Apply relative offset (+=/-=) if specified
- adjusted = valueParts[ 1 ] ?
- initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
- +valueParts[ 2 ];
- if ( tween ) {
- tween.unit = unit;
- tween.start = initialInUnit;
- tween.end = adjusted;
- }
- }
- return adjusted;
- }
-
-
- var defaultDisplayMap = {};
-
- function getDefaultDisplay( elem ) {
- var temp,
- doc = elem.ownerDocument,
- nodeName = elem.nodeName,
- display = defaultDisplayMap[ nodeName ];
-
- if ( display ) {
- return display;
- }
-
- temp = doc.body.appendChild( doc.createElement( nodeName ) );
- display = jQuery.css( temp, "display" );
-
- temp.parentNode.removeChild( temp );
-
- if ( display === "none" ) {
- display = "block";
- }
- defaultDisplayMap[ nodeName ] = display;
-
- return display;
- }
-
- function showHide( elements, show ) {
- var display, elem,
- values = [],
- index = 0,
- length = elements.length;
-
- // Determine new display value for elements that need to change
- for ( ; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
-
- display = elem.style.display;
- if ( show ) {
-
- // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
- // check is required in this first loop unless we have a nonempty display value (either
- // inline or about-to-be-restored)
- if ( display === "none" ) {
- values[ index ] = dataPriv.get( elem, "display" ) || null;
- if ( !values[ index ] ) {
- elem.style.display = "";
- }
- }
- if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
- values[ index ] = getDefaultDisplay( elem );
- }
- } else {
- if ( display !== "none" ) {
- values[ index ] = "none";
-
- // Remember what we're overwriting
- dataPriv.set( elem, "display", display );
- }
- }
- }
-
- // Set the display of the elements in a second loop to avoid constant reflow
- for ( index = 0; index < length; index++ ) {
- if ( values[ index ] != null ) {
- elements[ index ].style.display = values[ index ];
- }
- }
-
- return elements;
- }
-
- jQuery.fn.extend( {
- show: function() {
- return showHide( this, true );
- },
- hide: function() {
- return showHide( this );
- },
- toggle: function( state ) {
- if ( typeof state === "boolean" ) {
- return state ? this.show() : this.hide();
- }
-
- return this.each( function() {
- if ( isHiddenWithinTree( this ) ) {
- jQuery( this ).show();
- } else {
- jQuery( this ).hide();
- }
- } );
- }
- } );
- var rcheckableType = ( /^(?:checkbox|radio)$/i );
-
- var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
-
- var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
-
-
-
- ( function() {
- var fragment = document.createDocumentFragment(),
- div = fragment.appendChild( document.createElement( "div" ) ),
- input = document.createElement( "input" );
-
- // Support: Android 4.0 - 4.3 only
- // Check state lost if the name is set (#11217)
- // Support: Windows Web Apps (WWA)
- // `name` and `type` must use .setAttribute for WWA (#14901)
- input.setAttribute( "type", "radio" );
- input.setAttribute( "checked", "checked" );
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
-
- // Support: Android <=4.1 only
- // Older WebKit doesn't clone checked state correctly in fragments
- support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: IE <=11 only
- // Make sure textarea (and checkbox) defaultValue is properly cloned
- div.innerHTML = "<textarea>x</textarea>";
- support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
-
- // Support: IE <=9 only
- // IE <=9 replaces <option> tags with their contents when inserted outside of
- // the select element.
- div.innerHTML = "<option></option>";
- support.option = !!div.lastChild;
- } )();
-
-
- // We have to close these tags to support XHTML (#13200)
- var wrapMap = {
-
- // XHTML parsers do not magically insert elements in the
- // same way that tag soup parsers do. So we cannot shorten
- // this by omitting <tbody> or other required elements.
- thead: [ 1, "<table>", "</table>" ],
- col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-
- _default: [ 0, "", "" ]
- };
-
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- wrapMap.th = wrapMap.td;
-
- // Support: IE <=9 only
- if ( !support.option ) {
- wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
- }
-
-
- function getAll( context, tag ) {
-
- // Support: IE <=9 - 11 only
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
- var ret;
-
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- ret = context.getElementsByTagName( tag || "*" );
-
- } else if ( typeof context.querySelectorAll !== "undefined" ) {
- ret = context.querySelectorAll( tag || "*" );
-
- } else {
- ret = [];
- }
-
- if ( tag === undefined || tag && nodeName( context, tag ) ) {
- return jQuery.merge( [ context ], ret );
- }
-
- return ret;
- }
-
-
- // Mark scripts as having already been evaluated
- function setGlobalEval( elems, refElements ) {
- var i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- dataPriv.set(
- elems[ i ],
- "globalEval",
- !refElements || dataPriv.get( refElements[ i ], "globalEval" )
- );
- }
- }
-
-
- var rhtml = /<|&#?\w+;/;
-
- function buildFragment( elems, context, scripts, selection, ignored ) {
- var elem, tmp, tag, wrap, attached, j,
- fragment = context.createDocumentFragment(),
- nodes = [],
- i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- elem = elems[ i ];
-
- if ( elem || elem === 0 ) {
-
- // Add nodes directly
- if ( toType( elem ) === "object" ) {
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
- // Convert non-html into a text node
- } else if ( !rhtml.test( elem ) ) {
- nodes.push( context.createTextNode( elem ) );
-
- // Convert html into DOM nodes
- } else {
- tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
-
- // Deserialize a standard representation
- tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
- wrap = wrapMap[ tag ] || wrapMap._default;
- tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
-
- // Descend through wrappers to the right content
- j = wrap[ 0 ];
- while ( j-- ) {
- tmp = tmp.lastChild;
- }
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, tmp.childNodes );
-
- // Remember the top-level container
- tmp = fragment.firstChild;
-
- // Ensure the created nodes are orphaned (#12392)
- tmp.textContent = "";
- }
- }
- }
-
- // Remove wrapper from fragment
- fragment.textContent = "";
-
- i = 0;
- while ( ( elem = nodes[ i++ ] ) ) {
-
- // Skip elements already in the context collection (trac-4087)
- if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
- if ( ignored ) {
- ignored.push( elem );
- }
- continue;
- }
-
- attached = isAttached( elem );
-
- // Append to fragment
- tmp = getAll( fragment.appendChild( elem ), "script" );
-
- // Preserve script evaluation history
- if ( attached ) {
- setGlobalEval( tmp );
- }
-
- // Capture executables
- if ( scripts ) {
- j = 0;
- while ( ( elem = tmp[ j++ ] ) ) {
- if ( rscriptType.test( elem.type || "" ) ) {
- scripts.push( elem );
- }
- }
- }
- }
-
- return fragment;
- }
-
-
- var
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
-
- function returnTrue() {
- return true;
- }
-
- function returnFalse() {
- return false;
- }
-
- // Support: IE <=9 - 11+
- // focus() and blur() are asynchronous, except when they are no-op.
- // So expect focus to be synchronous when the element is already active,
- // and blur to be synchronous when the element is not already active.
- // (focus and blur are always synchronous in other supported browsers,
- // this just defines when we can count on it).
- function expectSync( elem, type ) {
- return ( elem === safeActiveElement() ) === ( type === "focus" );
- }
-
- // Support: IE <=9 only
- // Accessing document.activeElement can throw unexpectedly
- // https://bugs.jquery.com/ticket/13393
- function safeActiveElement() {
- try {
- return document.activeElement;
- } catch ( err ) { }
- }
-
- function on( elem, types, selector, data, fn, one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
-
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) {
-
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- on( elem, type, selector, data, types[ type ], one );
- }
- return elem;
- }
-
- if ( data == null && fn == null ) {
-
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
-
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
-
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return elem;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
-
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
-
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return elem.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- } );
- }
-
- /*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
- jQuery.event = {
-
- global: {},
-
- add: function( elem, types, handler, data, selector ) {
-
- var handleObjIn, eventHandle, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.get( elem );
-
- // Only attach events to objects that accept data
- if ( !acceptData( elem ) ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Ensure that invalid selectors throw exceptions at attach time
- // Evaluate against documentElement in case elem is a non-element node (e.g., document)
- if ( selector ) {
- jQuery.find.matchesSelector( documentElement, selector );
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- if ( !( events = elemData.events ) ) {
- events = elemData.events = Object.create( null );
- }
- if ( !( eventHandle = elemData.handle ) ) {
- eventHandle = elemData.handle = function( e ) {
-
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
- jQuery.event.dispatch.apply( elem, arguments ) : undefined;
- };
- }
-
- // Handle multiple events separated by a space
- types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // There *must* be a type, no attaching namespace-only handlers
- if ( !type ) {
- continue;
- }
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend( {
- type: type,
- origType: origType,
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join( "." )
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- if ( !( handlers = events[ type ] ) ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener if the special events handler returns false
- if ( !special.setup ||
- special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- },
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var j, origCount, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
-
- if ( !elemData || !( events = elemData.events ) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector ? special.delegateType : special.bindType ) || type;
- handlers = events[ type ] || [];
- tmp = tmp[ 2 ] &&
- new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
-
- // Remove matching events
- origCount = j = handlers.length;
- while ( j-- ) {
- handleObj = handlers[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector ||
- selector === "**" && handleObj.selector ) ) {
- handlers.splice( j, 1 );
-
- if ( handleObj.selector ) {
- handlers.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( origCount && !handlers.length ) {
- if ( !special.teardown ||
- special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove data and the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- dataPriv.remove( elem, "handle events" );
- }
- },
-
- dispatch: function( nativeEvent ) {
-
- var i, j, ret, matched, handleObj, handlerQueue,
- args = new Array( arguments.length ),
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( nativeEvent ),
-
- handlers = (
- dataPriv.get( this, "events" ) || Object.create( null )
- )[ event.type ] || [],
- special = jQuery.event.special[ event.type ] || {};
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[ 0 ] = event;
-
- for ( i = 1; i < arguments.length; i++ ) {
- args[ i ] = arguments[ i ];
- }
-
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
- // Run delegates first; they may want to stop propagation beneath us
- i = 0;
- while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
- event.currentTarget = matched.elem;
-
- j = 0;
- while ( ( handleObj = matched.handlers[ j++ ] ) &&
- !event.isImmediatePropagationStopped() ) {
-
- // If the event is namespaced, then each handler is only invoked if it is
- // specially universal or its namespaces are a superset of the event's.
- if ( !event.rnamespace || handleObj.namespace === false ||
- event.rnamespace.test( handleObj.namespace ) ) {
-
- event.handleObj = handleObj;
- event.data = handleObj.data;
-
- ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
- handleObj.handler ).apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- if ( ( event.result = ret ) === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- handlers: function( event, handlers ) {
- var i, handleObj, sel, matchedHandlers, matchedSelectors,
- handlerQueue = [],
- delegateCount = handlers.delegateCount,
- cur = event.target;
-
- // Find delegate handlers
- if ( delegateCount &&
-
- // Support: IE <=9
- // Black-hole SVG <use> instance trees (trac-13180)
- cur.nodeType &&
-
- // Support: Firefox <=42
- // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
- // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
- // Support: IE 11 only
- // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
- !( event.type === "click" && event.button >= 1 ) ) {
-
- for ( ; cur !== this; cur = cur.parentNode || this ) {
-
- // Don't check non-elements (#13208)
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
- if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
- matchedHandlers = [];
- matchedSelectors = {};
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
-
- // Don't conflict with Object.prototype properties (#13203)
- sel = handleObj.selector + " ";
-
- if ( matchedSelectors[ sel ] === undefined ) {
- matchedSelectors[ sel ] = handleObj.needsContext ?
- jQuery( sel, this ).index( cur ) > -1 :
- jQuery.find( sel, this, null, [ cur ] ).length;
- }
- if ( matchedSelectors[ sel ] ) {
- matchedHandlers.push( handleObj );
- }
- }
- if ( matchedHandlers.length ) {
- handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- cur = this;
- if ( delegateCount < handlers.length ) {
- handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
- }
-
- return handlerQueue;
- },
-
- addProp: function( name, hook ) {
- Object.defineProperty( jQuery.Event.prototype, name, {
- enumerable: true,
- configurable: true,
-
- get: isFunction( hook ) ?
- function() {
- if ( this.originalEvent ) {
- return hook( this.originalEvent );
- }
- } :
- function() {
- if ( this.originalEvent ) {
- return this.originalEvent[ name ];
- }
- },
-
- set: function( value ) {
- Object.defineProperty( this, name, {
- enumerable: true,
- configurable: true,
- writable: true,
- value: value
- } );
- }
- } );
- },
-
- fix: function( originalEvent ) {
- return originalEvent[ jQuery.expando ] ?
- originalEvent :
- new jQuery.Event( originalEvent );
- },
-
- special: {
- load: {
-
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
- click: {
-
- // Utilize native event to ensure correct state for checkable inputs
- setup: function( data ) {
-
- // For mutual compressibility with _default, replace `this` access with a local var.
- // `|| data` is dead code meant only to preserve the variable through minification.
- var el = this || data;
-
- // Claim the first handler
- if ( rcheckableType.test( el.type ) &&
- el.click && nodeName( el, "input" ) ) {
-
- // dataPriv.set( el, "click", ... )
- leverageNative( el, "click", returnTrue );
- }
-
- // Return false to allow normal processing in the caller
- return false;
- },
- trigger: function( data ) {
-
- // For mutual compressibility with _default, replace `this` access with a local var.
- // `|| data` is dead code meant only to preserve the variable through minification.
- var el = this || data;
-
- // Force setup before triggering a click
- if ( rcheckableType.test( el.type ) &&
- el.click && nodeName( el, "input" ) ) {
-
- leverageNative( el, "click" );
- }
-
- // Return non-false to allow normal event-path propagation
- return true;
- },
-
- // For cross-browser consistency, suppress native .click() on links
- // Also prevent it if we're currently inside a leveraged native-event stack
- _default: function( event ) {
- var target = event.target;
- return rcheckableType.test( target.type ) &&
- target.click && nodeName( target, "input" ) &&
- dataPriv.get( target, "click" ) ||
- nodeName( target, "a" );
- }
- },
-
- beforeunload: {
- postDispatch: function( event ) {
-
- // Support: Firefox 20+
- // Firefox doesn't alert if the returnValue field is not set.
- if ( event.result !== undefined && event.originalEvent ) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- }
- };
-
- // Ensure the presence of an event listener that handles manually-triggered
- // synthetic events by interrupting progress until reinvoked in response to
- // *native* events that it fires directly, ensuring that state changes have
- // already occurred before other listeners are invoked.
- function leverageNative( el, type, expectSync ) {
-
- // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
- if ( !expectSync ) {
- if ( dataPriv.get( el, type ) === undefined ) {
- jQuery.event.add( el, type, returnTrue );
- }
- return;
- }
-
- // Register the controller as a special universal handler for all event namespaces
- dataPriv.set( el, type, false );
- jQuery.event.add( el, type, {
- namespace: false,
- handler: function( event ) {
- var notAsync, result,
- saved = dataPriv.get( this, type );
-
- if ( ( event.isTrigger & 1 ) && this[ type ] ) {
-
- // Interrupt processing of the outer synthetic .trigger()ed event
- // Saved data should be false in such cases, but might be a leftover capture object
- // from an async native handler (gh-4350)
- if ( !saved.length ) {
-
- // Store arguments for use when handling the inner native event
- // There will always be at least one argument (an event object), so this array
- // will not be confused with a leftover capture object.
- saved = slice.call( arguments );
- dataPriv.set( this, type, saved );
-
- // Trigger the native event and capture its result
- // Support: IE <=9 - 11+
- // focus() and blur() are asynchronous
- notAsync = expectSync( this, type );
- this[ type ]();
- result = dataPriv.get( this, type );
- if ( saved !== result || notAsync ) {
- dataPriv.set( this, type, false );
- } else {
- result = {};
- }
- if ( saved !== result ) {
-
- // Cancel the outer synthetic event
- event.stopImmediatePropagation();
- event.preventDefault();
- return result.value;
- }
-
- // If this is an inner synthetic event for an event with a bubbling surrogate
- // (focus or blur), assume that the surrogate already propagated from triggering the
- // native event and prevent that from happening again here.
- // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
- // bubbling surrogate propagates *after* the non-bubbling base), but that seems
- // less bad than duplication.
- } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
- event.stopPropagation();
- }
-
- // If this is a native event triggered above, everything is now in order
- // Fire an inner synthetic event with the original arguments
- } else if ( saved.length ) {
-
- // ...and capture the result
- dataPriv.set( this, type, {
- value: jQuery.event.trigger(
-
- // Support: IE <=9 - 11+
- // Extend with the prototype to reset the above stopImmediatePropagation()
- jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
- saved.slice( 1 ),
- this
- )
- } );
-
- // Abort handling of the native event
- event.stopImmediatePropagation();
- }
- }
- } );
- }
-
- jQuery.removeEvent = function( elem, type, handle ) {
-
- // This "if" is needed for plain objects
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle );
- }
- };
-
- jQuery.Event = function( src, props ) {
-
- // Allow instantiation without the 'new' keyword
- if ( !( this instanceof jQuery.Event ) ) {
- return new jQuery.Event( src, props );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = src.defaultPrevented ||
- src.defaultPrevented === undefined &&
-
- // Support: Android <=2.3 only
- src.returnValue === false ?
- returnTrue :
- returnFalse;
-
- // Create target properties
- // Support: Safari <=6 - 7 only
- // Target should not be a text node (#504, #13143)
- this.target = ( src.target && src.target.nodeType === 3 ) ?
- src.target.parentNode :
- src.target;
-
- this.currentTarget = src.currentTarget;
- this.relatedTarget = src.relatedTarget;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if ( props ) {
- jQuery.extend( this, props );
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || Date.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
- };
-
- // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
- // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
- jQuery.Event.prototype = {
- constructor: jQuery.Event,
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse,
- isSimulated: false,
-
- preventDefault: function() {
- var e = this.originalEvent;
-
- this.isDefaultPrevented = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.preventDefault();
- }
- },
- stopPropagation: function() {
- var e = this.originalEvent;
-
- this.isPropagationStopped = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.stopPropagation();
- }
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
-
- this.isImmediatePropagationStopped = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.stopImmediatePropagation();
- }
-
- this.stopPropagation();
- }
- };
-
- // Includes all common event props including KeyEvent and MouseEvent specific props
- jQuery.each( {
- altKey: true,
- bubbles: true,
- cancelable: true,
- changedTouches: true,
- ctrlKey: true,
- detail: true,
- eventPhase: true,
- metaKey: true,
- pageX: true,
- pageY: true,
- shiftKey: true,
- view: true,
- "char": true,
- code: true,
- charCode: true,
- key: true,
- keyCode: true,
- button: true,
- buttons: true,
- clientX: true,
- clientY: true,
- offsetX: true,
- offsetY: true,
- pointerId: true,
- pointerType: true,
- screenX: true,
- screenY: true,
- targetTouches: true,
- toElement: true,
- touches: true,
-
- which: function( event ) {
- var button = event.button;
-
- // Add which for key events
- if ( event.which == null && rkeyEvent.test( event.type ) ) {
- return event.charCode != null ? event.charCode : event.keyCode;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
- if ( button & 1 ) {
- return 1;
- }
-
- if ( button & 2 ) {
- return 3;
- }
-
- if ( button & 4 ) {
- return 2;
- }
-
- return 0;
- }
-
- return event.which;
- }
- }, jQuery.event.addProp );
-
- jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
- jQuery.event.special[ type ] = {
-
- // Utilize native event if possible so blur/focus sequence is correct
- setup: function() {
-
- // Claim the first handler
- // dataPriv.set( this, "focus", ... )
- // dataPriv.set( this, "blur", ... )
- leverageNative( this, type, expectSync );
-
- // Return false to allow normal processing in the caller
- return false;
- },
- trigger: function() {
-
- // Force setup before trigger
- leverageNative( this, type );
-
- // Return non-false to allow normal event-path propagation
- return true;
- },
-
- delegateType: delegateType
- };
- } );
-
- // Create mouseenter/leave events using mouseover/out and event-time checks
- // so that event delegation works in jQuery.
- // Do the same for pointerenter/pointerleave and pointerover/pointerout
- //
- // Support: Safari 7 only
- // Safari sends mouseenter too often; see:
- // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
- // for the description of the bug (it existed in older Chrome versions as well).
- jQuery.each( {
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var ret,
- target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj;
-
- // For mouseenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply( this, arguments );
- event.type = fix;
- }
- return ret;
- }
- };
- } );
-
- jQuery.fn.extend( {
-
- on: function( types, selector, data, fn ) {
- return on( this, types, selector, data, fn );
- },
- one: function( types, selector, data, fn ) {
- return on( this, types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- var handleObj, type;
- if ( types && types.preventDefault && types.handleObj ) {
-
- // ( event ) dispatched jQuery.Event
- handleObj = types.handleObj;
- jQuery( types.delegateTarget ).off(
- handleObj.namespace ?
- handleObj.origType + "." + handleObj.namespace :
- handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if ( typeof types === "object" ) {
-
- // ( types-object [, selector] )
- for ( type in types ) {
- this.off( type, selector, types[ type ] );
- }
- return this;
- }
- if ( selector === false || typeof selector === "function" ) {
-
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if ( fn === false ) {
- fn = returnFalse;
- }
- return this.each( function() {
- jQuery.event.remove( this, types, fn, selector );
- } );
- }
- } );
-
-
- var
-
- // Support: IE <=10 - 11, Edge 12 - 13 only
- // In IE/Edge using regex groups here causes severe slowdowns.
- // See https://connect.microsoft.com/IE/feedback/details/1736512/
- rnoInnerhtml = /<script|<style|<link/i,
-
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
-
- // Prefer a tbody over its parent table for containing new rows
- function manipulationTarget( elem, content ) {
- if ( nodeName( elem, "table" ) &&
- nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
-
- return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
- }
-
- return elem;
- }
-
- // Replace/restore the type attribute of script elements for safe DOM manipulation
- function disableScript( elem ) {
- elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
- return elem;
- }
- function restoreScript( elem ) {
- if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
- elem.type = elem.type.slice( 5 );
- } else {
- elem.removeAttribute( "type" );
- }
-
- return elem;
- }
-
- function cloneCopyEvent( src, dest ) {
- var i, l, type, pdataOld, udataOld, udataCur, events;
-
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // 1. Copy private data: events, handlers, etc.
- if ( dataPriv.hasData( src ) ) {
- pdataOld = dataPriv.get( src );
- events = pdataOld.events;
-
- if ( events ) {
- dataPriv.remove( dest, "handle events" );
-
- for ( type in events ) {
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type, events[ type ][ i ] );
- }
- }
- }
- }
-
- // 2. Copy user data
- if ( dataUser.hasData( src ) ) {
- udataOld = dataUser.access( src );
- udataCur = jQuery.extend( {}, udataOld );
-
- dataUser.set( dest, udataCur );
- }
- }
-
- // Fix IE bugs, see support tests
- function fixInput( src, dest ) {
- var nodeName = dest.nodeName.toLowerCase();
-
- // Fails to persist the checked state of a cloned checkbox or radio button.
- if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
- dest.checked = src.checked;
-
- // Fails to return the selected option to the default selected state when cloning options
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
- dest.defaultValue = src.defaultValue;
- }
- }
-
- function domManip( collection, args, callback, ignored ) {
-
- // Flatten any nested arrays
- args = flat( args );
-
- var fragment, first, scripts, hasScripts, node, doc,
- i = 0,
- l = collection.length,
- iNoClone = l - 1,
- value = args[ 0 ],
- valueIsFunction = isFunction( value );
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( valueIsFunction ||
- ( l > 1 && typeof value === "string" &&
- !support.checkClone && rchecked.test( value ) ) ) {
- return collection.each( function( index ) {
- var self = collection.eq( index );
- if ( valueIsFunction ) {
- args[ 0 ] = value.call( this, index, self.html() );
- }
- domManip( self, args, callback, ignored );
- } );
- }
-
- if ( l ) {
- fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
- first = fragment.firstChild;
-
- if ( fragment.childNodes.length === 1 ) {
- fragment = first;
- }
-
- // Require either new content or an interest in ignored elements to invoke the callback
- if ( first || ignored ) {
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
- hasScripts = scripts.length;
-
- // Use the original fragment for the last item
- // instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
- for ( ; i < l; i++ ) {
- node = fragment;
-
- if ( i !== iNoClone ) {
- node = jQuery.clone( node, true, true );
-
- // Keep references to cloned scripts for later restoration
- if ( hasScripts ) {
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( scripts, getAll( node, "script" ) );
- }
- }
-
- callback.call( collection[ i ], node, i );
- }
-
- if ( hasScripts ) {
- doc = scripts[ scripts.length - 1 ].ownerDocument;
-
- // Reenable scripts
- jQuery.map( scripts, restoreScript );
-
- // Evaluate executable scripts on first document insertion
- for ( i = 0; i < hasScripts; i++ ) {
- node = scripts[ i ];
- if ( rscriptType.test( node.type || "" ) &&
- !dataPriv.access( node, "globalEval" ) &&
- jQuery.contains( doc, node ) ) {
-
- if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
-
- // Optional AJAX dependency, but won't run scripts if not present
- if ( jQuery._evalUrl && !node.noModule ) {
- jQuery._evalUrl( node.src, {
- nonce: node.nonce || node.getAttribute( "nonce" )
- }, doc );
- }
- } else {
- DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
- }
- }
- }
- }
- }
- }
-
- return collection;
- }
-
- function remove( elem, selector, keepData ) {
- var node,
- nodes = selector ? jQuery.filter( selector, elem ) : elem,
- i = 0;
-
- for ( ; ( node = nodes[ i ] ) != null; i++ ) {
- if ( !keepData && node.nodeType === 1 ) {
- jQuery.cleanData( getAll( node ) );
- }
-
- if ( node.parentNode ) {
- if ( keepData && isAttached( node ) ) {
- setGlobalEval( getAll( node, "script" ) );
- }
- node.parentNode.removeChild( node );
- }
- }
-
- return elem;
- }
-
- jQuery.extend( {
- htmlPrefilter: function( html ) {
- return html;
- },
-
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var i, l, srcElements, destElements,
- clone = elem.cloneNode( true ),
- inPage = isAttached( elem );
-
- // Fix IE cloning issues
- if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
- !jQuery.isXMLDoc( elem ) ) {
-
- // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
- destElements = getAll( clone );
- srcElements = getAll( elem );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- fixInput( srcElements[ i ], destElements[ i ] );
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- if ( deepDataAndEvents ) {
- srcElements = srcElements || getAll( elem );
- destElements = destElements || getAll( clone );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- cloneCopyEvent( srcElements[ i ], destElements[ i ] );
- }
- } else {
- cloneCopyEvent( elem, clone );
- }
- }
-
- // Preserve script evaluation history
- destElements = getAll( clone, "script" );
- if ( destElements.length > 0 ) {
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
- }
-
- // Return the cloned set
- return clone;
- },
-
- cleanData: function( elems ) {
- var data, elem, type,
- special = jQuery.event.special,
- i = 0;
-
- for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
- if ( acceptData( elem ) ) {
- if ( ( data = elem[ dataPriv.expando ] ) ) {
- if ( data.events ) {
- for ( type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
-
- // This is a shortcut to avoid jQuery.event.remove's overhead
- } else {
- jQuery.removeEvent( elem, type, data.handle );
- }
- }
- }
-
- // Support: Chrome <=35 - 45+
- // Assign undefined instead of using delete, see Data#remove
- elem[ dataPriv.expando ] = undefined;
- }
- if ( elem[ dataUser.expando ] ) {
-
- // Support: Chrome <=35 - 45+
- // Assign undefined instead of using delete, see Data#remove
- elem[ dataUser.expando ] = undefined;
- }
- }
- }
- }
- } );
-
- jQuery.fn.extend( {
- detach: function( selector ) {
- return remove( this, selector, true );
- },
-
- remove: function( selector ) {
- return remove( this, selector );
- },
-
- text: function( value ) {
- return access( this, function( value ) {
- return value === undefined ?
- jQuery.text( this ) :
- this.empty().each( function() {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- this.textContent = value;
- }
- } );
- }, null, value, arguments.length );
- },
-
- append: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.appendChild( elem );
- }
- } );
- },
-
- prepend: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.insertBefore( elem, target.firstChild );
- }
- } );
- },
-
- before: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this );
- }
- } );
- },
-
- after: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- }
- } );
- },
-
- empty: function() {
- var elem,
- i = 0;
-
- for ( ; ( elem = this[ i ] ) != null; i++ ) {
- if ( elem.nodeType === 1 ) {
-
- // Prevent memory leaks
- jQuery.cleanData( getAll( elem, false ) );
-
- // Remove any remaining nodes
- elem.textContent = "";
- }
- }
-
- return this;
- },
-
- clone: function( dataAndEvents, deepDataAndEvents ) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
- return this.map( function() {
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
- } );
- },
-
- html: function( value ) {
- return access( this, function( value ) {
- var elem = this[ 0 ] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined && elem.nodeType === 1 ) {
- return elem.innerHTML;
- }
-
- // See if we can take a shortcut and just use innerHTML
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
-
- value = jQuery.htmlPrefilter( value );
-
- try {
- for ( ; i < l; i++ ) {
- elem = this[ i ] || {};
-
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem, false ) );
- elem.innerHTML = value;
- }
- }
-
- elem = 0;
-
- // If using innerHTML throws an exception, use the fallback method
- } catch ( e ) {}
- }
-
- if ( elem ) {
- this.empty().append( value );
- }
- }, null, value, arguments.length );
- },
-
- replaceWith: function() {
- var ignored = [];
-
- // Make the changes, replacing each non-ignored context element with the new content
- return domManip( this, arguments, function( elem ) {
- var parent = this.parentNode;
-
- if ( jQuery.inArray( this, ignored ) < 0 ) {
- jQuery.cleanData( getAll( this ) );
- if ( parent ) {
- parent.replaceChild( elem, this );
- }
- }
-
- // Force callback invocation
- }, ignored );
- }
- } );
-
- jQuery.each( {
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var elems,
- ret = [],
- insert = jQuery( selector ),
- last = insert.length - 1,
- i = 0;
-
- for ( ; i <= last; i++ ) {
- elems = i === last ? this : this.clone( true );
- jQuery( insert[ i ] )[ original ]( elems );
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // .get() because push.apply(_, arraylike) throws on ancient WebKit
- push.apply( ret, elems.get() );
- }
-
- return this.pushStack( ret );
- };
- } );
- var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
-
- var getStyles = function( elem ) {
-
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
- // IE throws on elements created in popups
- // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
- var view = elem.ownerDocument.defaultView;
-
- if ( !view || !view.opener ) {
- view = window;
- }
-
- return view.getComputedStyle( elem );
- };
-
- var swap = function( elem, options, callback ) {
- var ret, name,
- old = {};
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.call( elem );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
- };
-
-
- var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
-
-
-
- ( function() {
-
- // Executing both pixelPosition & boxSizingReliable tests require only one layout
- // so they're executed at the same time to save the second computation.
- function computeStyleTests() {
-
- // This is a singleton, we need to execute it only once
- if ( !div ) {
- return;
- }
-
- container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
- "margin-top:1px;padding:0;border:0";
- div.style.cssText =
- "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
- "margin:auto;border:1px;padding:1px;" +
- "width:60%;top:1%";
- documentElement.appendChild( container ).appendChild( div );
-
- var divStyle = window.getComputedStyle( div );
- pixelPositionVal = divStyle.top !== "1%";
-
- // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
- reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
-
- // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
- // Some styles come back with percentage values, even though they shouldn't
- div.style.right = "60%";
- pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
-
- // Support: IE 9 - 11 only
- // Detect misreporting of content dimensions for box-sizing:border-box elements
- boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
-
- // Support: IE 9 only
- // Detect overflow:scroll screwiness (gh-3699)
- // Support: Chrome <=64
- // Don't get tricked when zoom affects offsetWidth (gh-4029)
- div.style.position = "absolute";
- scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
-
- documentElement.removeChild( container );
-
- // Nullify the div so it wouldn't be stored in the memory and
- // it will also be a sign that checks already performed
- div = null;
- }
-
- function roundPixelMeasures( measure ) {
- return Math.round( parseFloat( measure ) );
- }
-
- var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
- reliableTrDimensionsVal, reliableMarginLeftVal,
- container = document.createElement( "div" ),
- div = document.createElement( "div" );
-
- // Finish early in limited (non-browser) environments
- if ( !div.style ) {
- return;
- }
-
- // Support: IE <=9 - 11 only
- // Style of cloned element affects source element cloned (#8908)
- div.style.backgroundClip = "content-box";
- div.cloneNode( true ).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
- jQuery.extend( support, {
- boxSizingReliable: function() {
- computeStyleTests();
- return boxSizingReliableVal;
- },
- pixelBoxStyles: function() {
- computeStyleTests();
- return pixelBoxStylesVal;
- },
- pixelPosition: function() {
- computeStyleTests();
- return pixelPositionVal;
- },
- reliableMarginLeft: function() {
- computeStyleTests();
- return reliableMarginLeftVal;
- },
- scrollboxSize: function() {
- computeStyleTests();
- return scrollboxSizeVal;
- },
-
- // Support: IE 9 - 11+, Edge 15 - 18+
- // IE/Edge misreport `getComputedStyle` of table rows with width/height
- // set in CSS while `offset*` properties report correct values.
- // Behavior in IE 9 is more subtle than in newer versions & it passes
- // some versions of this test; make sure not to make it pass there!
- reliableTrDimensions: function() {
- var table, tr, trChild, trStyle;
- if ( reliableTrDimensionsVal == null ) {
- table = document.createElement( "table" );
- tr = document.createElement( "tr" );
- trChild = document.createElement( "div" );
-
- table.style.cssText = "position:absolute;left:-11111px";
- tr.style.height = "1px";
- trChild.style.height = "9px";
-
- documentElement
- .appendChild( table )
- .appendChild( tr )
- .appendChild( trChild );
-
- trStyle = window.getComputedStyle( tr );
- reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
-
- documentElement.removeChild( table );
- }
- return reliableTrDimensionsVal;
- }
- } );
- } )();
-
-
- function curCSS( elem, name, computed ) {
- var width, minWidth, maxWidth, ret,
-
- // Support: Firefox 51+
- // Retrieving style before computed somehow
- // fixes an issue with getting wrong values
- // on detached elements
- style = elem.style;
-
- computed = computed || getStyles( elem );
-
- // getPropertyValue is needed for:
- // .css('filter') (IE 9 only, #12537)
- // .css('--customProperty) (#3144)
- if ( computed ) {
- ret = computed.getPropertyValue( name ) || computed[ name ];
-
- if ( ret === "" && !isAttached( elem ) ) {
- ret = jQuery.style( elem, name );
- }
-
- // A tribute to the "awesome hack by Dean Edwards"
- // Android Browser returns percentage for some values,
- // but width seems to be reliably pixels.
- // This is against the CSSOM draft spec:
- // https://drafts.csswg.org/cssom/#resolved-values
- if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
-
- // Remember the original values
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
-
- // Put in the new values to get a computed value out
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
-
- // Revert the changed values
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
-
- return ret !== undefined ?
-
- // Support: IE <=9 - 11 only
- // IE returns zIndex value as an integer.
- ret + "" :
- ret;
- }
-
-
- function addGetHookIf( conditionFn, hookFn ) {
-
- // Define the hook, we'll check on the first run if it's really needed.
- return {
- get: function() {
- if ( conditionFn() ) {
-
- // Hook not needed (or it's not possible to use it due
- // to missing dependency), remove it.
- delete this.get;
- return;
- }
-
- // Hook needed; redefine it so that the support test is not executed again.
- return ( this.get = hookFn ).apply( this, arguments );
- }
- };
- }
-
-
- var cssPrefixes = [ "Webkit", "Moz", "ms" ],
- emptyStyle = document.createElement( "div" ).style,
- vendorProps = {};
-
- // Return a vendor-prefixed property or undefined
- function vendorPropName( name ) {
-
- // Check for vendor prefixed names
- var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
- i = cssPrefixes.length;
-
- while ( i-- ) {
- name = cssPrefixes[ i ] + capName;
- if ( name in emptyStyle ) {
- return name;
- }
- }
- }
-
- // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
- function finalPropName( name ) {
- var final = jQuery.cssProps[ name ] || vendorProps[ name ];
-
- if ( final ) {
- return final;
- }
- if ( name in emptyStyle ) {
- return name;
- }
- return vendorProps[ name ] = vendorPropName( name ) || name;
- }
-
-
- var
-
- // Swappable if display is none or starts with table
- // except "table", "table-cell", or "table-caption"
- // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
- rcustomProp = /^--/,
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssNormalTransform = {
- letterSpacing: "0",
- fontWeight: "400"
- };
-
- function setPositiveNumber( _elem, value, subtract ) {
-
- // Any relative (+/-) values have already been
- // normalized at this point
- var matches = rcssNum.exec( value );
- return matches ?
-
- // Guard against undefined "subtract", e.g., when used as in cssHooks
- Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
- value;
- }
-
- function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
- var i = dimension === "width" ? 1 : 0,
- extra = 0,
- delta = 0;
-
- // Adjustment may not be necessary
- if ( box === ( isBorderBox ? "border" : "content" ) ) {
- return 0;
- }
-
- for ( ; i < 4; i += 2 ) {
-
- // Both box models exclude margin
- if ( box === "margin" ) {
- delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
- }
-
- // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
- if ( !isBorderBox ) {
-
- // Add padding
- delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
- // For "border" or "margin", add border
- if ( box !== "padding" ) {
- delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-
- // But still keep track of it otherwise
- } else {
- extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
-
- // If we get here with a border-box (content + padding + border), we're seeking "content" or
- // "padding" or "margin"
- } else {
-
- // For "content", subtract padding
- if ( box === "content" ) {
- delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
- }
-
- // For "content" or "padding", subtract border
- if ( box !== "margin" ) {
- delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- }
- }
-
- // Account for positive content-box scroll gutter when requested by providing computedVal
- if ( !isBorderBox && computedVal >= 0 ) {
-
- // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
- // Assuming integer scroll gutter, subtract the rest and round down
- delta += Math.max( 0, Math.ceil(
- elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
- computedVal -
- delta -
- extra -
- 0.5
-
- // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
- // Use an explicit zero to avoid NaN (gh-3964)
- ) ) || 0;
- }
-
- return delta;
- }
-
- function getWidthOrHeight( elem, dimension, extra ) {
-
- // Start with computed style
- var styles = getStyles( elem ),
-
- // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
- // Fake content-box until we know it's needed to know the true value.
- boxSizingNeeded = !support.boxSizingReliable() || extra,
- isBorderBox = boxSizingNeeded &&
- jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- valueIsBorderBox = isBorderBox,
-
- val = curCSS( elem, dimension, styles ),
- offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
-
- // Support: Firefox <=54
- // Return a confounding non-pixel value or feign ignorance, as appropriate.
- if ( rnumnonpx.test( val ) ) {
- if ( !extra ) {
- return val;
- }
- val = "auto";
- }
-
-
- // Support: IE 9 - 11 only
- // Use offsetWidth/offsetHeight for when box sizing is unreliable.
- // In those cases, the computed value can be trusted to be border-box.
- if ( ( !support.boxSizingReliable() && isBorderBox ||
-
- // Support: IE 10 - 11+, Edge 15 - 18+
- // IE/Edge misreport `getComputedStyle` of table rows with width/height
- // set in CSS while `offset*` properties report correct values.
- // Interestingly, in some cases IE 9 doesn't suffer from this issue.
- !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
-
- // Fall back to offsetWidth/offsetHeight when value is "auto"
- // This happens for inline elements with no explicit setting (gh-3571)
- val === "auto" ||
-
- // Support: Android <=4.1 - 4.3 only
- // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
- !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
-
- // Make sure the element is visible & connected
- elem.getClientRects().length ) {
-
- isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
- // Where available, offsetWidth/offsetHeight approximate border box dimensions.
- // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
- // retrieved value as a content box dimension.
- valueIsBorderBox = offsetProp in elem;
- if ( valueIsBorderBox ) {
- val = elem[ offsetProp ];
- }
- }
-
- // Normalize "" and auto
- val = parseFloat( val ) || 0;
-
- // Adjust for the element's box model
- return ( val +
- boxModelAdjustment(
- elem,
- dimension,
- extra || ( isBorderBox ? "border" : "content" ),
- valueIsBorderBox,
- styles,
-
- // Provide the current computed size to request scroll gutter calculation (gh-3589)
- val
- )
- ) + "px";
- }
-
- jQuery.extend( {
-
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
-
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
- }
- }
- }
- },
-
- // Don't automatically add "px" to these possibly-unitless properties
- cssNumber: {
- "animationIterationCount": true,
- "columnCount": true,
- "fillOpacity": true,
- "flexGrow": true,
- "flexShrink": true,
- "fontWeight": true,
- "gridArea": true,
- "gridColumn": true,
- "gridColumnEnd": true,
- "gridColumnStart": true,
- "gridRow": true,
- "gridRowEnd": true,
- "gridRowStart": true,
- "lineHeight": true,
- "opacity": true,
- "order": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {},
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
-
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, hooks,
- origName = camelCase( name ),
- isCustomProp = rcustomProp.test( name ),
- style = elem.style;
-
- // Make sure that we're working with the right name. We don't
- // want to query the value if it is a CSS custom property
- // since they are user-defined.
- if ( !isCustomProp ) {
- name = finalPropName( origName );
- }
-
- // Gets hook for the prefixed version, then unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // Convert "+=" or "-=" to relative numbers (#7345)
- if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
- value = adjustCSS( elem, name, ret );
-
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that null and NaN values aren't set (#7116)
- if ( value == null || value !== value ) {
- return;
- }
-
- // If a number was passed in, add the unit (except for certain CSS properties)
- // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
- // "px" to a few hardcoded values.
- if ( type === "number" && !isCustomProp ) {
- value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
- }
-
- // background-* props affect original clone's values
- if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
- style[ name ] = "inherit";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !( "set" in hooks ) ||
- ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
-
- if ( isCustomProp ) {
- style.setProperty( name, value );
- } else {
- style[ name ] = value;
- }
- }
-
- } else {
-
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks &&
- ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
-
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra, styles ) {
- var val, num, hooks,
- origName = camelCase( name ),
- isCustomProp = rcustomProp.test( name );
-
- // Make sure that we're working with the right name. We don't
- // want to modify the value if it is a CSS custom property
- // since they are user-defined.
- if ( !isCustomProp ) {
- name = finalPropName( origName );
- }
-
- // Try prefixed name followed by the unprefixed name
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks ) {
- val = hooks.get( elem, true, extra );
- }
-
- // Otherwise, if a way to get the computed value exists, use that
- if ( val === undefined ) {
- val = curCSS( elem, name, styles );
- }
-
- // Convert "normal" to computed value
- if ( val === "normal" && name in cssNormalTransform ) {
- val = cssNormalTransform[ name ];
- }
-
- // Make numeric if forced or a qualifier was provided and val looks numeric
- if ( extra === "" || extra ) {
- num = parseFloat( val );
- return extra === true || isFinite( num ) ? num || 0 : val;
- }
-
- return val;
- }
- } );
-
- jQuery.each( [ "height", "width" ], function( _i, dimension ) {
- jQuery.cssHooks[ dimension ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
-
- // Certain elements can have dimension info if we invisibly show them
- // but it must have a current display style that would benefit
- return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
-
- // Support: Safari 8+
- // Table columns in Safari have non-zero offsetWidth & zero
- // getBoundingClientRect().width unless display is changed.
- // Support: IE <=11 only
- // Running getBoundingClientRect on a disconnected node
- // in IE throws an error.
- ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
- swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, dimension, extra );
- } ) :
- getWidthOrHeight( elem, dimension, extra );
- }
- },
-
- set: function( elem, value, extra ) {
- var matches,
- styles = getStyles( elem ),
-
- // Only read styles.position if the test has a chance to fail
- // to avoid forcing a reflow.
- scrollboxSizeBuggy = !support.scrollboxSize() &&
- styles.position === "absolute",
-
- // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
- boxSizingNeeded = scrollboxSizeBuggy || extra,
- isBorderBox = boxSizingNeeded &&
- jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- subtract = extra ?
- boxModelAdjustment(
- elem,
- dimension,
- extra,
- isBorderBox,
- styles
- ) :
- 0;
-
- // Account for unreliable border-box dimensions by comparing offset* to computed and
- // faking a content-box to get border and padding (gh-3699)
- if ( isBorderBox && scrollboxSizeBuggy ) {
- subtract -= Math.ceil(
- elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
- parseFloat( styles[ dimension ] ) -
- boxModelAdjustment( elem, dimension, "border", false, styles ) -
- 0.5
- );
- }
-
- // Convert to pixels if value adjustment is needed
- if ( subtract && ( matches = rcssNum.exec( value ) ) &&
- ( matches[ 3 ] || "px" ) !== "px" ) {
-
- elem.style[ dimension ] = value;
- value = jQuery.css( elem, dimension );
- }
-
- return setPositiveNumber( elem, value, subtract );
- }
- };
- } );
-
- jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
- function( elem, computed ) {
- if ( computed ) {
- return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
- elem.getBoundingClientRect().left -
- swap( elem, { marginLeft: 0 }, function() {
- return elem.getBoundingClientRect().left;
- } )
- ) + "px";
- }
- }
- );
-
- // These hooks are used by animate to expand properties
- jQuery.each( {
- margin: "",
- padding: "",
- border: "Width"
- }, function( prefix, suffix ) {
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i = 0,
- expanded = {},
-
- // Assumes a single number if not a string
- parts = typeof value === "string" ? value.split( " " ) : [ value ];
-
- for ( ; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-
- if ( prefix !== "margin" ) {
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
- }
- } );
-
- jQuery.fn.extend( {
- css: function( name, value ) {
- return access( this, function( elem, name, value ) {
- var styles, len,
- map = {},
- i = 0;
-
- if ( Array.isArray( name ) ) {
- styles = getStyles( elem );
- len = name.length;
-
- for ( ; i < len; i++ ) {
- map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
- }
-
- return map;
- }
-
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
- }
- } );
-
-
- function Tween( elem, options, prop, end, easing ) {
- return new Tween.prototype.init( elem, options, prop, end, easing );
- }
- jQuery.Tween = Tween;
-
- Tween.prototype = {
- constructor: Tween,
- init: function( elem, options, prop, end, easing, unit ) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || jQuery.easing._default;
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
- },
- cur: function() {
- var hooks = Tween.propHooks[ this.prop ];
-
- return hooks && hooks.get ?
- hooks.get( this ) :
- Tween.propHooks._default.get( this );
- },
- run: function( percent ) {
- var eased,
- hooks = Tween.propHooks[ this.prop ];
-
- if ( this.options.duration ) {
- this.pos = eased = jQuery.easing[ this.easing ](
- percent, this.options.duration * percent, 0, 1, this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = ( this.end - this.start ) * eased + this.start;
-
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- if ( hooks && hooks.set ) {
- hooks.set( this );
- } else {
- Tween.propHooks._default.set( this );
- }
- return this;
- }
- };
-
- Tween.prototype.init.prototype = Tween.prototype;
-
- Tween.propHooks = {
- _default: {
- get: function( tween ) {
- var result;
-
- // Use a property on the element directly when it is not a DOM element,
- // or when there is no matching style property that exists.
- if ( tween.elem.nodeType !== 1 ||
- tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
- return tween.elem[ tween.prop ];
- }
-
- // Passing an empty string as a 3rd parameter to .css will automatically
- // attempt a parseFloat and fallback to a string if the parse fails.
- // Simple values such as "10px" are parsed to Float;
- // complex values such as "rotate(1rad)" are returned as-is.
- result = jQuery.css( tween.elem, tween.prop, "" );
-
- // Empty strings, null, undefined and "auto" are converted to 0.
- return !result || result === "auto" ? 0 : result;
- },
- set: function( tween ) {
-
- // Use step hook for back compat.
- // Use cssHook if its there.
- // Use .style if available and use plain properties where available.
- if ( jQuery.fx.step[ tween.prop ] ) {
- jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.nodeType === 1 && (
- jQuery.cssHooks[ tween.prop ] ||
- tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
- } else {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- }
- };
-
- // Support: IE <=9 only
- // Panic based approach to setting things on disconnected nodes
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function( tween ) {
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- };
-
- jQuery.easing = {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return 0.5 - Math.cos( p * Math.PI ) / 2;
- },
- _default: "swing"
- };
-
- jQuery.fx = Tween.prototype.init;
-
- // Back compat <1.8 extension point
- jQuery.fx.step = {};
-
-
-
-
- var
- fxNow, inProgress,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rrun = /queueHooks$/;
-
- function schedule() {
- if ( inProgress ) {
- if ( document.hidden === false && window.requestAnimationFrame ) {
- window.requestAnimationFrame( schedule );
- } else {
- window.setTimeout( schedule, jQuery.fx.interval );
- }
-
- jQuery.fx.tick();
- }
- }
-
- // Animations created synchronously will run synchronously
- function createFxNow() {
- window.setTimeout( function() {
- fxNow = undefined;
- } );
- return ( fxNow = Date.now() );
- }
-
- // Generate parameters to create a standard animation
- function genFx( type, includeWidth ) {
- var which,
- i = 0,
- attrs = { height: type };
-
- // If we include width, step value is 1 to do all cssExpand values,
- // otherwise step value is 2 to skip over Left and Right
- includeWidth = includeWidth ? 1 : 0;
- for ( ; i < 4; i += 2 - includeWidth ) {
- which = cssExpand[ i ];
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
- }
-
- if ( includeWidth ) {
- attrs.opacity = attrs.width = type;
- }
-
- return attrs;
- }
-
- function createTween( value, prop, animation ) {
- var tween,
- collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
- index = 0,
- length = collection.length;
- for ( ; index < length; index++ ) {
- if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
-
- // We're done with this property
- return tween;
- }
- }
- }
-
- function defaultPrefilter( elem, props, opts ) {
- var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
- isBox = "width" in props || "height" in props,
- anim = this,
- orig = {},
- style = elem.style,
- hidden = elem.nodeType && isHiddenWithinTree( elem ),
- dataShow = dataPriv.get( elem, "fxshow" );
-
- // Queue-skipping animations hijack the fx hooks
- if ( !opts.queue ) {
- hooks = jQuery._queueHooks( elem, "fx" );
- if ( hooks.unqueued == null ) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if ( !hooks.unqueued ) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
-
- anim.always( function() {
-
- // Ensure the complete handler is called before this completes
- anim.always( function() {
- hooks.unqueued--;
- if ( !jQuery.queue( elem, "fx" ).length ) {
- hooks.empty.fire();
- }
- } );
- } );
- }
-
- // Detect show/hide animations
- for ( prop in props ) {
- value = props[ prop ];
- if ( rfxtypes.test( value ) ) {
- delete props[ prop ];
- toggle = toggle || value === "toggle";
- if ( value === ( hidden ? "hide" : "show" ) ) {
-
- // Pretend to be hidden if this is a "show" and
- // there is still data from a stopped show/hide
- if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
- hidden = true;
-
- // Ignore all other no-op show/hide data
- } else {
- continue;
- }
- }
- orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
- }
- }
-
- // Bail out if this is a no-op like .hide().hide()
- propTween = !jQuery.isEmptyObject( props );
- if ( !propTween && jQuery.isEmptyObject( orig ) ) {
- return;
- }
-
- // Restrict "overflow" and "display" styles during box animations
- if ( isBox && elem.nodeType === 1 ) {
-
- // Support: IE <=9 - 11, Edge 12 - 15
- // Record all 3 overflow attributes because IE does not infer the shorthand
- // from identically-valued overflowX and overflowY and Edge just mirrors
- // the overflowX value there.
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
- // Identify a display type, preferring old show/hide data over the CSS cascade
- restoreDisplay = dataShow && dataShow.display;
- if ( restoreDisplay == null ) {
- restoreDisplay = dataPriv.get( elem, "display" );
- }
- display = jQuery.css( elem, "display" );
- if ( display === "none" ) {
- if ( restoreDisplay ) {
- display = restoreDisplay;
- } else {
-
- // Get nonempty value(s) by temporarily forcing visibility
- showHide( [ elem ], true );
- restoreDisplay = elem.style.display || restoreDisplay;
- display = jQuery.css( elem, "display" );
- showHide( [ elem ] );
- }
- }
-
- // Animate inline elements as inline-block
- if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
- if ( jQuery.css( elem, "float" ) === "none" ) {
-
- // Restore the original display value at the end of pure show/hide animations
- if ( !propTween ) {
- anim.done( function() {
- style.display = restoreDisplay;
- } );
- if ( restoreDisplay == null ) {
- display = style.display;
- restoreDisplay = display === "none" ? "" : display;
- }
- }
- style.display = "inline-block";
- }
- }
- }
-
- if ( opts.overflow ) {
- style.overflow = "hidden";
- anim.always( function() {
- style.overflow = opts.overflow[ 0 ];
- style.overflowX = opts.overflow[ 1 ];
- style.overflowY = opts.overflow[ 2 ];
- } );
- }
-
- // Implement show/hide animations
- propTween = false;
- for ( prop in orig ) {
-
- // General show/hide setup for this element animation
- if ( !propTween ) {
- if ( dataShow ) {
- if ( "hidden" in dataShow ) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
- }
-
- // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
- if ( toggle ) {
- dataShow.hidden = !hidden;
- }
-
- // Show elements before animating them
- if ( hidden ) {
- showHide( [ elem ], true );
- }
-
- /* eslint-disable no-loop-func */
-
- anim.done( function() {
-
- /* eslint-enable no-loop-func */
-
- // The final step of a "hide" animation is actually hiding the element
- if ( !hidden ) {
- showHide( [ elem ] );
- }
- dataPriv.remove( elem, "fxshow" );
- for ( prop in orig ) {
- jQuery.style( elem, prop, orig[ prop ] );
- }
- } );
- }
-
- // Per-property setup
- propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
- if ( !( prop in dataShow ) ) {
- dataShow[ prop ] = propTween.start;
- if ( hidden ) {
- propTween.end = propTween.start;
- propTween.start = 0;
- }
- }
- }
- }
-
- function propFilter( props, specialEasing ) {
- var index, name, easing, value, hooks;
-
- // camelCase, specialEasing and expand cssHook pass
- for ( index in props ) {
- name = camelCase( index );
- easing = specialEasing[ name ];
- value = props[ index ];
- if ( Array.isArray( value ) ) {
- easing = value[ 1 ];
- value = props[ index ] = value[ 0 ];
- }
-
- if ( index !== name ) {
- props[ name ] = value;
- delete props[ index ];
- }
-
- hooks = jQuery.cssHooks[ name ];
- if ( hooks && "expand" in hooks ) {
- value = hooks.expand( value );
- delete props[ name ];
-
- // Not quite $.extend, this won't overwrite existing keys.
- // Reusing 'index' because we have the correct "name"
- for ( index in value ) {
- if ( !( index in props ) ) {
- props[ index ] = value[ index ];
- specialEasing[ index ] = easing;
- }
- }
- } else {
- specialEasing[ name ] = easing;
- }
- }
- }
-
- function Animation( elem, properties, options ) {
- var result,
- stopped,
- index = 0,
- length = Animation.prefilters.length,
- deferred = jQuery.Deferred().always( function() {
-
- // Don't match elem in the :animated selector
- delete tick.elem;
- } ),
- tick = function() {
- if ( stopped ) {
- return false;
- }
- var currentTime = fxNow || createFxNow(),
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-
- // Support: Android 2.3 only
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
- temp = remaining / animation.duration || 0,
- percent = 1 - temp,
- index = 0,
- length = animation.tweens.length;
-
- for ( ; index < length; index++ ) {
- animation.tweens[ index ].run( percent );
- }
-
- deferred.notifyWith( elem, [ animation, percent, remaining ] );
-
- // If there's more to do, yield
- if ( percent < 1 && length ) {
- return remaining;
- }
-
- // If this was an empty animation, synthesize a final progress notification
- if ( !length ) {
- deferred.notifyWith( elem, [ animation, 1, 0 ] );
- }
-
- // Resolve the animation and report its conclusion
- deferred.resolveWith( elem, [ animation ] );
- return false;
- },
- animation = deferred.promise( {
- elem: elem,
- props: jQuery.extend( {}, properties ),
- opts: jQuery.extend( true, {
- specialEasing: {},
- easing: jQuery.easing._default
- }, options ),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function( prop, end ) {
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
- animation.tweens.push( tween );
- return tween;
- },
- stop: function( gotoEnd ) {
- var index = 0,
-
- // If we are going to the end, we want to run all the tweens
- // otherwise we skip this part
- length = gotoEnd ? animation.tweens.length : 0;
- if ( stopped ) {
- return this;
- }
- stopped = true;
- for ( ; index < length; index++ ) {
- animation.tweens[ index ].run( 1 );
- }
-
- // Resolve when we played the last frame; otherwise, reject
- if ( gotoEnd ) {
- deferred.notifyWith( elem, [ animation, 1, 0 ] );
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
- } else {
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
- }
- return this;
- }
- } ),
- props = animation.props;
-
- propFilter( props, animation.opts.specialEasing );
-
- for ( ; index < length; index++ ) {
- result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
- if ( result ) {
- if ( isFunction( result.stop ) ) {
- jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
- result.stop.bind( result );
- }
- return result;
- }
- }
-
- jQuery.map( props, createTween, animation );
-
- if ( isFunction( animation.opts.start ) ) {
- animation.opts.start.call( elem, animation );
- }
-
- // Attach callbacks from options
- animation
- .progress( animation.opts.progress )
- .done( animation.opts.done, animation.opts.complete )
- .fail( animation.opts.fail )
- .always( animation.opts.always );
-
- jQuery.fx.timer(
- jQuery.extend( tick, {
- elem: elem,
- anim: animation,
- queue: animation.opts.queue
- } )
- );
-
- return animation;
- }
-
- jQuery.Animation = jQuery.extend( Animation, {
-
- tweeners: {
- "*": [ function( prop, value ) {
- var tween = this.createTween( prop, value );
- adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
- return tween;
- } ]
- },
-
- tweener: function( props, callback ) {
- if ( isFunction( props ) ) {
- callback = props;
- props = [ "*" ];
- } else {
- props = props.match( rnothtmlwhite );
- }
-
- var prop,
- index = 0,
- length = props.length;
-
- for ( ; index < length; index++ ) {
- prop = props[ index ];
- Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
- Animation.tweeners[ prop ].unshift( callback );
- }
- },
-
- prefilters: [ defaultPrefilter ],
-
- prefilter: function( callback, prepend ) {
- if ( prepend ) {
- Animation.prefilters.unshift( callback );
- } else {
- Animation.prefilters.push( callback );
- }
- }
- } );
-
- jQuery.speed = function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !isFunction( easing ) && easing
- };
-
- // Go to the end state if fx are off
- if ( jQuery.fx.off ) {
- opt.duration = 0;
-
- } else {
- if ( typeof opt.duration !== "number" ) {
- if ( opt.duration in jQuery.fx.speeds ) {
- opt.duration = jQuery.fx.speeds[ opt.duration ];
-
- } else {
- opt.duration = jQuery.fx.speeds._default;
- }
- }
- }
-
- // Normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function() {
- if ( isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- }
- };
-
- return opt;
- };
-
- jQuery.fn.extend( {
- fadeTo: function( speed, to, easing, callback ) {
-
- // Show any hidden elements after setting opacity to 0
- return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
-
- // Animate to the value specified
- .end().animate( { opacity: to }, speed, easing, callback );
- },
- animate: function( prop, speed, easing, callback ) {
- var empty = jQuery.isEmptyObject( prop ),
- optall = jQuery.speed( speed, easing, callback ),
- doAnimation = function() {
-
- // Operate on a copy of prop so per-property easing won't be lost
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
- // Empty animations, or finishing resolves immediately
- if ( empty || dataPriv.get( this, "finish" ) ) {
- anim.stop( true );
- }
- };
- doAnimation.finish = doAnimation;
-
- return empty || optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
- stop: function( type, clearQueue, gotoEnd ) {
- var stopQueue = function( hooks ) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop( gotoEnd );
- };
-
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each( function() {
- var dequeue = true,
- index = type != null && type + "queueHooks",
- timers = jQuery.timers,
- data = dataPriv.get( this );
-
- if ( index ) {
- if ( data[ index ] && data[ index ].stop ) {
- stopQueue( data[ index ] );
- }
- } else {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
- stopQueue( data[ index ] );
- }
- }
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this &&
- ( type == null || timers[ index ].queue === type ) ) {
-
- timers[ index ].anim.stop( gotoEnd );
- dequeue = false;
- timers.splice( index, 1 );
- }
- }
-
- // Start the next in the queue if the last step wasn't forced.
- // Timers currently will call their complete callbacks, which
- // will dequeue but only if they were gotoEnd.
- if ( dequeue || !gotoEnd ) {
- jQuery.dequeue( this, type );
- }
- } );
- },
- finish: function( type ) {
- if ( type !== false ) {
- type = type || "fx";
- }
- return this.each( function() {
- var index,
- data = dataPriv.get( this ),
- queue = data[ type + "queue" ],
- hooks = data[ type + "queueHooks" ],
- timers = jQuery.timers,
- length = queue ? queue.length : 0;
-
- // Enable finishing flag on private data
- data.finish = true;
-
- // Empty the queue first
- jQuery.queue( this, type, [] );
-
- if ( hooks && hooks.stop ) {
- hooks.stop.call( this, true );
- }
-
- // Look for any active animations, and finish them
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
- timers[ index ].anim.stop( true );
- timers.splice( index, 1 );
- }
- }
-
- // Look for any animations in the old queue and finish them
- for ( index = 0; index < length; index++ ) {
- if ( queue[ index ] && queue[ index ].finish ) {
- queue[ index ].finish.call( this );
- }
- }
-
- // Turn off finishing flag
- delete data.finish;
- } );
- }
- } );
-
- jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
- var cssFn = jQuery.fn[ name ];
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return speed == null || typeof speed === "boolean" ?
- cssFn.apply( this, arguments ) :
- this.animate( genFx( name, true ), speed, easing, callback );
- };
- } );
-
- // Generate shortcuts for custom animations
- jQuery.each( {
- slideDown: genFx( "show" ),
- slideUp: genFx( "hide" ),
- slideToggle: genFx( "toggle" ),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
- }, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
- } );
-
- jQuery.timers = [];
- jQuery.fx.tick = function() {
- var timer,
- i = 0,
- timers = jQuery.timers;
-
- fxNow = Date.now();
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
-
- // Run the timer and safely remove it when done (allowing for external removal)
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- fxNow = undefined;
- };
-
- jQuery.fx.timer = function( timer ) {
- jQuery.timers.push( timer );
- jQuery.fx.start();
- };
-
- jQuery.fx.interval = 13;
- jQuery.fx.start = function() {
- if ( inProgress ) {
- return;
- }
-
- inProgress = true;
- schedule();
- };
-
- jQuery.fx.stop = function() {
- inProgress = null;
- };
-
- jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
-
- // Default speed
- _default: 400
- };
-
-
- // Based off of the plugin by Clint Helfers, with permission.
- // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
- jQuery.fn.delay = function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = window.setTimeout( next, time );
- hooks.stop = function() {
- window.clearTimeout( timeout );
- };
- } );
- };
-
-
- ( function() {
- var input = document.createElement( "input" ),
- select = document.createElement( "select" ),
- opt = select.appendChild( document.createElement( "option" ) );
-
- input.type = "checkbox";
-
- // Support: Android <=4.3 only
- // Default value for a checkbox should be "on"
- support.checkOn = input.value !== "";
-
- // Support: IE <=11 only
- // Must access selectedIndex to make default options select
- support.optSelected = opt.selected;
-
- // Support: IE <=11 only
- // An input loses its value after becoming a radio
- input = document.createElement( "input" );
- input.value = "t";
- input.type = "radio";
- support.radioValue = input.value === "t";
- } )();
-
-
- var boolHook,
- attrHandle = jQuery.expr.attrHandle;
-
- jQuery.fn.extend( {
- attr: function( name, value ) {
- return access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each( function() {
- jQuery.removeAttr( this, name );
- } );
- }
- } );
-
- jQuery.extend( {
- attr: function( elem, name, value ) {
- var ret, hooks,
- nType = elem.nodeType;
-
- // Don't get/set attributes on text, comment and attribute nodes
- if ( nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === "undefined" ) {
- return jQuery.prop( elem, name, value );
- }
-
- // Attribute hooks are determined by the lowercase version
- // Grab necessary hook if one is defined
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
- hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
- ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
- }
-
- if ( value !== undefined ) {
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
- return;
- }
-
- if ( hooks && "set" in hooks &&
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
- return ret;
- }
-
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
- return ret;
- }
-
- ret = jQuery.find.attr( elem, name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret == null ? undefined : ret;
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- if ( !support.radioValue && value === "radio" &&
- nodeName( elem, "input" ) ) {
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- },
-
- removeAttr: function( elem, value ) {
- var name,
- i = 0,
-
- // Attribute names can contain non-HTML whitespace characters
- // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
- attrNames = value && value.match( rnothtmlwhite );
-
- if ( attrNames && elem.nodeType === 1 ) {
- while ( ( name = attrNames[ i++ ] ) ) {
- elem.removeAttribute( name );
- }
- }
- }
- } );
-
- // Hooks for boolean attributes
- boolHook = {
- set: function( elem, value, name ) {
- if ( value === false ) {
-
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- elem.setAttribute( name, name );
- }
- return name;
- }
- };
-
- jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
- var getter = attrHandle[ name ] || jQuery.find.attr;
-
- attrHandle[ name ] = function( elem, name, isXML ) {
- var ret, handle,
- lowercaseName = name.toLowerCase();
-
- if ( !isXML ) {
-
- // Avoid an infinite loop by temporarily removing this function from the getter
- handle = attrHandle[ lowercaseName ];
- attrHandle[ lowercaseName ] = ret;
- ret = getter( elem, name, isXML ) != null ?
- lowercaseName :
- null;
- attrHandle[ lowercaseName ] = handle;
- }
- return ret;
- };
- } );
-
-
-
-
- var rfocusable = /^(?:input|select|textarea|button)$/i,
- rclickable = /^(?:a|area)$/i;
-
- jQuery.fn.extend( {
- prop: function( name, value ) {
- return access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- return this.each( function() {
- delete this[ jQuery.propFix[ name ] || name ];
- } );
- }
- } );
-
- jQuery.extend( {
- prop: function( elem, name, value ) {
- var ret, hooks,
- nType = elem.nodeType;
-
- // Don't get/set properties on text, comment and attribute nodes
- if ( nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks &&
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
- return ret;
- }
-
- return ( elem[ name ] = value );
- }
-
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
- return ret;
- }
-
- return elem[ name ];
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
-
- // Support: IE <=9 - 11 only
- // elem.tabIndex doesn't always return the
- // correct value when it hasn't been explicitly set
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- // Use proper attribute retrieval(#12072)
- var tabindex = jQuery.find.attr( elem, "tabindex" );
-
- if ( tabindex ) {
- return parseInt( tabindex, 10 );
- }
-
- if (
- rfocusable.test( elem.nodeName ) ||
- rclickable.test( elem.nodeName ) &&
- elem.href
- ) {
- return 0;
- }
-
- return -1;
- }
- }
- },
-
- propFix: {
- "for": "htmlFor",
- "class": "className"
- }
- } );
-
- // Support: IE <=11 only
- // Accessing the selectedIndex property
- // forces the browser to respect setting selected
- // on the option
- // The getter ensures a default option is selected
- // when in an optgroup
- // eslint rule "no-unused-expressions" is disabled for this code
- // since it considers such accessions noop
- if ( !support.optSelected ) {
- jQuery.propHooks.selected = {
- get: function( elem ) {
-
- /* eslint no-unused-expressions: "off" */
-
- var parent = elem.parentNode;
- if ( parent && parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- return null;
- },
- set: function( elem ) {
-
- /* eslint no-unused-expressions: "off" */
-
- var parent = elem.parentNode;
- if ( parent ) {
- parent.selectedIndex;
-
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- }
- };
- }
-
- jQuery.each( [
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
- ], function() {
- jQuery.propFix[ this.toLowerCase() ] = this;
- } );
-
-
-
-
- // Strip and collapse whitespace according to HTML spec
- // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
- function stripAndCollapse( value ) {
- var tokens = value.match( rnothtmlwhite ) || [];
- return tokens.join( " " );
- }
-
-
- function getClass( elem ) {
- return elem.getAttribute && elem.getAttribute( "class" ) || "";
- }
-
- function classesToArray( value ) {
- if ( Array.isArray( value ) ) {
- return value;
- }
- if ( typeof value === "string" ) {
- return value.match( rnothtmlwhite ) || [];
- }
- return [];
- }
-
- jQuery.fn.extend( {
- addClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
-
- if ( isFunction( value ) ) {
- return this.each( function( j ) {
- jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
- } );
- }
-
- classes = classesToArray( value );
-
- if ( classes.length ) {
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
-
- if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
- }
- }
-
- // Only assign if different to avoid unneeded rendering.
- finalValue = stripAndCollapse( cur );
- if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
-
- if ( isFunction( value ) ) {
- return this.each( function( j ) {
- jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
- } );
- }
-
- if ( !arguments.length ) {
- return this.attr( "class", "" );
- }
-
- classes = classesToArray( value );
-
- if ( classes.length ) {
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
-
- // This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
-
- if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
-
- // Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
- cur = cur.replace( " " + clazz + " ", " " );
- }
- }
-
- // Only assign if different to avoid unneeded rendering.
- finalValue = stripAndCollapse( cur );
- if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value,
- isValidValue = type === "string" || Array.isArray( value );
-
- if ( typeof stateVal === "boolean" && isValidValue ) {
- return stateVal ? this.addClass( value ) : this.removeClass( value );
- }
-
- if ( isFunction( value ) ) {
- return this.each( function( i ) {
- jQuery( this ).toggleClass(
- value.call( this, i, getClass( this ), stateVal ),
- stateVal
- );
- } );
- }
-
- return this.each( function() {
- var className, i, self, classNames;
-
- if ( isValidValue ) {
-
- // Toggle individual class names
- i = 0;
- self = jQuery( this );
- classNames = classesToArray( value );
-
- while ( ( className = classNames[ i++ ] ) ) {
-
- // Check each className given, space separated list
- if ( self.hasClass( className ) ) {
- self.removeClass( className );
- } else {
- self.addClass( className );
- }
- }
-
- // Toggle whole class name
- } else if ( value === undefined || type === "boolean" ) {
- className = getClass( this );
- if ( className ) {
-
- // Store className if set
- dataPriv.set( this, "__className__", className );
- }
-
- // If the element has a class name or if we're passed `false`,
- // then remove the whole classname (if there was one, the above saved it).
- // Otherwise bring back whatever was previously saved (if anything),
- // falling back to the empty string if nothing was stored.
- if ( this.setAttribute ) {
- this.setAttribute( "class",
- className || value === false ?
- "" :
- dataPriv.get( this, "__className__" ) || ""
- );
- }
- }
- } );
- },
-
- hasClass: function( selector ) {
- var className, elem,
- i = 0;
-
- className = " " + selector + " ";
- while ( ( elem = this[ i++ ] ) ) {
- if ( elem.nodeType === 1 &&
- ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
- return true;
- }
- }
-
- return false;
- }
- } );
-
-
-
-
- var rreturn = /\r/g;
-
- jQuery.fn.extend( {
- val: function( value ) {
- var hooks, ret, valueIsFunction,
- elem = this[ 0 ];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] ||
- jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks &&
- "get" in hooks &&
- ( ret = hooks.get( elem, "value" ) ) !== undefined
- ) {
- return ret;
- }
-
- ret = elem.value;
-
- // Handle most common string cases
- if ( typeof ret === "string" ) {
- return ret.replace( rreturn, "" );
- }
-
- // Handle cases where value is null/undef or number
- return ret == null ? "" : ret;
- }
-
- return;
- }
-
- valueIsFunction = isFunction( value );
-
- return this.each( function( i ) {
- var val;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( valueIsFunction ) {
- val = value.call( this, i, jQuery( this ).val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
-
- } else if ( typeof val === "number" ) {
- val += "";
-
- } else if ( Array.isArray( val ) ) {
- val = jQuery.map( val, function( value ) {
- return value == null ? "" : value + "";
- } );
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- } );
- }
- } );
-
- jQuery.extend( {
- valHooks: {
- option: {
- get: function( elem ) {
-
- var val = jQuery.find.attr( elem, "value" );
- return val != null ?
- val :
-
- // Support: IE <=10 - 11 only
- // option.text throws exceptions (#14686, #14858)
- // Strip and collapse whitespace
- // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
- stripAndCollapse( jQuery.text( elem ) );
- }
- },
- select: {
- get: function( elem ) {
- var value, option, i,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one",
- values = one ? null : [],
- max = one ? index + 1 : options.length;
-
- if ( index < 0 ) {
- i = max;
-
- } else {
- i = one ? index : 0;
- }
-
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // Support: IE <=9 only
- // IE8-9 doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
-
- // Don't return options that are disabled or in a disabled optgroup
- !option.disabled &&
- ( !option.parentNode.disabled ||
- !nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var optionSet, option,
- options = elem.options,
- values = jQuery.makeArray( value ),
- i = options.length;
-
- while ( i-- ) {
- option = options[ i ];
-
- /* eslint-disable no-cond-assign */
-
- if ( option.selected =
- jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
- ) {
- optionSet = true;
- }
-
- /* eslint-enable no-cond-assign */
- }
-
- // Force browsers to behave consistently when non-matching value is set
- if ( !optionSet ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- }
- } );
-
- // Radios and checkboxes getter/setter
- jQuery.each( [ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- set: function( elem, value ) {
- if ( Array.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
- }
- }
- };
- if ( !support.checkOn ) {
- jQuery.valHooks[ this ].get = function( elem ) {
- return elem.getAttribute( "value" ) === null ? "on" : elem.value;
- };
- }
- } );
-
-
-
-
- // Return jQuery for attributes-only inclusion
-
-
- support.focusin = "onfocusin" in window;
-
-
- var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- stopPropagationCallback = function( e ) {
- e.stopPropagation();
- };
-
- jQuery.extend( jQuery.event, {
-
- trigger: function( event, data, elem, onlyHandlers ) {
-
- var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
- eventPath = [ elem || document ],
- type = hasOwn.call( event, "type" ) ? event.type : event,
- namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
-
- cur = lastElement = tmp = elem = elem || document;
-
- // Don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf( "." ) > -1 ) {
-
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split( "." );
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf( ":" ) < 0 && "on" + type;
-
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
- event = event[ jQuery.expando ] ?
- event :
- new jQuery.Event( type, typeof event === "object" && event );
-
- // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
- event.isTrigger = onlyHandlers ? 2 : 3;
- event.namespace = namespaces.join( "." );
- event.rnamespace = event.namespace ?
- new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
- null;
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data == null ?
- [ event ] :
- jQuery.makeArray( data, [ event ] );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- if ( !rfocusMorph.test( bubbleType + type ) ) {
- cur = cur.parentNode;
- }
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push( cur );
- tmp = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( tmp === ( elem.ownerDocument || document ) ) {
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
- }
- }
-
- // Fire handlers on the event path
- i = 0;
- while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
- lastElement = cur;
- event.type = i > 1 ?
- bubbleType :
- special.bindType || type;
-
- // jQuery handler
- handle = (
- dataPriv.get( cur, "events" ) || Object.create( null )
- )[ event.type ] &&
- dataPriv.get( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
-
- // Native handler
- handle = ontype && cur[ ontype ];
- if ( handle && handle.apply && acceptData( cur ) ) {
- event.result = handle.apply( cur, data );
- if ( event.result === false ) {
- event.preventDefault();
- }
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( ( !special._default ||
- special._default.apply( eventPath.pop(), data ) === false ) &&
- acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name as the event.
- // Don't do default actions on window, that's where global variables be (#6170)
- if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- tmp = elem[ ontype ];
-
- if ( tmp ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
-
- if ( event.isPropagationStopped() ) {
- lastElement.addEventListener( type, stopPropagationCallback );
- }
-
- elem[ type ]();
-
- if ( event.isPropagationStopped() ) {
- lastElement.removeEventListener( type, stopPropagationCallback );
- }
-
- jQuery.event.triggered = undefined;
-
- if ( tmp ) {
- elem[ ontype ] = tmp;
- }
- }
- }
- }
-
- return event.result;
- },
-
- // Piggyback on a donor event to simulate a different one
- // Used only for `focus(in | out)` events
- simulate: function( type, elem, event ) {
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {
- type: type,
- isSimulated: true
- }
- );
-
- jQuery.event.trigger( e, null, elem );
- }
-
- } );
-
- jQuery.fn.extend( {
-
- trigger: function( type, data ) {
- return this.each( function() {
- jQuery.event.trigger( type, data, this );
- } );
- },
- triggerHandler: function( type, data ) {
- var elem = this[ 0 ];
- if ( elem ) {
- return jQuery.event.trigger( type, data, elem, true );
- }
- }
- } );
-
-
- // Support: Firefox <=44
- // Firefox doesn't have focus(in | out) events
- // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
- //
- // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
- // focus(in | out) events fire after focus & blur events,
- // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
- // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
- if ( !support.focusin ) {
- jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler on the document while someone wants focusin/focusout
- var handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
-
- // Handle: regular nodes (via `this.ownerDocument`), window
- // (via `this.document`) & document (via `this`).
- var doc = this.ownerDocument || this.document || this,
- attaches = dataPriv.access( doc, fix );
-
- if ( !attaches ) {
- doc.addEventListener( orig, handler, true );
- }
- dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
- },
- teardown: function() {
- var doc = this.ownerDocument || this.document || this,
- attaches = dataPriv.access( doc, fix ) - 1;
-
- if ( !attaches ) {
- doc.removeEventListener( orig, handler, true );
- dataPriv.remove( doc, fix );
-
- } else {
- dataPriv.access( doc, fix, attaches );
- }
- }
- };
- } );
- }
- var location = window.location;
-
- var nonce = { guid: Date.now() };
-
- var rquery = ( /\?/ );
-
-
-
- // Cross-browser xml parsing
- jQuery.parseXML = function( data ) {
- var xml;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
-
- // Support: IE 9 - 11 only
- // IE throws on parseFromString with invalid input.
- try {
- xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
- } catch ( e ) {
- xml = undefined;
- }
-
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- };
-
-
- var
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
- function buildParams( prefix, obj, traditional, add ) {
- var name;
-
- if ( Array.isArray( obj ) ) {
-
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
-
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
-
- // Item is non-scalar (array or object), encode its numeric index.
- buildParams(
- prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
- v,
- traditional,
- add
- );
- }
- } );
-
- } else if ( !traditional && toType( obj ) === "object" ) {
-
- // Serialize object item.
- for ( name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
-
- // Serialize scalar item.
- add( prefix, obj );
- }
- }
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- jQuery.param = function( a, traditional ) {
- var prefix,
- s = [],
- add = function( key, valueOrFunction ) {
-
- // If value is a function, invoke it and use its return value
- var value = isFunction( valueOrFunction ) ?
- valueOrFunction() :
- valueOrFunction;
-
- s[ s.length ] = encodeURIComponent( key ) + "=" +
- encodeURIComponent( value == null ? "" : value );
- };
-
- if ( a == null ) {
- return "";
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- } );
-
- } else {
-
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" );
- };
-
- jQuery.fn.extend( {
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
- serializeArray: function() {
- return this.map( function() {
-
- // Can add propHook for "elements" to filter or add form elements
- var elements = jQuery.prop( this, "elements" );
- return elements ? jQuery.makeArray( elements ) : this;
- } )
- .filter( function() {
- var type = this.type;
-
- // Use .is( ":disabled" ) so that fieldset[disabled] works
- return this.name && !jQuery( this ).is( ":disabled" ) &&
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
- ( this.checked || !rcheckableType.test( type ) );
- } )
- .map( function( _i, elem ) {
- var val = jQuery( this ).val();
-
- if ( val == null ) {
- return null;
- }
-
- if ( Array.isArray( val ) ) {
- return jQuery.map( val, function( val ) {
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- } );
- }
-
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- } ).get();
- }
- } );
-
-
- var
- r20 = /%20/g,
- rhash = /#.*$/,
- rantiCache = /([?&])_=[^&]*/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
-
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = "*/".concat( "*" ),
-
- // Anchor tag for parsing the document origin
- originAnchor = document.createElement( "a" );
- originAnchor.href = location.href;
-
- // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
- function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- var dataType,
- i = 0,
- dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
-
- if ( isFunction( func ) ) {
-
- // For each dataType in the dataTypeExpression
- while ( ( dataType = dataTypes[ i++ ] ) ) {
-
- // Prepend if requested
- if ( dataType[ 0 ] === "+" ) {
- dataType = dataType.slice( 1 ) || "*";
- ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
-
- // Otherwise append
- } else {
- ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
- }
- }
- }
- };
- }
-
- // Base inspection function for prefilters and transports
- function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
- var inspected = {},
- seekingTransport = ( structure === transports );
-
- function inspect( dataType ) {
- var selected;
- inspected[ dataType ] = true;
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
- if ( typeof dataTypeOrTransport === "string" &&
- !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-
- options.dataTypes.unshift( dataTypeOrTransport );
- inspect( dataTypeOrTransport );
- return false;
- } else if ( seekingTransport ) {
- return !( selected = dataTypeOrTransport );
- }
- } );
- return selected;
- }
-
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
- }
-
- // A special extend for ajax options
- // that takes "flat" options (not to be deep extended)
- // Fixes #9887
- function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-
- return target;
- }
-
- /* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
- function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var ct, type, finalDataType, firstDataType,
- contents = s.contents,
- dataTypes = s.dataTypes;
-
- // Remove auto dataType and get content-type in the process
- while ( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
-
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
-
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
- }
-
- /* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
- function ajaxConvert( s, response, jqXHR, isSuccess ) {
- var conv2, current, conv, tmp, prev,
- converters = {},
-
- // Work with a copy of dataTypes in case we need to modify it for conversion
- dataTypes = s.dataTypes.slice();
-
- // Create converters map with lowercased keys
- if ( dataTypes[ 1 ] ) {
- for ( conv in s.converters ) {
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
- }
- }
-
- current = dataTypes.shift();
-
- // Convert to each sequential dataType
- while ( current ) {
-
- if ( s.responseFields[ current ] ) {
- jqXHR[ s.responseFields[ current ] ] = response;
- }
-
- // Apply the dataFilter if provided
- if ( !prev && isSuccess && s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- prev = current;
- current = dataTypes.shift();
-
- if ( current ) {
-
- // There's only work to do if current dataType is non-auto
- if ( current === "*" ) {
-
- current = prev;
-
- // Convert response if prev dataType is non-auto and differs from current
- } else if ( prev !== "*" && prev !== current ) {
-
- // Seek a direct converter
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
- // If none found, seek a pair
- if ( !conv ) {
- for ( conv2 in converters ) {
-
- // If conv2 outputs current
- tmp = conv2.split( " " );
- if ( tmp[ 1 ] === current ) {
-
- // If prev can be converted to accepted input
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
- converters[ "* " + tmp[ 0 ] ];
- if ( conv ) {
-
- // Condense equivalence converters
- if ( conv === true ) {
- conv = converters[ conv2 ];
-
- // Otherwise, insert the intermediate dataType
- } else if ( converters[ conv2 ] !== true ) {
- current = tmp[ 0 ];
- dataTypes.unshift( tmp[ 1 ] );
- }
- break;
- }
- }
- }
- }
-
- // Apply converter (if not an equivalence)
- if ( conv !== true ) {
-
- // Unless errors are allowed to bubble, catch and return them
- if ( conv && s.throws ) {
- response = conv( response );
- } else {
- try {
- response = conv( response );
- } catch ( e ) {
- return {
- state: "parsererror",
- error: conv ? e : "No conversion from " + prev + " to " + current
- };
- }
- }
- }
- }
- }
- }
-
- return { state: "success", data: response };
- }
-
- jQuery.extend( {
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajaxSettings: {
- url: location.href,
- type: "GET",
- isLocal: rlocalProtocol.test( location.protocol ),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
-
- contents: {
- xml: /\bxml\b/,
- html: /\bhtml/,
- json: /\bjson\b/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
-
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
-
- // Convert anything to text
- "* text": String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": JSON.parse,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- return settings ?
-
- // Building a settings object
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
- // Extending ajaxSettings
- ajaxExtend( jQuery.ajaxSettings, target );
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var transport,
-
- // URL without anti-cache param
- cacheURL,
-
- // Response headers
- responseHeadersString,
- responseHeaders,
-
- // timeout handle
- timeoutTimer,
-
- // Url cleanup var
- urlAnchor,
-
- // Request state (becomes false upon send and true upon completion)
- completed,
-
- // To know if global events are to be dispatched
- fireGlobals,
-
- // Loop variable
- i,
-
- // uncached part of the url
- uncached,
-
- // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
-
- // Callbacks context
- callbackContext = s.context || s,
-
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
- globalEventContext = s.context &&
- ( callbackContext.nodeType || callbackContext.jquery ) ?
- jQuery( callbackContext ) :
- jQuery.event,
-
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks( "once memory" ),
-
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
-
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
-
- // Default abort message
- strAbort = "canceled",
-
- // Fake xhr
- jqXHR = {
- readyState: 0,
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( completed ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
- ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
- .concat( match[ 2 ] );
- }
- }
- match = responseHeaders[ key.toLowerCase() + " " ];
- }
- return match == null ? null : match.join( ", " );
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return completed ? responseHeadersString : null;
- },
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- if ( completed == null ) {
- name = requestHeadersNames[ name.toLowerCase() ] =
- requestHeadersNames[ name.toLowerCase() ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( completed == null ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Status-dependent callbacks
- statusCode: function( map ) {
- var code;
- if ( map ) {
- if ( completed ) {
-
- // Execute the appropriate callbacks
- jqXHR.always( map[ jqXHR.status ] );
- } else {
-
- // Lazy-add the new callbacks in a way that preserves old ones
- for ( code in map ) {
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
- }
- }
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- var finalText = statusText || strAbort;
- if ( transport ) {
- transport.abort( finalText );
- }
- done( 0, finalText );
- return this;
- }
- };
-
- // Attach deferreds
- deferred.promise( jqXHR );
-
- // Add protocol if not provided (prefilters might expect it)
- // Handle falsy url in the settings object (#10093: consistency with old signature)
- // We also use the url parameter if available
- s.url = ( ( url || s.url || location.href ) + "" )
- .replace( rprotocol, location.protocol + "//" );
-
- // Alias method option to type as per ticket #12004
- s.type = options.method || options.type || s.method || s.type;
-
- // Extract dataTypes list
- s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
-
- // A cross-domain request is in order when the origin doesn't match the current origin.
- if ( s.crossDomain == null ) {
- urlAnchor = document.createElement( "a" );
-
- // Support: IE <=8 - 11, Edge 12 - 15
- // IE throws exception on accessing the href property if url is malformed,
- // e.g. http://example.com:80x/
- try {
- urlAnchor.href = s.url;
-
- // Support: IE <=8 - 11 only
- // Anchor's host property isn't correctly set when s.url is relative
- urlAnchor.href = urlAnchor.href;
- s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
- urlAnchor.protocol + "//" + urlAnchor.host;
- } catch ( e ) {
-
- // If there is an error parsing the URL, assume it is crossDomain,
- // it can be rejected by the transport if it is invalid
- s.crossDomain = true;
- }
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( completed ) {
- return jqXHR;
- }
-
- // We can fire global events as of now if asked to
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
- fireGlobals = jQuery.event && s.global;
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Save the URL in case we're toying with the If-Modified-Since
- // and/or If-None-Match header later on
- // Remove hash to simplify url manipulation
- cacheURL = s.url.replace( rhash, "" );
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // Remember the hash so we can put it back
- uncached = s.url.slice( cacheURL.length );
-
- // If data is available and should be processed, append data to url
- if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
- cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
-
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Add or update anti-cache param if needed
- if ( s.cache === false ) {
- cacheURL = cacheURL.replace( rantiCache, "$1" );
- uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
- uncached;
- }
-
- // Put hash and anti-cache on the URL that will be requested (gh-1732)
- s.url = cacheURL + uncached;
-
- // Change '%20' to '+' if this is encoded form body content (gh-2658)
- } else if ( s.data && s.processData &&
- ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
- s.data = s.data.replace( r20, "+" );
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
- }
- if ( jQuery.etag[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
- s.accepts[ s.dataTypes[ 0 ] ] +
- ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend &&
- ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
-
- // Abort if not done already and return
- return jqXHR.abort();
- }
-
- // Aborting is no longer a cancellation
- strAbort = "abort";
-
- // Install callbacks on deferreds
- completeDeferred.add( s.complete );
- jqXHR.done( s.success );
- jqXHR.fail( s.error );
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
-
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
-
- // If request was aborted inside ajaxSend, stop there
- if ( completed ) {
- return jqXHR;
- }
-
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = window.setTimeout( function() {
- jqXHR.abort( "timeout" );
- }, s.timeout );
- }
-
- try {
- completed = false;
- transport.send( requestHeaders, done );
- } catch ( e ) {
-
- // Rethrow post-completion exceptions
- if ( completed ) {
- throw e;
- }
-
- // Propagate others as results
- done( -1, e );
- }
- }
-
- // Callback for when everything is done
- function done( status, nativeStatusText, responses, headers ) {
- var isSuccess, success, error, response, modified,
- statusText = nativeStatusText;
-
- // Ignore repeat invocations
- if ( completed ) {
- return;
- }
-
- completed = true;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- window.clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- // Determine if successful
- isSuccess = status >= 200 && status < 300 || status === 304;
-
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
-
- // Use a noop converter for missing script
- if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
- s.converters[ "text script" ] = function() {};
- }
-
- // Convert no matter what (that way responseXXX fields are always set)
- response = ajaxConvert( s, response, jqXHR, isSuccess );
-
- // If successful, handle type chaining
- if ( isSuccess ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- modified = jqXHR.getResponseHeader( "Last-Modified" );
- if ( modified ) {
- jQuery.lastModified[ cacheURL ] = modified;
- }
- modified = jqXHR.getResponseHeader( "etag" );
- if ( modified ) {
- jQuery.etag[ cacheURL ] = modified;
- }
- }
-
- // if no content
- if ( status === 204 || s.type === "HEAD" ) {
- statusText = "nocontent";
-
- // if not modified
- } else if ( status === 304 ) {
- statusText = "notmodified";
-
- // If we have data, let's convert it
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
-
- // Extract error from statusText and normalize for non-aborts
- error = statusText;
- if ( status || !statusText ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
- }
-
- return jqXHR;
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- }
- } );
-
- jQuery.each( [ "get", "post" ], function( _i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
-
- // Shift arguments if data argument was omitted
- if ( isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- // The url can be an options object (which then must have .url)
- return jQuery.ajax( jQuery.extend( {
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- }, jQuery.isPlainObject( url ) && url ) );
- };
- } );
-
- jQuery.ajaxPrefilter( function( s ) {
- var i;
- for ( i in s.headers ) {
- if ( i.toLowerCase() === "content-type" ) {
- s.contentType = s.headers[ i ] || "";
- }
- }
- } );
-
-
- jQuery._evalUrl = function( url, options, doc ) {
- return jQuery.ajax( {
- url: url,
-
- // Make this explicit, since user can override this through ajaxSetup (#11264)
- type: "GET",
- dataType: "script",
- cache: true,
- async: false,
- global: false,
-
- // Only evaluate the response if it is successful (gh-4126)
- // dataFilter is not invoked for failure responses, so using it instead
- // of the default converter is kludgy but it works.
- converters: {
- "text script": function() {}
- },
- dataFilter: function( response ) {
- jQuery.globalEval( response, options, doc );
- }
- } );
- };
-
-
- jQuery.fn.extend( {
- wrapAll: function( html ) {
- var wrap;
-
- if ( this[ 0 ] ) {
- if ( isFunction( html ) ) {
- html = html.call( this[ 0 ] );
- }
-
- // The elements to wrap the target around
- wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
-
- if ( this[ 0 ].parentNode ) {
- wrap.insertBefore( this[ 0 ] );
- }
-
- wrap.map( function() {
- var elem = this;
-
- while ( elem.firstElementChild ) {
- elem = elem.firstElementChild;
- }
-
- return elem;
- } ).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( isFunction( html ) ) {
- return this.each( function( i ) {
- jQuery( this ).wrapInner( html.call( this, i ) );
- } );
- }
-
- return this.each( function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- } );
- },
-
- wrap: function( html ) {
- var htmlIsFunction = isFunction( html );
-
- return this.each( function( i ) {
- jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
- } );
- },
-
- unwrap: function( selector ) {
- this.parent( selector ).not( "body" ).each( function() {
- jQuery( this ).replaceWith( this.childNodes );
- } );
- return this;
- }
- } );
-
-
- jQuery.expr.pseudos.hidden = function( elem ) {
- return !jQuery.expr.pseudos.visible( elem );
- };
- jQuery.expr.pseudos.visible = function( elem ) {
- return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
- };
-
-
-
-
- jQuery.ajaxSettings.xhr = function() {
- try {
- return new window.XMLHttpRequest();
- } catch ( e ) {}
- };
-
- var xhrSuccessStatus = {
-
- // File protocol always yields status code 0, assume 200
- 0: 200,
-
- // Support: IE <=9 only
- // #1450: sometimes IE returns 1223 when it should be 204
- 1223: 204
- },
- xhrSupported = jQuery.ajaxSettings.xhr();
-
- support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
- support.ajax = xhrSupported = !!xhrSupported;
-
- jQuery.ajaxTransport( function( options ) {
- var callback, errorCallback;
-
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( support.cors || xhrSupported && !options.crossDomain ) {
- return {
- send: function( headers, complete ) {
- var i,
- xhr = options.xhr();
-
- xhr.open(
- options.type,
- options.url,
- options.async,
- options.username,
- options.password
- );
-
- // Apply custom fields if provided
- if ( options.xhrFields ) {
- for ( i in options.xhrFields ) {
- xhr[ i ] = options.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( options.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( options.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
- headers[ "X-Requested-With" ] = "XMLHttpRequest";
- }
-
- // Set headers
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
-
- // Callback
- callback = function( type ) {
- return function() {
- if ( callback ) {
- callback = errorCallback = xhr.onload =
- xhr.onerror = xhr.onabort = xhr.ontimeout =
- xhr.onreadystatechange = null;
-
- if ( type === "abort" ) {
- xhr.abort();
- } else if ( type === "error" ) {
-
- // Support: IE <=9 only
- // On a manual native abort, IE9 throws
- // errors on any property access that is not readyState
- if ( typeof xhr.status !== "number" ) {
- complete( 0, "error" );
- } else {
- complete(
-
- // File: protocol always yields status 0; see #8605, #14207
- xhr.status,
- xhr.statusText
- );
- }
- } else {
- complete(
- xhrSuccessStatus[ xhr.status ] || xhr.status,
- xhr.statusText,
-
- // Support: IE <=9 only
- // IE9 has no XHR2 but throws on binary (trac-11426)
- // For XHR2 non-text, let the caller handle it (gh-2498)
- ( xhr.responseType || "text" ) !== "text" ||
- typeof xhr.responseText !== "string" ?
- { binary: xhr.response } :
- { text: xhr.responseText },
- xhr.getAllResponseHeaders()
- );
- }
- }
- };
- };
-
- // Listen to events
- xhr.onload = callback();
- errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
-
- // Support: IE 9 only
- // Use onreadystatechange to replace onabort
- // to handle uncaught aborts
- if ( xhr.onabort !== undefined ) {
- xhr.onabort = errorCallback;
- } else {
- xhr.onreadystatechange = function() {
-
- // Check readyState before timeout as it changes
- if ( xhr.readyState === 4 ) {
-
- // Allow onerror to be called first,
- // but that will not handle a native abort
- // Also, save errorCallback to a variable
- // as xhr.onerror cannot be accessed
- window.setTimeout( function() {
- if ( callback ) {
- errorCallback();
- }
- } );
- }
- };
- }
-
- // Create the abort callback
- callback = callback( "abort" );
-
- try {
-
- // Do send the request (this may raise an exception)
- xhr.send( options.hasContent && options.data || null );
- } catch ( e ) {
-
- // #14683: Only rethrow if this hasn't been notified as an error yet
- if ( callback ) {
- throw e;
- }
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
- };
- }
- } );
-
-
-
-
- // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
- jQuery.ajaxPrefilter( function( s ) {
- if ( s.crossDomain ) {
- s.contents.script = false;
- }
- } );
-
- // Install script dataType
- jQuery.ajaxSetup( {
- accepts: {
- script: "text/javascript, application/javascript, " +
- "application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /\b(?:java|ecma)script\b/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
- } );
-
- // Handle cache's special case and crossDomain
- jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- }
- } );
-
- // Bind script tag hack transport
- jQuery.ajaxTransport( "script", function( s ) {
-
- // This transport only deals with cross domain or forced-by-attrs requests
- if ( s.crossDomain || s.scriptAttrs ) {
- var script, callback;
- return {
- send: function( _, complete ) {
- script = jQuery( "<script>" )
- .attr( s.scriptAttrs || {} )
- .prop( { charset: s.scriptCharset, src: s.url } )
- .on( "load error", callback = function( evt ) {
- script.remove();
- callback = null;
- if ( evt ) {
- complete( evt.type === "error" ? 404 : 200, evt.type );
- }
- } );
-
- // Use native DOM manipulation to avoid our domManip AJAX trickery
- document.head.appendChild( script[ 0 ] );
- },
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
- };
- }
- } );
-
-
-
-
- var oldCallbacks = [],
- rjsonp = /(=)\?(?=&|$)|\?\?/;
-
- // Default jsonp settings
- jQuery.ajaxSetup( {
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
- this[ callback ] = true;
- return callback;
- }
- } );
-
- // Detect, normalize options and install callbacks for jsonp requests
- jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
- var callbackName, overwritten, responseContainer,
- jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
- "url" :
- typeof s.data === "string" &&
- ( s.contentType || "" )
- .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
- rjsonp.test( s.data ) && "data"
- );
-
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
- if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
- // Get callback name, remembering preexisting value associated with it
- callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
- s.jsonpCallback() :
- s.jsonpCallback;
-
- // Insert callback into url or form data
- if ( jsonProp ) {
- s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
- } else if ( s.jsonp !== false ) {
- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
- }
-
- // Use data converter to retrieve json after script execution
- s.converters[ "script json" ] = function() {
- if ( !responseContainer ) {
- jQuery.error( callbackName + " was not called" );
- }
- return responseContainer[ 0 ];
- };
-
- // Force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Install callback
- overwritten = window[ callbackName ];
- window[ callbackName ] = function() {
- responseContainer = arguments;
- };
-
- // Clean-up function (fires after converters)
- jqXHR.always( function() {
-
- // If previous value didn't exist - remove it
- if ( overwritten === undefined ) {
- jQuery( window ).removeProp( callbackName );
-
- // Otherwise restore preexisting value
- } else {
- window[ callbackName ] = overwritten;
- }
-
- // Save back as free
- if ( s[ callbackName ] ) {
-
- // Make sure that re-using the options doesn't screw things around
- s.jsonpCallback = originalSettings.jsonpCallback;
-
- // Save the callback name for future use
- oldCallbacks.push( callbackName );
- }
-
- // Call if it was a function and we have a response
- if ( responseContainer && isFunction( overwritten ) ) {
- overwritten( responseContainer[ 0 ] );
- }
-
- responseContainer = overwritten = undefined;
- } );
-
- // Delegate to script
- return "script";
- }
- } );
-
-
-
-
- // Support: Safari 8 only
- // In Safari 8 documents created via document.implementation.createHTMLDocument
- // collapse sibling forms: the second one becomes a child of the first one.
- // Because of that, this security measure has to be disabled in Safari 8.
- // https://bugs.webkit.org/show_bug.cgi?id=137337
- support.createHTMLDocument = ( function() {
- var body = document.implementation.createHTMLDocument( "" ).body;
- body.innerHTML = "<form></form><form></form>";
- return body.childNodes.length === 2;
- } )();
-
-
- // Argument "data" should be string of html
- // context (optional): If specified, the fragment will be created in this context,
- // defaults to document
- // keepScripts (optional): If true, will include scripts passed in the html string
- jQuery.parseHTML = function( data, context, keepScripts ) {
- if ( typeof data !== "string" ) {
- return [];
- }
- if ( typeof context === "boolean" ) {
- keepScripts = context;
- context = false;
- }
-
- var base, parsed, scripts;
-
- if ( !context ) {
-
- // Stop scripts or inline event handlers from being executed immediately
- // by using document.implementation
- if ( support.createHTMLDocument ) {
- context = document.implementation.createHTMLDocument( "" );
-
- // Set the base href for the created document
- // so any parsed elements with URLs
- // are based on the document's URL (gh-2965)
- base = context.createElement( "base" );
- base.href = document.location.href;
- context.head.appendChild( base );
- } else {
- context = document;
- }
- }
-
- parsed = rsingleTag.exec( data );
- scripts = !keepScripts && [];
-
- // Single tag
- if ( parsed ) {
- return [ context.createElement( parsed[ 1 ] ) ];
- }
-
- parsed = buildFragment( [ data ], context, scripts );
-
- if ( scripts && scripts.length ) {
- jQuery( scripts ).remove();
- }
-
- return jQuery.merge( [], parsed.childNodes );
- };
-
-
- /**
- * Load a url into a page
- */
- jQuery.fn.load = function( url, params, callback ) {
- var selector, type, response,
- self = this,
- off = url.indexOf( " " );
-
- if ( off > -1 ) {
- selector = stripAndCollapse( url.slice( off ) );
- url = url.slice( 0, off );
- }
-
- // If it's a function
- if ( isFunction( params ) ) {
-
- // We assume that it's the callback
- callback = params;
- params = undefined;
-
- // Otherwise, build a param string
- } else if ( params && typeof params === "object" ) {
- type = "POST";
- }
-
- // If we have elements to modify, make the request
- if ( self.length > 0 ) {
- jQuery.ajax( {
- url: url,
-
- // If "type" variable is undefined, then "GET" method will be used.
- // Make value of this field explicit since
- // user can override it through ajaxSetup method
- type: type || "GET",
- dataType: "html",
- data: params
- } ).done( function( responseText ) {
-
- // Save response for use in complete callback
- response = arguments;
-
- self.html( selector ?
-
- // If a selector was specified, locate the right elements in a dummy div
- // Exclude scripts to avoid IE 'Permission Denied' errors
- jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
- // Otherwise use the full result
- responseText );
-
- // If the request succeeds, this function gets "data", "status", "jqXHR"
- // but they are ignored because response was set above.
- // If it fails, this function gets "jqXHR", "status", "error"
- } ).always( callback && function( jqXHR, status ) {
- self.each( function() {
- callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
- } );
- } );
- }
-
- return this;
- };
-
-
-
-
- jQuery.expr.pseudos.animated = function( elem ) {
- return jQuery.grep( jQuery.timers, function( fn ) {
- return elem === fn.elem;
- } ).length;
- };
-
-
-
-
- jQuery.offset = {
- setOffset: function( elem, options, i ) {
- var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
- position = jQuery.css( elem, "position" ),
- curElem = jQuery( elem ),
- props = {};
-
- // Set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- curOffset = curElem.offset();
- curCSSTop = jQuery.css( elem, "top" );
- curCSSLeft = jQuery.css( elem, "left" );
- calculatePosition = ( position === "absolute" || position === "fixed" ) &&
- ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
-
- // Need to be able to calculate position if either
- // top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
-
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( isFunction( options ) ) {
-
- // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
- options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
-
- } else {
- if ( typeof props.top === "number" ) {
- props.top += "px";
- }
- if ( typeof props.left === "number" ) {
- props.left += "px";
- }
- curElem.css( props );
- }
- }
- };
-
- jQuery.fn.extend( {
-
- // offset() relates an element's border box to the document origin
- offset: function( options ) {
-
- // Preserve chaining for setter
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each( function( i ) {
- jQuery.offset.setOffset( this, options, i );
- } );
- }
-
- var rect, win,
- elem = this[ 0 ];
-
- if ( !elem ) {
- return;
- }
-
- // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
- // Support: IE <=11 only
- // Running getBoundingClientRect on a
- // disconnected node in IE throws an error
- if ( !elem.getClientRects().length ) {
- return { top: 0, left: 0 };
- }
-
- // Get document-relative position by adding viewport scroll to viewport-relative gBCR
- rect = elem.getBoundingClientRect();
- win = elem.ownerDocument.defaultView;
- return {
- top: rect.top + win.pageYOffset,
- left: rect.left + win.pageXOffset
- };
- },
-
- // position() relates an element's margin box to its offset parent's padding box
- // This corresponds to the behavior of CSS absolute positioning
- position: function() {
- if ( !this[ 0 ] ) {
- return;
- }
-
- var offsetParent, offset, doc,
- elem = this[ 0 ],
- parentOffset = { top: 0, left: 0 };
-
- // position:fixed elements are offset from the viewport, which itself always has zero offset
- if ( jQuery.css( elem, "position" ) === "fixed" ) {
-
- // Assume position:fixed implies availability of getBoundingClientRect
- offset = elem.getBoundingClientRect();
-
- } else {
- offset = this.offset();
-
- // Account for the *real* offset parent, which can be the document or its root element
- // when a statically positioned element is identified
- doc = elem.ownerDocument;
- offsetParent = elem.offsetParent || doc.documentElement;
- while ( offsetParent &&
- ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
- jQuery.css( offsetParent, "position" ) === "static" ) {
-
- offsetParent = offsetParent.parentNode;
- }
- if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
-
- // Incorporate borders into its offset, since they are outside its content origin
- parentOffset = jQuery( offsetParent ).offset();
- parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
- parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
- }
- }
-
- // Subtract parent offsets and element margins
- return {
- top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
- left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
- };
- },
-
- // This method will return documentElement in the following cases:
- // 1) For the element inside the iframe without offsetParent, this method will return
- // documentElement of the parent window
- // 2) For the hidden or detached element
- // 3) For body or html element, i.e. in case of the html node - it will return itself
- //
- // but those exceptions were never presented as a real life use-cases
- // and might be considered as more preferable results.
- //
- // This logic, however, is not guaranteed and can change at any point in the future
- offsetParent: function() {
- return this.map( function() {
- var offsetParent = this.offsetParent;
-
- while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
- offsetParent = offsetParent.offsetParent;
- }
-
- return offsetParent || documentElement;
- } );
- }
- } );
-
- // Create scrollLeft and scrollTop methods
- jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
- var top = "pageYOffset" === prop;
-
- jQuery.fn[ method ] = function( val ) {
- return access( this, function( elem, method, val ) {
-
- // Coalesce documents and windows
- var win;
- if ( isWindow( elem ) ) {
- win = elem;
- } else if ( elem.nodeType === 9 ) {
- win = elem.defaultView;
- }
-
- if ( val === undefined ) {
- return win ? win[ prop ] : elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : win.pageXOffset,
- top ? val : win.pageYOffset
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length );
- };
- } );
-
- // Support: Safari <=7 - 9.1, Chrome <=37 - 49
- // Add the top/left cssHooks using jQuery.fn.position
- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
- // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
- // getComputedStyle returns percent when specified for top/left/bottom/right;
- // rather than make the css module depend on the offset module, just check for it here
- jQuery.each( [ "top", "left" ], function( _i, prop ) {
- jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
- function( elem, computed ) {
- if ( computed ) {
- computed = curCSS( elem, prop );
-
- // If curCSS returns percentage, fallback to offset
- return rnumnonpx.test( computed ) ?
- jQuery( elem ).position()[ prop ] + "px" :
- computed;
- }
- }
- );
- } );
-
-
- // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
- jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
- function( defaultExtra, funcName ) {
-
- // Margin is only for outerHeight, outerWidth
- jQuery.fn[ funcName ] = function( margin, value ) {
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
- return access( this, function( elem, type, value ) {
- var doc;
-
- if ( isWindow( elem ) ) {
-
- // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
- return funcName.indexOf( "outer" ) === 0 ?
- elem[ "inner" + name ] :
- elem.document.documentElement[ "client" + name ];
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- doc = elem.documentElement;
-
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
- // whichever is greatest
- return Math.max(
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
- elem.body[ "offset" + name ], doc[ "offset" + name ],
- doc[ "client" + name ]
- );
- }
-
- return value === undefined ?
-
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css( elem, type, extra ) :
-
- // Set width or height on the element
- jQuery.style( elem, type, value, extra );
- }, type, chainable ? margin : undefined, chainable );
- };
- } );
- } );
-
-
- jQuery.each( [
- "ajaxStart",
- "ajaxStop",
- "ajaxComplete",
- "ajaxError",
- "ajaxSuccess",
- "ajaxSend"
- ], function( _i, type ) {
- jQuery.fn[ type ] = function( fn ) {
- return this.on( type, fn );
- };
- } );
-
-
-
-
- jQuery.fn.extend( {
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
-
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ?
- this.off( selector, "**" ) :
- this.off( types, selector || "**", fn );
- },
-
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- }
- } );
-
- jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup contextmenu" ).split( " " ),
- function( _i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
- } );
-
-
-
-
- // Support: Android <=4.0 only
- // Make sure we trim BOM and NBSP
- var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
- // However, it is not slated for removal any time soon
- jQuery.proxy = function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- };
-
- jQuery.holdReady = function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- };
- jQuery.isArray = Array.isArray;
- jQuery.parseJSON = JSON.parse;
- jQuery.nodeName = nodeName;
- jQuery.isFunction = isFunction;
- jQuery.isWindow = isWindow;
- jQuery.camelCase = camelCase;
- jQuery.type = toType;
-
- jQuery.now = Date.now;
-
- jQuery.isNumeric = function( obj ) {
-
- // As of jQuery 3.0, isNumeric is limited to
- // strings and numbers (primitives or objects)
- // that can be coerced to finite numbers (gh-2662)
- var type = jQuery.type( obj );
- return ( type === "number" || type === "string" ) &&
-
- // parseFloat NaNs numeric-cast false positives ("")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- !isNaN( obj - parseFloat( obj ) );
- };
-
- jQuery.trim = function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- };
-
-
-
-
- var
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$;
-
- jQuery.noConflict = function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- };
-
- // Expose jQuery and $ identifiers, even in AMD
- // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
- // and CommonJS for browser emulators (#13566)
- if ( typeof noGlobal === "undefined" ) {
- window.jQuery = window.$ = jQuery;
- }
-
-
-
-
- return jQuery;
- } );
- });
-
- var jquery$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), jquery, {
- 'default': jquery
- }));
-
- /*!
+function(t){var e,n,i,o,r,s,a,l,u,c,h,d,f,p,m,g,_,v,y,b="sizzle"+1*new Date,x=t.document,w=0,T=0,C=lt(),E=lt(),$=lt(),L=lt(),k=function(t,e){return t===e&&(h=!0),0},P={}.hasOwnProperty,S=[],M=S.pop,A=S.push,N=S.push,D=S.slice,I=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",z="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\[[\\x20\\t\\r\\n\\f]*("+B+")(?:"+z+"*([*^$|!~]?=)"+z+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+z+"*\\]",R=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",Z=new RegExp(z+"+","g"),H=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),q=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),F=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),W=new RegExp(z+"|>"),U=new RegExp(R),V=new RegExp("^"+B+"$"),G={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,Y=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ot=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},rt=function(){d()},st=bt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{N.apply(S=D.call(x.childNodes),x.childNodes),S[x.childNodes.length].nodeType}catch(t){N={apply:S.length?function(t,e){A.apply(t,D.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,o){var r,a,u,c,h,p,_,v=e&&e.ownerDocument,x=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return i;if(!o&&(d(e),e=e||f,m)){if(11!==x&&(h=J.exec(t)))if(r=h[1]){if(9===x){if(!(u=e.getElementById(r)))return i;if(u.id===r)return i.push(u),i}else if(v&&(u=v.getElementById(r))&&y(e,u)&&u.id===r)return i.push(u),i}else{if(h[2])return N.apply(i,e.getElementsByTagName(t)),i;if((r=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return N.apply(i,e.getElementsByClassName(r)),i}if(n.qsa&&!L[t+" "]&&(!g||!g.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(_=t,v=e,1===x&&(W.test(t)||F.test(t))){for((v=tt.test(t)&&_t(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(it,ot):e.setAttribute("id",c=b)),a=(p=s(t)).length;a--;)p[a]=(c?"#"+c:":scope")+" "+yt(p[a]);_=p.join(",")}try{return N.apply(i,v.querySelectorAll(_)),i}catch(e){L(t,!0)}finally{c===b&&e.removeAttribute("id")}}}return l(t.replace(H,"$1"),e,i,o)}function lt(){var t=[];return function e(n,o){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=o}}function ut(t){return t[b]=!0,t}function ct(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=e}function dt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&st(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ut((function(e){return e=+e,ut((function(n,i){for(var o,r=t([],n.length,e),s=r.length;s--;)n[o=r[s]]&&(n[o]=!(i[o]=n[o]))}))}))}function _t(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},r=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!K.test(e||n&&n.nodeName||"HTML")},d=at.setDocument=function(t){var e,o,s=t?t.ownerDocument||t:x;return s!=f&&9===s.nodeType&&s.documentElement?(p=(f=s).documentElement,m=!r(f),x!=f&&(o=f.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",rt,!1):o.attachEvent&&o.attachEvent("onunload",rt)),n.scope=ct((function(t){return p.appendChild(t).appendChild(f.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ct((function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(f.getElementsByClassName),n.getById=ct((function(t){return p.appendChild(t).id=b,!f.getElementsByName||!f.getElementsByName(b).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,o,r=e.getElementById(t);if(r){if((n=r.getAttributeNode("id"))&&n.value===t)return[r];for(o=e.getElementsByName(t),i=0;r=o[i++];)if((n=r.getAttributeNode("id"))&&n.value===t)return[r]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],o=0,r=e.getElementsByTagName(t);if("*"===t){for(;n=r[o++];)1===n.nodeType&&i.push(n);return i}return r},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},_=[],g=[],(n.qsa=Q.test(f.querySelectorAll))&&(ct((function(t){var e;p.appendChild(t).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+O+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=f.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Q.test(v=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ct((function(t){n.disconnectedMatch=v.call(t,"*"),v.call(t,"[s!='']:x"),_.push("!=",R)})),g=g.length&&new RegExp(g.join("|")),_=_.length&&new RegExp(_.join("|")),e=Q.test(p.compareDocumentPosition),y=e||Q.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},k=e?function(t,e){if(t===e)return h=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==f||t.ownerDocument==x&&y(x,t)?-1:e==f||e.ownerDocument==x&&y(x,e)?1:c?I(c,t)-I(c,e):0:4&i?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,i=0,o=t.parentNode,r=e.parentNode,s=[t],a=[e];if(!o||!r)return t==f?-1:e==f?1:o?-1:r?1:c?I(c,t)-I(c,e):0;if(o===r)return dt(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?dt(s[i],a[i]):s[i]==x?-1:a[i]==x?1:0},f):f},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&m&&!L[e+" "]&&(!_||!_.test(e))&&(!g||!g.test(e)))try{var i=v.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){L(e,!0)}return at(e,f,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=f&&d(t),y(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=f&&d(t);var o=i.attrHandle[e.toLowerCase()],r=o&&P.call(i.attrHandle,e.toLowerCase())?o(t,e,!m):void 0;return void 0!==r?r:n.attributes||!m?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},at.escape=function(t){return(t+"").replace(it,ot)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],o=0,r=0;if(h=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(k),h){for(;e=t[r++];)e===t[r]&&(o=i.push(r));for(;o--;)t.splice(i[o],1)}return c=null,t},o=at.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=o(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=o(e);return n},(i=at.selectors={cacheLength:50,createPseudo:ut,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&U.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=C[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+z+"|$)"))&&C(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var o=at.attr(i,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(Z," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,o){var r="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===o?function(t){return!!t.parentNode}:function(e,n,l){var u,c,h,d,f,p,m=r!==s?"nextSibling":"previousSibling",g=e.parentNode,_=a&&e.nodeName.toLowerCase(),v=!l&&!a,y=!1;if(g){if(r){for(;m;){for(d=e;d=d[m];)if(a?d.nodeName.toLowerCase()===_:1===d.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?g.firstChild:g.lastChild],s&&v){for(y=(f=(u=(c=(h=(d=g)[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(y=f=0)||p.pop();)if(1===d.nodeType&&++y&&d===e){c[t]=[w,f,y];break}}else if(v&&(y=f=(u=(c=(h=(d=e)[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===y)for(;(d=++f&&d&&d[m]||(y=f=0)||p.pop())&&((a?d.nodeName.toLowerCase()!==_:1!==d.nodeType)||!++y||(v&&((c=(h=d[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]=[w,y]),d!==e)););return(y-=o)===i||y%i==0&&y/i>=0}}},PSEUDO:function(t,e){var n,o=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return o[b]?o(e):o.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ut((function(t,n){for(var i,r=o(t,e),s=r.length;s--;)t[i=I(t,r[s])]=!(n[i]=r[s])})):function(t){return o(t,0,n)}):o}},pseudos:{not:ut((function(t){var e=[],n=[],i=a(t.replace(H,"$1"));return i[b]?ut((function(t,e,n,o){for(var r,s=i(t,null,o,[]),a=t.length;a--;)(r=s[a])&&(t[a]=!(e[a]=r))})):function(t,o,r){return e[0]=t,i(e,null,r,n),e[0]=null,!n.pop()}})),has:ut((function(t){return function(e){return at(t,e).length>0}})),contains:ut((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||o(e)).indexOf(t)>-1}})),lang:ut((function(t){return V.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return X.test(t.nodeName)},input:function(t){return Y.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:gt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:gt((function(t,e,n){for(var i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:gt((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}}).pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=ft(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=pt(e);function vt(){}function yt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function bt(t,e,n){var i=e.dir,o=e.next,r=o||i,s=n&&"parentNode"===r,a=T++;return e.first?function(e,n,o){for(;e=e[i];)if(1===e.nodeType||s)return t(e,n,o);return!1}:function(e,n,l){var u,c,h,d=[w,a];if(l){for(;e=e[i];)if((1===e.nodeType||s)&&t(e,n,l))return!0}else for(;e=e[i];)if(1===e.nodeType||s)if(c=(h=e[b]||(e[b]={}))[e.uniqueID]||(h[e.uniqueID]={}),o&&o===e.nodeName.toLowerCase())e=e[i]||e;else{if((u=c[r])&&u[0]===w&&u[1]===a)return d[2]=u[2];if(c[r]=d,d[2]=t(e,n,l))return!0}return!1}}function xt(t){return t.length>1?function(e,n,i){for(var o=t.length;o--;)if(!t[o](e,n,i))return!1;return!0}:t[0]}function wt(t,e,n,i,o){for(var r,s=[],a=0,l=t.length,u=null!=e;a<l;a++)(r=t[a])&&(n&&!n(r,i,o)||(s.push(r),u&&e.push(a)));return s}function Tt(t,e,n,i,o,r){return i&&!i[b]&&(i=Tt(i)),o&&!o[b]&&(o=Tt(o,r)),ut((function(r,s,a,l){var u,c,h,d=[],f=[],p=s.length,m=r||function(t,e,n){for(var i=0,o=e.length;i<o;i++)at(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),g=!t||!r&&e?m:wt(m,d,t,a,l),_=n?o||(r?t:p||i)?[]:s:g;if(n&&n(g,_,a,l),i)for(u=wt(_,f),i(u,[],a,l),c=u.length;c--;)(h=u[c])&&(_[f[c]]=!(g[f[c]]=h));if(r){if(o||t){if(o){for(u=[],c=_.length;c--;)(h=_[c])&&u.push(g[c]=h);o(null,_=[],u,l)}for(c=_.length;c--;)(h=_[c])&&(u=o?I(r,h):d[c])>-1&&(r[u]=!(s[u]=h))}}else _=wt(_===s?_.splice(p,_.length):_),o?o(null,s,_,l):N.apply(s,_)}))}function Ct(t){for(var e,n,o,r=t.length,s=i.relative[t[0].type],a=s||i.relative[" "],l=s?1:0,c=bt((function(t){return t===e}),a,!0),h=bt((function(t){return I(e,t)>-1}),a,!0),d=[function(t,n,i){var o=!s&&(i||n!==u)||((e=n).nodeType?c(t,n,i):h(t,n,i));return e=null,o}];l<r;l++)if(n=i.relative[t[l].type])d=[bt(xt(d),n)];else{if((n=i.filter[t[l].type].apply(null,t[l].matches))[b]){for(o=++l;o<r&&!i.relative[t[o].type];o++);return Tt(l>1&&xt(d),l>1&&yt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(H,"$1"),n,l<o&&Ct(t.slice(l,o)),o<r&&Ct(t=t.slice(o)),o<r&&yt(t))}d.push(n)}return xt(d)}return vt.prototype=i.filters=i.pseudos,i.setFilters=new vt,s=at.tokenize=function(t,e){var n,o,r,s,a,l,u,c=E[t+" "];if(c)return e?0:c.slice(0);for(a=t,l=[],u=i.preFilter;a;){for(s in n&&!(o=q.exec(a))||(o&&(a=a.slice(o[0].length)||a),l.push(r=[])),n=!1,(o=F.exec(a))&&(n=o.shift(),r.push({value:n,type:o[0].replace(H," ")}),a=a.slice(n.length)),i.filter)!(o=G[s].exec(a))||u[s]&&!(o=u[s](o))||(n=o.shift(),r.push({value:n,type:s,matches:o}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):E(t,l).slice(0)},a=at.compile=function(t,e){var n,o=[],r=[],a=$[t+" "];if(!a){for(e||(e=s(t)),n=e.length;n--;)(a=Ct(e[n]))[b]?o.push(a):r.push(a);(a=$(t,function(t,e){var n=e.length>0,o=t.length>0,r=function(r,s,a,l,c){var h,p,g,_=0,v="0",y=r&&[],b=[],x=u,T=r||o&&i.find.TAG("*",c),C=w+=null==x?1:Math.random()||.1,E=T.length;for(c&&(u=s==f||s||c);v!==E&&null!=(h=T[v]);v++){if(o&&h){for(p=0,s||h.ownerDocument==f||(d(h),a=!m);g=t[p++];)if(g(h,s||f,a)){l.push(h);break}c&&(w=C)}n&&((h=!g&&h)&&_--,r&&y.push(h))}if(_+=v,n&&v!==_){for(p=0;g=e[p++];)g(y,b,s,a);if(r){if(_>0)for(;v--;)y[v]||b[v]||(b[v]=M.call(l));b=wt(b)}N.apply(l,b),c&&!r&&b.length>0&&_+e.length>1&&at.uniqueSort(l)}return c&&(w=C,u=x),y};return n?ut(r):r}(r,o))).selector=t}return a},l=at.select=function(t,e,n,o){var r,l,u,c,h,d="function"==typeof t&&t,f=!o&&s(t=d.selector||t);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===e.nodeType&&m&&i.relative[l[1].type]){if(!(e=(i.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(r=G.needsContext.test(t)?0:l.length;r--&&(u=l[r],!i.relative[c=u.type]);)if((h=i.find[c])&&(o=h(u.matches[0].replace(et,nt),tt.test(l[0].type)&&_t(e.parentNode)||e))){if(l.splice(r,1),!(t=o.length&&yt(l)))return N.apply(n,o),n;break}}return(d||a(t,f))(o,e,!m,n,!e||tt.test(t)&&_t(e.parentNode)||e),n},n.sortStable=b.split("").sort(k).join("")===b,n.detectDuplicates=!!h,d(),n.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))})),ct((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ht("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ct((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ht("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ct((function(t){return null==t.getAttribute("disabled")}))||ht(O,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),at}(t);x.find=T,x.expr=T.selectors,x.expr[":"]=x.expr.pseudos,x.uniqueSort=x.unique=T.uniqueSort,x.text=T.getText,x.isXMLDoc=T.isXML,x.contains=T.contains,x.escapeSelector=T.escape;var C=function(t,e,n){for(var i=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&x(t).is(n))break;i.push(t)}return i},E=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},$=x.expr.match.needsContext;function L(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var k=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(t,e,n){return p(e)?x.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?x.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?x.grep(t,(function(t){return a.call(e,t)>-1!==n})):x.filter(e,t,n)}x.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?x.find.matchesSelector(i,t)?[i]:[]:x.find.matches(t,x.grep(e,(function(t){return 1===t.nodeType})))},x.fn.extend({find:function(t){var e,n,i=this.length,o=this;if("string"!=typeof t)return this.pushStack(x(t).filter((function(){for(e=0;e<i;e++)if(x.contains(o[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)x.find(t,o[e],n);return i>1?x.uniqueSort(n):n},filter:function(t){return this.pushStack(P(this,t||[],!1))},not:function(t){return this.pushStack(P(this,t||[],!0))},is:function(t){return!!P(this,"string"==typeof t&&$.test(t)?x(t):t||[],!1).length}});var S,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(t,e,n){var i,o;if(!t)return this;if(n=n||S,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:M.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof x?e[0]:e,x.merge(this,x.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),k.test(i[1])&&x.isPlainObject(e))for(i in e)p(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(o=g.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):p(t)?void 0!==n.ready?n.ready(t):t(x):x.makeArray(t,this)}).prototype=x.fn,S=x(g);var A=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function D(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}x.fn.extend({has:function(t){var e=x(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(x.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,o=this.length,r=[],s="string"!=typeof t&&x(t);if(!$.test(t))for(;i<o;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,t))){r.push(n);break}return this.pushStack(r.length>1?x.uniqueSort(r):r)},index:function(t){return t?"string"==typeof t?a.call(x(t),this[0]):a.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),x.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return C(t,"parentNode")},parentsUntil:function(t,e,n){return C(t,"parentNode",n)},next:function(t){return D(t,"nextSibling")},prev:function(t){return D(t,"previousSibling")},nextAll:function(t){return C(t,"nextSibling")},prevAll:function(t){return C(t,"previousSibling")},nextUntil:function(t,e,n){return C(t,"nextSibling",n)},prevUntil:function(t,e,n){return C(t,"previousSibling",n)},siblings:function(t){return E((t.parentNode||{}).firstChild,t)},children:function(t){return E(t.firstChild)},contents:function(t){return null!=t.contentDocument&&i(t.contentDocument)?t.contentDocument:(L(t,"template")&&(t=t.content||t),x.merge([],t.childNodes))}},(function(t,e){x.fn[t]=function(n,i){var o=x.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=x.filter(i,o)),this.length>1&&(N[t]||x.uniqueSort(o),A.test(t)&&o.reverse()),this.pushStack(o)}}));var I=/[^\x20\t\r\n\f]+/g;function O(t){return t}function z(t){throw t}function B(t,e,n,i){var o;try{t&&p(o=t.promise)?o.call(t).done(e).fail(n):t&&p(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}x.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return x.each(t.match(I)||[],(function(t,n){e[n]=!0})),e}(t):x.extend({},t);var e,n,i,o,r=[],s=[],a=-1,l=function(){for(o=o||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a<r.length;)!1===r[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=r.length,n=!1);t.memory||(n=!1),e=!1,o&&(r=n?[]:"")},u={add:function(){return r&&(n&&!e&&(a=r.length-1,s.push(n)),function e(n){x.each(n,(function(n,i){p(i)?t.unique&&u.has(i)||r.push(i):i&&i.length&&"string"!==y(i)&&e(i)}))}(arguments),n&&!e&&l()),this},remove:function(){return x.each(arguments,(function(t,e){for(var n;(n=x.inArray(e,r,n))>-1;)r.splice(n,1),n<=a&&a--})),this},has:function(t){return t?x.inArray(t,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return o=s=[],r=n="",this},disabled:function(){return!r},lock:function(){return o=s=[],n||e||(r=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},x.extend({Deferred:function(e){var n=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],i="pending",o={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return x.Deferred((function(e){x.each(n,(function(n,i){var o=p(t[i[4]])&&t[i[4]];r[i[1]]((function(){var t=o&&o.apply(this,arguments);t&&p(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,o?[t]:arguments)}))})),t=null})).promise()},then:function(e,i,o){var r=0;function s(e,n,i,o){return function(){var a=this,l=arguments,u=function(){var t,u;if(!(e<r)){if((t=i.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");u=t&&("object"==typeof t||"function"==typeof t)&&t.then,p(u)?o?u.call(t,s(r,n,O,o),s(r,n,z,o)):(r++,u.call(t,s(r,n,O,o),s(r,n,z,o),s(r,n,O,n.notifyWith))):(i!==O&&(a=void 0,l=[t]),(o||n.resolveWith)(a,l))}},c=o?u:function(){try{u()}catch(t){x.Deferred.exceptionHook&&x.Deferred.exceptionHook(t,c.stackTrace),e+1>=r&&(i!==z&&(a=void 0,l=[t]),n.rejectWith(a,l))}};e?c():(x.Deferred.getStackHook&&(c.stackTrace=x.Deferred.getStackHook()),t.setTimeout(c))}}return x.Deferred((function(t){n[0][3].add(s(0,t,p(o)?o:O,t.notifyWith)),n[1][3].add(s(0,t,p(e)?e:O)),n[2][3].add(s(0,t,p(i)?i:z))})).promise()},promise:function(t){return null!=t?x.extend(t,o):o}},r={};return x.each(n,(function(t,e){var s=e[2],a=e[5];o[e[1]]=s.add,a&&s.add((function(){i=a}),n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),s.add(e[3].fire),r[e[0]]=function(){return r[e[0]+"With"](this===r?void 0:this,arguments),this},r[e[0]+"With"]=s.fireWith})),o.promise(r),e&&e.call(r,r),r},when:function(t){var e=arguments.length,n=e,i=Array(n),r=o.call(arguments),s=x.Deferred(),a=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?o.call(arguments):n,--e||s.resolveWith(i,r)}};if(e<=1&&(B(t,s.done(a(n)).resolve,s.reject,!e),"pending"===s.state()||p(r[n]&&r[n].then)))return s.then();for(;n--;)B(r[n],a(n),s.reject);return s.promise()}});var j=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&j.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},x.readyException=function(e){t.setTimeout((function(){throw e}))};var R=x.Deferred();function Z(){g.removeEventListener("DOMContentLoaded",Z),t.removeEventListener("load",Z),x.ready()}x.fn.ready=function(t){return R.then(t).catch((function(t){x.readyException(t)})),this},x.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==t&&--x.readyWait>0||R.resolveWith(g,[x]))}}),x.ready.then=R.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?t.setTimeout(x.ready):(g.addEventListener("DOMContentLoaded",Z),t.addEventListener("load",Z));var H=function(t,e,n,i,o,r,s){var a=0,l=t.length,u=null==n;if("object"===y(n))for(a in o=!0,n)H(t,e,a,n[a],!0,r,s);else if(void 0!==i&&(o=!0,p(i)||(s=!0),u&&(s?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(x(t),n)})),e))for(;a<l;a++)e(t[a],n,s?i:i.call(t[a],a,e(t[a],n)));return o?t:u?e.call(t):l?e(t[0],n):r},q=/^-ms-/,F=/-([a-z])/g;function W(t,e){return e.toUpperCase()}function U(t){return t.replace(q,"ms-").replace(F,W)}var V=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function G(){this.expando=x.expando+G.uid++}G.uid=1,G.prototype={cache:function(t){var e=t[this.expando];return e||(e={},V(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,o=this.cache(t);if("string"==typeof e)o[U(e)]=n;else for(i in e)o[U(i)]=e[i];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][U(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){n=(e=Array.isArray(e)?e.map(U):(e=U(e))in i?[e]:e.match(I)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||x.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!x.isEmptyObject(e)}};var K=new G,Y=new G,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function J(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(Q,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:X.test(t)?JSON.parse(t):t)}(n)}catch(t){}Y.set(t,e,n)}else n=void 0;return n}x.extend({hasData:function(t){return Y.hasData(t)||K.hasData(t)},data:function(t,e,n){return Y.access(t,e,n)},removeData:function(t,e){Y.remove(t,e)},_data:function(t,e,n){return K.access(t,e,n)},_removeData:function(t,e){K.remove(t,e)}}),x.fn.extend({data:function(t,e){var n,i,o,r=this[0],s=r&&r.attributes;if(void 0===t){if(this.length&&(o=Y.get(r),1===r.nodeType&&!K.get(r,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&(i=U(i.slice(5)),J(r,i,o[i]));K.set(r,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each((function(){Y.set(this,t)})):H(this,(function(e){var n;if(r&&void 0===e)return void 0!==(n=Y.get(r,t))||void 0!==(n=J(r,t))?n:void 0;this.each((function(){Y.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Y.remove(this,t)}))}}),x.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=K.get(t,e),n&&(!i||Array.isArray(n)?i=K.access(t,e,x.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=x.queue(t,e),i=n.length,o=n.shift(),r=x._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),i--),o&&("fx"===e&&n.unshift("inprogress"),delete r.stop,o.call(t,(function(){x.dequeue(t,e)}),r)),!i&&r&&r.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return K.get(t,n)||K.access(t,n,{empty:x.Callbacks("once memory").add((function(){K.remove(t,[e+"queue",n])}))})}}),x.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?x.queue(this[0],t):void 0===e?this:this.each((function(){var n=x.queue(this,t,e);x._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&x.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){x.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,o=x.Deferred(),r=this,s=this.length,a=function(){--i||o.resolveWith(r,[r])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=K.get(r[s],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),o.promise(e)}});var tt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,et=new RegExp("^(?:([+-])=|)("+tt+")([a-z%]*)$","i"),nt=["Top","Right","Bottom","Left"],it=g.documentElement,ot=function(t){return x.contains(t.ownerDocument,t)},rt={composed:!0};it.getRootNode&&(ot=function(t){return x.contains(t.ownerDocument,t)||t.getRootNode(rt)===t.ownerDocument});var st=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&ot(t)&&"none"===x.css(t,"display")};function at(t,e,n,i){var o,r,s=20,a=i?function(){return i.cur()}:function(){return x.css(t,e,"")},l=a(),u=n&&n[3]||(x.cssNumber[e]?"":"px"),c=t.nodeType&&(x.cssNumber[e]||"px"!==u&&+l)&&et.exec(x.css(t,e));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;s--;)x.style(t,e,c+u),(1-r)*(1-(r=a()/l||.5))<=0&&(s=0),c/=r;c*=2,x.style(t,e,c+u),n=n||[]}return n&&(c=+c||+l||0,o=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=c,i.end=o)),o}var lt={};function ut(t){var e,n=t.ownerDocument,i=t.nodeName,o=lt[i];return o||(e=n.body.appendChild(n.createElement(i)),o=x.css(e,"display"),e.parentNode.removeChild(e),"none"===o&&(o="block"),lt[i]=o,o)}function ct(t,e){for(var n,i,o=[],r=0,s=t.length;r<s;r++)(i=t[r]).style&&(n=i.style.display,e?("none"===n&&(o[r]=K.get(i,"display")||null,o[r]||(i.style.display="")),""===i.style.display&&st(i)&&(o[r]=ut(i))):"none"!==n&&(o[r]="none",K.set(i,"display",n)));for(r=0;r<s;r++)null!=o[r]&&(t[r].style.display=o[r]);return t}x.fn.extend({show:function(){return ct(this,!0)},hide:function(){return ct(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){st(this)?x(this).show():x(this).hide()}))}});var ht,dt,ft=/^(?:checkbox|radio)$/i,pt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,mt=/^$|^module$|\/(?:java|ecma)script/i;ht=g.createDocumentFragment().appendChild(g.createElement("div")),(dt=g.createElement("input")).setAttribute("type","radio"),dt.setAttribute("checked","checked"),dt.setAttribute("name","t"),ht.appendChild(dt),f.checkClone=ht.cloneNode(!0).cloneNode(!0).lastChild.checked,ht.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!ht.cloneNode(!0).lastChild.defaultValue,ht.innerHTML="<option></option>",f.option=!!ht.lastChild;var gt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function _t(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&L(t,e)?x.merge([t],n):n}function vt(t,e){for(var n=0,i=t.length;n<i;n++)K.set(t[n],"globalEval",!e||K.get(e[n],"globalEval"))}gt.tbody=gt.tfoot=gt.colgroup=gt.caption=gt.thead,gt.th=gt.td,f.option||(gt.optgroup=gt.option=[1,"<select multiple='multiple'>","</select>"]);var yt=/<|&#?\w+;/;function bt(t,e,n,i,o){for(var r,s,a,l,u,c,h=e.createDocumentFragment(),d=[],f=0,p=t.length;f<p;f++)if((r=t[f])||0===r)if("object"===y(r))x.merge(d,r.nodeType?[r]:r);else if(yt.test(r)){for(s=s||h.appendChild(e.createElement("div")),a=(pt.exec(r)||["",""])[1].toLowerCase(),l=gt[a]||gt._default,s.innerHTML=l[1]+x.htmlPrefilter(r)+l[2],c=l[0];c--;)s=s.lastChild;x.merge(d,s.childNodes),(s=h.firstChild).textContent=""}else d.push(e.createTextNode(r));for(h.textContent="",f=0;r=d[f++];)if(i&&x.inArray(r,i)>-1)o&&o.push(r);else if(u=ot(r),s=_t(h.appendChild(r),"script"),u&&vt(s),n)for(c=0;r=s[c++];)mt.test(r.type||"")&&n.push(r);return h}var xt=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function Tt(){return!1}function Ct(t,e){return t===function(){try{return g.activeElement}catch(t){}}()==("focus"===e)}function Et(t,e,n,i,o,r){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Et(t,a,n,i,e[a],r);return t}if(null==i&&null==o?(o=n,i=n=void 0):null==o&&("string"==typeof n?(o=i,i=void 0):(o=i,i=n,n=void 0)),!1===o)o=Tt;else if(!o)return t;return 1===r&&(s=o,(o=function(t){return x().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=x.guid++)),t.each((function(){x.event.add(this,e,o,i,n)}))}function $t(t,e,n){n?(K.set(t,e,!1),x.event.add(t,e,{namespace:!1,handler:function(t){var i,r,s=K.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)(x.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=o.call(arguments),K.set(this,e,s),i=n(this,e),this[e](),s!==(r=K.get(this,e))||i?K.set(this,e,!1):r={},s!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else s.length&&(K.set(this,e,{value:x.event.trigger(x.extend(s[0],x.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===K.get(t,e)&&x.event.add(t,e,wt)}x.event={global:{},add:function(t,e,n,i,o){var r,s,a,l,u,c,h,d,f,p,m,g=K.get(t);if(V(t))for(n.handler&&(n=(r=n).handler,o=r.selector),o&&x.find.matchesSelector(it,o),n.guid||(n.guid=x.guid++),(l=g.events)||(l=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(e){return void 0!==x&&x.event.triggered!==e.type?x.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(I)||[""]).length;u--;)f=m=(a=xt.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),f&&(h=x.event.special[f]||{},f=(o?h.delegateType:h.bindType)||f,h=x.event.special[f]||{},c=x.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:p.join(".")},r),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,i,p,s)||t.addEventListener&&t.addEventListener(f,s)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,c):d.push(c),x.event.global[f]=!0)},remove:function(t,e,n,i,o){var r,s,a,l,u,c,h,d,f,p,m,g=K.hasData(t)&&K.get(t);if(g&&(l=g.events)){for(u=(e=(e||"").match(I)||[""]).length;u--;)if(f=m=(a=xt.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),f){for(h=x.event.special[f]||{},d=l[f=(i?h.delegateType:h.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=r=d.length;r--;)c=d[r],!o&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(r,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(t,c));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,p,g.handle)||x.removeEvent(t,f,g.handle),delete l[f])}else for(f in l)x.event.remove(t,f+e[u],n,i,!0);x.isEmptyObject(l)&&K.remove(t,"handle events")}},dispatch:function(t){var e,n,i,o,r,s,a=new Array(arguments.length),l=x.event.fix(t),u=(K.get(this,"events")||Object.create(null))[l.type]||[],c=x.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(s=x.event.handlers.call(this,l,u),e=0;(o=s[e++])&&!l.isPropagationStopped();)for(l.currentTarget=o.elem,n=0;(r=o.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==r.namespace&&!l.rnamespace.test(r.namespace)||(l.handleObj=r,l.data=r.data,void 0!==(i=((x.event.special[r.origType]||{}).handle||r.handler).apply(o.elem,a))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,i,o,r,s,a=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(r=[],s={},n=0;n<l;n++)void 0===s[o=(i=e[n]).selector+" "]&&(s[o]=i.needsContext?x(o,this).index(u)>-1:x.find(o,this,null,[u]).length),s[o]&&r.push(i);r.length&&a.push({elem:u,handlers:r})}return u=this,l<e.length&&a.push({elem:u,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(x.Event.prototype,t,{enumerable:!0,configurable:!0,get:p(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[x.expando]?t:new x.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return ft.test(e.type)&&e.click&&L(e,"input")&&$t(e,"click",wt),!1},trigger:function(t){var e=this||t;return ft.test(e.type)&&e.click&&L(e,"input")&&$t(e,"click"),!0},_default:function(t){var e=t.target;return ft.test(e.type)&&e.click&&L(e,"input")&&K.get(e,"click")||L(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},x.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},x.Event=function(t,e){if(!(this instanceof x.Event))return new x.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?wt:Tt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&x.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[x.expando]=!0},x.Event.prototype={constructor:x.Event,isDefaultPrevented:Tt,isPropagationStopped:Tt,isImmediatePropagationStopped:Tt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=wt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=wt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=wt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},x.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},x.event.addProp),x.each({focus:"focusin",blur:"focusout"},(function(t,e){x.event.special[t]={setup:function(){return $t(this,t,Ct),!1},trigger:function(){return $t(this,t),!0},_default:function(){return!0},delegateType:e}})),x.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){x.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,o=t.relatedTarget,r=t.handleObj;return o&&(o===i||x.contains(i,o))||(t.type=r.origType,n=r.handler.apply(this,arguments),t.type=e),n}}})),x.fn.extend({on:function(t,e,n,i){return Et(this,t,e,n,i)},one:function(t,e,n,i){return Et(this,t,e,n,i,1)},off:function(t,e,n){var i,o;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,x(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Tt),this.each((function(){x.event.remove(this,t,n,e)}))}});var Lt=/<script|<style|<link/i,kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Pt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function St(t,e){return L(t,"table")&&L(11!==e.nodeType?e:e.firstChild,"tr")&&x(t).children("tbody")[0]||t}function Mt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function At(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Nt(t,e){var n,i,o,r,s,a;if(1===e.nodeType){if(K.hasData(t)&&(a=K.get(t).events))for(o in K.remove(e,"handle events"),a)for(n=0,i=a[o].length;n<i;n++)x.event.add(e,o,a[o][n]);Y.hasData(t)&&(r=Y.access(t),s=x.extend({},r),Y.set(e,s))}}function Dt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&ft.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function It(t,e,n,i){e=r(e);var o,s,a,l,u,c,h=0,d=t.length,m=d-1,g=e[0],_=p(g);if(_||d>1&&"string"==typeof g&&!f.checkClone&&kt.test(g))return t.each((function(o){var r=t.eq(o);_&&(e[0]=g.call(this,o,r.html())),It(r,e,n,i)}));if(d&&(s=(o=bt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===o.childNodes.length&&(o=s),s||i)){for(l=(a=x.map(_t(o,"script"),Mt)).length;h<d;h++)u=o,h!==m&&(u=x.clone(u,!0,!0),l&&x.merge(a,_t(u,"script"))),n.call(t[h],u,h);if(l)for(c=a[a.length-1].ownerDocument,x.map(a,At),h=0;h<l;h++)u=a[h],mt.test(u.type||"")&&!K.access(u,"globalEval")&&x.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?x._evalUrl&&!u.noModule&&x._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):v(u.textContent.replace(Pt,""),u,c))}return t}function Ot(t,e,n){for(var i,o=e?x.filter(e,t):t,r=0;null!=(i=o[r]);r++)n||1!==i.nodeType||x.cleanData(_t(i)),i.parentNode&&(n&&ot(i)&&vt(_t(i,"script")),i.parentNode.removeChild(i));return t}x.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,o,r,s,a=t.cloneNode(!0),l=ot(t);if(!(f.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||x.isXMLDoc(t)))for(s=_t(a),i=0,o=(r=_t(t)).length;i<o;i++)Dt(r[i],s[i]);if(e)if(n)for(r=r||_t(t),s=s||_t(a),i=0,o=r.length;i<o;i++)Nt(r[i],s[i]);else Nt(t,a);return(s=_t(a,"script")).length>0&&vt(s,!l&&_t(t,"script")),a},cleanData:function(t){for(var e,n,i,o=x.event.special,r=0;void 0!==(n=t[r]);r++)if(V(n)){if(e=n[K.expando]){if(e.events)for(i in e.events)o[i]?x.event.remove(n,i):x.removeEvent(n,i,e.handle);n[K.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),x.fn.extend({detach:function(t){return Ot(this,t,!0)},remove:function(t){return Ot(this,t)},text:function(t){return H(this,(function(t){return void 0===t?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return It(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||St(this,t).appendChild(t)}))},prepend:function(){return It(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=St(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return It(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return It(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(x.cleanData(_t(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return x.clone(this,t,e)}))},html:function(t){return H(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Lt.test(t)&&!gt[(pt.exec(t)||["",""])[1].toLowerCase()]){t=x.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(x.cleanData(_t(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return It(this,arguments,(function(e){var n=this.parentNode;x.inArray(this,t)<0&&(x.cleanData(_t(this)),n&&n.replaceChild(e,this))}),t)}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){x.fn[t]=function(t){for(var n,i=[],o=x(t),r=o.length-1,a=0;a<=r;a++)n=a===r?this:this.clone(!0),x(o[a])[e](n),s.apply(i,n.get());return this.pushStack(i)}}));var zt=new RegExp("^("+tt+")(?!px)[a-z%]+$","i"),Bt=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},jt=function(t,e,n){var i,o,r={};for(o in e)r[o]=t.style[o],t.style[o]=e[o];for(o in i=n.call(t),e)t.style[o]=r[o];return i},Rt=new RegExp(nt.join("|"),"i");function Zt(t,e,n){var i,o,r,s,a=t.style;return(n=n||Bt(t))&&(""!==(s=n.getPropertyValue(e)||n[e])||ot(t)||(s=x.style(t,e)),!f.pixelBoxStyles()&&zt.test(s)&&Rt.test(e)&&(i=a.width,o=a.minWidth,r=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=o,a.maxWidth=r)),void 0!==s?s+"":s}function Ht(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",it.appendChild(u).appendChild(c);var e=t.getComputedStyle(c);i="1%"!==e.top,l=12===n(e.marginLeft),c.style.right="60%",s=36===n(e.right),o=36===n(e.width),c.style.position="absolute",r=12===n(c.offsetWidth/3),it.removeChild(u),c=null}}function n(t){return Math.round(parseFloat(t))}var i,o,r,s,a,l,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,x.extend(f,{boxSizingReliable:function(){return e(),o},pixelBoxStyles:function(){return e(),s},pixelPosition:function(){return e(),i},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),r},reliableTrDimensions:function(){var e,n,i,o;return null==a&&(e=g.createElement("table"),n=g.createElement("tr"),i=g.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",i.style.height="9px",i.style.display="block",it.appendChild(e).appendChild(n).appendChild(i),o=t.getComputedStyle(n),a=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===n.offsetHeight,it.removeChild(e)),a}}))}();var qt=["Webkit","Moz","ms"],Ft=g.createElement("div").style,Wt={};function Ut(t){var e=x.cssProps[t]||Wt[t];return e||(t in Ft?t:Wt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=qt.length;n--;)if((t=qt[n]+e)in Ft)return t}(t)||t)}var Vt=/^(none|table(?!-c[ea]).+)/,Gt=/^--/,Kt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:"0",fontWeight:"400"};function Xt(t,e,n){var i=et.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function Qt(t,e,n,i,o,r){var s="width"===e?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=x.css(t,n+nt[s],!0,o)),i?("content"===n&&(l-=x.css(t,"padding"+nt[s],!0,o)),"margin"!==n&&(l-=x.css(t,"border"+nt[s]+"Width",!0,o))):(l+=x.css(t,"padding"+nt[s],!0,o),"padding"!==n?l+=x.css(t,"border"+nt[s]+"Width",!0,o):a+=x.css(t,"border"+nt[s]+"Width",!0,o));return!i&&r>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-r-l-a-.5))||0),l}function Jt(t,e,n){var i=Bt(t),o=(!f.boxSizingReliable()||n)&&"border-box"===x.css(t,"boxSizing",!1,i),r=o,s=Zt(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(zt.test(s)){if(!n)return s;s="auto"}return(!f.boxSizingReliable()&&o||!f.reliableTrDimensions()&&L(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===x.css(t,"display",!1,i))&&t.getClientRects().length&&(o="border-box"===x.css(t,"boxSizing",!1,i),(r=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+Qt(t,e,n||(o?"border":"content"),r,i,s)+"px"}function te(t,e,n,i,o){return new te.prototype.init(t,e,n,i,o)}x.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Zt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,r,s,a=U(e),l=Gt.test(e),u=t.style;if(l||(e=Ut(a)),s=x.cssHooks[e]||x.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(t,!1,i))?o:u[e];"string"===(r=typeof n)&&(o=et.exec(n))&&o[1]&&(n=at(t,e,o),r="number"),null!=n&&n==n&&("number"!==r||l||(n+=o&&o[3]||(x.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,i){var o,r,s,a=U(e);return Gt.test(e)||(e=Ut(a)),(s=x.cssHooks[e]||x.cssHooks[a])&&"get"in s&&(o=s.get(t,!0,n)),void 0===o&&(o=Zt(t,e,i)),"normal"===o&&e in Yt&&(o=Yt[e]),""===n||n?(r=parseFloat(o),!0===n||isFinite(r)?r||0:o):o}}),x.each(["height","width"],(function(t,e){x.cssHooks[e]={get:function(t,n,i){if(n)return!Vt.test(x.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?Jt(t,e,i):jt(t,Kt,(function(){return Jt(t,e,i)}))},set:function(t,n,i){var o,r=Bt(t),s=!f.scrollboxSize()&&"absolute"===r.position,a=(s||i)&&"border-box"===x.css(t,"boxSizing",!1,r),l=i?Qt(t,e,i,a,r):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-Qt(t,e,"border",!1,r)-.5)),l&&(o=et.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=x.css(t,e)),Xt(0,n,l)}}})),x.cssHooks.marginLeft=Ht(f.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-jt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(t,e){x.cssHooks[t+e]={expand:function(n){for(var i=0,o={},r="string"==typeof n?n.split(" "):[n];i<4;i++)o[t+nt[i]+e]=r[i]||r[i-2]||r[0];return o}},"margin"!==t&&(x.cssHooks[t+e].set=Xt)})),x.fn.extend({css:function(t,e){return H(this,(function(t,e,n){var i,o,r={},s=0;if(Array.isArray(e)){for(i=Bt(t),o=e.length;s<o;s++)r[e[s]]=x.css(t,e[s],!1,i);return r}return void 0!==n?x.style(t,e,n):x.css(t,e)}),t,e,arguments.length>1)}}),x.Tween=te,te.prototype={constructor:te,init:function(t,e,n,i,o,r){this.elem=t,this.prop=n,this.easing=o||x.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=r||(x.cssNumber[n]?"":"px")},cur:function(){var t=te.propHooks[this.prop];return t&&t.get?t.get(this):te.propHooks._default.get(this)},run:function(t){var e,n=te.propHooks[this.prop];return this.options.duration?this.pos=e=x.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):te.propHooks._default.set(this),this}},te.prototype.init.prototype=te.prototype,te.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=x.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){x.fx.step[t.prop]?x.fx.step[t.prop](t):1!==t.elem.nodeType||!x.cssHooks[t.prop]&&null==t.elem.style[Ut(t.prop)]?t.elem[t.prop]=t.now:x.style(t.elem,t.prop,t.now+t.unit)}}},te.propHooks.scrollTop=te.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},x.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},x.fx=te.prototype.init,x.fx.step={};var ee,ne,ie=/^(?:toggle|show|hide)$/,oe=/queueHooks$/;function re(){ne&&(!1===g.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(re):t.setTimeout(re,x.fx.interval),x.fx.tick())}function se(){return t.setTimeout((function(){ee=void 0})),ee=Date.now()}function ae(t,e){var n,i=0,o={height:t};for(e=e?1:0;i<4;i+=2-e)o["margin"+(n=nt[i])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function le(t,e,n){for(var i,o=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),r=0,s=o.length;r<s;r++)if(i=o[r].call(n,e,t))return i}function ue(t,e,n){var i,o,r=0,s=ue.prefilters.length,a=x.Deferred().always((function(){delete l.elem})),l=function(){if(o)return!1;for(var e=ee||se(),n=Math.max(0,u.startTime+u.duration-e),i=1-(n/u.duration||0),r=0,s=u.tweens.length;r<s;r++)u.tweens[r].run(i);return a.notifyWith(t,[u,i,n]),i<1&&s?n:(s||a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u]),!1)},u=a.promise({elem:t,props:x.extend({},e),opts:x.extend(!0,{specialEasing:{},easing:x.easing._default},n),originalProperties:e,originalOptions:n,startTime:ee||se(),duration:n.duration,tweens:[],createTween:function(e,n){var i=x.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(i),i},stop:function(e){var n=0,i=e?u.tweens.length:0;if(o)return this;for(o=!0;n<i;n++)u.tweens[n].run(1);return e?(a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u,e])):a.rejectWith(t,[u,e]),this}}),c=u.props;for(!function(t,e){var n,i,o,r,s;for(n in t)if(o=e[i=U(n)],r=t[n],Array.isArray(r)&&(o=r[1],r=t[n]=r[0]),n!==i&&(t[i]=r,delete t[n]),(s=x.cssHooks[i])&&"expand"in s)for(n in r=s.expand(r),delete t[i],r)n in t||(t[n]=r[n],e[n]=o);else e[i]=o}(c,u.opts.specialEasing);r<s;r++)if(i=ue.prefilters[r].call(u,t,c,u.opts))return p(i.stop)&&(x._queueHooks(u.elem,u.opts.queue).stop=i.stop.bind(i)),i;return x.map(c,le,u),p(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),x.fx.timer(x.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u}x.Animation=x.extend(ue,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return at(n.elem,t,et.exec(e),n),n}]},tweener:function(t,e){p(t)?(e=t,t=["*"]):t=t.match(I);for(var n,i=0,o=t.length;i<o;i++)n=t[i],ue.tweeners[n]=ue.tweeners[n]||[],ue.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,o,r,s,a,l,u,c,h="width"in e||"height"in e,d=this,f={},p=t.style,m=t.nodeType&&st(t),g=K.get(t,"fxshow");for(i in n.queue||(null==(s=x._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always((function(){d.always((function(){s.unqueued--,x.queue(t,"fx").length||s.empty.fire()}))}))),e)if(o=e[i],ie.test(o)){if(delete e[i],r=r||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||!g||void 0===g[i])continue;m=!0}f[i]=g&&g[i]||x.style(t,i)}if((l=!x.isEmptyObject(e))||!x.isEmptyObject(f))for(i in h&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=g&&g.display)&&(u=K.get(t,"display")),"none"===(c=x.css(t,"display"))&&(u?c=u:(ct([t],!0),u=t.style.display||u,c=x.css(t,"display"),ct([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===x.css(t,"float")&&(l||(d.done((function(){p.display=u})),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=K.access(t,"fxshow",{display:u}),r&&(g.hidden=!m),m&&ct([t],!0),d.done((function(){for(i in m||ct([t]),K.remove(t,"fxshow"),f)x.style(t,i,f[i])}))),l=le(m?g[i]:0,i,d),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?ue.prefilters.unshift(t):ue.prefilters.push(t)}}),x.speed=function(t,e,n){var i=t&&"object"==typeof t?x.extend({},t):{complete:n||!n&&e||p(t)&&t,duration:t,easing:n&&e||e&&!p(e)&&e};return x.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in x.fx.speeds?i.duration=x.fx.speeds[i.duration]:i.duration=x.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){p(i.old)&&i.old.call(this),i.queue&&x.dequeue(this,i.queue)},i},x.fn.extend({fadeTo:function(t,e,n,i){return this.filter(st).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var o=x.isEmptyObject(t),r=x.speed(e,n,i),s=function(){var e=ue(this,x.extend({},t),r);(o||K.get(this,"finish"))&&e.stop(!0)};return s.finish=s,o||!1===r.queue?this.each(s):this.queue(r.queue,s)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,o=null!=t&&t+"queueHooks",r=x.timers,s=K.get(this);if(o)s[o]&&s[o].stop&&i(s[o]);else for(o in s)s[o]&&s[o].stop&&oe.test(o)&&i(s[o]);for(o=r.length;o--;)r[o].elem!==this||null!=t&&r[o].queue!==t||(r[o].anim.stop(n),e=!1,r.splice(o,1));!e&&n||x.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=K.get(this),i=n[t+"queue"],o=n[t+"queueHooks"],r=x.timers,s=i?i.length:0;for(n.finish=!0,x.queue(this,t,[]),o&&o.stop&&o.stop.call(this,!0),e=r.length;e--;)r[e].elem===this&&r[e].queue===t&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;e<s;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),x.each(["toggle","show","hide"],(function(t,e){var n=x.fn[e];x.fn[e]=function(t,i,o){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ae(e,!0),t,i,o)}})),x.each({slideDown:ae("show"),slideUp:ae("hide"),slideToggle:ae("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){x.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),x.timers=[],x.fx.tick=function(){var t,e=0,n=x.timers;for(ee=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||x.fx.stop(),ee=void 0},x.fx.timer=function(t){x.timers.push(t),x.fx.start()},x.fx.interval=13,x.fx.start=function(){ne||(ne=!0,re())},x.fx.stop=function(){ne=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fn.delay=function(e,n){return e=x.fx&&x.fx.speeds[e]||e,n=n||"fx",this.queue(n,(function(n,i){var o=t.setTimeout(n,e);i.stop=function(){t.clearTimeout(o)}}))},function(){var t=g.createElement("input"),e=g.createElement("select").appendChild(g.createElement("option"));t.type="checkbox",f.checkOn=""!==t.value,f.optSelected=e.selected,(t=g.createElement("input")).value="t",t.type="radio",f.radioValue="t"===t.value}();var ce,he=x.expr.attrHandle;x.fn.extend({attr:function(t,e){return H(this,x.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){x.removeAttr(this,t)}))}}),x.extend({attr:function(t,e,n){var i,o,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===t.getAttribute?x.prop(t,e,n):(1===r&&x.isXMLDoc(t)||(o=x.attrHooks[e.toLowerCase()]||(x.expr.match.bool.test(e)?ce:void 0)),void 0!==n?null===n?void x.removeAttr(t,e):o&&"set"in o&&void 0!==(i=o.set(t,n,e))?i:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(i=o.get(t,e))?i:null==(i=x.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!f.radioValue&&"radio"===e&&L(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,o=e&&e.match(I);if(o&&1===t.nodeType)for(;n=o[i++];)t.removeAttribute(n)}}),ce={set:function(t,e,n){return!1===e?x.removeAttr(t,n):t.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=he[e]||x.find.attr;he[e]=function(t,e,i){var o,r,s=e.toLowerCase();return i||(r=he[s],he[s]=o,o=null!=n(t,e,i)?s:null,he[s]=r),o}}));var de=/^(?:input|select|textarea|button)$/i,fe=/^(?:a|area)$/i;function pe(t){return(t.match(I)||[]).join(" ")}function me(t){return t.getAttribute&&t.getAttribute("class")||""}function ge(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(I)||[]}x.fn.extend({prop:function(t,e){return H(this,x.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[x.propFix[t]||t]}))}}),x.extend({prop:function(t,e,n){var i,o,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&x.isXMLDoc(t)||(e=x.propFix[e]||e,o=x.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(i=o.set(t,n,e))?i:t[e]=n:o&&"get"in o&&null!==(i=o.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=x.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||fe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(x.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(t){var e,n,i,o,r,s,a,l=0;if(p(t))return this.each((function(e){x(this).addClass(t.call(this,e,me(this)))}));if((e=ge(t)).length)for(;n=this[l++];)if(o=me(n),i=1===n.nodeType&&" "+pe(o)+" "){for(s=0;r=e[s++];)i.indexOf(" "+r+" ")<0&&(i+=r+" ");o!==(a=pe(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,o,r,s,a,l=0;if(p(t))return this.each((function(e){x(this).removeClass(t.call(this,e,me(this)))}));if(!arguments.length)return this.attr("class","");if((e=ge(t)).length)for(;n=this[l++];)if(o=me(n),i=1===n.nodeType&&" "+pe(o)+" "){for(s=0;r=e[s++];)for(;i.indexOf(" "+r+" ")>-1;)i=i.replace(" "+r+" "," ");o!==(a=pe(i))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):p(t)?this.each((function(n){x(this).toggleClass(t.call(this,n,me(this),e),e)})):this.each((function(){var e,o,r,s;if(i)for(o=0,r=x(this),s=ge(t);e=s[o++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==n||((e=me(this))&&K.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":K.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+pe(me(n))+" ").indexOf(e)>-1)return!0;return!1}});var _e=/\r/g;x.fn.extend({val:function(t){var e,n,i,o=this[0];return arguments.length?(i=p(t),this.each((function(n){var o;1===this.nodeType&&(null==(o=i?t.call(this,n,x(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=x.map(o,(function(t){return null==t?"":t+""}))),(e=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))}))):o?(e=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(_e,""):null==n?"":n:void 0}}),x.extend({valHooks:{option:{get:function(t){var e=x.find.attr(t,"value");return null!=e?e:pe(x.text(t))}},select:{get:function(t){var e,n,i,o=t.options,r=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?r+1:o.length;for(i=r<0?l:s?r:0;i<l;i++)if(((n=o[i]).selected||i===r)&&!n.disabled&&(!n.parentNode.disabled||!L(n.parentNode,"optgroup"))){if(e=x(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,i,o=t.options,r=x.makeArray(e),s=o.length;s--;)((i=o[s]).selected=x.inArray(x.valHooks.option.get(i),r)>-1)&&(n=!0);return n||(t.selectedIndex=-1),r}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=x.inArray(x(t).val(),e)>-1}},f.checkOn||(x.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),f.focusin="onfocusin"in t;var ve=/^(?:focusinfocus|focusoutblur)$/,ye=function(t){t.stopPropagation()};x.extend(x.event,{trigger:function(e,n,i,o){var r,s,a,l,u,h,d,f,_=[i||g],v=c.call(e,"type")?e.type:e,y=c.call(e,"namespace")?e.namespace.split("."):[];if(s=f=a=i=i||g,3!==i.nodeType&&8!==i.nodeType&&!ve.test(v+x.event.triggered)&&(v.indexOf(".")>-1&&(y=v.split("."),v=y.shift(),y.sort()),u=v.indexOf(":")<0&&"on"+v,(e=e[x.expando]?e:new x.Event(v,"object"==typeof e&&e)).isTrigger=o?2:3,e.namespace=y.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:x.makeArray(n,[e]),d=x.event.special[v]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!m(i)){for(l=d.delegateType||v,ve.test(l+v)||(s=s.parentNode);s;s=s.parentNode)_.push(s),a=s;a===(i.ownerDocument||g)&&_.push(a.defaultView||a.parentWindow||t)}for(r=0;(s=_[r++])&&!e.isPropagationStopped();)f=s,e.type=r>1?l:d.bindType||v,(h=(K.get(s,"events")||Object.create(null))[e.type]&&K.get(s,"handle"))&&h.apply(s,n),(h=u&&s[u])&&h.apply&&V(s)&&(e.result=h.apply(s,n),!1===e.result&&e.preventDefault());return e.type=v,o||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(_.pop(),n)||!V(i)||u&&p(i[v])&&!m(i)&&((a=i[u])&&(i[u]=null),x.event.triggered=v,e.isPropagationStopped()&&f.addEventListener(v,ye),i[v](),e.isPropagationStopped()&&f.removeEventListener(v,ye),x.event.triggered=void 0,a&&(i[u]=a)),e.result}},simulate:function(t,e,n){var i=x.extend(new x.Event,n,{type:t,isSimulated:!0});x.event.trigger(i,null,e)}}),x.fn.extend({trigger:function(t,e){return this.each((function(){x.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return x.event.trigger(t,e,n,!0)}}),f.focusin||x.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){x.event.simulate(e,t.target,x.event.fix(t))};x.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,o=K.access(i,e);o||i.addEventListener(t,n,!0),K.access(i,e,(o||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,o=K.access(i,e)-1;o?K.access(i,e,o):(i.removeEventListener(t,n,!0),K.remove(i,e))}}}));var be=t.location,xe={guid:Date.now()},we=/\?/;x.parseXML=function(e){var n,i;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return i=n&&n.getElementsByTagName("parsererror")[0],n&&!i||x.error("Invalid XML: "+(i?x.map(i.childNodes,(function(t){return t.textContent})).join("\n"):e)),n};var Te=/\[\]$/,Ce=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,$e=/^(?:input|select|textarea|keygen)/i;function Le(t,e,n,i){var o;if(Array.isArray(e))x.each(e,(function(e,o){n||Te.test(t)?i(t,o):Le(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,i)}));else if(n||"object"!==y(e))i(t,e);else for(o in e)Le(t+"["+o+"]",e[o],n,i)}x.param=function(t,e){var n,i=[],o=function(t,e){var n=p(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!x.isPlainObject(t))x.each(t,(function(){o(this.name,this.value)}));else for(n in t)Le(n,t[n],e,o);return i.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=x.prop(this,"elements");return t?x.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!x(this).is(":disabled")&&$e.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!ft.test(t))})).map((function(t,e){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(t){return{name:e.name,value:t.replace(Ce,"\r\n")}})):{name:e.name,value:n.replace(Ce,"\r\n")}})).get()}});var ke=/%20/g,Pe=/#.*$/,Se=/([?&])_=[^&]*/,Me=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ae=/^(?:GET|HEAD)$/,Ne=/^\/\//,De={},Ie={},Oe="*/".concat("*"),ze=g.createElement("a");function Be(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,o=0,r=e.toLowerCase().match(I)||[];if(p(n))for(;i=r[o++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function je(t,e,n,i){var o={},r=t===Ie;function s(a){var l;return o[a]=!0,x.each(t[a]||[],(function(t,a){var u=a(e,n,i);return"string"!=typeof u||r||o[u]?r?!(l=u):void 0:(e.dataTypes.unshift(u),s(u),!1)})),l}return s(e.dataTypes[0])||!o["*"]&&s("*")}function Re(t,e){var n,i,o=x.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:i||(i={}))[n]=e[n]);return i&&x.extend(!0,t,i),t}ze.href=be.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:be.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(be.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Oe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Re(Re(t,x.ajaxSettings),e):Re(x.ajaxSettings,t)},ajaxPrefilter:Be(De),ajaxTransport:Be(Ie),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var i,o,r,s,a,l,u,c,h,d,f=x.ajaxSetup({},n),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?x(p):x.event,_=x.Deferred(),v=x.Callbacks("once memory"),y=f.statusCode||{},b={},w={},T="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=Me.exec(r);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?r:null},setRequestHeader:function(t,e){return null==u&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==u&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)C.always(t[C.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||T;return i&&i.abort(e),E(0,e),this}};if(_.promise(C),f.url=((e||f.url||be.href)+"").replace(Ne,be.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(I)||[""],null==f.crossDomain){l=g.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=ze.protocol+"//"+ze.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=x.param(f.data,f.traditional)),je(De,f,n,C),u)return C;for(h in(c=x.event&&f.global)&&0==x.active++&&x.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ae.test(f.type),o=f.url.replace(Pe,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(ke,"+")):(d=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(we.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(Se,"$1"),d=(we.test(o)?"&":"?")+"_="+xe.guid+++d),f.url=o+d),f.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Oe+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,C,f)||u))return C.abort();if(T="abort",v.add(f.complete),C.done(f.success),C.fail(f.error),i=je(Ie,f,n,C)){if(C.readyState=1,c&&m.trigger("ajaxSend",[C,f]),u)return C;f.async&&f.timeout>0&&(a=t.setTimeout((function(){C.abort("timeout")}),f.timeout));try{u=!1,i.send(b,E)}catch(t){if(u)throw t;E(-1,t)}}else E(-1,"No Transport");function E(e,n,s,l){var h,d,g,b,w,T=n;u||(u=!0,a&&t.clearTimeout(a),i=void 0,r=l||"",C.readyState=e>0?4:0,h=e>=200&&e<300||304===e,s&&(b=function(t,e,n){for(var i,o,r,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(o in a)if(a[o]&&a[o].test(i)){l.unshift(o);break}if(l[0]in n)r=l[0];else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){r=o;break}s||(s=o)}r=r||s}if(r)return r!==l[0]&&l.unshift(r),n[r]}(f,C,s)),!h&&x.inArray("script",f.dataTypes)>-1&&x.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(t,e,n,i){var o,r,s,a,l,u={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(r=c.shift();r;)if(t.responseFields[r]&&(n[t.responseFields[r]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=r,r=c.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(s=u[l+" "+r]||u["* "+r]))for(o in u)if((a=o.split(" "))[1]===r&&(s=u[l+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[o]:!0!==u[o]&&(r=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+r}}}return{state:"success",data:e}}(f,b,C,h),h?(f.ifModified&&((w=C.getResponseHeader("Last-Modified"))&&(x.lastModified[o]=w),(w=C.getResponseHeader("etag"))&&(x.etag[o]=w)),204===e||"HEAD"===f.type?T="nocontent":304===e?T="notmodified":(T=b.state,d=b.data,h=!(g=b.error))):(g=T,!e&&T||(T="error",e<0&&(e=0))),C.status=e,C.statusText=(n||T)+"",h?_.resolveWith(p,[d,T,C]):_.rejectWith(p,[C,T,g]),C.statusCode(y),y=void 0,c&&m.trigger(h?"ajaxSuccess":"ajaxError",[C,f,h?d:g]),v.fireWith(p,[C,T]),c&&(m.trigger("ajaxComplete",[C,f]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return x.get(t,e,n,"json")},getScript:function(t,e){return x.get(t,void 0,e,"script")}}),x.each(["get","post"],(function(t,e){x[e]=function(t,n,i,o){return p(n)&&(o=o||i,i=n,n=void 0),x.ajax(x.extend({url:t,type:e,dataType:o,data:n,success:i},x.isPlainObject(t)&&t))}})),x.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),x._evalUrl=function(t,e,n){return x.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){x.globalEval(t,e,n)}})},x.fn.extend({wrapAll:function(t){var e;return this[0]&&(p(t)&&(t=t.call(this[0])),e=x(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return p(t)?this.each((function(e){x(this).wrapInner(t.call(this,e))})):this.each((function(){var e=x(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=p(t);return this.each((function(n){x(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(t){return!x.expr.pseudos.visible(t)},x.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ze={0:200,1223:204},He=x.ajaxSettings.xhr();f.cors=!!He&&"withCredentials"in He,f.ajax=He=!!He,x.ajaxTransport((function(e){var n,i;if(f.cors||He&&!e.crossDomain)return{send:function(o,r){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];for(s in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)a.setRequestHeader(s,o[s]);n=function(t){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?r(0,"error"):r(a.status,a.statusText):r(Ze[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout((function(){n&&i()}))},n=n("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}})),x.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return x.globalEval(t),t}}}),x.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),x.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,o){e=x("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&o("error"===t.type?404:200,t.type)}),g.head.appendChild(e[0])},abort:function(){n&&n()}}}));var qe,Fe=[],We=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Fe.pop()||x.expando+"_"+xe.guid++;return this[t]=!0,t}}),x.ajaxPrefilter("json jsonp",(function(e,n,i){var o,r,s,a=!1!==e.jsonp&&(We.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&We.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=p(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(We,"$1"+o):!1!==e.jsonp&&(e.url+=(we.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},e.dataTypes[0]="json",r=t[o],t[o]=function(){s=arguments},i.always((function(){void 0===r?x(t).removeProp(o):t[o]=r,e[o]&&(e.jsonpCallback=n.jsonpCallback,Fe.push(o)),s&&p(r)&&r(s[0]),s=r=void 0})),"script"})),f.createHTMLDocument=((qe=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===qe.childNodes.length),x.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(f.createHTMLDocument?((i=(e=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,e.head.appendChild(i)):e=g),r=!n&&[],(o=k.exec(t))?[e.createElement(o[1])]:(o=bt([t],e,r),r&&r.length&&x(r).remove(),x.merge([],o.childNodes)));var i,o,r},x.fn.load=function(t,e,n){var i,o,r,s=this,a=t.indexOf(" ");return a>-1&&(i=pe(t.slice(a)),t=t.slice(0,a)),p(e)?(n=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&x.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done((function(t){r=arguments,s.html(i?x("<div>").append(x.parseHTML(t)).find(i):t)})).always(n&&function(t,e){s.each((function(){n.apply(this,r||[t.responseText,e,t])}))}),this},x.expr.pseudos.animated=function(t){return x.grep(x.timers,(function(e){return t===e.elem})).length},x.offset={setOffset:function(t,e,n){var i,o,r,s,a,l,u=x.css(t,"position"),c=x(t),h={};"static"===u&&(t.style.position="relative"),a=c.offset(),r=x.css(t,"top"),l=x.css(t,"left"),("absolute"===u||"fixed"===u)&&(r+l).indexOf("auto")>-1?(s=(i=c.position()).top,o=i.left):(s=parseFloat(r)||0,o=parseFloat(l)||0),p(e)&&(e=e.call(t,n,x.extend({},a))),null!=e.top&&(h.top=e.top-a.top+s),null!=e.left&&(h.left=e.left-a.left+o),"using"in e?e.using.call(t,h):c.css(h)}},x.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){x.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],o={top:0,left:0};if("fixed"===x.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===x.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((o=x(t).offset()).top+=x.css(t,"borderTopWidth",!0),o.left+=x.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-x.css(i,"marginTop",!0),left:e.left-o.left-x.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===x.css(t,"position");)t=t.offsetParent;return t||it}))}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;x.fn[t]=function(i){return H(this,(function(t,i,o){var r;if(m(t)?r=t:9===t.nodeType&&(r=t.defaultView),void 0===o)return r?r[e]:t[i];r?r.scrollTo(n?r.pageXOffset:o,n?o:r.pageYOffset):t[i]=o}),t,i,arguments.length)}})),x.each(["top","left"],(function(t,e){x.cssHooks[e]=Ht(f.pixelPosition,(function(t,n){if(n)return n=Zt(t,e),zt.test(n)?x(t).position()[e]+"px":n}))})),x.each({Height:"height",Width:"width"},(function(t,e){x.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){x.fn[i]=function(o,r){var s=arguments.length&&(n||"boolean"!=typeof o),a=n||(!0===o||!0===r?"margin":"border");return H(this,(function(e,n,o){var r;return m(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===o?x.css(e,n,a):x.style(e,n,o,a)}),e,s?o:void 0,s)}}))})),x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){x.fn[e]=function(t){return this.on(e,t)}})),x.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),x.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){x.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var Ue=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;x.proxy=function(t,e){var n,i,r;if("string"==typeof e&&(n=t[e],e=t,t=n),p(t))return i=o.call(arguments,2),(r=function(){return t.apply(e||this,i.concat(o.call(arguments)))}).guid=t.guid=t.guid||x.guid++,r},x.holdReady=function(t){t?x.readyWait++:x.ready(!0)},x.isArray=Array.isArray,x.parseJSON=JSON.parse,x.nodeName=L,x.isFunction=p,x.isWindow=m,x.camelCase=U,x.type=y,x.now=Date.now,x.isNumeric=function(t){var e=x.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},x.trim=function(t){return null==t?"":(t+"").replace(Ue,"")};var Ve=t.jQuery,Ge=t.$;return x.noConflict=function(e){return t.$===x&&(t.$=Ge),e&&t.jQuery===x&&(t.jQuery=Ve),x},void 0===e&&(t.jQuery=t.$=x),x}))}));
+/*!
* Bootstrap v4.6.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- */
-
- createCommonjsModule(function (module, exports) {
- (function (global, factory) {
- factory(exports, jquery) ;
- }(commonjsGlobal, (function (exports, $) {
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
-
- var $__default = /*#__PURE__*/_interopDefaultLegacy($);
-
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
-
- function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
- }
-
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
-
- /**
- * --------------------------------------------------------------------------
- * Bootstrap (v4.6.0): util.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- * --------------------------------------------------------------------------
- */
- /**
- * ------------------------------------------------------------------------
- * Private TransitionEnd Helpers
- * ------------------------------------------------------------------------
- */
-
- var TRANSITION_END = 'transitionend';
- var MAX_UID = 1000000;
- var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
-
- function toType(obj) {
- if (obj === null || typeof obj === 'undefined') {
- return "" + obj;
- }
-
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
- }
-
- function getSpecialTransitionEndEvent() {
- return {
- bindType: TRANSITION_END,
- delegateType: TRANSITION_END,
- handle: function handle(event) {
- if ($__default['default'](event.target).is(this)) {
- return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
- }
-
- return undefined;
- }
- };
- }
-
- function transitionEndEmulator(duration) {
- var _this = this;
-
- var called = false;
- $__default['default'](this).one(Util.TRANSITION_END, function () {
- called = true;
- });
- setTimeout(function () {
- if (!called) {
- Util.triggerTransitionEnd(_this);
- }
- }, duration);
- return this;
- }
-
- function setTransitionEndSupport() {
- $__default['default'].fn.emulateTransitionEnd = transitionEndEmulator;
- $__default['default'].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
- }
- /**
- * --------------------------------------------------------------------------
- * Public Util Api
- * --------------------------------------------------------------------------
- */
-
-
- var Util = {
- TRANSITION_END: 'bsTransitionEnd',
- getUID: function getUID(prefix) {
- do {
- prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
- } while (document.getElementById(prefix));
-
- return prefix;
- },
- getSelectorFromElement: function getSelectorFromElement(element) {
- var selector = element.getAttribute('data-target');
-
- if (!selector || selector === '#') {
- var hrefAttr = element.getAttribute('href');
- selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
- }
-
- try {
- return document.querySelector(selector) ? selector : null;
- } catch (_) {
- return null;
- }
- },
- getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
- if (!element) {
- return 0;
- } // Get transition-duration of the element
-
-
- var transitionDuration = $__default['default'](element).css('transition-duration');
- var transitionDelay = $__default['default'](element).css('transition-delay');
- var floatTransitionDuration = parseFloat(transitionDuration);
- var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
-
- if (!floatTransitionDuration && !floatTransitionDelay) {
- return 0;
- } // If multiple durations are defined, take the first
-
-
- transitionDuration = transitionDuration.split(',')[0];
- transitionDelay = transitionDelay.split(',')[0];
- return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
- },
- reflow: function reflow(element) {
- return element.offsetHeight;
- },
- triggerTransitionEnd: function triggerTransitionEnd(element) {
- $__default['default'](element).trigger(TRANSITION_END);
- },
- supportsTransitionEnd: function supportsTransitionEnd() {
- return Boolean(TRANSITION_END);
- },
- isElement: function isElement(obj) {
- return (obj[0] || obj).nodeType;
- },
- typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
- for (var property in configTypes) {
- if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
- var expectedTypes = configTypes[property];
- var value = config[property];
- var valueType = value && Util.isElement(value) ? 'element' : toType(value);
-
- if (!new RegExp(expectedTypes).test(valueType)) {
- throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
- }
- }
- }
- },
- findShadowRoot: function findShadowRoot(element) {
- if (!document.documentElement.attachShadow) {
- return null;
- } // Can find the shadow root otherwise it'll return the document
-
-
- if (typeof element.getRootNode === 'function') {
- var root = element.getRootNode();
- return root instanceof ShadowRoot ? root : null;
- }
-
- if (element instanceof ShadowRoot) {
- return element;
- } // when we don't find a shadow root
-
-
- if (!element.parentNode) {
- return null;
- }
-
- return Util.findShadowRoot(element.parentNode);
- },
- jQueryDetection: function jQueryDetection() {
- if (typeof $__default['default'] === 'undefined') {
- throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
- }
-
- var version = $__default['default'].fn.jquery.split(' ')[0].split('.');
- var minMajor = 1;
- var ltMajor = 2;
- var minMinor = 9;
- var minPatch = 1;
- var maxMajor = 4;
-
- if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
- throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
- }
- }
- };
- Util.jQueryDetection();
- setTransitionEndSupport();
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME = 'alert';
- var VERSION = '4.6.0';
- var DATA_KEY = 'bs.alert';
- var EVENT_KEY = "." + DATA_KEY;
- var DATA_API_KEY = '.data-api';
- var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
- var SELECTOR_DISMISS = '[data-dismiss="alert"]';
- var EVENT_CLOSE = "close" + EVENT_KEY;
- var EVENT_CLOSED = "closed" + EVENT_KEY;
- var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
- var CLASS_NAME_ALERT = 'alert';
- var CLASS_NAME_FADE = 'fade';
- var CLASS_NAME_SHOW = 'show';
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Alert = /*#__PURE__*/function () {
- function Alert(element) {
- this._element = element;
- } // Getters
-
-
- var _proto = Alert.prototype;
-
- // Public
- _proto.close = function close(element) {
- var rootElement = this._element;
-
- if (element) {
- rootElement = this._getRootElement(element);
- }
-
- var customEvent = this._triggerCloseEvent(rootElement);
-
- if (customEvent.isDefaultPrevented()) {
- return;
- }
-
- this._removeElement(rootElement);
- };
-
- _proto.dispose = function dispose() {
- $__default['default'].removeData(this._element, DATA_KEY);
- this._element = null;
- } // Private
- ;
-
- _proto._getRootElement = function _getRootElement(element) {
- var selector = Util.getSelectorFromElement(element);
- var parent = false;
-
- if (selector) {
- parent = document.querySelector(selector);
- }
-
- if (!parent) {
- parent = $__default['default'](element).closest("." + CLASS_NAME_ALERT)[0];
- }
-
- return parent;
- };
-
- _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
- var closeEvent = $__default['default'].Event(EVENT_CLOSE);
- $__default['default'](element).trigger(closeEvent);
- return closeEvent;
- };
-
- _proto._removeElement = function _removeElement(element) {
- var _this = this;
-
- $__default['default'](element).removeClass(CLASS_NAME_SHOW);
-
- if (!$__default['default'](element).hasClass(CLASS_NAME_FADE)) {
- this._destroyElement(element);
-
- return;
- }
-
- var transitionDuration = Util.getTransitionDurationFromElement(element);
- $__default['default'](element).one(Util.TRANSITION_END, function (event) {
- return _this._destroyElement(element, event);
- }).emulateTransitionEnd(transitionDuration);
- };
-
- _proto._destroyElement = function _destroyElement(element) {
- $__default['default'](element).detach().trigger(EVENT_CLOSED).remove();
- } // Static
- ;
-
- Alert._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $element = $__default['default'](this);
- var data = $element.data(DATA_KEY);
-
- if (!data) {
- data = new Alert(this);
- $element.data(DATA_KEY, data);
- }
-
- if (config === 'close') {
- data[config](this);
- }
- });
- };
-
- Alert._handleDismiss = function _handleDismiss(alertInstance) {
- return function (event) {
- if (event) {
- event.preventDefault();
- }
-
- alertInstance.close(this);
- };
- };
-
- _createClass(Alert, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION;
- }
- }]);
-
- return Alert;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME] = Alert._jQueryInterface;
- $__default['default'].fn[NAME].Constructor = Alert;
-
- $__default['default'].fn[NAME].noConflict = function () {
- $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
- return Alert._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$1 = 'button';
- var VERSION$1 = '4.6.0';
- var DATA_KEY$1 = 'bs.button';
- var EVENT_KEY$1 = "." + DATA_KEY$1;
- var DATA_API_KEY$1 = '.data-api';
- var JQUERY_NO_CONFLICT$1 = $__default['default'].fn[NAME$1];
- var CLASS_NAME_ACTIVE = 'active';
- var CLASS_NAME_BUTTON = 'btn';
- var CLASS_NAME_FOCUS = 'focus';
- var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
- var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
- var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
- var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
- var SELECTOR_INPUT = 'input:not([type="hidden"])';
- var SELECTOR_ACTIVE = '.active';
- var SELECTOR_BUTTON = '.btn';
- var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
- var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1);
- var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1;
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Button = /*#__PURE__*/function () {
- function Button(element) {
- this._element = element;
- this.shouldAvoidTriggerChange = false;
- } // Getters
-
-
- var _proto = Button.prototype;
-
- // Public
- _proto.toggle = function toggle() {
- var triggerChangeEvent = true;
- var addAriaPressed = true;
- var rootElement = $__default['default'](this._element).closest(SELECTOR_DATA_TOGGLES)[0];
-
- if (rootElement) {
- var input = this._element.querySelector(SELECTOR_INPUT);
-
- if (input) {
- if (input.type === 'radio') {
- if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
- triggerChangeEvent = false;
- } else {
- var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
-
- if (activeElement) {
- $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE);
- }
- }
- }
-
- if (triggerChangeEvent) {
- // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
- if (input.type === 'checkbox' || input.type === 'radio') {
- input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
- }
-
- if (!this.shouldAvoidTriggerChange) {
- $__default['default'](input).trigger('change');
- }
- }
-
- input.focus();
- addAriaPressed = false;
- }
- }
-
- if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
- if (addAriaPressed) {
- this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
- }
-
- if (triggerChangeEvent) {
- $__default['default'](this._element).toggleClass(CLASS_NAME_ACTIVE);
- }
- }
- };
-
- _proto.dispose = function dispose() {
- $__default['default'].removeData(this._element, DATA_KEY$1);
- this._element = null;
- } // Static
- ;
-
- Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {
- return this.each(function () {
- var $element = $__default['default'](this);
- var data = $element.data(DATA_KEY$1);
-
- if (!data) {
- data = new Button(this);
- $element.data(DATA_KEY$1, data);
- }
-
- data.shouldAvoidTriggerChange = avoidTriggerChange;
-
- if (config === 'toggle') {
- data[config]();
- }
- });
- };
-
- _createClass(Button, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$1;
- }
- }]);
-
- return Button;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
- var button = event.target;
- var initialButton = button;
-
- if (!$__default['default'](button).hasClass(CLASS_NAME_BUTTON)) {
- button = $__default['default'](button).closest(SELECTOR_BUTTON)[0];
- }
-
- if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
- event.preventDefault(); // work around Firefox bug #1540995
- } else {
- var inputBtn = button.querySelector(SELECTOR_INPUT);
-
- if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
- event.preventDefault(); // work around Firefox bug #1540995
-
- return;
- }
-
- if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {
- Button._jQueryInterface.call($__default['default'](button), 'toggle', initialButton.tagName === 'INPUT');
- }
- }
- }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
- var button = $__default['default'](event.target).closest(SELECTOR_BUTTON)[0];
- $__default['default'](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
- });
- $__default['default'](window).on(EVENT_LOAD_DATA_API, function () {
- // ensure correct active class is set to match the controls' actual values/states
- // find all checkboxes/readio buttons inside data-toggle groups
- var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
-
- for (var i = 0, len = buttons.length; i < len; i++) {
- var button = buttons[i];
- var input = button.querySelector(SELECTOR_INPUT);
-
- if (input.checked || input.hasAttribute('checked')) {
- button.classList.add(CLASS_NAME_ACTIVE);
- } else {
- button.classList.remove(CLASS_NAME_ACTIVE);
- }
- } // find all button toggles
-
-
- buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
-
- for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
- var _button = buttons[_i];
-
- if (_button.getAttribute('aria-pressed') === 'true') {
- _button.classList.add(CLASS_NAME_ACTIVE);
- } else {
- _button.classList.remove(CLASS_NAME_ACTIVE);
- }
- }
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME$1] = Button._jQueryInterface;
- $__default['default'].fn[NAME$1].Constructor = Button;
-
- $__default['default'].fn[NAME$1].noConflict = function () {
- $__default['default'].fn[NAME$1] = JQUERY_NO_CONFLICT$1;
- return Button._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$2 = 'carousel';
- var VERSION$2 = '4.6.0';
- var DATA_KEY$2 = 'bs.carousel';
- var EVENT_KEY$2 = "." + DATA_KEY$2;
- var DATA_API_KEY$2 = '.data-api';
- var JQUERY_NO_CONFLICT$2 = $__default['default'].fn[NAME$2];
- var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
-
- var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
-
- var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
-
- var SWIPE_THRESHOLD = 40;
- var Default = {
- interval: 5000,
- keyboard: true,
- slide: false,
- pause: 'hover',
- wrap: true,
- touch: true
- };
- var DefaultType = {
- interval: '(number|boolean)',
- keyboard: 'boolean',
- slide: '(boolean|string)',
- pause: '(string|boolean)',
- wrap: 'boolean',
- touch: 'boolean'
- };
- var DIRECTION_NEXT = 'next';
- var DIRECTION_PREV = 'prev';
- var DIRECTION_LEFT = 'left';
- var DIRECTION_RIGHT = 'right';
- var EVENT_SLIDE = "slide" + EVENT_KEY$2;
- var EVENT_SLID = "slid" + EVENT_KEY$2;
- var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2;
- var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2;
- var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2;
- var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2;
- var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2;
- var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2;
- var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2;
- var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2;
- var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2;
- var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2;
- var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2;
- var CLASS_NAME_CAROUSEL = 'carousel';
- var CLASS_NAME_ACTIVE$1 = 'active';
- var CLASS_NAME_SLIDE = 'slide';
- var CLASS_NAME_RIGHT = 'carousel-item-right';
- var CLASS_NAME_LEFT = 'carousel-item-left';
- var CLASS_NAME_NEXT = 'carousel-item-next';
- var CLASS_NAME_PREV = 'carousel-item-prev';
- var CLASS_NAME_POINTER_EVENT = 'pointer-event';
- var SELECTOR_ACTIVE$1 = '.active';
- var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
- var SELECTOR_ITEM = '.carousel-item';
- var SELECTOR_ITEM_IMG = '.carousel-item img';
- var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
- var SELECTOR_INDICATORS = '.carousel-indicators';
- var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
- var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
- var PointerType = {
- TOUCH: 'touch',
- PEN: 'pen'
- };
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Carousel = /*#__PURE__*/function () {
- function Carousel(element, config) {
- this._items = null;
- this._interval = null;
- this._activeElement = null;
- this._isPaused = false;
- this._isSliding = false;
- this.touchTimeout = null;
- this.touchStartX = 0;
- this.touchDeltaX = 0;
- this._config = this._getConfig(config);
- this._element = element;
- this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);
- this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
- this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
-
- this._addEventListeners();
- } // Getters
-
-
- var _proto = Carousel.prototype;
-
- // Public
- _proto.next = function next() {
- if (!this._isSliding) {
- this._slide(DIRECTION_NEXT);
- }
- };
-
- _proto.nextWhenVisible = function nextWhenVisible() {
- var $element = $__default['default'](this._element); // Don't call next when the page isn't visible
- // or the carousel or its parent isn't visible
-
- if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') {
- this.next();
- }
- };
-
- _proto.prev = function prev() {
- if (!this._isSliding) {
- this._slide(DIRECTION_PREV);
- }
- };
-
- _proto.pause = function pause(event) {
- if (!event) {
- this._isPaused = true;
- }
-
- if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
- Util.triggerTransitionEnd(this._element);
- this.cycle(true);
- }
-
- clearInterval(this._interval);
- this._interval = null;
- };
-
- _proto.cycle = function cycle(event) {
- if (!event) {
- this._isPaused = false;
- }
-
- if (this._interval) {
- clearInterval(this._interval);
- this._interval = null;
- }
-
- if (this._config.interval && !this._isPaused) {
- this._updateInterval();
-
- this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
- }
- };
-
- _proto.to = function to(index) {
- var _this = this;
-
- this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
-
- var activeIndex = this._getItemIndex(this._activeElement);
-
- if (index > this._items.length - 1 || index < 0) {
- return;
- }
-
- if (this._isSliding) {
- $__default['default'](this._element).one(EVENT_SLID, function () {
- return _this.to(index);
- });
- return;
- }
-
- if (activeIndex === index) {
- this.pause();
- this.cycle();
- return;
- }
-
- var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
-
- this._slide(direction, this._items[index]);
- };
-
- _proto.dispose = function dispose() {
- $__default['default'](this._element).off(EVENT_KEY$2);
- $__default['default'].removeData(this._element, DATA_KEY$2);
- this._items = null;
- this._config = null;
- this._element = null;
- this._interval = null;
- this._isPaused = null;
- this._isSliding = null;
- this._activeElement = null;
- this._indicatorsElement = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _extends({}, Default, config);
- Util.typeCheckConfig(NAME$2, config, DefaultType);
- return config;
- };
-
- _proto._handleSwipe = function _handleSwipe() {
- var absDeltax = Math.abs(this.touchDeltaX);
-
- if (absDeltax <= SWIPE_THRESHOLD) {
- return;
- }
-
- var direction = absDeltax / this.touchDeltaX;
- this.touchDeltaX = 0; // swipe left
-
- if (direction > 0) {
- this.prev();
- } // swipe right
-
-
- if (direction < 0) {
- this.next();
- }
- };
-
- _proto._addEventListeners = function _addEventListeners() {
- var _this2 = this;
-
- if (this._config.keyboard) {
- $__default['default'](this._element).on(EVENT_KEYDOWN, function (event) {
- return _this2._keydown(event);
- });
- }
-
- if (this._config.pause === 'hover') {
- $__default['default'](this._element).on(EVENT_MOUSEENTER, function (event) {
- return _this2.pause(event);
- }).on(EVENT_MOUSELEAVE, function (event) {
- return _this2.cycle(event);
- });
- }
-
- if (this._config.touch) {
- this._addTouchEventListeners();
- }
- };
-
- _proto._addTouchEventListeners = function _addTouchEventListeners() {
- var _this3 = this;
-
- if (!this._touchSupported) {
- return;
- }
-
- var start = function start(event) {
- if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
- _this3.touchStartX = event.originalEvent.clientX;
- } else if (!_this3._pointerEvent) {
- _this3.touchStartX = event.originalEvent.touches[0].clientX;
- }
- };
-
- var move = function move(event) {
- // ensure swiping with one touch and not pinching
- if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
- _this3.touchDeltaX = 0;
- } else {
- _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
- }
- };
-
- var end = function end(event) {
- if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
- _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
- }
-
- _this3._handleSwipe();
-
- if (_this3._config.pause === 'hover') {
- // If it's a touch-enabled device, mouseenter/leave are fired as
- // part of the mouse compatibility events on first tap - the carousel
- // would stop cycling until user tapped out of it;
- // here, we listen for touchend, explicitly pause the carousel
- // (as if it's the second time we tap on it, mouseenter compat event
- // is NOT fired) and after a timeout (to allow for mouse compatibility
- // events to fire) we explicitly restart cycling
- _this3.pause();
-
- if (_this3.touchTimeout) {
- clearTimeout(_this3.touchTimeout);
- }
-
- _this3.touchTimeout = setTimeout(function (event) {
- return _this3.cycle(event);
- }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
- }
- };
-
- $__default['default'](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
- return e.preventDefault();
- });
-
- if (this._pointerEvent) {
- $__default['default'](this._element).on(EVENT_POINTERDOWN, function (event) {
- return start(event);
- });
- $__default['default'](this._element).on(EVENT_POINTERUP, function (event) {
- return end(event);
- });
-
- this._element.classList.add(CLASS_NAME_POINTER_EVENT);
- } else {
- $__default['default'](this._element).on(EVENT_TOUCHSTART, function (event) {
- return start(event);
- });
- $__default['default'](this._element).on(EVENT_TOUCHMOVE, function (event) {
- return move(event);
- });
- $__default['default'](this._element).on(EVENT_TOUCHEND, function (event) {
- return end(event);
- });
- }
- };
-
- _proto._keydown = function _keydown(event) {
- if (/input|textarea/i.test(event.target.tagName)) {
- return;
- }
-
- switch (event.which) {
- case ARROW_LEFT_KEYCODE:
- event.preventDefault();
- this.prev();
- break;
-
- case ARROW_RIGHT_KEYCODE:
- event.preventDefault();
- this.next();
- break;
- }
- };
-
- _proto._getItemIndex = function _getItemIndex(element) {
- this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
- return this._items.indexOf(element);
- };
-
- _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
- var isNextDirection = direction === DIRECTION_NEXT;
- var isPrevDirection = direction === DIRECTION_PREV;
-
- var activeIndex = this._getItemIndex(activeElement);
-
- var lastItemIndex = this._items.length - 1;
- var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
-
- if (isGoingToWrap && !this._config.wrap) {
- return activeElement;
- }
-
- var delta = direction === DIRECTION_PREV ? -1 : 1;
- var itemIndex = (activeIndex + delta) % this._items.length;
- return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
- };
-
- _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
- var targetIndex = this._getItemIndex(relatedTarget);
-
- var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
-
- var slideEvent = $__default['default'].Event(EVENT_SLIDE, {
- relatedTarget: relatedTarget,
- direction: eventDirectionName,
- from: fromIndex,
- to: targetIndex
- });
- $__default['default'](this._element).trigger(slideEvent);
- return slideEvent;
- };
-
- _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
- if (this._indicatorsElement) {
- var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));
- $__default['default'](indicators).removeClass(CLASS_NAME_ACTIVE$1);
-
- var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
-
- if (nextIndicator) {
- $__default['default'](nextIndicator).addClass(CLASS_NAME_ACTIVE$1);
- }
- }
- };
-
- _proto._updateInterval = function _updateInterval() {
- var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM);
-
- if (!element) {
- return;
- }
-
- var elementInterval = parseInt(element.getAttribute('data-interval'), 10);
-
- if (elementInterval) {
- this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
- this._config.interval = elementInterval;
- } else {
- this._config.interval = this._config.defaultInterval || this._config.interval;
- }
- };
-
- _proto._slide = function _slide(direction, element) {
- var _this4 = this;
-
- var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
-
- var activeElementIndex = this._getItemIndex(activeElement);
-
- var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
-
- var nextElementIndex = this._getItemIndex(nextElement);
-
- var isCycling = Boolean(this._interval);
- var directionalClassName;
- var orderClassName;
- var eventDirectionName;
-
- if (direction === DIRECTION_NEXT) {
- directionalClassName = CLASS_NAME_LEFT;
- orderClassName = CLASS_NAME_NEXT;
- eventDirectionName = DIRECTION_LEFT;
- } else {
- directionalClassName = CLASS_NAME_RIGHT;
- orderClassName = CLASS_NAME_PREV;
- eventDirectionName = DIRECTION_RIGHT;
- }
-
- if (nextElement && $__default['default'](nextElement).hasClass(CLASS_NAME_ACTIVE$1)) {
- this._isSliding = false;
- return;
- }
-
- var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
-
- if (slideEvent.isDefaultPrevented()) {
- return;
- }
-
- if (!activeElement || !nextElement) {
- // Some weirdness is happening, so we bail
- return;
- }
-
- this._isSliding = true;
-
- if (isCycling) {
- this.pause();
- }
-
- this._setActiveIndicatorElement(nextElement);
-
- this._activeElement = nextElement;
- var slidEvent = $__default['default'].Event(EVENT_SLID, {
- relatedTarget: nextElement,
- direction: eventDirectionName,
- from: activeElementIndex,
- to: nextElementIndex
- });
-
- if ($__default['default'](this._element).hasClass(CLASS_NAME_SLIDE)) {
- $__default['default'](nextElement).addClass(orderClassName);
- Util.reflow(nextElement);
- $__default['default'](activeElement).addClass(directionalClassName);
- $__default['default'](nextElement).addClass(directionalClassName);
- var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
- $__default['default'](activeElement).one(Util.TRANSITION_END, function () {
- $__default['default'](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1);
- $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName);
- _this4._isSliding = false;
- setTimeout(function () {
- return $__default['default'](_this4._element).trigger(slidEvent);
- }, 0);
- }).emulateTransitionEnd(transitionDuration);
- } else {
- $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1);
- $__default['default'](nextElement).addClass(CLASS_NAME_ACTIVE$1);
- this._isSliding = false;
- $__default['default'](this._element).trigger(slidEvent);
- }
-
- if (isCycling) {
- this.cycle();
- }
- } // Static
- ;
-
- Carousel._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $__default['default'](this).data(DATA_KEY$2);
-
- var _config = _extends({}, Default, $__default['default'](this).data());
-
- if (typeof config === 'object') {
- _config = _extends({}, _config, config);
- }
-
- var action = typeof config === 'string' ? config : _config.slide;
-
- if (!data) {
- data = new Carousel(this, _config);
- $__default['default'](this).data(DATA_KEY$2, data);
- }
-
- if (typeof config === 'number') {
- data.to(config);
- } else if (typeof action === 'string') {
- if (typeof data[action] === 'undefined') {
- throw new TypeError("No method named \"" + action + "\"");
- }
-
- data[action]();
- } else if (_config.interval && _config.ride) {
- data.pause();
- data.cycle();
- }
- });
- };
-
- Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
- var selector = Util.getSelectorFromElement(this);
-
- if (!selector) {
- return;
- }
-
- var target = $__default['default'](selector)[0];
-
- if (!target || !$__default['default'](target).hasClass(CLASS_NAME_CAROUSEL)) {
- return;
- }
-
- var config = _extends({}, $__default['default'](target).data(), $__default['default'](this).data());
-
- var slideIndex = this.getAttribute('data-slide-to');
-
- if (slideIndex) {
- config.interval = false;
- }
-
- Carousel._jQueryInterface.call($__default['default'](target), config);
-
- if (slideIndex) {
- $__default['default'](target).data(DATA_KEY$2).to(slideIndex);
- }
-
- event.preventDefault();
- };
-
- _createClass(Carousel, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$2;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default;
- }
- }]);
-
- return Carousel;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
- $__default['default'](window).on(EVENT_LOAD_DATA_API$1, function () {
- var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
-
- for (var i = 0, len = carousels.length; i < len; i++) {
- var $carousel = $__default['default'](carousels[i]);
-
- Carousel._jQueryInterface.call($carousel, $carousel.data());
- }
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME$2] = Carousel._jQueryInterface;
- $__default['default'].fn[NAME$2].Constructor = Carousel;
-
- $__default['default'].fn[NAME$2].noConflict = function () {
- $__default['default'].fn[NAME$2] = JQUERY_NO_CONFLICT$2;
- return Carousel._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$3 = 'collapse';
- var VERSION$3 = '4.6.0';
- var DATA_KEY$3 = 'bs.collapse';
- var EVENT_KEY$3 = "." + DATA_KEY$3;
- var DATA_API_KEY$3 = '.data-api';
- var JQUERY_NO_CONFLICT$3 = $__default['default'].fn[NAME$3];
- var Default$1 = {
- toggle: true,
- parent: ''
- };
- var DefaultType$1 = {
- toggle: 'boolean',
- parent: '(string|element)'
- };
- var EVENT_SHOW = "show" + EVENT_KEY$3;
- var EVENT_SHOWN = "shown" + EVENT_KEY$3;
- var EVENT_HIDE = "hide" + EVENT_KEY$3;
- var EVENT_HIDDEN = "hidden" + EVENT_KEY$3;
- var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3;
- var CLASS_NAME_SHOW$1 = 'show';
- var CLASS_NAME_COLLAPSE = 'collapse';
- var CLASS_NAME_COLLAPSING = 'collapsing';
- var CLASS_NAME_COLLAPSED = 'collapsed';
- var DIMENSION_WIDTH = 'width';
- var DIMENSION_HEIGHT = 'height';
- var SELECTOR_ACTIVES = '.show, .collapsing';
- var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]';
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Collapse = /*#__PURE__*/function () {
- function Collapse(element, config) {
- this._isTransitioning = false;
- this._element = element;
- this._config = this._getConfig(config);
- this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
- var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1));
-
- for (var i = 0, len = toggleList.length; i < len; i++) {
- var elem = toggleList[i];
- var selector = Util.getSelectorFromElement(elem);
- var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
- return foundElem === element;
- });
-
- if (selector !== null && filterElement.length > 0) {
- this._selector = selector;
-
- this._triggerArray.push(elem);
- }
- }
-
- this._parent = this._config.parent ? this._getParent() : null;
-
- if (!this._config.parent) {
- this._addAriaAndCollapsedClass(this._element, this._triggerArray);
- }
-
- if (this._config.toggle) {
- this.toggle();
- }
- } // Getters
-
-
- var _proto = Collapse.prototype;
-
- // Public
- _proto.toggle = function toggle() {
- if ($__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {
- this.hide();
- } else {
- this.show();
- }
- };
-
- _proto.show = function show() {
- var _this = this;
-
- if (this._isTransitioning || $__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {
- return;
- }
-
- var actives;
- var activesData;
-
- if (this._parent) {
- actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
- if (typeof _this._config.parent === 'string') {
- return elem.getAttribute('data-parent') === _this._config.parent;
- }
-
- return elem.classList.contains(CLASS_NAME_COLLAPSE);
- });
-
- if (actives.length === 0) {
- actives = null;
- }
- }
-
- if (actives) {
- activesData = $__default['default'](actives).not(this._selector).data(DATA_KEY$3);
-
- if (activesData && activesData._isTransitioning) {
- return;
- }
- }
-
- var startEvent = $__default['default'].Event(EVENT_SHOW);
- $__default['default'](this._element).trigger(startEvent);
-
- if (startEvent.isDefaultPrevented()) {
- return;
- }
-
- if (actives) {
- Collapse._jQueryInterface.call($__default['default'](actives).not(this._selector), 'hide');
-
- if (!activesData) {
- $__default['default'](actives).data(DATA_KEY$3, null);
- }
- }
-
- var dimension = this._getDimension();
-
- $__default['default'](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
- this._element.style[dimension] = 0;
-
- if (this._triggerArray.length) {
- $__default['default'](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
- }
-
- this.setTransitioning(true);
-
- var complete = function complete() {
- $__default['default'](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
- _this._element.style[dimension] = '';
-
- _this.setTransitioning(false);
-
- $__default['default'](_this._element).trigger(EVENT_SHOWN);
- };
-
- var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
- var scrollSize = "scroll" + capitalizedDimension;
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- this._element.style[dimension] = this._element[scrollSize] + "px";
- };
-
- _proto.hide = function hide() {
- var _this2 = this;
-
- if (this._isTransitioning || !$__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {
- return;
- }
-
- var startEvent = $__default['default'].Event(EVENT_HIDE);
- $__default['default'](this._element).trigger(startEvent);
-
- if (startEvent.isDefaultPrevented()) {
- return;
- }
-
- var dimension = this._getDimension();
-
- this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
- Util.reflow(this._element);
- $__default['default'](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
- var triggerArrayLength = this._triggerArray.length;
-
- if (triggerArrayLength > 0) {
- for (var i = 0; i < triggerArrayLength; i++) {
- var trigger = this._triggerArray[i];
- var selector = Util.getSelectorFromElement(trigger);
-
- if (selector !== null) {
- var $elem = $__default['default']([].slice.call(document.querySelectorAll(selector)));
-
- if (!$elem.hasClass(CLASS_NAME_SHOW$1)) {
- $__default['default'](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
- }
- }
- }
- }
-
- this.setTransitioning(true);
-
- var complete = function complete() {
- _this2.setTransitioning(false);
-
- $__default['default'](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
- };
-
- this._element.style[dimension] = '';
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- };
-
- _proto.setTransitioning = function setTransitioning(isTransitioning) {
- this._isTransitioning = isTransitioning;
- };
-
- _proto.dispose = function dispose() {
- $__default['default'].removeData(this._element, DATA_KEY$3);
- this._config = null;
- this._parent = null;
- this._element = null;
- this._triggerArray = null;
- this._isTransitioning = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _extends({}, Default$1, config);
- config.toggle = Boolean(config.toggle); // Coerce string values
-
- Util.typeCheckConfig(NAME$3, config, DefaultType$1);
- return config;
- };
-
- _proto._getDimension = function _getDimension() {
- var hasWidth = $__default['default'](this._element).hasClass(DIMENSION_WIDTH);
- return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
- };
-
- _proto._getParent = function _getParent() {
- var _this3 = this;
-
- var parent;
-
- if (Util.isElement(this._config.parent)) {
- parent = this._config.parent; // It's a jQuery object
-
- if (typeof this._config.parent.jquery !== 'undefined') {
- parent = this._config.parent[0];
- }
- } else {
- parent = document.querySelector(this._config.parent);
- }
-
- var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
- var children = [].slice.call(parent.querySelectorAll(selector));
- $__default['default'](children).each(function (i, element) {
- _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
- });
- return parent;
- };
-
- _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
- var isOpen = $__default['default'](element).hasClass(CLASS_NAME_SHOW$1);
-
- if (triggerArray.length) {
- $__default['default'](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
- }
- } // Static
- ;
-
- Collapse._getTargetFromElement = function _getTargetFromElement(element) {
- var selector = Util.getSelectorFromElement(element);
- return selector ? document.querySelector(selector) : null;
- };
-
- Collapse._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $element = $__default['default'](this);
- var data = $element.data(DATA_KEY$3);
-
- var _config = _extends({}, Default$1, $element.data(), typeof config === 'object' && config ? config : {});
-
- if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
- _config.toggle = false;
- }
-
- if (!data) {
- data = new Collapse(this, _config);
- $element.data(DATA_KEY$3, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Collapse, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$3;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$1;
- }
- }]);
-
- return Collapse;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {
- // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
- if (event.currentTarget.tagName === 'A') {
- event.preventDefault();
- }
-
- var $trigger = $__default['default'](this);
- var selector = Util.getSelectorFromElement(this);
- var selectors = [].slice.call(document.querySelectorAll(selector));
- $__default['default'](selectors).each(function () {
- var $target = $__default['default'](this);
- var data = $target.data(DATA_KEY$3);
- var config = data ? 'toggle' : $trigger.data();
-
- Collapse._jQueryInterface.call($target, config);
- });
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME$3] = Collapse._jQueryInterface;
- $__default['default'].fn[NAME$3].Constructor = Collapse;
-
- $__default['default'].fn[NAME$3].noConflict = function () {
- $__default['default'].fn[NAME$3] = JQUERY_NO_CONFLICT$3;
- return Collapse._jQueryInterface;
- };
-
- /**!
+ */st((function(t,e){!function(t,e){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=n(e);function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function r(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var l="transitionend",u=1e6,c=1e3;function h(t){return null==t?""+t:{}.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase()}function d(){return{bindType:l,delegateType:l,handle:function(t){if(i.default(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}}}function f(t){var e=this,n=!1;return i.default(this).one(m.TRANSITION_END,(function(){n=!0})),setTimeout((function(){n||m.triggerTransitionEnd(e)}),t),this}function p(){i.default.fn.emulateTransitionEnd=f,i.default.event.special[m.TRANSITION_END]=d()}var m={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(Math.random()*u)}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=i.default(t).css("transition-duration"),n=i.default(t).css("transition-delay"),o=parseFloat(e),r=parseFloat(n);return o||r?(e=e.split(",")[0],n=n.split(",")[0],(parseFloat(e)+parseFloat(n))*c):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){i.default(t).trigger(l)},supportsTransitionEnd:function(){return Boolean(l)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&m.isElement(r)?"element":h(r);if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?m.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if(void 0===i.default)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=i.default.fn.jquery.split(" ")[0].split("."),e=1,n=2,o=9,r=1,s=4;if(t[0]<n&&t[1]<o||t[0]===e&&t[1]===o&&t[2]<r||t[0]>=s)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};m.jQueryDetection(),p();var g="alert",_="4.6.0",v="bs.alert",y="."+v,b=".data-api",x=i.default.fn[g],w='[data-dismiss="alert"]',T="close"+y,C="closed"+y,E="click"+y+b,$="alert",L="fade",k="show",P=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){i.default.removeData(this._element,v),this._element=null},e._getRootElement=function(t){var e=m.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=i.default(t).closest("."+$)[0]),n},e._triggerCloseEvent=function(t){var e=i.default.Event(T);return i.default(t).trigger(e),e},e._removeElement=function(t){var e=this;if(i.default(t).removeClass(k),i.default(t).hasClass(L)){var n=m.getTransitionDurationFromElement(t);i.default(t).one(m.TRANSITION_END,(function(n){return e._destroyElement(t,n)})).emulateTransitionEnd(n)}else this._destroyElement(t)},e._destroyElement=function(t){i.default(t).detach().trigger(C).remove()},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(v);o||(o=new t(this),n.data(v,o)),"close"===e&&o[e](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},r(t,null,[{key:"VERSION",get:function(){return _}}]),t}();i.default(document).on(E,w,P._handleDismiss(new P)),i.default.fn[g]=P._jQueryInterface,i.default.fn[g].Constructor=P,i.default.fn[g].noConflict=function(){return i.default.fn[g]=x,P._jQueryInterface};var S="button",M="4.6.0",A="bs.button",N="."+A,D=".data-api",I=i.default.fn[S],O="active",z="btn",B="focus",j='[data-toggle^="button"]',R='[data-toggle="buttons"]',Z='[data-toggle="button"]',H='[data-toggle="buttons"] .btn',q='input:not([type="hidden"])',F=".active",W=".btn",U="click"+N+D,V="focus"+N+D+" blur"+N+D,G="load"+N+D,K=function(){function t(t){this._element=t,this.shouldAvoidTriggerChange=!1}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=i.default(this._element).closest(R)[0];if(n){var o=this._element.querySelector(q);if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains(O))t=!1;else{var r=n.querySelector(F);r&&i.default(r).removeClass(O)}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains(O)),this.shouldAvoidTriggerChange||i.default(o).trigger("change")),o.focus(),e=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(O)),t&&i.default(this._element).toggleClass(O))},e.dispose=function(){i.default.removeData(this._element,A),this._element=null},t._jQueryInterface=function(e,n){return this.each((function(){var o=i.default(this),r=o.data(A);r||(r=new t(this),o.data(A,r)),r.shouldAvoidTriggerChange=n,"toggle"===e&&r[e]()}))},r(t,null,[{key:"VERSION",get:function(){return M}}]),t}();i.default(document).on(U,j,(function(t){var e=t.target,n=e;if(i.default(e).hasClass(z)||(e=i.default(e).closest(W)[0]),!e||e.hasAttribute("disabled")||e.classList.contains("disabled"))t.preventDefault();else{var o=e.querySelector(q);if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"INPUT"!==n.tagName&&"LABEL"===e.tagName||K._jQueryInterface.call(i.default(e),"toggle","INPUT"===n.tagName)}})).on(V,j,(function(t){var e=i.default(t.target).closest(W)[0];i.default(e).toggleClass(B,/^focus(in)?$/.test(t.type))})),i.default(window).on(G,(function(){for(var t=[].slice.call(document.querySelectorAll(H)),e=0,n=t.length;e<n;e++){var i=t[e],o=i.querySelector(q);o.checked||o.hasAttribute("checked")?i.classList.add(O):i.classList.remove(O)}for(var r=0,s=(t=[].slice.call(document.querySelectorAll(Z))).length;r<s;r++){var a=t[r];"true"===a.getAttribute("aria-pressed")?a.classList.add(O):a.classList.remove(O)}})),i.default.fn[S]=K._jQueryInterface,i.default.fn[S].Constructor=K,i.default.fn[S].noConflict=function(){return i.default.fn[S]=I,K._jQueryInterface};var Y="carousel",X="4.6.0",Q="bs.carousel",J="."+Q,tt=".data-api",et=i.default.fn[Y],nt=37,it=39,ot=500,st=40,at={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},lt={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},ut="next",ct="prev",ht="left",dt="right",ft="slide"+J,pt="slid"+J,mt="keydown"+J,gt="mouseenter"+J,_t="mouseleave"+J,vt="touchstart"+J,yt="touchmove"+J,bt="touchend"+J,xt="pointerdown"+J,wt="pointerup"+J,Tt="dragstart"+J,Ct="load"+J+tt,Et="click"+J+tt,$t="carousel",Lt="active",kt="slide",Pt="carousel-item-right",St="carousel-item-left",Mt="carousel-item-next",At="carousel-item-prev",Nt="pointer-event",Dt=".active",It=".active.carousel-item",Ot=".carousel-item",zt=".carousel-item img",Bt=".carousel-item-next, .carousel-item-prev",jt=".carousel-indicators",Rt="[data-slide], [data-slide-to]",Zt='[data-ride="carousel"]',Ht={TOUCH:"touch",PEN:"pen"},qt=function(){function t(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(jt),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var e=t.prototype;return e.next=function(){this._isSliding||this._slide(ut)},e.nextWhenVisible=function(){var t=i.default(this._element);!document.hidden&&t.is(":visible")&&"hidden"!==t.css("visibility")&&this.next()},e.prev=function(){this._isSliding||this._slide(ct)},e.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(Bt)&&(m.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},e.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},e.to=function(t){var e=this;this._activeElement=this._element.querySelector(It);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)i.default(this._element).one(pt,(function(){return e.to(t)}));else{if(n===t)return this.pause(),void this.cycle();var o=t>n?ut:ct;this._slide(o,this._items[t])}},e.dispose=function(){i.default(this._element).off(J),i.default.removeData(this._element,Q),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},e._getConfig=function(t){return t=s({},at,t),m.typeCheckConfig(Y,t,lt),t},e._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=st)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},e._addEventListeners=function(){var t=this;this._config.keyboard&&i.default(this._element).on(mt,(function(e){return t._keydown(e)})),"hover"===this._config.pause&&i.default(this._element).on(gt,(function(e){return t.pause(e)})).on(_t,(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},e._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var e=function(e){t._pointerEvent&&Ht[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},n=function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX},o=function(e){t._pointerEvent&&Ht[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),ot+t._config.interval))};i.default(this._element.querySelectorAll(zt)).on(Tt,(function(t){return t.preventDefault()})),this._pointerEvent?(i.default(this._element).on(xt,(function(t){return e(t)})),i.default(this._element).on(wt,(function(t){return o(t)})),this._element.classList.add(Nt)):(i.default(this._element).on(vt,(function(t){return e(t)})),i.default(this._element).on(yt,(function(t){return n(t)})),i.default(this._element).on(bt,(function(t){return o(t)})))}},e._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case nt:t.preventDefault(),this.prev();break;case it:t.preventDefault(),this.next()}},e._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(Ot)):[],this._items.indexOf(t)},e._getItemByDirection=function(t,e){var n=t===ut,i=t===ct,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===ct?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},e._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(It)),r=i.default.Event(ft,{relatedTarget:t,direction:e,from:o,to:n});return i.default(this._element).trigger(r),r},e._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(Dt));i.default(e).removeClass(Lt);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&i.default(n).addClass(Lt)}},e._updateInterval=function(){var t=this._activeElement||this._element.querySelector(It);if(t){var e=parseInt(t.getAttribute("data-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}},e._slide=function(t,e){var n,o,r,s=this,a=this._element.querySelector(It),l=this._getItemIndex(a),u=e||a&&this._getItemByDirection(t,a),c=this._getItemIndex(u),h=Boolean(this._interval);if(t===ut?(n=St,o=Mt,r=ht):(n=Pt,o=At,r=dt),u&&i.default(u).hasClass(Lt))this._isSliding=!1;else if(!this._triggerSlideEvent(u,r).isDefaultPrevented()&&a&&u){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(u),this._activeElement=u;var d=i.default.Event(pt,{relatedTarget:u,direction:r,from:l,to:c});if(i.default(this._element).hasClass(kt)){i.default(u).addClass(o),m.reflow(u),i.default(a).addClass(n),i.default(u).addClass(n);var f=m.getTransitionDurationFromElement(a);i.default(a).one(m.TRANSITION_END,(function(){i.default(u).removeClass(n+" "+o).addClass(Lt),i.default(a).removeClass(Lt+" "+o+" "+n),s._isSliding=!1,setTimeout((function(){return i.default(s._element).trigger(d)}),0)})).emulateTransitionEnd(f)}else i.default(a).removeClass(Lt),i.default(u).addClass(Lt),this._isSliding=!1,i.default(this._element).trigger(d);h&&this.cycle()}},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this).data(Q),o=s({},at,i.default(this).data());"object"==typeof e&&(o=s({},o,e));var r="string"==typeof e?e:o.slide;if(n||(n=new t(this,o),i.default(this).data(Q,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new TypeError('No method named "'+r+'"');n[r]()}else o.interval&&o.ride&&(n.pause(),n.cycle())}))},t._dataApiClickHandler=function(e){var n=m.getSelectorFromElement(this);if(n){var o=i.default(n)[0];if(o&&i.default(o).hasClass($t)){var r=s({},i.default(o).data(),i.default(this).data()),a=this.getAttribute("data-slide-to");a&&(r.interval=!1),t._jQueryInterface.call(i.default(o),r),a&&i.default(o).data(Q).to(a),e.preventDefault()}}},r(t,null,[{key:"VERSION",get:function(){return X}},{key:"Default",get:function(){return at}}]),t}();i.default(document).on(Et,Rt,qt._dataApiClickHandler),i.default(window).on(Ct,(function(){for(var t=[].slice.call(document.querySelectorAll(Zt)),e=0,n=t.length;e<n;e++){var o=i.default(t[e]);qt._jQueryInterface.call(o,o.data())}})),i.default.fn[Y]=qt._jQueryInterface,i.default.fn[Y].Constructor=qt,i.default.fn[Y].noConflict=function(){return i.default.fn[Y]=et,qt._jQueryInterface};var Ft="collapse",Wt="4.6.0",Ut="bs.collapse",Vt="."+Ut,Gt=".data-api",Kt=i.default.fn[Ft],Yt={toggle:!0,parent:""},Xt={toggle:"boolean",parent:"(string|element)"},Qt="show"+Vt,Jt="shown"+Vt,te="hide"+Vt,ee="hidden"+Vt,ne="click"+Vt+Gt,ie="show",oe="collapse",re="collapsing",se="collapsed",ae="width",le="height",ue=".show, .collapsing",ce='[data-toggle="collapse"]',he=function(){function t(t,e){this._isTransitioning=!1,this._element=t,this._config=this._getConfig(e),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(ce)),i=0,o=n.length;i<o;i++){var r=n[i],s=m.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter((function(e){return e===t}));null!==s&&a.length>0&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var e=t.prototype;return e.toggle=function(){i.default(this._element).hasClass(ie)?this.hide():this.show()},e.show=function(){var e,n,o=this;if(!(this._isTransitioning||i.default(this._element).hasClass(ie)||(this._parent&&0===(e=[].slice.call(this._parent.querySelectorAll(ue)).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains(oe)}))).length&&(e=null),e&&(n=i.default(e).not(this._selector).data(Ut))&&n._isTransitioning))){var r=i.default.Event(Qt);if(i.default(this._element).trigger(r),!r.isDefaultPrevented()){e&&(t._jQueryInterface.call(i.default(e).not(this._selector),"hide"),n||i.default(e).data(Ut,null));var s=this._getDimension();i.default(this._element).removeClass(oe).addClass(re),this._element.style[s]=0,this._triggerArray.length&&i.default(this._triggerArray).removeClass(se).attr("aria-expanded",!0),this.setTransitioning(!0);var a=function(){i.default(o._element).removeClass(re).addClass(oe+" "+ie),o._element.style[s]="",o.setTransitioning(!1),i.default(o._element).trigger(Jt)},l="scroll"+(s[0].toUpperCase()+s.slice(1)),u=m.getTransitionDurationFromElement(this._element);i.default(this._element).one(m.TRANSITION_END,a).emulateTransitionEnd(u),this._element.style[s]=this._element[l]+"px"}}},e.hide=function(){var t=this;if(!this._isTransitioning&&i.default(this._element).hasClass(ie)){var e=i.default.Event(te);if(i.default(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",m.reflow(this._element),i.default(this._element).addClass(re).removeClass(oe+" "+ie);var o=this._triggerArray.length;if(o>0)for(var r=0;r<o;r++){var s=this._triggerArray[r],a=m.getSelectorFromElement(s);null!==a&&(i.default([].slice.call(document.querySelectorAll(a))).hasClass(ie)||i.default(s).addClass(se).attr("aria-expanded",!1))}this.setTransitioning(!0);var l=function(){t.setTransitioning(!1),i.default(t._element).removeClass(re).addClass(oe).trigger(ee)};this._element.style[n]="";var u=m.getTransitionDurationFromElement(this._element);i.default(this._element).one(m.TRANSITION_END,l).emulateTransitionEnd(u)}}},e.setTransitioning=function(t){this._isTransitioning=t},e.dispose=function(){i.default.removeData(this._element,Ut),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},e._getConfig=function(t){return(t=s({},Yt,t)).toggle=Boolean(t.toggle),m.typeCheckConfig(Ft,t,Xt),t},e._getDimension=function(){return i.default(this._element).hasClass(ae)?ae:le},e._getParent=function(){var e,n=this;m.isElement(this._config.parent)?(e=this._config.parent,void 0!==this._config.parent.jquery&&(e=this._config.parent[0])):e=document.querySelector(this._config.parent);var o='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',r=[].slice.call(e.querySelectorAll(o));return i.default(r).each((function(e,i){n._addAriaAndCollapsedClass(t._getTargetFromElement(i),[i])})),e},e._addAriaAndCollapsedClass=function(t,e){var n=i.default(t).hasClass(ie);e.length&&i.default(e).toggleClass(se,!n).attr("aria-expanded",n)},t._getTargetFromElement=function(t){var e=m.getSelectorFromElement(t);return e?document.querySelector(e):null},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(Ut),r=s({},Yt,n.data(),"object"==typeof e&&e?e:{});if(!o&&r.toggle&&"string"==typeof e&&/show|hide/.test(e)&&(r.toggle=!1),o||(o=new t(this,r),n.data(Ut,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}}))},r(t,null,[{key:"VERSION",get:function(){return Wt}},{key:"Default",get:function(){return Yt}}]),t}();i.default(document).on(ne,ce,(function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var e=i.default(this),n=m.getSelectorFromElement(this),o=[].slice.call(document.querySelectorAll(n));i.default(o).each((function(){var t=i.default(this),n=t.data(Ut)?"toggle":e.data();he._jQueryInterface.call(t,n)}))})),i.default.fn[Ft]=he._jQueryInterface,i.default.fn[Ft].Constructor=he,i.default.fn[Ft].noConflict=function(){return i.default.fn[Ft]=Kt,he._jQueryInterface};
+/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
* @license
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
-
- var timeoutDuration = function () {
- var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
- for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
- if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
- return 1;
- }
- }
- return 0;
- }();
-
- function microtaskDebounce(fn) {
- var called = false;
- return function () {
- if (called) {
- return;
- }
- called = true;
- window.Promise.resolve().then(function () {
- called = false;
- fn();
- });
- };
- }
-
- function taskDebounce(fn) {
- var scheduled = false;
- return function () {
- if (!scheduled) {
- scheduled = true;
- setTimeout(function () {
- scheduled = false;
- fn();
- }, timeoutDuration);
- }
- };
- }
-
- var supportsMicroTasks = isBrowser && window.Promise;
-
- /**
- * Create a debounced version of a method, that's asynchronously deferred
- * but called in the minimum time possible.
- *
- * @method
- * @memberof Popper.Utils
- * @argument {Function} fn
- * @returns {Function}
- */
- var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
-
- /**
- * Check if the given variable is a function
- * @method
- * @memberof Popper.Utils
- * @argument {Any} functionToCheck - variable to check
- * @returns {Boolean} answer to: is a function?
- */
- function isFunction(functionToCheck) {
- var getType = {};
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
- }
-
- /**
- * Get CSS computed property of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Eement} element
- * @argument {String} property
- */
- function getStyleComputedProperty(element, property) {
- if (element.nodeType !== 1) {
- return [];
- }
- // NOTE: 1 DOM access here
- var window = element.ownerDocument.defaultView;
- var css = window.getComputedStyle(element, null);
- return property ? css[property] : css;
- }
-
- /**
- * Returns the parentNode or the host of the element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} parent
- */
- function getParentNode(element) {
- if (element.nodeName === 'HTML') {
- return element;
- }
- return element.parentNode || element.host;
- }
-
- /**
- * Returns the scrolling parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} scroll parent
- */
- function getScrollParent(element) {
- // Return body, `getScroll` will take care to get the correct `scrollTop` from it
- if (!element) {
- return document.body;
- }
-
- switch (element.nodeName) {
- case 'HTML':
- case 'BODY':
- return element.ownerDocument.body;
- case '#document':
- return element.body;
- }
-
- // Firefox want us to check `-x` and `-y` variations as well
-
- var _getStyleComputedProp = getStyleComputedProperty(element),
- overflow = _getStyleComputedProp.overflow,
- overflowX = _getStyleComputedProp.overflowX,
- overflowY = _getStyleComputedProp.overflowY;
-
- if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
- return element;
- }
-
- return getScrollParent(getParentNode(element));
- }
-
- /**
- * Returns the reference node of the reference object, or the reference object itself.
- * @method
- * @memberof Popper.Utils
- * @param {Element|Object} reference - the reference element (the popper will be relative to this)
- * @returns {Element} parent
- */
- function getReferenceNode(reference) {
- return reference && reference.referenceNode ? reference.referenceNode : reference;
- }
-
- var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
- var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
-
- /**
- * Determines if the browser is Internet Explorer
- * @method
- * @memberof Popper.Utils
- * @param {Number} version to check
- * @returns {Boolean} isIE
- */
- function isIE(version) {
- if (version === 11) {
- return isIE11;
- }
- if (version === 10) {
- return isIE10;
- }
- return isIE11 || isIE10;
- }
-
- /**
- * Returns the offset parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} offset parent
- */
- function getOffsetParent(element) {
- if (!element) {
- return document.documentElement;
- }
-
- var noOffsetParent = isIE(10) ? document.body : null;
-
- // NOTE: 1 DOM access here
- var offsetParent = element.offsetParent || null;
- // Skip hidden elements which don't have an offsetParent
- while (offsetParent === noOffsetParent && element.nextElementSibling) {
- offsetParent = (element = element.nextElementSibling).offsetParent;
- }
-
- var nodeName = offsetParent && offsetParent.nodeName;
-
- if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
- return element ? element.ownerDocument.documentElement : document.documentElement;
- }
-
- // .offsetParent will return the closest TH, TD or TABLE in case
- // no offsetParent is present, I hate this job...
- if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
- return getOffsetParent(offsetParent);
- }
-
- return offsetParent;
- }
-
- function isOffsetContainer(element) {
- var nodeName = element.nodeName;
-
- if (nodeName === 'BODY') {
- return false;
- }
- return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
- }
-
- /**
- * Finds the root node (document, shadowDOM root) of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} node
- * @returns {Element} root node
- */
- function getRoot(node) {
- if (node.parentNode !== null) {
- return getRoot(node.parentNode);
- }
-
- return node;
- }
-
- /**
- * Finds the offset parent common to the two provided nodes
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element1
- * @argument {Element} element2
- * @returns {Element} common offset parent
- */
- function findCommonOffsetParent(element1, element2) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
- return document.documentElement;
- }
-
- // Here we make sure to give as "start" the element that comes first in the DOM
- var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
- var start = order ? element1 : element2;
- var end = order ? element2 : element1;
-
- // Get common ancestor container
- var range = document.createRange();
- range.setStart(start, 0);
- range.setEnd(end, 0);
- var commonAncestorContainer = range.commonAncestorContainer;
-
- // Both nodes are inside #document
-
- if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
- if (isOffsetContainer(commonAncestorContainer)) {
- return commonAncestorContainer;
- }
-
- return getOffsetParent(commonAncestorContainer);
- }
-
- // one of the nodes is inside shadowDOM, find which one
- var element1root = getRoot(element1);
- if (element1root.host) {
- return findCommonOffsetParent(element1root.host, element2);
- } else {
- return findCommonOffsetParent(element1, getRoot(element2).host);
- }
- }
-
- /**
- * Gets the scroll value of the given element in the given side (top and left)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {String} side `top` or `left`
- * @returns {number} amount of scrolled pixels
- */
- function getScroll(element) {
- var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
-
- var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
- var nodeName = element.nodeName;
-
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- var html = element.ownerDocument.documentElement;
- var scrollingElement = element.ownerDocument.scrollingElement || html;
- return scrollingElement[upperSide];
- }
-
- return element[upperSide];
- }
-
- /*
- * Sum or subtract the element scroll values (left and top) from a given rect object
- * @method
- * @memberof Popper.Utils
- * @param {Object} rect - Rect object you want to change
- * @param {HTMLElement} element - The element from the function reads the scroll values
- * @param {Boolean} subtract - set to true if you want to subtract the scroll values
- * @return {Object} rect - The modifier rect object
- */
- function includeScroll(rect, element) {
- var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- var modifier = subtract ? -1 : 1;
- rect.top += scrollTop * modifier;
- rect.bottom += scrollTop * modifier;
- rect.left += scrollLeft * modifier;
- rect.right += scrollLeft * modifier;
- return rect;
- }
-
- /*
- * Helper to detect borders of a given element
- * @method
- * @memberof Popper.Utils
- * @param {CSSStyleDeclaration} styles
- * Result of `getStyleComputedProperty` on the given element
- * @param {String} axis - `x` or `y`
- * @return {number} borders - The borders size of the given axis
- */
-
- function getBordersSize(styles, axis) {
- var sideA = axis === 'x' ? 'Left' : 'Top';
- var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
-
- return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
- }
-
- function getSize(axis, body, html, computedStyle) {
- return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
- }
-
- function getWindowSizes(document) {
- var body = document.body;
- var html = document.documentElement;
- var computedStyle = isIE(10) && getComputedStyle(html);
-
- return {
- height: getSize('Height', body, html, computedStyle),
- width: getSize('Width', body, html, computedStyle)
- };
- }
-
- var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- };
-
- var createClass = function () {
- function defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
-
-
-
-
-
- var defineProperty = function (obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- };
-
- var _extends$1 = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- /**
- * Given element offsets, generate an output similar to getBoundingClientRect
- * @method
- * @memberof Popper.Utils
- * @argument {Object} offsets
- * @returns {Object} ClientRect like output
- */
- function getClientRect(offsets) {
- return _extends$1({}, offsets, {
- right: offsets.left + offsets.width,
- bottom: offsets.top + offsets.height
- });
- }
-
- /**
- * Get bounding client rect of given element
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} element
- * @return {Object} client rect
- */
- function getBoundingClientRect(element) {
- var rect = {};
-
- // IE10 10 FIX: Please, don't ask, the element isn't
- // considered in DOM in some circumstances...
- // This isn't reproducible in IE10 compatibility mode of IE11
- try {
- if (isIE(10)) {
- rect = element.getBoundingClientRect();
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- rect.top += scrollTop;
- rect.left += scrollLeft;
- rect.bottom += scrollTop;
- rect.right += scrollLeft;
- } else {
- rect = element.getBoundingClientRect();
- }
- } catch (e) {}
-
- var result = {
- left: rect.left,
- top: rect.top,
- width: rect.right - rect.left,
- height: rect.bottom - rect.top
- };
-
- // subtract scrollbar size from sizes
- var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
- var width = sizes.width || element.clientWidth || result.width;
- var height = sizes.height || element.clientHeight || result.height;
-
- var horizScrollbar = element.offsetWidth - width;
- var vertScrollbar = element.offsetHeight - height;
-
- // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
- // we make this check conditional for performance reasons
- if (horizScrollbar || vertScrollbar) {
- var styles = getStyleComputedProperty(element);
- horizScrollbar -= getBordersSize(styles, 'x');
- vertScrollbar -= getBordersSize(styles, 'y');
-
- result.width -= horizScrollbar;
- result.height -= vertScrollbar;
- }
-
- return getClientRect(result);
- }
-
- function getOffsetRectRelativeToArbitraryNode(children, parent) {
- var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- var isIE10 = isIE(10);
- var isHTML = parent.nodeName === 'HTML';
- var childrenRect = getBoundingClientRect(children);
- var parentRect = getBoundingClientRect(parent);
- var scrollParent = getScrollParent(children);
-
- var styles = getStyleComputedProperty(parent);
- var borderTopWidth = parseFloat(styles.borderTopWidth);
- var borderLeftWidth = parseFloat(styles.borderLeftWidth);
-
- // In cases where the parent is fixed, we must ignore negative scroll in offset calc
- if (fixedPosition && isHTML) {
- parentRect.top = Math.max(parentRect.top, 0);
- parentRect.left = Math.max(parentRect.left, 0);
- }
- var offsets = getClientRect({
- top: childrenRect.top - parentRect.top - borderTopWidth,
- left: childrenRect.left - parentRect.left - borderLeftWidth,
- width: childrenRect.width,
- height: childrenRect.height
- });
- offsets.marginTop = 0;
- offsets.marginLeft = 0;
-
- // Subtract margins of documentElement in case it's being used as parent
- // we do this only on HTML because it's the only element that behaves
- // differently when margins are applied to it. The margins are included in
- // the box of the documentElement, in the other cases not.
- if (!isIE10 && isHTML) {
- var marginTop = parseFloat(styles.marginTop);
- var marginLeft = parseFloat(styles.marginLeft);
-
- offsets.top -= borderTopWidth - marginTop;
- offsets.bottom -= borderTopWidth - marginTop;
- offsets.left -= borderLeftWidth - marginLeft;
- offsets.right -= borderLeftWidth - marginLeft;
-
- // Attach marginTop and marginLeft because in some circumstances we may need them
- offsets.marginTop = marginTop;
- offsets.marginLeft = marginLeft;
- }
-
- if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
- offsets = includeScroll(offsets, parent);
- }
-
- return offsets;
- }
-
- function getViewportOffsetRectRelativeToArtbitraryNode(element) {
- var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var html = element.ownerDocument.documentElement;
- var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
- var width = Math.max(html.clientWidth, window.innerWidth || 0);
- var height = Math.max(html.clientHeight, window.innerHeight || 0);
-
- var scrollTop = !excludeScroll ? getScroll(html) : 0;
- var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
-
- var offset = {
- top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
- left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
- width: width,
- height: height
- };
-
- return getClientRect(offset);
- }
-
- /**
- * Check if the given element is fixed or is inside a fixed parent
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {Element} customContainer
- * @returns {Boolean} answer to "isFixed?"
- */
- function isFixed(element) {
- var nodeName = element.nodeName;
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- return false;
- }
- if (getStyleComputedProperty(element, 'position') === 'fixed') {
- return true;
- }
- var parentNode = getParentNode(element);
- if (!parentNode) {
- return false;
- }
- return isFixed(parentNode);
- }
-
- /**
- * Finds the first parent of an element that has a transformed property defined
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} first transformed parent or documentElement
- */
-
- function getFixedPositionOffsetParent(element) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element || !element.parentElement || isIE()) {
- return document.documentElement;
- }
- var el = element.parentElement;
- while (el && getStyleComputedProperty(el, 'transform') === 'none') {
- el = el.parentElement;
- }
- return el || document.documentElement;
- }
-
- /**
- * Computed the boundaries limits and return them
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} popper
- * @param {HTMLElement} reference
- * @param {number} padding
- * @param {HTMLElement} boundariesElement - Element used to define the boundaries
- * @param {Boolean} fixedPosition - Is in fixed position mode
- * @returns {Object} Coordinates of the boundaries
- */
- function getBoundaries(popper, reference, padding, boundariesElement) {
- var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
-
- // NOTE: 1 DOM access here
-
- var boundaries = { top: 0, left: 0 };
- var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
-
- // Handle viewport case
- if (boundariesElement === 'viewport') {
- boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
- } else {
- // Handle other cases based on DOM element used as boundaries
- var boundariesNode = void 0;
- if (boundariesElement === 'scrollParent') {
- boundariesNode = getScrollParent(getParentNode(reference));
- if (boundariesNode.nodeName === 'BODY') {
- boundariesNode = popper.ownerDocument.documentElement;
- }
- } else if (boundariesElement === 'window') {
- boundariesNode = popper.ownerDocument.documentElement;
- } else {
- boundariesNode = boundariesElement;
- }
-
- var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
-
- // In case of HTML, we need a different computation
- if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
- var _getWindowSizes = getWindowSizes(popper.ownerDocument),
- height = _getWindowSizes.height,
- width = _getWindowSizes.width;
-
- boundaries.top += offsets.top - offsets.marginTop;
- boundaries.bottom = height + offsets.top;
- boundaries.left += offsets.left - offsets.marginLeft;
- boundaries.right = width + offsets.left;
- } else {
- // for all the other DOM elements, this one is good
- boundaries = offsets;
- }
- }
-
- // Add paddings
- padding = padding || 0;
- var isPaddingNumber = typeof padding === 'number';
- boundaries.left += isPaddingNumber ? padding : padding.left || 0;
- boundaries.top += isPaddingNumber ? padding : padding.top || 0;
- boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
- boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
-
- return boundaries;
- }
-
- function getArea(_ref) {
- var width = _ref.width,
- height = _ref.height;
-
- return width * height;
- }
-
- /**
- * Utility used to transform the `auto` placement to the placement with more
- * available space.
- * @method
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
- var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
-
- if (placement.indexOf('auto') === -1) {
- return placement;
- }
-
- var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
-
- var rects = {
- top: {
- width: boundaries.width,
- height: refRect.top - boundaries.top
- },
- right: {
- width: boundaries.right - refRect.right,
- height: boundaries.height
- },
- bottom: {
- width: boundaries.width,
- height: boundaries.bottom - refRect.bottom
- },
- left: {
- width: refRect.left - boundaries.left,
- height: boundaries.height
- }
- };
-
- var sortedAreas = Object.keys(rects).map(function (key) {
- return _extends$1({
- key: key
- }, rects[key], {
- area: getArea(rects[key])
- });
- }).sort(function (a, b) {
- return b.area - a.area;
- });
-
- var filteredAreas = sortedAreas.filter(function (_ref2) {
- var width = _ref2.width,
- height = _ref2.height;
- return width >= popper.clientWidth && height >= popper.clientHeight;
- });
-
- var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
-
- var variation = placement.split('-')[1];
-
- return computedPlacement + (variation ? '-' + variation : '');
- }
-
- /**
- * Get offsets to the reference element
- * @method
- * @memberof Popper.Utils
- * @param {Object} state
- * @param {Element} popper - the popper element
- * @param {Element} reference - the reference element (the popper will be relative to this)
- * @param {Element} fixedPosition - is in fixed position mode
- * @returns {Object} An object containing the offsets which will be applied to the popper
- */
- function getReferenceOffsets(state, popper, reference) {
- var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
-
- var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
- return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
- }
-
- /**
- * Get the outer sizes of the given element (offset size + margins)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Object} object containing width and height properties
- */
- function getOuterSizes(element) {
- var window = element.ownerDocument.defaultView;
- var styles = window.getComputedStyle(element);
- var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
- var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
- var result = {
- width: element.offsetWidth + y,
- height: element.offsetHeight + x
- };
- return result;
- }
-
- /**
- * Get the opposite placement of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement
- * @returns {String} flipped placement
- */
- function getOppositePlacement(placement) {
- var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
- return placement.replace(/left|right|bottom|top/g, function (matched) {
- return hash[matched];
- });
- }
-
- /**
- * Get offsets to the popper
- * @method
- * @memberof Popper.Utils
- * @param {Object} position - CSS position the Popper will get applied
- * @param {HTMLElement} popper - the popper element
- * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
- * @param {String} placement - one of the valid placement options
- * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
- */
- function getPopperOffsets(popper, referenceOffsets, placement) {
- placement = placement.split('-')[0];
-
- // Get popper node sizes
- var popperRect = getOuterSizes(popper);
-
- // Add position, width and height to our offsets object
- var popperOffsets = {
- width: popperRect.width,
- height: popperRect.height
- };
-
- // depending by the popper placement we have to compute its offsets slightly differently
- var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
- var mainSide = isHoriz ? 'top' : 'left';
- var secondarySide = isHoriz ? 'left' : 'top';
- var measurement = isHoriz ? 'height' : 'width';
- var secondaryMeasurement = !isHoriz ? 'height' : 'width';
-
- popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
- if (placement === secondarySide) {
- popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
- } else {
- popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
- }
-
- return popperOffsets;
- }
-
- /**
- * Mimics the `find` method of Array
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function find(arr, check) {
- // use native find if supported
- if (Array.prototype.find) {
- return arr.find(check);
- }
-
- // use `filter` to obtain the same behavior of `find`
- return arr.filter(check)[0];
- }
-
- /**
- * Return the index of the matching object
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function findIndex(arr, prop, value) {
- // use native findIndex if supported
- if (Array.prototype.findIndex) {
- return arr.findIndex(function (cur) {
- return cur[prop] === value;
- });
- }
-
- // use `find` + `indexOf` if `findIndex` isn't supported
- var match = find(arr, function (obj) {
- return obj[prop] === value;
- });
- return arr.indexOf(match);
- }
-
- /**
- * Loop trough the list of modifiers and run them in order,
- * each of them will then edit the data object.
- * @method
- * @memberof Popper.Utils
- * @param {dataObject} data
- * @param {Array} modifiers
- * @param {String} ends - Optional modifier name used as stopper
- * @returns {dataObject}
- */
- function runModifiers(modifiers, data, ends) {
- var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
-
- modifiersToRun.forEach(function (modifier) {
- if (modifier['function']) {
- // eslint-disable-line dot-notation
- console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
- }
- var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
- if (modifier.enabled && isFunction(fn)) {
- // Add properties to offsets to make them a complete clientRect object
- // we do this before each modifier to make sure the previous one doesn't
- // mess with these values
- data.offsets.popper = getClientRect(data.offsets.popper);
- data.offsets.reference = getClientRect(data.offsets.reference);
-
- data = fn(data, modifier);
- }
- });
-
- return data;
- }
-
- /**
- * Updates the position of the popper, computing the new offsets and applying
- * the new style.<br />
- * Prefer `scheduleUpdate` over `update` because of performance reasons.
- * @method
- * @memberof Popper
- */
- function update() {
- // if popper is destroyed, don't perform any further update
- if (this.state.isDestroyed) {
- return;
- }
-
- var data = {
- instance: this,
- styles: {},
- arrowStyles: {},
- attributes: {},
- flipped: false,
- offsets: {}
- };
-
- // compute reference element offsets
- data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
-
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
-
- // store the computed placement inside `originalPlacement`
- data.originalPlacement = data.placement;
-
- data.positionFixed = this.options.positionFixed;
-
- // compute the popper offsets
- data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
-
- data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
-
- // run the modifiers
- data = runModifiers(this.modifiers, data);
-
- // the first `update` will call `onCreate` callback
- // the other ones will call `onUpdate` callback
- if (!this.state.isCreated) {
- this.state.isCreated = true;
- this.options.onCreate(data);
- } else {
- this.options.onUpdate(data);
- }
- }
-
- /**
- * Helper used to know if the given modifier is enabled.
- * @method
- * @memberof Popper.Utils
- * @returns {Boolean}
- */
- function isModifierEnabled(modifiers, modifierName) {
- return modifiers.some(function (_ref) {
- var name = _ref.name,
- enabled = _ref.enabled;
- return enabled && name === modifierName;
- });
- }
-
- /**
- * Get the prefixed supported property name
- * @method
- * @memberof Popper.Utils
- * @argument {String} property (camelCase)
- * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
- */
- function getSupportedPropertyName(property) {
- var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
- var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
-
- for (var i = 0; i < prefixes.length; i++) {
- var prefix = prefixes[i];
- var toCheck = prefix ? '' + prefix + upperProp : property;
- if (typeof document.body.style[toCheck] !== 'undefined') {
- return toCheck;
- }
- }
- return null;
- }
-
- /**
- * Destroys the popper.
- * @method
- * @memberof Popper
- */
- function destroy() {
- this.state.isDestroyed = true;
-
- // touch DOM only if `applyStyle` modifier is enabled
- if (isModifierEnabled(this.modifiers, 'applyStyle')) {
- this.popper.removeAttribute('x-placement');
- this.popper.style.position = '';
- this.popper.style.top = '';
- this.popper.style.left = '';
- this.popper.style.right = '';
- this.popper.style.bottom = '';
- this.popper.style.willChange = '';
- this.popper.style[getSupportedPropertyName('transform')] = '';
- }
-
- this.disableEventListeners();
-
- // remove the popper if user explicitly asked for the deletion on destroy
- // do not use `remove` because IE11 doesn't support it
- if (this.options.removeOnDestroy) {
- this.popper.parentNode.removeChild(this.popper);
- }
- return this;
- }
-
- /**
- * Get the window associated with the element
- * @argument {Element} element
- * @returns {Window}
- */
- function getWindow(element) {
- var ownerDocument = element.ownerDocument;
- return ownerDocument ? ownerDocument.defaultView : window;
- }
-
- function attachToScrollParents(scrollParent, event, callback, scrollParents) {
- var isBody = scrollParent.nodeName === 'BODY';
- var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
- target.addEventListener(event, callback, { passive: true });
-
- if (!isBody) {
- attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
- }
- scrollParents.push(target);
- }
-
- /**
- * Setup needed event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function setupEventListeners(reference, options, state, updateBound) {
- // Resize event listener on window
- state.updateBound = updateBound;
- getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
-
- // Scroll event listener on scroll parents
- var scrollElement = getScrollParent(reference);
- attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
- state.scrollElement = scrollElement;
- state.eventsEnabled = true;
-
- return state;
- }
-
- /**
- * It will add resize/scroll events and start recalculating
- * position of the popper element when they are triggered.
- * @method
- * @memberof Popper
- */
- function enableEventListeners() {
- if (!this.state.eventsEnabled) {
- this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
- }
- }
-
- /**
- * Remove event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function removeEventListeners(reference, state) {
- // Remove resize event listener on window
- getWindow(reference).removeEventListener('resize', state.updateBound);
-
- // Remove scroll event listener on scroll parents
- state.scrollParents.forEach(function (target) {
- target.removeEventListener('scroll', state.updateBound);
- });
-
- // Reset state
- state.updateBound = null;
- state.scrollParents = [];
- state.scrollElement = null;
- state.eventsEnabled = false;
- return state;
- }
-
- /**
- * It will remove resize/scroll events and won't recalculate popper position
- * when they are triggered. It also won't trigger `onUpdate` callback anymore,
- * unless you call `update` method manually.
- * @method
- * @memberof Popper
- */
- function disableEventListeners() {
- if (this.state.eventsEnabled) {
- cancelAnimationFrame(this.scheduleUpdate);
- this.state = removeEventListeners(this.reference, this.state);
- }
- }
-
- /**
- * Tells if a given input is a number
- * @method
- * @memberof Popper.Utils
- * @param {*} input to check
- * @return {Boolean}
- */
- function isNumeric(n) {
- return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
- }
-
- /**
- * Set the style to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the style to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setStyles(element, styles) {
- Object.keys(styles).forEach(function (prop) {
- var unit = '';
- // add unit if the value is numeric and is one of the following
- if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
- unit = 'px';
- }
- element.style[prop] = styles[prop] + unit;
- });
- }
-
- /**
- * Set the attributes to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the attributes to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setAttributes(element, attributes) {
- Object.keys(attributes).forEach(function (prop) {
- var value = attributes[prop];
- if (value !== false) {
- element.setAttribute(prop, attributes[prop]);
- } else {
- element.removeAttribute(prop);
- }
- });
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} data.styles - List of style properties - values to apply to popper element
- * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The same data object
- */
- function applyStyle(data) {
- // any property present in `data.styles` will be applied to the popper,
- // in this way we can make the 3rd party modifiers add custom styles to it
- // Be aware, modifiers could override the properties defined in the previous
- // lines of this modifier!
- setStyles(data.instance.popper, data.styles);
-
- // any property present in `data.attributes` will be applied to the popper,
- // they will be set as HTML attributes of the element
- setAttributes(data.instance.popper, data.attributes);
-
- // if arrowElement is defined and arrowStyles has some properties
- if (data.arrowElement && Object.keys(data.arrowStyles).length) {
- setStyles(data.arrowElement, data.arrowStyles);
- }
-
- return data;
- }
-
- /**
- * Set the x-placement attribute before everything else because it could be used
- * to add margins to the popper margins needs to be calculated to get the
- * correct popper offsets.
- * @method
- * @memberof Popper.modifiers
- * @param {HTMLElement} reference - The reference element used to position the popper
- * @param {HTMLElement} popper - The HTML element used as popper
- * @param {Object} options - Popper.js options
- */
- function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
- // compute reference element offsets
- var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
-
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
-
- popper.setAttribute('x-placement', placement);
-
- // Apply `position` to popper before anything else because
- // without the position applied we can't guarantee correct computations
- setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
-
- return options;
- }
-
- /**
- * @function
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Boolean} shouldRound - If the offsets should be rounded at all
- * @returns {Object} The popper's position offsets rounded
- *
- * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
- * good as it can be within reason.
- * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
- *
- * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
- * as well on High DPI screens).
- *
- * Firefox prefers no rounding for positioning and does not have blurriness on
- * high DPI screens.
- *
- * Only horizontal placement and left/right values need to be considered.
- */
- function getRoundedOffsets(data, shouldRound) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var round = Math.round,
- floor = Math.floor;
-
- var noRound = function noRound(v) {
- return v;
- };
-
- var referenceWidth = round(reference.width);
- var popperWidth = round(popper.width);
-
- var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
- var isVariation = data.placement.indexOf('-') !== -1;
- var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
- var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
-
- var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
- var verticalToInteger = !shouldRound ? noRound : round;
-
- return {
- left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
- top: verticalToInteger(popper.top),
- bottom: verticalToInteger(popper.bottom),
- right: horizontalToInteger(popper.right)
- };
- }
-
- var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeStyle(data, options) {
- var x = options.x,
- y = options.y;
- var popper = data.offsets.popper;
-
- // Remove this legacy support in Popper.js v2
-
- var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'applyStyle';
- }).gpuAcceleration;
- if (legacyGpuAccelerationOption !== undefined) {
- console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
- }
- var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
-
- var offsetParent = getOffsetParent(data.instance.popper);
- var offsetParentRect = getBoundingClientRect(offsetParent);
-
- // Styles
- var styles = {
- position: popper.position
- };
-
- var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
-
- var sideA = x === 'bottom' ? 'top' : 'bottom';
- var sideB = y === 'right' ? 'left' : 'right';
-
- // if gpuAcceleration is set to `true` and transform is supported,
- // we use `translate3d` to apply the position to the popper we
- // automatically use the supported prefixed version if needed
- var prefixedProperty = getSupportedPropertyName('transform');
-
- // now, let's make a step back and look at this code closely (wtf?)
- // If the content of the popper grows once it's been positioned, it
- // may happen that the popper gets misplaced because of the new content
- // overflowing its reference element
- // To avoid this problem, we provide two options (x and y), which allow
- // the consumer to define the offset origin.
- // If we position a popper on top of a reference element, we can set
- // `x` to `top` to make the popper grow towards its top instead of
- // its bottom.
- var left = void 0,
- top = void 0;
- if (sideA === 'bottom') {
- // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
- // and not the bottom of the html element
- if (offsetParent.nodeName === 'HTML') {
- top = -offsetParent.clientHeight + offsets.bottom;
- } else {
- top = -offsetParentRect.height + offsets.bottom;
- }
- } else {
- top = offsets.top;
- }
- if (sideB === 'right') {
- if (offsetParent.nodeName === 'HTML') {
- left = -offsetParent.clientWidth + offsets.right;
- } else {
- left = -offsetParentRect.width + offsets.right;
- }
- } else {
- left = offsets.left;
- }
- if (gpuAcceleration && prefixedProperty) {
- styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
- styles[sideA] = 0;
- styles[sideB] = 0;
- styles.willChange = 'transform';
- } else {
- // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
- var invertTop = sideA === 'bottom' ? -1 : 1;
- var invertLeft = sideB === 'right' ? -1 : 1;
- styles[sideA] = top * invertTop;
- styles[sideB] = left * invertLeft;
- styles.willChange = sideA + ', ' + sideB;
- }
-
- // Attributes
- var attributes = {
- 'x-placement': data.placement
- };
-
- // Update `data` attributes, styles and arrowStyles
- data.attributes = _extends$1({}, attributes, data.attributes);
- data.styles = _extends$1({}, styles, data.styles);
- data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
-
- return data;
- }
-
- /**
- * Helper used to know if the given modifier depends from another one.<br />
- * It checks if the needed modifier is listed and enabled.
- * @method
- * @memberof Popper.Utils
- * @param {Array} modifiers - list of modifiers
- * @param {String} requestingName - name of requesting modifier
- * @param {String} requestedName - name of requested modifier
- * @returns {Boolean}
- */
- function isModifierRequired(modifiers, requestingName, requestedName) {
- var requesting = find(modifiers, function (_ref) {
- var name = _ref.name;
- return name === requestingName;
- });
-
- var isRequired = !!requesting && modifiers.some(function (modifier) {
- return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
- });
-
- if (!isRequired) {
- var _requesting = '`' + requestingName + '`';
- var requested = '`' + requestedName + '`';
- console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
- }
- return isRequired;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function arrow(data, options) {
- var _data$offsets$arrow;
-
- // arrow depends on keepTogether in order to work
- if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
- return data;
- }
-
- var arrowElement = options.element;
-
- // if arrowElement is a string, suppose it's a CSS selector
- if (typeof arrowElement === 'string') {
- arrowElement = data.instance.popper.querySelector(arrowElement);
-
- // if arrowElement is not found, don't run the modifier
- if (!arrowElement) {
- return data;
- }
- } else {
- // if the arrowElement isn't a query selector we must check that the
- // provided DOM node is child of its popper node
- if (!data.instance.popper.contains(arrowElement)) {
- console.warn('WARNING: `arrow.element` must be child of its popper element!');
- return data;
- }
- }
-
- var placement = data.placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var isVertical = ['left', 'right'].indexOf(placement) !== -1;
-
- var len = isVertical ? 'height' : 'width';
- var sideCapitalized = isVertical ? 'Top' : 'Left';
- var side = sideCapitalized.toLowerCase();
- var altSide = isVertical ? 'left' : 'top';
- var opSide = isVertical ? 'bottom' : 'right';
- var arrowElementSize = getOuterSizes(arrowElement)[len];
-
- //
- // extends keepTogether behavior making sure the popper and its
- // reference have enough pixels in conjunction
- //
-
- // top/left side
- if (reference[opSide] - arrowElementSize < popper[side]) {
- data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
- }
- // bottom/right side
- if (reference[side] + arrowElementSize > popper[opSide]) {
- data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
- }
- data.offsets.popper = getClientRect(data.offsets.popper);
-
- // compute center of the popper
- var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
-
- // Compute the sideValue using the updated popper offsets
- // take popper margin in account because we don't have this info available
- var css = getStyleComputedProperty(data.instance.popper);
- var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
- var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
- var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
-
- // prevent arrowElement from being placed not contiguously to its popper
- sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
-
- data.arrowElement = arrowElement;
- data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
-
- return data;
- }
-
- /**
- * Get the opposite placement variation of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement variation
- * @returns {String} flipped placement variation
- */
- function getOppositeVariation(variation) {
- if (variation === 'end') {
- return 'start';
- } else if (variation === 'start') {
- return 'end';
- }
- return variation;
- }
-
- /**
- * List of accepted placements to use as values of the `placement` option.<br />
- * Valid placements are:
- * - `auto`
- * - `top`
- * - `right`
- * - `bottom`
- * - `left`
- *
- * Each placement can have a variation from this list:
- * - `-start`
- * - `-end`
- *
- * Variations are interpreted easily if you think of them as the left to right
- * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
- * is right.<br />
- * Vertically (`left` and `right`), `start` is top and `end` is bottom.
- *
- * Some valid examples are:
- * - `top-end` (on top of reference, right aligned)
- * - `right-start` (on right of reference, top aligned)
- * - `bottom` (on bottom, centered)
- * - `auto-end` (on the side with more space available, alignment depends by placement)
- *
- * @static
- * @type {Array}
- * @enum {String}
- * @readonly
- * @method placements
- * @memberof Popper
- */
- var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
-
- // Get rid of `auto` `auto-start` and `auto-end`
- var validPlacements = placements.slice(3);
-
- /**
- * Given an initial placement, returns all the subsequent placements
- * clockwise (or counter-clockwise).
- *
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement - A valid placement (it accepts variations)
- * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
- * @returns {Array} placements including their variations
- */
- function clockwise(placement) {
- var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var index = validPlacements.indexOf(placement);
- var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
- return counter ? arr.reverse() : arr;
- }
-
- var BEHAVIORS = {
- FLIP: 'flip',
- CLOCKWISE: 'clockwise',
- COUNTERCLOCKWISE: 'counterclockwise'
- };
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function flip(data, options) {
- // if `inner` modifier is enabled, we can't use the `flip` modifier
- if (isModifierEnabled(data.instance.modifiers, 'inner')) {
- return data;
- }
-
- if (data.flipped && data.placement === data.originalPlacement) {
- // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
- return data;
- }
-
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
-
- var placement = data.placement.split('-')[0];
- var placementOpposite = getOppositePlacement(placement);
- var variation = data.placement.split('-')[1] || '';
-
- var flipOrder = [];
-
- switch (options.behavior) {
- case BEHAVIORS.FLIP:
- flipOrder = [placement, placementOpposite];
- break;
- case BEHAVIORS.CLOCKWISE:
- flipOrder = clockwise(placement);
- break;
- case BEHAVIORS.COUNTERCLOCKWISE:
- flipOrder = clockwise(placement, true);
- break;
- default:
- flipOrder = options.behavior;
- }
-
- flipOrder.forEach(function (step, index) {
- if (placement !== step || flipOrder.length === index + 1) {
- return data;
- }
-
- placement = data.placement.split('-')[0];
- placementOpposite = getOppositePlacement(placement);
-
- var popperOffsets = data.offsets.popper;
- var refOffsets = data.offsets.reference;
-
- // using floor because the reference offsets may contain decimals we are not going to consider here
- var floor = Math.floor;
- var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
-
- var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
- var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
- var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
- var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
-
- var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
-
- // flip the variation if required
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
-
- // flips variation if reference element overflows boundaries
- var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
-
- // flips variation if popper content overflows boundaries
- var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
-
- var flippedVariation = flippedVariationByRef || flippedVariationByContent;
-
- if (overlapsRef || overflowsBoundaries || flippedVariation) {
- // this boolean to detect any flip loop
- data.flipped = true;
-
- if (overlapsRef || overflowsBoundaries) {
- placement = flipOrder[index + 1];
- }
-
- if (flippedVariation) {
- variation = getOppositeVariation(variation);
- }
-
- data.placement = placement + (variation ? '-' + variation : '');
-
- // this object contains `position`, we want to preserve it along with
- // any additional property we may add in the future
- data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
-
- data = runModifiers(data.instance.modifiers, data, 'flip');
- }
- });
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function keepTogether(data) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var placement = data.placement.split('-')[0];
- var floor = Math.floor;
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
- var side = isVertical ? 'right' : 'bottom';
- var opSide = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
-
- if (popper[side] < floor(reference[opSide])) {
- data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
- }
- if (popper[opSide] > floor(reference[side])) {
- data.offsets.popper[opSide] = floor(reference[side]);
- }
-
- return data;
- }
-
- /**
- * Converts a string containing value + unit into a px value number
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} str - Value + unit string
- * @argument {String} measurement - `height` or `width`
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @returns {Number|String}
- * Value in pixels, or original string if no values were extracted
- */
- function toValue(str, measurement, popperOffsets, referenceOffsets) {
- // separate value from unit
- var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
- var value = +split[1];
- var unit = split[2];
-
- // If it's not a number it's an operator, I guess
- if (!value) {
- return str;
- }
-
- if (unit.indexOf('%') === 0) {
- var element = void 0;
- switch (unit) {
- case '%p':
- element = popperOffsets;
- break;
- case '%':
- case '%r':
- default:
- element = referenceOffsets;
- }
-
- var rect = getClientRect(element);
- return rect[measurement] / 100 * value;
- } else if (unit === 'vh' || unit === 'vw') {
- // if is a vh or vw, we calculate the size based on the viewport
- var size = void 0;
- if (unit === 'vh') {
- size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
- } else {
- size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
- }
- return size / 100 * value;
- } else {
- // if is an explicit pixel unit, we get rid of the unit and keep the value
- // if is an implicit unit, it's px, and we return just the value
- return value;
- }
- }
-
- /**
- * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} offset
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @argument {String} basePlacement
- * @returns {Array} a two cells array with x and y offsets in numbers
- */
- function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
- var offsets = [0, 0];
-
- // Use height if placement is left or right and index is 0 otherwise use width
- // in this way the first offset will use an axis and the second one
- // will use the other one
- var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
-
- // Split the offset string to obtain a list of values and operands
- // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
- var fragments = offset.split(/(\+|\-)/).map(function (frag) {
- return frag.trim();
- });
-
- // Detect if the offset string contains a pair of values or a single one
- // they could be separated by comma or space
- var divider = fragments.indexOf(find(fragments, function (frag) {
- return frag.search(/,|\s/) !== -1;
- }));
-
- if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
- console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
- }
-
- // If divider is found, we divide the list of values and operands to divide
- // them by ofset X and Y.
- var splitRegex = /\s*,\s*|\s+/;
- var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
-
- // Convert the values with units to absolute pixels to allow our computations
- ops = ops.map(function (op, index) {
- // Most of the units rely on the orientation of the popper
- var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
- var mergeWithPrevious = false;
- return op
- // This aggregates any `+` or `-` sign that aren't considered operators
- // e.g.: 10 + +5 => [10, +, +5]
- .reduce(function (a, b) {
- if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
- a[a.length - 1] = b;
- mergeWithPrevious = true;
- return a;
- } else if (mergeWithPrevious) {
- a[a.length - 1] += b;
- mergeWithPrevious = false;
- return a;
- } else {
- return a.concat(b);
- }
- }, [])
- // Here we convert the string values into number values (in px)
- .map(function (str) {
- return toValue(str, measurement, popperOffsets, referenceOffsets);
- });
- });
-
- // Loop trough the offsets arrays and execute the operations
- ops.forEach(function (op, index) {
- op.forEach(function (frag, index2) {
- if (isNumeric(frag)) {
- offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
- }
- });
- });
- return offsets;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @argument {Number|String} options.offset=0
- * The offset value as described in the modifier description
- * @returns {Object} The data object, properly modified
- */
- function offset(data, _ref) {
- var offset = _ref.offset;
- var placement = data.placement,
- _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var basePlacement = placement.split('-')[0];
-
- var offsets = void 0;
- if (isNumeric(+offset)) {
- offsets = [+offset, 0];
- } else {
- offsets = parseOffset(offset, popper, reference, basePlacement);
- }
-
- if (basePlacement === 'left') {
- popper.top += offsets[0];
- popper.left -= offsets[1];
- } else if (basePlacement === 'right') {
- popper.top += offsets[0];
- popper.left += offsets[1];
- } else if (basePlacement === 'top') {
- popper.left += offsets[0];
- popper.top -= offsets[1];
- } else if (basePlacement === 'bottom') {
- popper.left += offsets[0];
- popper.top += offsets[1];
- }
-
- data.popper = popper;
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function preventOverflow(data, options) {
- var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
-
- // If offsetParent is the reference element, we really want to
- // go one step up and use the next offsetParent as reference to
- // avoid to make this modifier completely useless and look like broken
- if (data.instance.reference === boundariesElement) {
- boundariesElement = getOffsetParent(boundariesElement);
- }
-
- // NOTE: DOM access here
- // resets the popper's position so that the document size can be calculated excluding
- // the size of the popper element itself
- var transformProp = getSupportedPropertyName('transform');
- var popperStyles = data.instance.popper.style; // assignment to help minification
- var top = popperStyles.top,
- left = popperStyles.left,
- transform = popperStyles[transformProp];
-
- popperStyles.top = '';
- popperStyles.left = '';
- popperStyles[transformProp] = '';
-
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
-
- // NOTE: DOM access here
- // restores the original style properties after the offsets have been computed
- popperStyles.top = top;
- popperStyles.left = left;
- popperStyles[transformProp] = transform;
-
- options.boundaries = boundaries;
-
- var order = options.priority;
- var popper = data.offsets.popper;
-
- var check = {
- primary: function primary(placement) {
- var value = popper[placement];
- if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
- value = Math.max(popper[placement], boundaries[placement]);
- }
- return defineProperty({}, placement, value);
- },
- secondary: function secondary(placement) {
- var mainSide = placement === 'right' ? 'left' : 'top';
- var value = popper[mainSide];
- if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
- value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
- }
- return defineProperty({}, mainSide, value);
- }
- };
-
- order.forEach(function (placement) {
- var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
- popper = _extends$1({}, popper, check[side](placement));
- });
-
- data.offsets.popper = popper;
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function shift(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var shiftvariation = placement.split('-')[1];
-
- // if shift shiftvariation is specified, run the modifier
- if (shiftvariation) {
- var _data$offsets = data.offsets,
- reference = _data$offsets.reference,
- popper = _data$offsets.popper;
-
- var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
- var side = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
-
- var shiftOffsets = {
- start: defineProperty({}, side, reference[side]),
- end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
- };
-
- data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
- }
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function hide(data) {
- if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
- return data;
- }
-
- var refRect = data.offsets.reference;
- var bound = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'preventOverflow';
- }).boundaries;
-
- if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === true) {
- return data;
- }
-
- data.hide = true;
- data.attributes['x-out-of-boundaries'] = '';
- } else {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === false) {
- return data;
- }
-
- data.hide = false;
- data.attributes['x-out-of-boundaries'] = false;
- }
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function inner(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
-
- var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
-
- popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
-
- data.placement = getOppositePlacement(placement);
- data.offsets.popper = getClientRect(popper);
-
- return data;
- }
-
- /**
- * Modifier function, each modifier can have a function of this type assigned
- * to its `fn` property.<br />
- * These functions will be called on each update, this means that you must
- * make sure they are performant enough to avoid performance bottlenecks.
- *
- * @function ModifierFn
- * @argument {dataObject} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {dataObject} The data object, properly modified
- */
-
- /**
- * Modifiers are plugins used to alter the behavior of your poppers.<br />
- * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
- * needed by the library.
- *
- * Usually you don't want to override the `order`, `fn` and `onLoad` props.
- * All the other properties are configurations that could be tweaked.
- * @namespace modifiers
- */
- var modifiers = {
- /**
- * Modifier used to shift the popper on the start or end of its reference
- * element.<br />
- * It will read the variation of the `placement` property.<br />
- * It can be one either `-end` or `-start`.
- * @memberof modifiers
- * @inner
- */
- shift: {
- /** @prop {number} order=100 - Index used to define the order of execution */
- order: 100,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: shift
- },
-
- /**
- * The `offset` modifier can shift your popper on both its axis.
- *
- * It accepts the following units:
- * - `px` or unit-less, interpreted as pixels
- * - `%` or `%r`, percentage relative to the length of the reference element
- * - `%p`, percentage relative to the length of the popper element
- * - `vw`, CSS viewport width unit
- * - `vh`, CSS viewport height unit
- *
- * For length is intended the main axis relative to the placement of the popper.<br />
- * This means that if the placement is `top` or `bottom`, the length will be the
- * `width`. In case of `left` or `right`, it will be the `height`.
- *
- * You can provide a single value (as `Number` or `String`), or a pair of values
- * as `String` divided by a comma or one (or more) white spaces.<br />
- * The latter is a deprecated method because it leads to confusion and will be
- * removed in v2.<br />
- * Additionally, it accepts additions and subtractions between different units.
- * Note that multiplications and divisions aren't supported.
- *
- * Valid examples are:
- * ```
- * 10
- * '10%'
- * '10, 10'
- * '10%, 10'
- * '10 + 10%'
- * '10 - 5vh + 3%'
- * '-10px + 5vh, 5px - 6%'
- * ```
- * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
- * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
- * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
- *
- * @memberof modifiers
- * @inner
- */
- offset: {
- /** @prop {number} order=200 - Index used to define the order of execution */
- order: 200,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: offset,
- /** @prop {Number|String} offset=0
- * The offset value as described in the modifier description
- */
- offset: 0
- },
-
- /**
- * Modifier used to prevent the popper from being positioned outside the boundary.
- *
- * A scenario exists where the reference itself is not within the boundaries.<br />
- * We can say it has "escaped the boundaries" — or just "escaped".<br />
- * In this case we need to decide whether the popper should either:
- *
- * - detach from the reference and remain "trapped" in the boundaries, or
- * - if it should ignore the boundary and "escape with its reference"
- *
- * When `escapeWithReference` is set to`true` and reference is completely
- * outside its boundaries, the popper will overflow (or completely leave)
- * the boundaries in order to remain attached to the edge of the reference.
- *
- * @memberof modifiers
- * @inner
- */
- preventOverflow: {
- /** @prop {number} order=300 - Index used to define the order of execution */
- order: 300,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: preventOverflow,
- /**
- * @prop {Array} [priority=['left','right','top','bottom']]
- * Popper will try to prevent overflow following these priorities by default,
- * then, it could overflow on the left and on top of the `boundariesElement`
- */
- priority: ['left', 'right', 'top', 'bottom'],
- /**
- * @prop {number} padding=5
- * Amount of pixel used to define a minimum distance between the boundaries
- * and the popper. This makes sure the popper always has a little padding
- * between the edges of its container
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='scrollParent'
- * Boundaries used by the modifier. Can be `scrollParent`, `window`,
- * `viewport` or any DOM element.
- */
- boundariesElement: 'scrollParent'
- },
-
- /**
- * Modifier used to make sure the reference and its popper stay near each other
- * without leaving any gap between the two. Especially useful when the arrow is
- * enabled and you want to ensure that it points to its reference element.
- * It cares only about the first axis. You can still have poppers with margin
- * between the popper and its reference element.
- * @memberof modifiers
- * @inner
- */
- keepTogether: {
- /** @prop {number} order=400 - Index used to define the order of execution */
- order: 400,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: keepTogether
- },
-
- /**
- * This modifier is used to move the `arrowElement` of the popper to make
- * sure it is positioned between the reference element and its popper element.
- * It will read the outer size of the `arrowElement` node to detect how many
- * pixels of conjunction are needed.
- *
- * It has no effect if no `arrowElement` is provided.
- * @memberof modifiers
- * @inner
- */
- arrow: {
- /** @prop {number} order=500 - Index used to define the order of execution */
- order: 500,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: arrow,
- /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
- element: '[x-arrow]'
- },
-
- /**
- * Modifier used to flip the popper's placement when it starts to overlap its
- * reference element.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- *
- * **NOTE:** this modifier will interrupt the current update cycle and will
- * restart it if it detects the need to flip the placement.
- * @memberof modifiers
- * @inner
- */
- flip: {
- /** @prop {number} order=600 - Index used to define the order of execution */
- order: 600,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: flip,
- /**
- * @prop {String|Array} behavior='flip'
- * The behavior used to change the popper's placement. It can be one of
- * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
- * placements (with optional variations)
- */
- behavior: 'flip',
- /**
- * @prop {number} padding=5
- * The popper will flip if it hits the edges of the `boundariesElement`
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='viewport'
- * The element which will define the boundaries of the popper position.
- * The popper will never be placed outside of the defined boundaries
- * (except if `keepTogether` is enabled)
- */
- boundariesElement: 'viewport',
- /**
- * @prop {Boolean} flipVariations=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the reference element overlaps its boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariations: false,
- /**
- * @prop {Boolean} flipVariationsByContent=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the popper element overlaps its reference boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariationsByContent: false
- },
-
- /**
- * Modifier used to make the popper flow toward the inner of the reference element.
- * By default, when this modifier is disabled, the popper will be placed outside
- * the reference element.
- * @memberof modifiers
- * @inner
- */
- inner: {
- /** @prop {number} order=700 - Index used to define the order of execution */
- order: 700,
- /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
- enabled: false,
- /** @prop {ModifierFn} */
- fn: inner
- },
-
- /**
- * Modifier used to hide the popper when its reference element is outside of the
- * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
- * be used to hide with a CSS selector the popper when its reference is
- * out of boundaries.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- * @memberof modifiers
- * @inner
- */
- hide: {
- /** @prop {number} order=800 - Index used to define the order of execution */
- order: 800,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: hide
- },
-
- /**
- * Computes the style that will be applied to the popper element to gets
- * properly positioned.
- *
- * Note that this modifier will not touch the DOM, it just prepares the styles
- * so that `applyStyle` modifier can apply it. This separation is useful
- * in case you need to replace `applyStyle` with a custom implementation.
- *
- * This modifier has `850` as `order` value to maintain backward compatibility
- * with previous versions of Popper.js. Expect the modifiers ordering method
- * to change in future major versions of the library.
- *
- * @memberof modifiers
- * @inner
- */
- computeStyle: {
- /** @prop {number} order=850 - Index used to define the order of execution */
- order: 850,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: computeStyle,
- /**
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: true,
- /**
- * @prop {string} [x='bottom']
- * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
- * Change this if your popper should grow in a direction different from `bottom`
- */
- x: 'bottom',
- /**
- * @prop {string} [x='left']
- * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
- * Change this if your popper should grow in a direction different from `right`
- */
- y: 'right'
- },
-
- /**
- * Applies the computed styles to the popper element.
- *
- * All the DOM manipulations are limited to this modifier. This is useful in case
- * you want to integrate Popper.js inside a framework or view library and you
- * want to delegate all the DOM manipulations to it.
- *
- * Note that if you disable this modifier, you must make sure the popper element
- * has its position set to `absolute` before Popper.js can do its work!
- *
- * Just disable this modifier and define your own to achieve the desired effect.
- *
- * @memberof modifiers
- * @inner
- */
- applyStyle: {
- /** @prop {number} order=900 - Index used to define the order of execution */
- order: 900,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: applyStyle,
- /** @prop {Function} */
- onLoad: applyStyleOnLoad,
- /**
- * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: undefined
- }
- };
-
- /**
- * The `dataObject` is an object containing all the information used by Popper.js.
- * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
- * @name dataObject
- * @property {Object} data.instance The Popper.js instance
- * @property {String} data.placement Placement applied to popper
- * @property {String} data.originalPlacement Placement originally defined on init
- * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
- * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
- * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
- * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.boundaries Offsets of the popper boundaries
- * @property {Object} data.offsets The measurements of popper, reference and arrow elements
- * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
- */
-
- /**
- * Default options provided to Popper.js constructor.<br />
- * These can be overridden using the `options` argument of Popper.js.<br />
- * To override an option, simply pass an object with the same
- * structure of the `options` object, as the 3rd argument. For example:
- * ```
- * new Popper(ref, pop, {
- * modifiers: {
- * preventOverflow: { enabled: false }
- * }
- * })
- * ```
- * @type {Object}
- * @static
- * @memberof Popper
- */
- var Defaults = {
- /**
- * Popper's placement.
- * @prop {Popper.placements} placement='bottom'
- */
- placement: 'bottom',
-
- /**
- * Set this to true if you want popper to position it self in 'fixed' mode
- * @prop {Boolean} positionFixed=false
- */
- positionFixed: false,
-
- /**
- * Whether events (resize, scroll) are initially enabled.
- * @prop {Boolean} eventsEnabled=true
- */
- eventsEnabled: true,
-
- /**
- * Set to true if you want to automatically remove the popper when
- * you call the `destroy` method.
- * @prop {Boolean} removeOnDestroy=false
- */
- removeOnDestroy: false,
-
- /**
- * Callback called when the popper is created.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onCreate}
- */
- onCreate: function onCreate() {},
-
- /**
- * Callback called when the popper is updated. This callback is not called
- * on the initialization/creation of the popper, but only on subsequent
- * updates.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onUpdate}
- */
- onUpdate: function onUpdate() {},
-
- /**
- * List of modifiers used to modify the offsets before they are applied to the popper.
- * They provide most of the functionalities of Popper.js.
- * @prop {modifiers}
- */
- modifiers: modifiers
- };
-
- /**
- * @callback onCreate
- * @param {dataObject} data
- */
-
- /**
- * @callback onUpdate
- * @param {dataObject} data
- */
-
- // Utils
- // Methods
- var Popper = function () {
- /**
- * Creates a new Popper.js instance.
- * @class Popper
- * @param {Element|referenceObject} reference - The reference element used to position the popper
- * @param {Element} popper - The HTML / XML element used as the popper
- * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
- * @return {Object} instance - The generated Popper.js instance
- */
- function Popper(reference, popper) {
- var _this = this;
-
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- classCallCheck(this, Popper);
-
- this.scheduleUpdate = function () {
- return requestAnimationFrame(_this.update);
- };
-
- // make update() debounced, so that it only runs at most once-per-tick
- this.update = debounce(this.update.bind(this));
-
- // with {} we create a new object with the options inside it
- this.options = _extends$1({}, Popper.Defaults, options);
-
- // init state
- this.state = {
- isDestroyed: false,
- isCreated: false,
- scrollParents: []
- };
-
- // get reference and popper elements (allow jQuery wrappers)
- this.reference = reference && reference.jquery ? reference[0] : reference;
- this.popper = popper && popper.jquery ? popper[0] : popper;
-
- // Deep merge modifiers options
- this.options.modifiers = {};
- Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
- _this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
- });
-
- // Refactoring modifiers' list (Object => Array)
- this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
- return _extends$1({
- name: name
- }, _this.options.modifiers[name]);
- })
- // sort the modifiers by order
- .sort(function (a, b) {
- return a.order - b.order;
- });
-
- // modifiers have the ability to execute arbitrary code when Popper.js get inited
- // such code is executed in the same order of its modifier
- // they could add new properties to their options configuration
- // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
- this.modifiers.forEach(function (modifierOptions) {
- if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
- modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
- }
- });
-
- // fire the first update to position the popper in the right place
- this.update();
-
- var eventsEnabled = this.options.eventsEnabled;
- if (eventsEnabled) {
- // setup event listeners, they will take care of update the position in specific situations
- this.enableEventListeners();
- }
-
- this.state.eventsEnabled = eventsEnabled;
- }
-
- // We can't use class properties because they don't get listed in the
- // class prototype and break stuff like Sinon stubs
-
-
- createClass(Popper, [{
- key: 'update',
- value: function update$$1() {
- return update.call(this);
- }
- }, {
- key: 'destroy',
- value: function destroy$$1() {
- return destroy.call(this);
- }
- }, {
- key: 'enableEventListeners',
- value: function enableEventListeners$$1() {
- return enableEventListeners.call(this);
- }
- }, {
- key: 'disableEventListeners',
- value: function disableEventListeners$$1() {
- return disableEventListeners.call(this);
- }
-
- /**
- * Schedules an update. It will run on the next UI update available.
- * @method scheduleUpdate
- * @memberof Popper
- */
-
-
- /**
- * Collection of utilities useful when writing custom modifiers.
- * Starting from version 1.7, this method is available only if you
- * include `popper-utils.js` before `popper.js`.
- *
- * **DEPRECATION**: This way to access PopperUtils is deprecated
- * and will be removed in v2! Use the PopperUtils module directly instead.
- * Due to the high instability of the methods contained in Utils, we can't
- * guarantee them to follow semver. Use them at your own risk!
- * @static
- * @private
- * @type {Object}
- * @deprecated since version 1.8
- * @member Utils
- * @memberof Popper
- */
-
- }]);
- return Popper;
- }();
-
- /**
- * The `referenceObject` is an object that provides an interface compatible with Popper.js
- * and lets you use it as replacement of a real DOM node.<br />
- * You can use this method to position a popper relatively to a set of coordinates
- * in case you don't have a DOM node to use as reference.
- *
- * ```
- * new Popper(referenceObject, popperNode);
- * ```
- *
- * NB: This feature isn't supported in Internet Explorer 10.
- * @name referenceObject
- * @property {Function} data.getBoundingClientRect
- * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
- * @property {number} data.clientWidth
- * An ES6 getter that will return the width of the virtual reference element.
- * @property {number} data.clientHeight
- * An ES6 getter that will return the height of the virtual reference element.
- */
-
-
- Popper.Utils = (typeof window !== 'undefined' ? window : commonjsGlobal).PopperUtils;
- Popper.placements = placements;
- Popper.Defaults = Defaults;
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$4 = 'dropdown';
- var VERSION$4 = '4.6.0';
- var DATA_KEY$4 = 'bs.dropdown';
- var EVENT_KEY$4 = "." + DATA_KEY$4;
- var DATA_API_KEY$4 = '.data-api';
- var JQUERY_NO_CONFLICT$4 = $__default['default'].fn[NAME$4];
- var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
-
- var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
-
- var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
-
- var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
-
- var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
-
- var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
-
- var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
- var EVENT_HIDE$1 = "hide" + EVENT_KEY$4;
- var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4;
- var EVENT_SHOW$1 = "show" + EVENT_KEY$4;
- var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4;
- var EVENT_CLICK = "click" + EVENT_KEY$4;
- var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4;
- var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4;
- var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4;
- var CLASS_NAME_DISABLED = 'disabled';
- var CLASS_NAME_SHOW$2 = 'show';
- var CLASS_NAME_DROPUP = 'dropup';
- var CLASS_NAME_DROPRIGHT = 'dropright';
- var CLASS_NAME_DROPLEFT = 'dropleft';
- var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
- var CLASS_NAME_POSITION_STATIC = 'position-static';
- var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]';
- var SELECTOR_FORM_CHILD = '.dropdown form';
- var SELECTOR_MENU = '.dropdown-menu';
- var SELECTOR_NAVBAR_NAV = '.navbar-nav';
- var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
- var PLACEMENT_TOP = 'top-start';
- var PLACEMENT_TOPEND = 'top-end';
- var PLACEMENT_BOTTOM = 'bottom-start';
- var PLACEMENT_BOTTOMEND = 'bottom-end';
- var PLACEMENT_RIGHT = 'right-start';
- var PLACEMENT_LEFT = 'left-start';
- var Default$2 = {
- offset: 0,
- flip: true,
- boundary: 'scrollParent',
- reference: 'toggle',
- display: 'dynamic',
- popperConfig: null
- };
- var DefaultType$2 = {
- offset: '(number|string|function)',
- flip: 'boolean',
- boundary: '(string|element)',
- reference: '(string|element)',
- display: 'string',
- popperConfig: '(null|object)'
- };
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Dropdown = /*#__PURE__*/function () {
- function Dropdown(element, config) {
- this._element = element;
- this._popper = null;
- this._config = this._getConfig(config);
- this._menu = this._getMenuElement();
- this._inNavbar = this._detectNavbar();
-
- this._addEventListeners();
- } // Getters
-
-
- var _proto = Dropdown.prototype;
-
- // Public
- _proto.toggle = function toggle() {
- if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) {
- return;
- }
-
- var isActive = $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2);
-
- Dropdown._clearMenus();
-
- if (isActive) {
- return;
- }
-
- this.show(true);
- };
-
- _proto.show = function show(usePopper) {
- if (usePopper === void 0) {
- usePopper = false;
- }
-
- if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) {
- return;
- }
-
- var relatedTarget = {
- relatedTarget: this._element
- };
- var showEvent = $__default['default'].Event(EVENT_SHOW$1, relatedTarget);
-
- var parent = Dropdown._getParentFromElement(this._element);
-
- $__default['default'](parent).trigger(showEvent);
-
- if (showEvent.isDefaultPrevented()) {
- return;
- } // Totally disable Popper for Dropdowns in Navbar
-
-
- if (!this._inNavbar && usePopper) {
- /**
- * Check for Popper dependency
- * Popper - https://popper.js.org
- */
- if (typeof Popper === 'undefined') {
- throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
- }
-
- var referenceElement = this._element;
-
- if (this._config.reference === 'parent') {
- referenceElement = parent;
- } else if (Util.isElement(this._config.reference)) {
- referenceElement = this._config.reference; // Check if it's jQuery element
-
- if (typeof this._config.reference.jquery !== 'undefined') {
- referenceElement = this._config.reference[0];
- }
- } // If boundary is not `scrollParent`, then set position to `static`
- // to allow the menu to "escape" the scroll parent's boundaries
- // https://github.com/twbs/bootstrap/issues/24251
-
-
- if (this._config.boundary !== 'scrollParent') {
- $__default['default'](parent).addClass(CLASS_NAME_POSITION_STATIC);
- }
-
- this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
- } // If this is a touch-enabled device we add extra
- // empty mouseover listeners to the body's immediate children;
- // only needed because of broken event delegation on iOS
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
-
-
- if ('ontouchstart' in document.documentElement && $__default['default'](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
- $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
- }
-
- this._element.focus();
-
- this._element.setAttribute('aria-expanded', true);
-
- $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2);
- $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_SHOWN$1, relatedTarget));
- };
-
- _proto.hide = function hide() {
- if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) {
- return;
- }
-
- var relatedTarget = {
- relatedTarget: this._element
- };
- var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget);
-
- var parent = Dropdown._getParentFromElement(this._element);
-
- $__default['default'](parent).trigger(hideEvent);
-
- if (hideEvent.isDefaultPrevented()) {
- return;
- }
-
- if (this._popper) {
- this._popper.destroy();
- }
-
- $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2);
- $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget));
- };
-
- _proto.dispose = function dispose() {
- $__default['default'].removeData(this._element, DATA_KEY$4);
- $__default['default'](this._element).off(EVENT_KEY$4);
- this._element = null;
- this._menu = null;
-
- if (this._popper !== null) {
- this._popper.destroy();
-
- this._popper = null;
- }
- };
-
- _proto.update = function update() {
- this._inNavbar = this._detectNavbar();
-
- if (this._popper !== null) {
- this._popper.scheduleUpdate();
- }
- } // Private
- ;
-
- _proto._addEventListeners = function _addEventListeners() {
- var _this = this;
-
- $__default['default'](this._element).on(EVENT_CLICK, function (event) {
- event.preventDefault();
- event.stopPropagation();
-
- _this.toggle();
- });
- };
-
- _proto._getConfig = function _getConfig(config) {
- config = _extends({}, this.constructor.Default, $__default['default'](this._element).data(), config);
- Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
- return config;
- };
-
- _proto._getMenuElement = function _getMenuElement() {
- if (!this._menu) {
- var parent = Dropdown._getParentFromElement(this._element);
-
- if (parent) {
- this._menu = parent.querySelector(SELECTOR_MENU);
- }
- }
-
- return this._menu;
- };
-
- _proto._getPlacement = function _getPlacement() {
- var $parentDropdown = $__default['default'](this._element.parentNode);
- var placement = PLACEMENT_BOTTOM; // Handle dropup
-
- if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
- placement = $__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
- } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
- placement = PLACEMENT_RIGHT;
- } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
- placement = PLACEMENT_LEFT;
- } else if ($__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
- placement = PLACEMENT_BOTTOMEND;
- }
-
- return placement;
- };
-
- _proto._detectNavbar = function _detectNavbar() {
- return $__default['default'](this._element).closest('.navbar').length > 0;
- };
-
- _proto._getOffset = function _getOffset() {
- var _this2 = this;
-
- var offset = {};
-
- if (typeof this._config.offset === 'function') {
- offset.fn = function (data) {
- data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
- return data;
- };
- } else {
- offset.offset = this._config.offset;
- }
-
- return offset;
- };
-
- _proto._getPopperConfig = function _getPopperConfig() {
- var popperConfig = {
- placement: this._getPlacement(),
- modifiers: {
- offset: this._getOffset(),
- flip: {
- enabled: this._config.flip
- },
- preventOverflow: {
- boundariesElement: this._config.boundary
- }
- }
- }; // Disable Popper if we have a static display
-
- if (this._config.display === 'static') {
- popperConfig.modifiers.applyStyle = {
- enabled: false
- };
- }
-
- return _extends({}, popperConfig, this._config.popperConfig);
- } // Static
- ;
-
- Dropdown._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $__default['default'](this).data(DATA_KEY$4);
-
- var _config = typeof config === 'object' ? config : null;
-
- if (!data) {
- data = new Dropdown(this, _config);
- $__default['default'](this).data(DATA_KEY$4, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- Dropdown._clearMenus = function _clearMenus(event) {
- if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
- return;
- }
-
- var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));
-
- for (var i = 0, len = toggles.length; i < len; i++) {
- var parent = Dropdown._getParentFromElement(toggles[i]);
-
- var context = $__default['default'](toggles[i]).data(DATA_KEY$4);
- var relatedTarget = {
- relatedTarget: toggles[i]
- };
-
- if (event && event.type === 'click') {
- relatedTarget.clickEvent = event;
- }
-
- if (!context) {
- continue;
- }
-
- var dropdownMenu = context._menu;
-
- if (!$__default['default'](parent).hasClass(CLASS_NAME_SHOW$2)) {
- continue;
- }
-
- if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default['default'].contains(parent, event.target)) {
- continue;
- }
-
- var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget);
- $__default['default'](parent).trigger(hideEvent);
-
- if (hideEvent.isDefaultPrevented()) {
- continue;
- } // If this is a touch-enabled device we remove the extra
- // empty mouseover listeners we added for iOS support
-
-
- if ('ontouchstart' in document.documentElement) {
- $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
- }
-
- toggles[i].setAttribute('aria-expanded', 'false');
-
- if (context._popper) {
- context._popper.destroy();
- }
-
- $__default['default'](dropdownMenu).removeClass(CLASS_NAME_SHOW$2);
- $__default['default'](parent).removeClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget));
- }
- };
-
- Dropdown._getParentFromElement = function _getParentFromElement(element) {
- var parent;
- var selector = Util.getSelectorFromElement(element);
-
- if (selector) {
- parent = document.querySelector(selector);
- }
-
- return parent || element.parentNode;
- } // eslint-disable-next-line complexity
- ;
-
- Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
- // If not input/textarea:
- // - And not a key in REGEXP_KEYDOWN => not a dropdown command
- // If input/textarea:
- // - If space key => not a dropdown command
- // - If key is other than escape
- // - If key is not up or down => not a dropdown command
- // - If trigger inside the menu => not a dropdown command
- if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default['default'](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
- return;
- }
-
- if (this.disabled || $__default['default'](this).hasClass(CLASS_NAME_DISABLED)) {
- return;
- }
-
- var parent = Dropdown._getParentFromElement(this);
-
- var isActive = $__default['default'](parent).hasClass(CLASS_NAME_SHOW$2);
-
- if (!isActive && event.which === ESCAPE_KEYCODE) {
- return;
- }
-
- event.preventDefault();
- event.stopPropagation();
-
- if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) {
- if (event.which === ESCAPE_KEYCODE) {
- $__default['default'](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus');
- }
-
- $__default['default'](this).trigger('click');
- return;
- }
-
- var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
- return $__default['default'](item).is(':visible');
- });
-
- if (items.length === 0) {
- return;
- }
-
- var index = items.indexOf(event.target);
-
- if (event.which === ARROW_UP_KEYCODE && index > 0) {
- // Up
- index--;
- }
-
- if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
- // Down
- index++;
- }
-
- if (index < 0) {
- index = 0;
- }
-
- items[index].focus();
- };
-
- _createClass(Dropdown, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$4;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$2;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$2;
- }
- }]);
-
- return Dropdown;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {
- event.preventDefault();
- event.stopPropagation();
-
- Dropdown._jQueryInterface.call($__default['default'](this), 'toggle');
- }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {
- e.stopPropagation();
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME$4] = Dropdown._jQueryInterface;
- $__default['default'].fn[NAME$4].Constructor = Dropdown;
-
- $__default['default'].fn[NAME$4].noConflict = function () {
- $__default['default'].fn[NAME$4] = JQUERY_NO_CONFLICT$4;
- return Dropdown._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$5 = 'modal';
- var VERSION$5 = '4.6.0';
- var DATA_KEY$5 = 'bs.modal';
- var EVENT_KEY$5 = "." + DATA_KEY$5;
- var DATA_API_KEY$5 = '.data-api';
- var JQUERY_NO_CONFLICT$5 = $__default['default'].fn[NAME$5];
- var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
-
- var Default$3 = {
- backdrop: true,
- keyboard: true,
- focus: true,
- show: true
- };
- var DefaultType$3 = {
- backdrop: '(boolean|string)',
- keyboard: 'boolean',
- focus: 'boolean',
- show: 'boolean'
- };
- var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
- var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
- var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;
- var EVENT_SHOW$2 = "show" + EVENT_KEY$5;
- var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;
- var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;
- var EVENT_RESIZE = "resize" + EVENT_KEY$5;
- var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5;
- var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;
- var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;
- var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;
- var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5;
- var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
- var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
- var CLASS_NAME_BACKDROP = 'modal-backdrop';
- var CLASS_NAME_OPEN = 'modal-open';
- var CLASS_NAME_FADE$1 = 'fade';
- var CLASS_NAME_SHOW$3 = 'show';
- var CLASS_NAME_STATIC = 'modal-static';
- var SELECTOR_DIALOG = '.modal-dialog';
- var SELECTOR_MODAL_BODY = '.modal-body';
- var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]';
- var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
- var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
- var SELECTOR_STICKY_CONTENT = '.sticky-top';
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Modal = /*#__PURE__*/function () {
- function Modal(element, config) {
- this._config = this._getConfig(config);
- this._element = element;
- this._dialog = element.querySelector(SELECTOR_DIALOG);
- this._backdrop = null;
- this._isShown = false;
- this._isBodyOverflowing = false;
- this._ignoreBackdropClick = false;
- this._isTransitioning = false;
- this._scrollbarWidth = 0;
- } // Getters
-
-
- var _proto = Modal.prototype;
-
- // Public
- _proto.toggle = function toggle(relatedTarget) {
- return this._isShown ? this.hide() : this.show(relatedTarget);
- };
-
- _proto.show = function show(relatedTarget) {
- var _this = this;
-
- if (this._isShown || this._isTransitioning) {
- return;
- }
-
- if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) {
- this._isTransitioning = true;
- }
-
- var showEvent = $__default['default'].Event(EVENT_SHOW$2, {
- relatedTarget: relatedTarget
- });
- $__default['default'](this._element).trigger(showEvent);
-
- if (this._isShown || showEvent.isDefaultPrevented()) {
- return;
- }
-
- this._isShown = true;
-
- this._checkScrollbar();
-
- this._setScrollbar();
-
- this._adjustDialog();
-
- this._setEscapeEvent();
-
- this._setResizeEvent();
-
- $__default['default'](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
- return _this.hide(event);
- });
- $__default['default'](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
- $__default['default'](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
- if ($__default['default'](event.target).is(_this._element)) {
- _this._ignoreBackdropClick = true;
- }
- });
- });
-
- this._showBackdrop(function () {
- return _this._showElement(relatedTarget);
- });
- };
-
- _proto.hide = function hide(event) {
- var _this2 = this;
-
- if (event) {
- event.preventDefault();
- }
-
- if (!this._isShown || this._isTransitioning) {
- return;
- }
-
- var hideEvent = $__default['default'].Event(EVENT_HIDE$2);
- $__default['default'](this._element).trigger(hideEvent);
-
- if (!this._isShown || hideEvent.isDefaultPrevented()) {
- return;
- }
-
- this._isShown = false;
- var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1);
-
- if (transition) {
- this._isTransitioning = true;
- }
-
- this._setEscapeEvent();
-
- this._setResizeEvent();
-
- $__default['default'](document).off(EVENT_FOCUSIN);
- $__default['default'](this._element).removeClass(CLASS_NAME_SHOW$3);
- $__default['default'](this._element).off(EVENT_CLICK_DISMISS);
- $__default['default'](this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
-
- if (transition) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $__default['default'](this._element).one(Util.TRANSITION_END, function (event) {
- return _this2._hideModal(event);
- }).emulateTransitionEnd(transitionDuration);
- } else {
- this._hideModal();
- }
- };
-
- _proto.dispose = function dispose() {
- [window, this._element, this._dialog].forEach(function (htmlElement) {
- return $__default['default'](htmlElement).off(EVENT_KEY$5);
- });
- /**
- * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
- * Do not move `document` in `htmlElements` array
- * It will remove `EVENT_CLICK_DATA_API` event that should remain
- */
-
- $__default['default'](document).off(EVENT_FOCUSIN);
- $__default['default'].removeData(this._element, DATA_KEY$5);
- this._config = null;
- this._element = null;
- this._dialog = null;
- this._backdrop = null;
- this._isShown = null;
- this._isBodyOverflowing = null;
- this._ignoreBackdropClick = null;
- this._isTransitioning = null;
- this._scrollbarWidth = null;
- };
-
- _proto.handleUpdate = function handleUpdate() {
- this._adjustDialog();
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _extends({}, Default$3, config);
- Util.typeCheckConfig(NAME$5, config, DefaultType$3);
- return config;
- };
-
- _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
- var _this3 = this;
-
- var hideEventPrevented = $__default['default'].Event(EVENT_HIDE_PREVENTED);
- $__default['default'](this._element).trigger(hideEventPrevented);
-
- if (hideEventPrevented.isDefaultPrevented()) {
- return;
- }
-
- var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
-
- if (!isModalOverflowing) {
- this._element.style.overflowY = 'hidden';
- }
-
- this._element.classList.add(CLASS_NAME_STATIC);
-
- var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog);
- $__default['default'](this._element).off(Util.TRANSITION_END);
- $__default['default'](this._element).one(Util.TRANSITION_END, function () {
- _this3._element.classList.remove(CLASS_NAME_STATIC);
-
- if (!isModalOverflowing) {
- $__default['default'](_this3._element).one(Util.TRANSITION_END, function () {
- _this3._element.style.overflowY = '';
- }).emulateTransitionEnd(_this3._element, modalTransitionDuration);
- }
- }).emulateTransitionEnd(modalTransitionDuration);
-
- this._element.focus();
- };
-
- _proto._showElement = function _showElement(relatedTarget) {
- var _this4 = this;
-
- var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1);
- var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
-
- if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
- // Don't move modal's DOM position
- document.body.appendChild(this._element);
- }
-
- this._element.style.display = 'block';
-
- this._element.removeAttribute('aria-hidden');
-
- this._element.setAttribute('aria-modal', true);
-
- this._element.setAttribute('role', 'dialog');
-
- if ($__default['default'](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
- modalBody.scrollTop = 0;
- } else {
- this._element.scrollTop = 0;
- }
-
- if (transition) {
- Util.reflow(this._element);
- }
-
- $__default['default'](this._element).addClass(CLASS_NAME_SHOW$3);
-
- if (this._config.focus) {
- this._enforceFocus();
- }
-
- var shownEvent = $__default['default'].Event(EVENT_SHOWN$2, {
- relatedTarget: relatedTarget
- });
-
- var transitionComplete = function transitionComplete() {
- if (_this4._config.focus) {
- _this4._element.focus();
- }
-
- _this4._isTransitioning = false;
- $__default['default'](_this4._element).trigger(shownEvent);
- };
-
- if (transition) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
- $__default['default'](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
- } else {
- transitionComplete();
- }
- };
-
- _proto._enforceFocus = function _enforceFocus() {
- var _this5 = this;
-
- $__default['default'](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
- .on(EVENT_FOCUSIN, function (event) {
- if (document !== event.target && _this5._element !== event.target && $__default['default'](_this5._element).has(event.target).length === 0) {
- _this5._element.focus();
- }
- });
- };
-
- _proto._setEscapeEvent = function _setEscapeEvent() {
- var _this6 = this;
-
- if (this._isShown) {
- $__default['default'](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
- if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
- event.preventDefault();
-
- _this6.hide();
- } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
- _this6._triggerBackdropTransition();
- }
- });
- } else if (!this._isShown) {
- $__default['default'](this._element).off(EVENT_KEYDOWN_DISMISS);
- }
- };
-
- _proto._setResizeEvent = function _setResizeEvent() {
- var _this7 = this;
-
- if (this._isShown) {
- $__default['default'](window).on(EVENT_RESIZE, function (event) {
- return _this7.handleUpdate(event);
- });
- } else {
- $__default['default'](window).off(EVENT_RESIZE);
- }
- };
-
- _proto._hideModal = function _hideModal() {
- var _this8 = this;
-
- this._element.style.display = 'none';
-
- this._element.setAttribute('aria-hidden', true);
-
- this._element.removeAttribute('aria-modal');
-
- this._element.removeAttribute('role');
-
- this._isTransitioning = false;
-
- this._showBackdrop(function () {
- $__default['default'](document.body).removeClass(CLASS_NAME_OPEN);
-
- _this8._resetAdjustments();
-
- _this8._resetScrollbar();
-
- $__default['default'](_this8._element).trigger(EVENT_HIDDEN$2);
- });
- };
-
- _proto._removeBackdrop = function _removeBackdrop() {
- if (this._backdrop) {
- $__default['default'](this._backdrop).remove();
- this._backdrop = null;
- }
- };
-
- _proto._showBackdrop = function _showBackdrop(callback) {
- var _this9 = this;
-
- var animate = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : '';
-
- if (this._isShown && this._config.backdrop) {
- this._backdrop = document.createElement('div');
- this._backdrop.className = CLASS_NAME_BACKDROP;
-
- if (animate) {
- this._backdrop.classList.add(animate);
- }
-
- $__default['default'](this._backdrop).appendTo(document.body);
- $__default['default'](this._element).on(EVENT_CLICK_DISMISS, function (event) {
- if (_this9._ignoreBackdropClick) {
- _this9._ignoreBackdropClick = false;
- return;
- }
-
- if (event.target !== event.currentTarget) {
- return;
- }
-
- if (_this9._config.backdrop === 'static') {
- _this9._triggerBackdropTransition();
- } else {
- _this9.hide();
- }
- });
-
- if (animate) {
- Util.reflow(this._backdrop);
- }
-
- $__default['default'](this._backdrop).addClass(CLASS_NAME_SHOW$3);
-
- if (!callback) {
- return;
- }
-
- if (!animate) {
- callback();
- return;
- }
-
- var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
- $__default['default'](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
- } else if (!this._isShown && this._backdrop) {
- $__default['default'](this._backdrop).removeClass(CLASS_NAME_SHOW$3);
-
- var callbackRemove = function callbackRemove() {
- _this9._removeBackdrop();
-
- if (callback) {
- callback();
- }
- };
-
- if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) {
- var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
-
- $__default['default'](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
- } else {
- callbackRemove();
- }
- } else if (callback) {
- callback();
- }
- } // ----------------------------------------------------------------------
- // the following methods are used to handle overflowing modals
- // todo (fat): these should probably be refactored out of modal.js
- // ----------------------------------------------------------------------
- ;
-
- _proto._adjustDialog = function _adjustDialog() {
- var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
-
- if (!this._isBodyOverflowing && isModalOverflowing) {
- this._element.style.paddingLeft = this._scrollbarWidth + "px";
- }
-
- if (this._isBodyOverflowing && !isModalOverflowing) {
- this._element.style.paddingRight = this._scrollbarWidth + "px";
- }
- };
-
- _proto._resetAdjustments = function _resetAdjustments() {
- this._element.style.paddingLeft = '';
- this._element.style.paddingRight = '';
- };
-
- _proto._checkScrollbar = function _checkScrollbar() {
- var rect = document.body.getBoundingClientRect();
- this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
- this._scrollbarWidth = this._getScrollbarWidth();
- };
-
- _proto._setScrollbar = function _setScrollbar() {
- var _this10 = this;
-
- if (this._isBodyOverflowing) {
- // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
- // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
- var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
- var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
-
- $__default['default'](fixedContent).each(function (index, element) {
- var actualPadding = element.style.paddingRight;
- var calculatedPadding = $__default['default'](element).css('padding-right');
- $__default['default'](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
- }); // Adjust sticky content margin
-
- $__default['default'](stickyContent).each(function (index, element) {
- var actualMargin = element.style.marginRight;
- var calculatedMargin = $__default['default'](element).css('margin-right');
- $__default['default'](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
- }); // Adjust body padding
-
- var actualPadding = document.body.style.paddingRight;
- var calculatedPadding = $__default['default'](document.body).css('padding-right');
- $__default['default'](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
- }
-
- $__default['default'](document.body).addClass(CLASS_NAME_OPEN);
- };
-
- _proto._resetScrollbar = function _resetScrollbar() {
- // Restore fixed content padding
- var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
- $__default['default'](fixedContent).each(function (index, element) {
- var padding = $__default['default'](element).data('padding-right');
- $__default['default'](element).removeData('padding-right');
- element.style.paddingRight = padding ? padding : '';
- }); // Restore sticky content
-
- var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
- $__default['default'](elements).each(function (index, element) {
- var margin = $__default['default'](element).data('margin-right');
-
- if (typeof margin !== 'undefined') {
- $__default['default'](element).css('margin-right', margin).removeData('margin-right');
- }
- }); // Restore body padding
-
- var padding = $__default['default'](document.body).data('padding-right');
- $__default['default'](document.body).removeData('padding-right');
- document.body.style.paddingRight = padding ? padding : '';
- };
-
- _proto._getScrollbarWidth = function _getScrollbarWidth() {
- // thx d.walsh
- var scrollDiv = document.createElement('div');
- scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
- document.body.appendChild(scrollDiv);
- var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
- document.body.removeChild(scrollDiv);
- return scrollbarWidth;
- } // Static
- ;
-
- Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
- return this.each(function () {
- var data = $__default['default'](this).data(DATA_KEY$5);
-
- var _config = _extends({}, Default$3, $__default['default'](this).data(), typeof config === 'object' && config ? config : {});
-
- if (!data) {
- data = new Modal(this, _config);
- $__default['default'](this).data(DATA_KEY$5, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config](relatedTarget);
- } else if (_config.show) {
- data.show(relatedTarget);
- }
- });
- };
-
- _createClass(Modal, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$5;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$3;
- }
- }]);
-
- return Modal;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
- var _this11 = this;
-
- var target;
- var selector = Util.getSelectorFromElement(this);
-
- if (selector) {
- target = document.querySelector(selector);
- }
-
- var config = $__default['default'](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default['default'](target).data(), $__default['default'](this).data());
-
- if (this.tagName === 'A' || this.tagName === 'AREA') {
- event.preventDefault();
- }
-
- var $target = $__default['default'](target).one(EVENT_SHOW$2, function (showEvent) {
- if (showEvent.isDefaultPrevented()) {
- // Only register focus restorer if modal will actually get shown
- return;
- }
-
- $target.one(EVENT_HIDDEN$2, function () {
- if ($__default['default'](_this11).is(':visible')) {
- _this11.focus();
- }
- });
- });
-
- Modal._jQueryInterface.call($__default['default'](target), config, this);
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME$5] = Modal._jQueryInterface;
- $__default['default'].fn[NAME$5].Constructor = Modal;
-
- $__default['default'].fn[NAME$5].noConflict = function () {
- $__default['default'].fn[NAME$5] = JQUERY_NO_CONFLICT$5;
- return Modal._jQueryInterface;
- };
-
- /**
- * --------------------------------------------------------------------------
- * Bootstrap (v4.6.0): tools/sanitizer.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- * --------------------------------------------------------------------------
- */
- var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
- var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
- var DefaultWhitelist = {
- // Global attributes allowed on any supplied element below.
- '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
- a: ['target', 'href', 'title', 'rel'],
- area: [],
- b: [],
- br: [],
- col: [],
- code: [],
- div: [],
- em: [],
- hr: [],
- h1: [],
- h2: [],
- h3: [],
- h4: [],
- h5: [],
- h6: [],
- i: [],
- img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
- li: [],
- ol: [],
- p: [],
- pre: [],
- s: [],
- small: [],
- span: [],
- sub: [],
- sup: [],
- strong: [],
- u: [],
- ul: []
- };
- /**
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
- *
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
- */
-
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
- /**
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
- *
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
- */
-
- var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
-
- function allowedAttribute(attr, allowedAttributeList) {
- var attrName = attr.nodeName.toLowerCase();
-
- if (allowedAttributeList.indexOf(attrName) !== -1) {
- if (uriAttrs.indexOf(attrName) !== -1) {
- return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
- }
-
- return true;
- }
-
- var regExp = allowedAttributeList.filter(function (attrRegex) {
- return attrRegex instanceof RegExp;
- }); // Check if a regular expression validates the attribute.
-
- for (var i = 0, len = regExp.length; i < len; i++) {
- if (attrName.match(regExp[i])) {
- return true;
- }
- }
-
- return false;
- }
-
- function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
- if (unsafeHtml.length === 0) {
- return unsafeHtml;
- }
-
- if (sanitizeFn && typeof sanitizeFn === 'function') {
- return sanitizeFn(unsafeHtml);
- }
-
- var domParser = new window.DOMParser();
- var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
- var whitelistKeys = Object.keys(whiteList);
- var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
-
- var _loop = function _loop(i, len) {
- var el = elements[i];
- var elName = el.nodeName.toLowerCase();
-
- if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
- el.parentNode.removeChild(el);
- return "continue";
- }
-
- var attributeList = [].slice.call(el.attributes);
- var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
- attributeList.forEach(function (attr) {
- if (!allowedAttribute(attr, whitelistedAttributes)) {
- el.removeAttribute(attr.nodeName);
- }
- });
- };
-
- for (var i = 0, len = elements.length; i < len; i++) {
- var _ret = _loop(i);
-
- if (_ret === "continue") continue;
- }
-
- return createdDocument.body.innerHTML;
- }
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$6 = 'tooltip';
- var VERSION$6 = '4.6.0';
- var DATA_KEY$6 = 'bs.tooltip';
- var EVENT_KEY$6 = "." + DATA_KEY$6;
- var JQUERY_NO_CONFLICT$6 = $__default['default'].fn[NAME$6];
- var CLASS_PREFIX = 'bs-tooltip';
- var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
- var DefaultType$4 = {
- animation: 'boolean',
- template: 'string',
- title: '(string|element|function)',
- trigger: 'string',
- delay: '(number|object)',
- html: 'boolean',
- selector: '(string|boolean)',
- placement: '(string|function)',
- offset: '(number|string|function)',
- container: '(string|element|boolean)',
- fallbackPlacement: '(string|array)',
- boundary: '(string|element)',
- customClass: '(string|function)',
- sanitize: 'boolean',
- sanitizeFn: '(null|function)',
- whiteList: 'object',
- popperConfig: '(null|object)'
- };
- var AttachmentMap = {
- AUTO: 'auto',
- TOP: 'top',
- RIGHT: 'right',
- BOTTOM: 'bottom',
- LEFT: 'left'
- };
- var Default$4 = {
- animation: true,
- template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
- trigger: 'hover focus',
- title: '',
- delay: 0,
- html: false,
- selector: false,
- placement: 'top',
- offset: 0,
- container: false,
- fallbackPlacement: 'flip',
- boundary: 'scrollParent',
- customClass: '',
- sanitize: true,
- sanitizeFn: null,
- whiteList: DefaultWhitelist,
- popperConfig: null
- };
- var HOVER_STATE_SHOW = 'show';
- var HOVER_STATE_OUT = 'out';
- var Event = {
- HIDE: "hide" + EVENT_KEY$6,
- HIDDEN: "hidden" + EVENT_KEY$6,
- SHOW: "show" + EVENT_KEY$6,
- SHOWN: "shown" + EVENT_KEY$6,
- INSERTED: "inserted" + EVENT_KEY$6,
- CLICK: "click" + EVENT_KEY$6,
- FOCUSIN: "focusin" + EVENT_KEY$6,
- FOCUSOUT: "focusout" + EVENT_KEY$6,
- MOUSEENTER: "mouseenter" + EVENT_KEY$6,
- MOUSELEAVE: "mouseleave" + EVENT_KEY$6
- };
- var CLASS_NAME_FADE$2 = 'fade';
- var CLASS_NAME_SHOW$4 = 'show';
- var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
- var SELECTOR_ARROW = '.arrow';
- var TRIGGER_HOVER = 'hover';
- var TRIGGER_FOCUS = 'focus';
- var TRIGGER_CLICK = 'click';
- var TRIGGER_MANUAL = 'manual';
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Tooltip = /*#__PURE__*/function () {
- function Tooltip(element, config) {
- if (typeof Popper === 'undefined') {
- throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
- } // private
-
-
- this._isEnabled = true;
- this._timeout = 0;
- this._hoverState = '';
- this._activeTrigger = {};
- this._popper = null; // Protected
-
- this.element = element;
- this.config = this._getConfig(config);
- this.tip = null;
-
- this._setListeners();
- } // Getters
-
-
- var _proto = Tooltip.prototype;
-
- // Public
- _proto.enable = function enable() {
- this._isEnabled = true;
- };
-
- _proto.disable = function disable() {
- this._isEnabled = false;
- };
-
- _proto.toggleEnabled = function toggleEnabled() {
- this._isEnabled = !this._isEnabled;
- };
-
- _proto.toggle = function toggle(event) {
- if (!this._isEnabled) {
- return;
- }
-
- if (event) {
- var dataKey = this.constructor.DATA_KEY;
- var context = $__default['default'](event.currentTarget).data(dataKey);
-
- if (!context) {
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $__default['default'](event.currentTarget).data(dataKey, context);
- }
-
- context._activeTrigger.click = !context._activeTrigger.click;
-
- if (context._isWithActiveTrigger()) {
- context._enter(null, context);
- } else {
- context._leave(null, context);
- }
- } else {
- if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) {
- this._leave(null, this);
-
- return;
- }
-
- this._enter(null, this);
- }
- };
-
- _proto.dispose = function dispose() {
- clearTimeout(this._timeout);
- $__default['default'].removeData(this.element, this.constructor.DATA_KEY);
- $__default['default'](this.element).off(this.constructor.EVENT_KEY);
- $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
-
- if (this.tip) {
- $__default['default'](this.tip).remove();
- }
-
- this._isEnabled = null;
- this._timeout = null;
- this._hoverState = null;
- this._activeTrigger = null;
-
- if (this._popper) {
- this._popper.destroy();
- }
-
- this._popper = null;
- this.element = null;
- this.config = null;
- this.tip = null;
- };
-
- _proto.show = function show() {
- var _this = this;
-
- if ($__default['default'](this.element).css('display') === 'none') {
- throw new Error('Please use show on visible elements');
- }
-
- var showEvent = $__default['default'].Event(this.constructor.Event.SHOW);
-
- if (this.isWithContent() && this._isEnabled) {
- $__default['default'](this.element).trigger(showEvent);
- var shadowRoot = Util.findShadowRoot(this.element);
- var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
-
- if (showEvent.isDefaultPrevented() || !isInTheDom) {
- return;
- }
-
- var tip = this.getTipElement();
- var tipId = Util.getUID(this.constructor.NAME);
- tip.setAttribute('id', tipId);
- this.element.setAttribute('aria-describedby', tipId);
- this.setContent();
-
- if (this.config.animation) {
- $__default['default'](tip).addClass(CLASS_NAME_FADE$2);
- }
-
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
-
- var attachment = this._getAttachment(placement);
-
- this.addAttachmentClass(attachment);
-
- var container = this._getContainer();
-
- $__default['default'](tip).data(this.constructor.DATA_KEY, this);
-
- if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) {
- $__default['default'](tip).appendTo(container);
- }
-
- $__default['default'](this.element).trigger(this.constructor.Event.INSERTED);
- this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
- $__default['default'](tip).addClass(CLASS_NAME_SHOW$4);
- $__default['default'](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra
- // empty mouseover listeners to the body's immediate children;
- // only needed because of broken event delegation on iOS
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
-
- if ('ontouchstart' in document.documentElement) {
- $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
- }
-
- var complete = function complete() {
- if (_this.config.animation) {
- _this._fixTransition();
- }
-
- var prevHoverState = _this._hoverState;
- _this._hoverState = null;
- $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN);
-
- if (prevHoverState === HOVER_STATE_OUT) {
- _this._leave(null, _this);
- }
- };
-
- if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) {
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
- $__default['default'](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- }
- };
-
- _proto.hide = function hide(callback) {
- var _this2 = this;
-
- var tip = this.getTipElement();
- var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE);
-
- var complete = function complete() {
- if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
- tip.parentNode.removeChild(tip);
- }
-
- _this2._cleanTipClass();
-
- _this2.element.removeAttribute('aria-describedby');
-
- $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
-
- if (_this2._popper !== null) {
- _this2._popper.destroy();
- }
-
- if (callback) {
- callback();
- }
- };
-
- $__default['default'](this.element).trigger(hideEvent);
-
- if (hideEvent.isDefaultPrevented()) {
- return;
- }
-
- $__default['default'](tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra
- // empty mouseover listeners we added for iOS support
-
- if ('ontouchstart' in document.documentElement) {
- $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
- }
-
- this._activeTrigger[TRIGGER_CLICK] = false;
- this._activeTrigger[TRIGGER_FOCUS] = false;
- this._activeTrigger[TRIGGER_HOVER] = false;
-
- if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) {
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
- $__default['default'](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
-
- this._hoverState = '';
- };
-
- _proto.update = function update() {
- if (this._popper !== null) {
- this._popper.scheduleUpdate();
- }
- } // Protected
- ;
-
- _proto.isWithContent = function isWithContent() {
- return Boolean(this.getTitle());
- };
-
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
- $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
- };
-
- _proto.getTipElement = function getTipElement() {
- this.tip = this.tip || $__default['default'](this.config.template)[0];
- return this.tip;
- };
-
- _proto.setContent = function setContent() {
- var tip = this.getTipElement();
- this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
- $__default['default'](tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4);
- };
-
- _proto.setElementContent = function setElementContent($element, content) {
- if (typeof content === 'object' && (content.nodeType || content.jquery)) {
- // Content is a DOM node or a jQuery
- if (this.config.html) {
- if (!$__default['default'](content).parent().is($element)) {
- $element.empty().append(content);
- }
- } else {
- $element.text($__default['default'](content).text());
- }
-
- return;
- }
-
- if (this.config.html) {
- if (this.config.sanitize) {
- content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
- }
-
- $element.html(content);
- } else {
- $element.text(content);
- }
- };
-
- _proto.getTitle = function getTitle() {
- var title = this.element.getAttribute('data-original-title');
-
- if (!title) {
- title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
- }
-
- return title;
- } // Private
- ;
-
- _proto._getPopperConfig = function _getPopperConfig(attachment) {
- var _this3 = this;
-
- var defaultBsConfig = {
- placement: attachment,
- modifiers: {
- offset: this._getOffset(),
- flip: {
- behavior: this.config.fallbackPlacement
- },
- arrow: {
- element: SELECTOR_ARROW
- },
- preventOverflow: {
- boundariesElement: this.config.boundary
- }
- },
- onCreate: function onCreate(data) {
- if (data.originalPlacement !== data.placement) {
- _this3._handlePopperPlacementChange(data);
- }
- },
- onUpdate: function onUpdate(data) {
- return _this3._handlePopperPlacementChange(data);
- }
- };
- return _extends({}, defaultBsConfig, this.config.popperConfig);
- };
-
- _proto._getOffset = function _getOffset() {
- var _this4 = this;
-
- var offset = {};
-
- if (typeof this.config.offset === 'function') {
- offset.fn = function (data) {
- data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
- return data;
- };
- } else {
- offset.offset = this.config.offset;
- }
-
- return offset;
- };
-
- _proto._getContainer = function _getContainer() {
- if (this.config.container === false) {
- return document.body;
- }
-
- if (Util.isElement(this.config.container)) {
- return $__default['default'](this.config.container);
- }
-
- return $__default['default'](document).find(this.config.container);
- };
-
- _proto._getAttachment = function _getAttachment(placement) {
- return AttachmentMap[placement.toUpperCase()];
- };
-
- _proto._setListeners = function _setListeners() {
- var _this5 = this;
-
- var triggers = this.config.trigger.split(' ');
- triggers.forEach(function (trigger) {
- if (trigger === 'click') {
- $__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
- return _this5.toggle(event);
- });
- } else if (trigger !== TRIGGER_MANUAL) {
- var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
- var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
- $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) {
- return _this5._enter(event);
- }).on(eventOut, _this5.config.selector, function (event) {
- return _this5._leave(event);
- });
- }
- });
-
- this._hideModalHandler = function () {
- if (_this5.element) {
- _this5.hide();
- }
- };
-
- $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
-
- if (this.config.selector) {
- this.config = _extends({}, this.config, {
- trigger: 'manual',
- selector: ''
- });
- } else {
- this._fixTitle();
- }
- };
-
- _proto._fixTitle = function _fixTitle() {
- var titleType = typeof this.element.getAttribute('data-original-title');
-
- if (this.element.getAttribute('title') || titleType !== 'string') {
- this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
- this.element.setAttribute('title', '');
- }
- };
-
- _proto._enter = function _enter(event, context) {
- var dataKey = this.constructor.DATA_KEY;
- context = context || $__default['default'](event.currentTarget).data(dataKey);
-
- if (!context) {
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $__default['default'](event.currentTarget).data(dataKey, context);
- }
-
- if (event) {
- context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
- }
-
- if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) {
- context._hoverState = HOVER_STATE_SHOW;
- return;
- }
-
- clearTimeout(context._timeout);
- context._hoverState = HOVER_STATE_SHOW;
-
- if (!context.config.delay || !context.config.delay.show) {
- context.show();
- return;
- }
-
- context._timeout = setTimeout(function () {
- if (context._hoverState === HOVER_STATE_SHOW) {
- context.show();
- }
- }, context.config.delay.show);
- };
-
- _proto._leave = function _leave(event, context) {
- var dataKey = this.constructor.DATA_KEY;
- context = context || $__default['default'](event.currentTarget).data(dataKey);
-
- if (!context) {
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $__default['default'](event.currentTarget).data(dataKey, context);
- }
-
- if (event) {
- context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
- }
-
- if (context._isWithActiveTrigger()) {
- return;
- }
-
- clearTimeout(context._timeout);
- context._hoverState = HOVER_STATE_OUT;
-
- if (!context.config.delay || !context.config.delay.hide) {
- context.hide();
- return;
- }
-
- context._timeout = setTimeout(function () {
- if (context._hoverState === HOVER_STATE_OUT) {
- context.hide();
- }
- }, context.config.delay.hide);
- };
-
- _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
- for (var trigger in this._activeTrigger) {
- if (this._activeTrigger[trigger]) {
- return true;
- }
- }
-
- return false;
- };
-
- _proto._getConfig = function _getConfig(config) {
- var dataAttributes = $__default['default'](this.element).data();
- Object.keys(dataAttributes).forEach(function (dataAttr) {
- if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
- delete dataAttributes[dataAttr];
- }
- });
- config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
-
- if (typeof config.delay === 'number') {
- config.delay = {
- show: config.delay,
- hide: config.delay
- };
- }
-
- if (typeof config.title === 'number') {
- config.title = config.title.toString();
- }
-
- if (typeof config.content === 'number') {
- config.content = config.content.toString();
- }
-
- Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
-
- if (config.sanitize) {
- config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
- }
-
- return config;
- };
-
- _proto._getDelegateConfig = function _getDelegateConfig() {
- var config = {};
-
- if (this.config) {
- for (var key in this.config) {
- if (this.constructor.Default[key] !== this.config[key]) {
- config[key] = this.config[key];
- }
- }
- }
-
- return config;
- };
-
- _proto._cleanTipClass = function _cleanTipClass() {
- var $tip = $__default['default'](this.getTipElement());
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
-
- if (tabClass !== null && tabClass.length) {
- $tip.removeClass(tabClass.join(''));
- }
- };
-
- _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
- this.tip = popperData.instance.popper;
-
- this._cleanTipClass();
-
- this.addAttachmentClass(this._getAttachment(popperData.placement));
- };
-
- _proto._fixTransition = function _fixTransition() {
- var tip = this.getTipElement();
- var initConfigAnimation = this.config.animation;
-
- if (tip.getAttribute('x-placement') !== null) {
- return;
- }
-
- $__default['default'](tip).removeClass(CLASS_NAME_FADE$2);
- this.config.animation = false;
- this.hide();
- this.show();
- this.config.animation = initConfigAnimation;
- } // Static
- ;
-
- Tooltip._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $element = $__default['default'](this);
- var data = $element.data(DATA_KEY$6);
-
- var _config = typeof config === 'object' && config;
-
- if (!data && /dispose|hide/.test(config)) {
- return;
- }
-
- if (!data) {
- data = new Tooltip(this, _config);
- $element.data(DATA_KEY$6, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Tooltip, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$6;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$4;
- }
- }, {
- key: "NAME",
- get: function get() {
- return NAME$6;
- }
- }, {
- key: "DATA_KEY",
- get: function get() {
- return DATA_KEY$6;
- }
- }, {
- key: "Event",
- get: function get() {
- return Event;
- }
- }, {
- key: "EVENT_KEY",
- get: function get() {
- return EVENT_KEY$6;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$4;
- }
- }]);
-
- return Tooltip;
- }();
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'].fn[NAME$6] = Tooltip._jQueryInterface;
- $__default['default'].fn[NAME$6].Constructor = Tooltip;
-
- $__default['default'].fn[NAME$6].noConflict = function () {
- $__default['default'].fn[NAME$6] = JQUERY_NO_CONFLICT$6;
- return Tooltip._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$7 = 'popover';
- var VERSION$7 = '4.6.0';
- var DATA_KEY$7 = 'bs.popover';
- var EVENT_KEY$7 = "." + DATA_KEY$7;
- var JQUERY_NO_CONFLICT$7 = $__default['default'].fn[NAME$7];
- var CLASS_PREFIX$1 = 'bs-popover';
- var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
-
- var Default$5 = _extends({}, Tooltip.Default, {
- placement: 'right',
- trigger: 'click',
- content: '',
- template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
- });
-
- var DefaultType$5 = _extends({}, Tooltip.DefaultType, {
- content: '(string|element|function)'
- });
-
- var CLASS_NAME_FADE$3 = 'fade';
- var CLASS_NAME_SHOW$5 = 'show';
- var SELECTOR_TITLE = '.popover-header';
- var SELECTOR_CONTENT = '.popover-body';
- var Event$1 = {
- HIDE: "hide" + EVENT_KEY$7,
- HIDDEN: "hidden" + EVENT_KEY$7,
- SHOW: "show" + EVENT_KEY$7,
- SHOWN: "shown" + EVENT_KEY$7,
- INSERTED: "inserted" + EVENT_KEY$7,
- CLICK: "click" + EVENT_KEY$7,
- FOCUSIN: "focusin" + EVENT_KEY$7,
- FOCUSOUT: "focusout" + EVENT_KEY$7,
- MOUSEENTER: "mouseenter" + EVENT_KEY$7,
- MOUSELEAVE: "mouseleave" + EVENT_KEY$7
- };
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Popover = /*#__PURE__*/function (_Tooltip) {
- _inheritsLoose(Popover, _Tooltip);
-
- function Popover() {
- return _Tooltip.apply(this, arguments) || this;
- }
-
- var _proto = Popover.prototype;
-
- // Overrides
- _proto.isWithContent = function isWithContent() {
- return this.getTitle() || this._getContent();
- };
-
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
- $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
- };
-
- _proto.getTipElement = function getTipElement() {
- this.tip = this.tip || $__default['default'](this.config.template)[0];
- return this.tip;
- };
-
- _proto.setContent = function setContent() {
- var $tip = $__default['default'](this.getTipElement()); // We use append for html objects to maintain js events
-
- this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
-
- var content = this._getContent();
-
- if (typeof content === 'function') {
- content = content.call(this.element);
- }
-
- this.setElementContent($tip.find(SELECTOR_CONTENT), content);
- $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5);
- } // Private
- ;
-
- _proto._getContent = function _getContent() {
- return this.element.getAttribute('data-content') || this.config.content;
- };
-
- _proto._cleanTipClass = function _cleanTipClass() {
- var $tip = $__default['default'](this.getTipElement());
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
-
- if (tabClass !== null && tabClass.length > 0) {
- $tip.removeClass(tabClass.join(''));
- }
- } // Static
- ;
-
- Popover._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $__default['default'](this).data(DATA_KEY$7);
-
- var _config = typeof config === 'object' ? config : null;
-
- if (!data && /dispose|hide/.test(config)) {
- return;
- }
-
- if (!data) {
- data = new Popover(this, _config);
- $__default['default'](this).data(DATA_KEY$7, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Popover, null, [{
- key: "VERSION",
- // Getters
- get: function get() {
- return VERSION$7;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$5;
- }
- }, {
- key: "NAME",
- get: function get() {
- return NAME$7;
- }
- }, {
- key: "DATA_KEY",
- get: function get() {
- return DATA_KEY$7;
- }
- }, {
- key: "Event",
- get: function get() {
- return Event$1;
- }
- }, {
- key: "EVENT_KEY",
- get: function get() {
- return EVENT_KEY$7;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$5;
- }
- }]);
-
- return Popover;
- }(Tooltip);
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'].fn[NAME$7] = Popover._jQueryInterface;
- $__default['default'].fn[NAME$7].Constructor = Popover;
-
- $__default['default'].fn[NAME$7].noConflict = function () {
- $__default['default'].fn[NAME$7] = JQUERY_NO_CONFLICT$7;
- return Popover._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$8 = 'scrollspy';
- var VERSION$8 = '4.6.0';
- var DATA_KEY$8 = 'bs.scrollspy';
- var EVENT_KEY$8 = "." + DATA_KEY$8;
- var DATA_API_KEY$6 = '.data-api';
- var JQUERY_NO_CONFLICT$8 = $__default['default'].fn[NAME$8];
- var Default$6 = {
- offset: 10,
- method: 'auto',
- target: ''
- };
- var DefaultType$6 = {
- offset: 'number',
- method: 'string',
- target: '(string|element)'
- };
- var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
- var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
- var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
- var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
- var CLASS_NAME_ACTIVE$2 = 'active';
- var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
- var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
- var SELECTOR_NAV_LINKS = '.nav-link';
- var SELECTOR_NAV_ITEMS = '.nav-item';
- var SELECTOR_LIST_ITEMS = '.list-group-item';
- var SELECTOR_DROPDOWN = '.dropdown';
- var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';
- var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
- var METHOD_OFFSET = 'offset';
- var METHOD_POSITION = 'position';
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var ScrollSpy = /*#__PURE__*/function () {
- function ScrollSpy(element, config) {
- var _this = this;
-
- this._element = element;
- this._scrollElement = element.tagName === 'BODY' ? window : element;
- this._config = this._getConfig(config);
- this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
- this._offsets = [];
- this._targets = [];
- this._activeTarget = null;
- this._scrollHeight = 0;
- $__default['default'](this._scrollElement).on(EVENT_SCROLL, function (event) {
- return _this._process(event);
- });
- this.refresh();
-
- this._process();
- } // Getters
-
-
- var _proto = ScrollSpy.prototype;
-
- // Public
- _proto.refresh = function refresh() {
- var _this2 = this;
-
- var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
- var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
- var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
- this._offsets = [];
- this._targets = [];
- this._scrollHeight = this._getScrollHeight();
- var targets = [].slice.call(document.querySelectorAll(this._selector));
- targets.map(function (element) {
- var target;
- var targetSelector = Util.getSelectorFromElement(element);
-
- if (targetSelector) {
- target = document.querySelector(targetSelector);
- }
-
- if (target) {
- var targetBCR = target.getBoundingClientRect();
-
- if (targetBCR.width || targetBCR.height) {
- // TODO (fat): remove sketch reliance on jQuery position/offset
- return [$__default['default'](target)[offsetMethod]().top + offsetBase, targetSelector];
- }
- }
-
- return null;
- }).filter(function (item) {
- return item;
- }).sort(function (a, b) {
- return a[0] - b[0];
- }).forEach(function (item) {
- _this2._offsets.push(item[0]);
-
- _this2._targets.push(item[1]);
- });
- };
-
- _proto.dispose = function dispose() {
- $__default['default'].removeData(this._element, DATA_KEY$8);
- $__default['default'](this._scrollElement).off(EVENT_KEY$8);
- this._element = null;
- this._scrollElement = null;
- this._config = null;
- this._selector = null;
- this._offsets = null;
- this._targets = null;
- this._activeTarget = null;
- this._scrollHeight = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _extends({}, Default$6, typeof config === 'object' && config ? config : {});
-
- if (typeof config.target !== 'string' && Util.isElement(config.target)) {
- var id = $__default['default'](config.target).attr('id');
-
- if (!id) {
- id = Util.getUID(NAME$8);
- $__default['default'](config.target).attr('id', id);
- }
-
- config.target = "#" + id;
- }
-
- Util.typeCheckConfig(NAME$8, config, DefaultType$6);
- return config;
- };
-
- _proto._getScrollTop = function _getScrollTop() {
- return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
- };
-
- _proto._getScrollHeight = function _getScrollHeight() {
- return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
- };
-
- _proto._getOffsetHeight = function _getOffsetHeight() {
- return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
- };
-
- _proto._process = function _process() {
- var scrollTop = this._getScrollTop() + this._config.offset;
-
- var scrollHeight = this._getScrollHeight();
-
- var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
-
- if (this._scrollHeight !== scrollHeight) {
- this.refresh();
- }
-
- if (scrollTop >= maxScroll) {
- var target = this._targets[this._targets.length - 1];
-
- if (this._activeTarget !== target) {
- this._activate(target);
- }
-
- return;
- }
-
- if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
- this._activeTarget = null;
-
- this._clear();
-
- return;
- }
-
- for (var i = this._offsets.length; i--;) {
- var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
-
- if (isActiveTarget) {
- this._activate(this._targets[i]);
- }
- }
- };
-
- _proto._activate = function _activate(target) {
- this._activeTarget = target;
-
- this._clear();
-
- var queries = this._selector.split(',').map(function (selector) {
- return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
- });
-
- var $link = $__default['default']([].slice.call(document.querySelectorAll(queries.join(','))));
-
- if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
- $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2);
- $link.addClass(CLASS_NAME_ACTIVE$2);
- } else {
- // Set triggered link as active
- $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active
- // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
-
- $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$2); // Handle special case when .nav-link is inside .nav-item
-
- $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2);
- }
-
- $__default['default'](this._scrollElement).trigger(EVENT_ACTIVATE, {
- relatedTarget: target
- });
- };
-
- _proto._clear = function _clear() {
- [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
- return node.classList.contains(CLASS_NAME_ACTIVE$2);
- }).forEach(function (node) {
- return node.classList.remove(CLASS_NAME_ACTIVE$2);
- });
- } // Static
- ;
-
- ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $__default['default'](this).data(DATA_KEY$8);
-
- var _config = typeof config === 'object' && config;
-
- if (!data) {
- data = new ScrollSpy(this, _config);
- $__default['default'](this).data(DATA_KEY$8, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(ScrollSpy, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$8;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$6;
- }
- }]);
-
- return ScrollSpy;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](window).on(EVENT_LOAD_DATA_API$2, function () {
- var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));
- var scrollSpysLength = scrollSpys.length;
-
- for (var i = scrollSpysLength; i--;) {
- var $spy = $__default['default'](scrollSpys[i]);
-
- ScrollSpy._jQueryInterface.call($spy, $spy.data());
- }
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME$8] = ScrollSpy._jQueryInterface;
- $__default['default'].fn[NAME$8].Constructor = ScrollSpy;
-
- $__default['default'].fn[NAME$8].noConflict = function () {
- $__default['default'].fn[NAME$8] = JQUERY_NO_CONFLICT$8;
- return ScrollSpy._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$9 = 'tab';
- var VERSION$9 = '4.6.0';
- var DATA_KEY$9 = 'bs.tab';
- var EVENT_KEY$9 = "." + DATA_KEY$9;
- var DATA_API_KEY$7 = '.data-api';
- var JQUERY_NO_CONFLICT$9 = $__default['default'].fn[NAME$9];
- var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
- var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
- var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
- var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
- var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
- var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
- var CLASS_NAME_ACTIVE$3 = 'active';
- var CLASS_NAME_DISABLED$1 = 'disabled';
- var CLASS_NAME_FADE$4 = 'fade';
- var CLASS_NAME_SHOW$6 = 'show';
- var SELECTOR_DROPDOWN$1 = '.dropdown';
- var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
- var SELECTOR_ACTIVE$2 = '.active';
- var SELECTOR_ACTIVE_UL = '> li > .active';
- var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
- var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
- var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Tab = /*#__PURE__*/function () {
- function Tab(element) {
- this._element = element;
- } // Getters
-
-
- var _proto = Tab.prototype;
-
- // Public
- _proto.show = function show() {
- var _this = this;
-
- if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default['default'](this._element).hasClass(CLASS_NAME_ACTIVE$3) || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED$1)) {
- return;
- }
-
- var target;
- var previous;
- var listElement = $__default['default'](this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0];
- var selector = Util.getSelectorFromElement(this._element);
-
- if (listElement) {
- var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
- previous = $__default['default'].makeArray($__default['default'](listElement).find(itemSelector));
- previous = previous[previous.length - 1];
- }
-
- var hideEvent = $__default['default'].Event(EVENT_HIDE$3, {
- relatedTarget: this._element
- });
- var showEvent = $__default['default'].Event(EVENT_SHOW$3, {
- relatedTarget: previous
- });
-
- if (previous) {
- $__default['default'](previous).trigger(hideEvent);
- }
-
- $__default['default'](this._element).trigger(showEvent);
-
- if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
- return;
- }
-
- if (selector) {
- target = document.querySelector(selector);
- }
-
- this._activate(this._element, listElement);
-
- var complete = function complete() {
- var hiddenEvent = $__default['default'].Event(EVENT_HIDDEN$3, {
- relatedTarget: _this._element
- });
- var shownEvent = $__default['default'].Event(EVENT_SHOWN$3, {
- relatedTarget: previous
- });
- $__default['default'](previous).trigger(hiddenEvent);
- $__default['default'](_this._element).trigger(shownEvent);
- };
-
- if (target) {
- this._activate(target, target.parentNode, complete);
- } else {
- complete();
- }
- };
-
- _proto.dispose = function dispose() {
- $__default['default'].removeData(this._element, DATA_KEY$9);
- this._element = null;
- } // Private
- ;
-
- _proto._activate = function _activate(element, container, callback) {
- var _this2 = this;
-
- var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default['default'](container).find(SELECTOR_ACTIVE_UL) : $__default['default'](container).children(SELECTOR_ACTIVE$2);
- var active = activeElements[0];
- var isTransitioning = callback && active && $__default['default'](active).hasClass(CLASS_NAME_FADE$4);
-
- var complete = function complete() {
- return _this2._transitionComplete(element, active, callback);
- };
-
- if (active && isTransitioning) {
- var transitionDuration = Util.getTransitionDurationFromElement(active);
- $__default['default'](active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- };
-
- _proto._transitionComplete = function _transitionComplete(element, active, callback) {
- if (active) {
- $__default['default'](active).removeClass(CLASS_NAME_ACTIVE$3);
- var dropdownChild = $__default['default'](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
-
- if (dropdownChild) {
- $__default['default'](dropdownChild).removeClass(CLASS_NAME_ACTIVE$3);
- }
-
- if (active.getAttribute('role') === 'tab') {
- active.setAttribute('aria-selected', false);
- }
- }
-
- $__default['default'](element).addClass(CLASS_NAME_ACTIVE$3);
-
- if (element.getAttribute('role') === 'tab') {
- element.setAttribute('aria-selected', true);
- }
-
- Util.reflow(element);
-
- if (element.classList.contains(CLASS_NAME_FADE$4)) {
- element.classList.add(CLASS_NAME_SHOW$6);
- }
-
- if (element.parentNode && $__default['default'](element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
- var dropdownElement = $__default['default'](element).closest(SELECTOR_DROPDOWN$1)[0];
-
- if (dropdownElement) {
- var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1));
- $__default['default'](dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3);
- }
-
- element.setAttribute('aria-expanded', true);
- }
-
- if (callback) {
- callback();
- }
- } // Static
- ;
-
- Tab._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $this = $__default['default'](this);
- var data = $this.data(DATA_KEY$9);
-
- if (!data) {
- data = new Tab(this);
- $this.data(DATA_KEY$9, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Tab, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$9;
- }
- }]);
-
- return Tab;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
- event.preventDefault();
-
- Tab._jQueryInterface.call($__default['default'](this), 'show');
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $__default['default'].fn[NAME$9] = Tab._jQueryInterface;
- $__default['default'].fn[NAME$9].Constructor = Tab;
-
- $__default['default'].fn[NAME$9].noConflict = function () {
- $__default['default'].fn[NAME$9] = JQUERY_NO_CONFLICT$9;
- return Tab._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$a = 'toast';
- var VERSION$a = '4.6.0';
- var DATA_KEY$a = 'bs.toast';
- var EVENT_KEY$a = "." + DATA_KEY$a;
- var JQUERY_NO_CONFLICT$a = $__default['default'].fn[NAME$a];
- var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
- var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
- var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
- var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
- var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
- var CLASS_NAME_FADE$5 = 'fade';
- var CLASS_NAME_HIDE = 'hide';
- var CLASS_NAME_SHOW$7 = 'show';
- var CLASS_NAME_SHOWING = 'showing';
- var DefaultType$7 = {
- animation: 'boolean',
- autohide: 'boolean',
- delay: 'number'
- };
- var Default$7 = {
- animation: true,
- autohide: true,
- delay: 500
- };
- var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- var Toast = /*#__PURE__*/function () {
- function Toast(element, config) {
- this._element = element;
- this._config = this._getConfig(config);
- this._timeout = null;
-
- this._setListeners();
- } // Getters
-
-
- var _proto = Toast.prototype;
-
- // Public
- _proto.show = function show() {
- var _this = this;
-
- var showEvent = $__default['default'].Event(EVENT_SHOW$4);
- $__default['default'](this._element).trigger(showEvent);
-
- if (showEvent.isDefaultPrevented()) {
- return;
- }
-
- this._clearTimeout();
-
- if (this._config.animation) {
- this._element.classList.add(CLASS_NAME_FADE$5);
- }
-
- var complete = function complete() {
- _this._element.classList.remove(CLASS_NAME_SHOWING);
-
- _this._element.classList.add(CLASS_NAME_SHOW$7);
-
- $__default['default'](_this._element).trigger(EVENT_SHOWN$4);
-
- if (_this._config.autohide) {
- _this._timeout = setTimeout(function () {
- _this.hide();
- }, _this._config.delay);
- }
- };
-
- this._element.classList.remove(CLASS_NAME_HIDE);
-
- Util.reflow(this._element);
-
- this._element.classList.add(CLASS_NAME_SHOWING);
-
- if (this._config.animation) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- };
-
- _proto.hide = function hide() {
- if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) {
- return;
- }
-
- var hideEvent = $__default['default'].Event(EVENT_HIDE$4);
- $__default['default'](this._element).trigger(hideEvent);
-
- if (hideEvent.isDefaultPrevented()) {
- return;
- }
-
- this._close();
- };
-
- _proto.dispose = function dispose() {
- this._clearTimeout();
-
- if (this._element.classList.contains(CLASS_NAME_SHOW$7)) {
- this._element.classList.remove(CLASS_NAME_SHOW$7);
- }
-
- $__default['default'](this._element).off(EVENT_CLICK_DISMISS$1);
- $__default['default'].removeData(this._element, DATA_KEY$a);
- this._element = null;
- this._config = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _extends({}, Default$7, $__default['default'](this._element).data(), typeof config === 'object' && config ? config : {});
- Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
- return config;
- };
-
- _proto._setListeners = function _setListeners() {
- var _this2 = this;
-
- $__default['default'](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
- return _this2.hide();
- });
- };
-
- _proto._close = function _close() {
- var _this3 = this;
-
- var complete = function complete() {
- _this3._element.classList.add(CLASS_NAME_HIDE);
-
- $__default['default'](_this3._element).trigger(EVENT_HIDDEN$4);
- };
-
- this._element.classList.remove(CLASS_NAME_SHOW$7);
-
- if (this._config.animation) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- };
-
- _proto._clearTimeout = function _clearTimeout() {
- clearTimeout(this._timeout);
- this._timeout = null;
- } // Static
- ;
-
- Toast._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $element = $__default['default'](this);
- var data = $element.data(DATA_KEY$a);
-
- var _config = typeof config === 'object' && config;
-
- if (!data) {
- data = new Toast(this, _config);
- $element.data(DATA_KEY$a, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config](this);
- }
- });
- };
-
- _createClass(Toast, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$a;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$7;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$7;
- }
- }]);
-
- return Toast;
- }();
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
-
- $__default['default'].fn[NAME$a] = Toast._jQueryInterface;
- $__default['default'].fn[NAME$a].Constructor = Toast;
-
- $__default['default'].fn[NAME$a].noConflict = function () {
- $__default['default'].fn[NAME$a] = JQUERY_NO_CONFLICT$a;
- return Toast._jQueryInterface;
- };
-
- exports.Alert = Alert;
- exports.Button = Button;
- exports.Carousel = Carousel;
- exports.Collapse = Collapse;
- exports.Dropdown = Dropdown;
- exports.Modal = Modal;
- exports.Popover = Popover;
- exports.Scrollspy = ScrollSpy;
- exports.Tab = Tab;
- exports.Toast = Toast;
- exports.Tooltip = Tooltip;
- exports.Util = Util;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
- })));
-
- });
-
- const subscriber_queue = [];
- /**
- * Create a `Writable` store that allows both updating and reading by subscription.
- * @param {*=}value initial value
- * @param {StartStopNotifier=}start start and stop notifications for subscriptions
- */
- function writable(value, start = noop) {
- let stop;
- const subscribers = [];
- function set(new_value) {
- if (safe_not_equal(value, new_value)) {
- value = new_value;
- if (stop) { // store is ready
- const run_queue = !subscriber_queue.length;
- for (let i = 0; i < subscribers.length; i += 1) {
- const s = subscribers[i];
- s[1]();
- subscriber_queue.push(s, value);
- }
- if (run_queue) {
- for (let i = 0; i < subscriber_queue.length; i += 2) {
- subscriber_queue[i][0](subscriber_queue[i + 1]);
- }
- subscriber_queue.length = 0;
- }
- }
- }
- }
- function update(fn) {
- set(fn(value));
- }
- function subscribe(run, invalidate = noop) {
- const subscriber = [run, invalidate];
- subscribers.push(subscriber);
- if (subscribers.length === 1) {
- stop = start(set) || noop;
- }
- run(value);
- return () => {
- const index = subscribers.indexOf(subscriber);
- if (index !== -1) {
- subscribers.splice(index, 1);
- }
- if (subscribers.length === 0) {
- stop();
- stop = null;
- }
- };
- }
- return { set, update, subscribe };
- }
-
- const map_store = writable();
- const results_store = writable();
- const current_result_store = writable();
- const current_request_latlon = writable();
- const last_updated_store = writable();
-
- /* src/components/Header.svelte generated by Svelte v3.31.2 */
- const file = "src/components/Header.svelte";
-
- // (76:8) {#if last_updated}
- function create_if_block(ctx) {
- let div;
- let t0;
- let a0;
- let t1;
- let a0_href_value;
- let t2;
- let span0;
- let t3;
- let a1;
- let t4;
- let a1_href_value;
- let t5;
- let t6;
- let span1;
- let t7_value = /*last_updated*/ ctx[0].date + "";
- let t7;
-
- const block = {
- c: function create() {
- div = element("div");
- t0 = text("Data from ");
- a0 = element("a");
- t1 = text("API request");
- t2 = space();
- span0 = element("span");
- t3 = text("(");
- a1 = element("a");
- t4 = text("debug output");
- t5 = text(")");
- t6 = text("\n Data last updated: ");
- span1 = element("span");
- t7 = text(t7_value);
- attr_dev(a0, "href", a0_href_value = /*last_updated*/ ctx[0].api_request_url);
- attr_dev(a0, "class", "svelte-1hjkg8o");
- add_location(a0, file, 77, 22, 1413);
- attr_dev(a1, "href", a1_href_value = /*last_updated*/ ctx[0].api_request_url_debug);
- attr_dev(a1, "class", "svelte-1hjkg8o");
- add_location(a1, file, 78, 42, 1512);
- attr_dev(span0, "id", "api-request-debug");
- add_location(span0, file, 78, 12, 1482);
- attr_dev(div, "id", "api-request");
- add_location(div, file, 76, 10, 1368);
- attr_dev(span1, "id", "data-date");
- add_location(span1, file, 80, 29, 1630);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, t0);
- append_dev(div, a0);
- append_dev(a0, t1);
- append_dev(div, t2);
- append_dev(div, span0);
- append_dev(span0, t3);
- append_dev(span0, a1);
- append_dev(a1, t4);
- append_dev(span0, t5);
- insert_dev(target, t6, anchor);
- insert_dev(target, span1, anchor);
- append_dev(span1, t7);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*last_updated*/ 1 && a0_href_value !== (a0_href_value = /*last_updated*/ ctx[0].api_request_url)) {
- attr_dev(a0, "href", a0_href_value);
- }
-
- if (dirty & /*last_updated*/ 1 && a1_href_value !== (a1_href_value = /*last_updated*/ ctx[0].api_request_url_debug)) {
- attr_dev(a1, "href", a1_href_value);
- }
-
- if (dirty & /*last_updated*/ 1 && t7_value !== (t7_value = /*last_updated*/ ctx[0].date + "")) set_data_dev(t7, t7_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- if (detaching) detach_dev(t6);
- if (detaching) detach_dev(span1);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block.name,
- type: "if",
- source: "(76:8) {#if last_updated}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment(ctx) {
- let header;
- let div9;
- let div1;
- let div0;
- let a0;
- let img;
- let img_src_value;
- let t0;
- let h1;
- let t2;
- let div4;
- let div3;
- let div2;
- let t4;
- let t5;
- let div8;
- let div7;
- let button;
- let t7;
- let div6;
- let a1;
- let t9;
- let a2;
- let t11;
- let a3;
- let t13;
- let a4;
- let t15;
- let a5;
- let t17;
- let div5;
- let t18;
- let a6;
- let if_block = /*last_updated*/ ctx[0] && create_if_block(ctx);
-
- const block = {
- c: function create() {
- header = element("header");
- div9 = element("div");
- div1 = element("div");
- div0 = element("div");
- a0 = element("a");
- img = element("img");
- t0 = space();
- h1 = element("h1");
- h1.textContent = "Nominatim";
- t2 = space();
- div4 = element("div");
- div3 = element("div");
- div2 = element("div");
- div2.textContent = "loading...";
- t4 = space();
- if (if_block) if_block.c();
- t5 = space();
- div8 = element("div");
- div7 = element("div");
- button = element("button");
- button.textContent = "About & Help";
- t7 = space();
- div6 = element("div");
- a1 = element("a");
- a1.textContent = "API Reference";
- t9 = space();
- a2 = element("a");
- a2.textContent = "FAQ";
- t11 = space();
- a3 = element("a");
- a3.textContent = "OpenStreetMap Help";
- t13 = space();
- a4 = element("a");
- a4.textContent = "Nominatim on Github";
- t15 = space();
- a5 = element("a");
- a5.textContent = "This frontend on Github";
- t17 = space();
- div5 = element("div");
- t18 = space();
- a6 = element("a");
- a6.textContent = "Report problem with results";
- attr_dev(img, "alt", "logo");
- if (img.src !== (img_src_value = "images/osm_logo.120px.png")) attr_dev(img, "src", img_src_value);
- attr_dev(img, "width", "30");
- attr_dev(img, "height", "30");
- attr_dev(img, "class", "svelte-1hjkg8o");
- add_location(img, file, 67, 10, 1075);
- attr_dev(h1, "class", "svelte-1hjkg8o");
- add_location(h1, file, 68, 10, 1158);
- attr_dev(a0, "href", "search.html");
- attr_dev(a0, "class", "svelte-1hjkg8o");
- add_location(a0, file, 66, 8, 1042);
- attr_dev(div0, "class", "brand svelte-1hjkg8o");
- add_location(div0, file, 65, 6, 1014);
- attr_dev(div1, "class", "col-4");
- add_location(div1, file, 64, 4, 988);
- attr_dev(div2, "id", "loading");
- attr_dev(div2, "class", "svelte-1hjkg8o");
- add_location(div2, file, 74, 8, 1296);
- attr_dev(div3, "id", "last-updated");
- attr_dev(div3, "class", "text-center svelte-1hjkg8o");
- add_location(div3, file, 73, 6, 1244);
- attr_dev(div4, "class", "col-4");
- add_location(div4, file, 72, 4, 1218);
- attr_dev(button, "class", "dropdown-toggle btn btn-sm btn-outline-secondary");
- attr_dev(button, "data-toggle", "dropdown");
- attr_dev(button, "role", "button");
- attr_dev(button, "aria-haspopup", "true");
- attr_dev(button, "aria-expanded", "false");
- add_location(button, file, 86, 8, 1788);
- attr_dev(a1, "class", "dropdown-item svelte-1hjkg8o");
- attr_dev(a1, "href", "https://nominatim.org/release-docs/develop/api/Overview/");
- attr_dev(a1, "target", "_blank");
- add_location(a1, file, 90, 10, 2045);
- attr_dev(a2, "class", "dropdown-item svelte-1hjkg8o");
- attr_dev(a2, "href", "https://nominatim.org/release-docs/develop/api/Faq/");
- attr_dev(a2, "target", "_blank");
- add_location(a2, file, 91, 10, 2178);
- attr_dev(a3, "class", "dropdown-item svelte-1hjkg8o");
- attr_dev(a3, "href", "https://help.openstreetmap.org/tags/nominatim/");
- add_location(a3, file, 92, 10, 2296);
- attr_dev(a4, "class", "dropdown-item svelte-1hjkg8o");
- attr_dev(a4, "href", "https://github.com/osm-search/Nominatim");
- add_location(a4, file, 93, 10, 2408);
- attr_dev(a5, "class", "dropdown-item svelte-1hjkg8o");
- attr_dev(a5, "href", "https://github.com/osm-search/nominatim-ui");
- add_location(a5, file, 94, 10, 2514);
- attr_dev(div5, "class", "dropdown-divider");
- add_location(div5, file, 95, 10, 2627);
- attr_dev(a6, "class", "dropdown-item svelte-1hjkg8o");
- attr_dev(a6, "href", "#");
- attr_dev(a6, "data-toggle", "modal");
- attr_dev(a6, "data-target", "#report-modal");
- add_location(a6, file, 96, 10, 2674);
- attr_dev(div6, "class", "dropdown-menu dropdown-menu-right svelte-1hjkg8o");
- add_location(div6, file, 89, 8, 1987);
- attr_dev(div7, "class", "dropdown");
- add_location(div7, file, 85, 6, 1757);
- attr_dev(div8, "class", "col-4 text-right");
- add_location(div8, file, 84, 4, 1720);
- attr_dev(div9, "class", "row");
- add_location(div9, file, 63, 2, 966);
- attr_dev(header, "class", "container-fluid svelte-1hjkg8o");
- add_location(header, file, 62, 0, 931);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, header, anchor);
- append_dev(header, div9);
- append_dev(div9, div1);
- append_dev(div1, div0);
- append_dev(div0, a0);
- append_dev(a0, img);
- append_dev(a0, t0);
- append_dev(a0, h1);
- append_dev(div9, t2);
- append_dev(div9, div4);
- append_dev(div4, div3);
- append_dev(div3, div2);
- append_dev(div3, t4);
- if (if_block) if_block.m(div3, null);
- append_dev(div9, t5);
- append_dev(div9, div8);
- append_dev(div8, div7);
- append_dev(div7, button);
- append_dev(div7, t7);
- append_dev(div7, div6);
- append_dev(div6, a1);
- append_dev(div6, t9);
- append_dev(div6, a2);
- append_dev(div6, t11);
- append_dev(div6, a3);
- append_dev(div6, t13);
- append_dev(div6, a4);
- append_dev(div6, t15);
- append_dev(div6, a5);
- append_dev(div6, t17);
- append_dev(div6, div5);
- append_dev(div6, t18);
- append_dev(div6, a6);
- },
- p: function update(ctx, [dirty]) {
- if (/*last_updated*/ ctx[0]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block(ctx);
- if_block.c();
- if_block.m(div3, null);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(header);
- if (if_block) if_block.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Header", slots, []);
- let last_updated;
-
- last_updated_store.subscribe(data => {
- if (!data) {
- return;
- }
-
- $$invalidate(0, last_updated = data);
- });
-
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Header> was created with unknown prop '${key}'`);
- });
-
- $$self.$capture_state = () => ({ last_updated_store, last_updated });
-
- $$self.$inject_state = $$props => {
- if ("last_updated" in $$props) $$invalidate(0, last_updated = $$props.last_updated);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [last_updated];
- }
-
- class Header extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance, create_fragment, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Header",
- options,
- id: create_fragment.name
- });
- }
- }
-
- /* src/components/Footer.svelte generated by Svelte v3.31.2 */
-
- const file$1 = "src/components/Footer.svelte";
-
- function create_fragment$1(ctx) {
- let footer;
- let p0;
- let t1;
- let p1;
- let t2;
- let a;
- let t4;
-
- const block = {
- c: function create() {
- footer = element("footer");
- p0 = element("p");
- p0.textContent = "Addresses and postcodes are approximate";
- t1 = space();
- p1 = element("p");
- t2 = text("© ");
- a = element("a");
- a.textContent = "OpenStreetMap";
- t4 = text(" contributors");
- attr_dev(p0, "class", "disclaimer svelte-1f2bd8l");
- add_location(p0, file$1, 12, 2, 141);
- attr_dev(a, "href", "https://osm.org/copyright");
- add_location(a, file$1, 16, 11, 250);
- attr_dev(p1, "class", "copyright svelte-1f2bd8l");
- add_location(p1, file$1, 15, 2, 217);
- attr_dev(footer, "class", "svelte-1f2bd8l");
- add_location(footer, file$1, 11, 0, 130);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, footer, anchor);
- append_dev(footer, p0);
- append_dev(footer, t1);
- append_dev(footer, p1);
- append_dev(p1, t2);
- append_dev(p1, a);
- append_dev(p1, t4);
- },
- p: noop,
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(footer);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$1.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$1($$self, $$props) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Footer", slots, []);
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Footer> was created with unknown prop '${key}'`);
- });
-
- return [];
- }
-
- class Footer extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Footer",
- options,
- id: create_fragment$1.name
- });
- }
- }
-
- /* src/App.svelte generated by Svelte v3.31.2 */
- const file$2 = "src/App.svelte";
-
- function create_fragment$2(ctx) {
- let header;
- let t0;
- let div;
- let t1;
- let footer;
- let current;
- header = new Header({ $$inline: true });
- footer = new Footer({ $$inline: true });
-
- const block = {
- c: function create() {
- create_component(header.$$.fragment);
- t0 = space();
- div = element("div");
- t1 = space();
- create_component(footer.$$.fragment);
- attr_dev(div, "id", "main");
- add_location(div, file$2, 10, 0, 297);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- mount_component(header, target, anchor);
- insert_dev(target, t0, anchor);
- insert_dev(target, div, anchor);
- insert_dev(target, t1, anchor);
- mount_component(footer, target, anchor);
- current = true;
- },
- p: noop,
- i: function intro(local) {
- if (current) return;
- transition_in(header.$$.fragment, local);
- transition_in(footer.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(header.$$.fragment, local);
- transition_out(footer.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(header, detaching);
- if (detaching) detach_dev(t0);
- if (detaching) detach_dev(div);
- if (detaching) detach_dev(t1);
- destroy_component(footer, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$2.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$2($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("App", slots, []);
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<App> was created with unknown prop '${key}'`);
- });
-
- $$self.$capture_state = () => ({ jquery: jquery$1, Header, Footer });
- return [];
- }
-
- class App extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$2, create_fragment$2, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "App",
- options,
- id: create_fragment$2.name
- });
- }
- }
-
- var get_config_value_1 = get_config_value;
-
-
- const Nominatim_Config_Defaults = {
- Nominatim_API_Endpoint: 'http://localhost/nominatim/',
- Images_Base_Url: 'mapicons/',
- Search_AreaPolygons: 1,
- Reverse_Default_Search_Zoom: 18,
- Map_Default_Lat: 20.0,
- Map_Default_Lon: 0.0,
- Map_Default_Zoom: 2,
- Map_Tile_URL: 'https://{s}.tile.osm.org/{z}/{x}/{y}.png',
- Map_Tile_Attribution: '<a href="https://osm.org/copyright">OpenStreetMap contributors</a>'
- };
-
- function get_config_value(str, default_val) {
- var value = ((typeof Nominatim_Config !== 'undefined')
- && (typeof Nominatim_Config[str] !== 'undefined'))
- ? Nominatim_Config[str]
- : Nominatim_Config_Defaults[str];
- return (typeof value !== 'undefined' ? value : default_val);
- }
-
- async function fetch_from_api(endpoint_name, params, callback) {
- var api_url = generate_nominatim_api_url(endpoint_name, params);
-
- document.getElementById('loading').style.display = 'block';
- await fetch(api_url)
- .then(response => response.json())
- .then(data => {
- callback(data);
- document.getElementById('loading').style.display = 'none';
- });
-
-
- fetch(generate_nominatim_api_url('status', {format: 'json'}))
- .then(response => response.json())
- .then(data => {
- let last_updated = {
- api_request_url: api_url,
- api_request_url_debug: api_url + '&debug=1',
- date: data.data_updated
- };
- last_updated_store.set(last_updated);
- });
- }
-
- function generate_nominatim_api_url(endpoint_name, params) {
- return get_config_value_1('Nominatim_API_Endpoint') + endpoint_name + '.php?'
- + Object.keys(clean_up_parameters(params)).map( (k) => {
- return encodeURIComponent(k) + '=' + encodeURIComponent(params[k])
- }).join('&');
- }
-
- /*!
- * Serialize all form data into a SearchParams string
- * (c) 2020 Chris Ferdinandi, MIT License, https://gomakethings.com
- * @param {Node} form The form to serialize
- * @return {String} The serialized form data
- */
- function serialize_form(form) {
- var arr = [];
- Array.prototype.slice.call(form.elements).forEach(function (field) {
- if (!field.name || field.disabled || ['file', 'reset', 'submit', 'button'].indexOf(field.type) > -1) return;
- // if (field.type === 'select-multiple') {
- // Array.prototype.slice.call(field.options).forEach(function (option) {
- // if (!option.selected) return;
- // arr.push(encodeURIComponent(field.name) + '=' + encodeURIComponent(option.value));
- // });
- // return;
- // }
- if (['checkbox', 'radio'].indexOf(field.type) >-1 && !field.checked) return;
- if (typeof(field.value) === 'undefined') return;
- arr.push(encodeURIComponent(field.name) + '=' + encodeURIComponent(field.value));
- });
- return arr.join('&');
- }
-
- // remove any URL paramters with empty values
- // '&empty=&filled=value' => 'filled=value'
- function clean_up_url_parameters(url) {
- var url_params = new URLSearchParams(url);
- var to_delete = []; // deleting inside loop would skip iterations
- url_params.forEach(function (value, key) {
- if (value === '') to_delete.push(key);
- });
- for (var i = 0; i < to_delete.length; i += 1) {
- url_params.delete(to_delete[i]);
- }
- return url_params.toString();
- }
-
- function clean_up_parameters(params) {
- // `&a=&b=&c=1` => '&c=1'
- var param_names = Object.keys(params);
- for (var i = 0; i < param_names.length; i += 1) {
- var val = params[param_names[i]];
- if (typeof (val) === 'undefined' || val === '' || val === null) {
- delete params[param_names[i]];
- }
- }
- return params;
- }
-
- function update_html_title(title) {
- document.title = [title, 'OpenStreetMap Nominatim']
- .filter( (val) => val && val.length > 1 )
- .join(' | ');
- }
-
- /*!
+var de="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,fe=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(de&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0}();function pe(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}function me(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),fe))}}var ge=de&&window.Promise?pe:me;function _e(t){return t&&"[object Function]"==={}.toString.call(t)}function ve(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function ye(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function be(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=ve(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/(auto|scroll|overlay)/.test(n+o+i)?t:be(ye(t))}function xe(t){return t&&t.referenceNode?t.referenceNode:t}var we=de&&!(!window.MSInputMethodContext||!document.documentMode),Te=de&&/MSIE 10/.test(navigator.userAgent);function Ce(t){return 11===t?we:10===t?Te:we||Te}function Ee(t){if(!t)return document.documentElement;for(var e=Ce(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===ve(n,"position")?Ee(n):n:t?t.ownerDocument.documentElement:document.documentElement}function $e(t){var e=t.nodeName;return"BODY"!==e&&("HTML"===e||Ee(t.firstElementChild)===t)}function Le(t){return null!==t.parentNode?Le(t.parentNode):t}function ke(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,o=n?e:t,r=document.createRange();r.setStart(i,0),r.setEnd(o,0);var s=r.commonAncestorContainer;if(t!==s&&e!==s||i.contains(o))return $e(s)?s:Ee(s);var a=Le(t);return a.host?ke(a.host,e):ke(t,Le(e).host)}function Pe(t){var e="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=t.nodeName;if("BODY"===n||"HTML"===n){var i=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||i)[e]}return t[e]}function Se(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Pe(e,"top"),o=Pe(e,"left"),r=n?-1:1;return t.top+=i*r,t.bottom+=i*r,t.left+=o*r,t.right+=o*r,t}function Me(t,e){var n="x"===e?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+i+"Width"])}function Ae(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Ce(10)?parseInt(n["offset"+t])+parseInt(i["margin"+("Height"===t?"Top":"Left")])+parseInt(i["margin"+("Height"===t?"Bottom":"Right")]):0)}function Ne(t){var e=t.body,n=t.documentElement,i=Ce(10)&&getComputedStyle(n);return{height:Ae("Height",e,n,i),width:Ae("Width",e,n,i)}}var De=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ie=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Oe=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},ze=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};function Be(t){return ze({},t,{right:t.left+t.width,bottom:t.top+t.height})}function je(t){var e={};try{if(Ce(10)){e=t.getBoundingClientRect();var n=Pe(t,"top"),i=Pe(t,"left");e.top+=n,e.left+=i,e.bottom+=n,e.right+=i}else e=t.getBoundingClientRect()}catch(t){}var o={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},r="HTML"===t.nodeName?Ne(t.ownerDocument):{},s=r.width||t.clientWidth||o.width,a=r.height||t.clientHeight||o.height,l=t.offsetWidth-s,u=t.offsetHeight-a;if(l||u){var c=ve(t);l-=Me(c,"x"),u-=Me(c,"y"),o.width-=l,o.height-=u}return Be(o)}function Re(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Ce(10),o="HTML"===e.nodeName,r=je(t),s=je(e),a=be(t),l=ve(e),u=parseFloat(l.borderTopWidth),c=parseFloat(l.borderLeftWidth);n&&o&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var h=Be({top:r.top-s.top-u,left:r.left-s.left-c,width:r.width,height:r.height});if(h.marginTop=0,h.marginLeft=0,!i&&o){var d=parseFloat(l.marginTop),f=parseFloat(l.marginLeft);h.top-=u-d,h.bottom-=u-d,h.left-=c-f,h.right-=c-f,h.marginTop=d,h.marginLeft=f}return(i&&!n?e.contains(a):e===a&&"BODY"!==a.nodeName)&&(h=Se(h,e)),h}function Ze(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,i=Re(t,n),o=Math.max(n.clientWidth,window.innerWidth||0),r=Math.max(n.clientHeight,window.innerHeight||0),s=e?0:Pe(n),a=e?0:Pe(n,"left");return Be({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:o,height:r})}function He(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===ve(t,"position"))return!0;var n=ye(t);return!!n&&He(n)}function qe(t){if(!t||!t.parentElement||Ce())return document.documentElement;for(var e=t.parentElement;e&&"none"===ve(e,"transform");)e=e.parentElement;return e||document.documentElement}function Fe(t,e,n,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={top:0,left:0},s=o?qe(t):ke(t,xe(e));if("viewport"===i)r=Ze(s,o);else{var a=void 0;"scrollParent"===i?"BODY"===(a=be(ye(e))).nodeName&&(a=t.ownerDocument.documentElement):a="window"===i?t.ownerDocument.documentElement:i;var l=Re(a,s,o);if("HTML"!==a.nodeName||He(s))r=l;else{var u=Ne(t.ownerDocument),c=u.height,h=u.width;r.top+=l.top-l.marginTop,r.bottom=c+l.top,r.left+=l.left-l.marginLeft,r.right=h+l.left}}var d="number"==typeof(n=n||0);return r.left+=d?n:n.left||0,r.top+=d?n:n.top||0,r.right-=d?n:n.right||0,r.bottom-=d?n:n.bottom||0,r}function We(t){return t.width*t.height}function Ue(t,e,n,i,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var s=Fe(n,i,r,o),a={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},l=Object.keys(a).map((function(t){return ze({key:t},a[t],{area:We(a[t])})})).sort((function(t,e){return e.area-t.area})),u=l.filter((function(t){var e=t.width,i=t.height;return e>=n.clientWidth&&i>=n.clientHeight})),c=u.length>0?u[0].key:l[0].key,h=t.split("-")[1];return c+(h?"-"+h:"")}function Ve(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Re(n,i?qe(e):ke(e,xe(n)),i)}function Ge(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),i=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function Ke(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function Ye(t,e,n){n=n.split("-")[0];var i=Ge(t),o={width:i.width,height:i.height},r=-1!==["right","left"].indexOf(n),s=r?"top":"left",a=r?"left":"top",l=r?"height":"width",u=r?"width":"height";return o[s]=e[s]+e[l]/2-i[l]/2,o[a]=n===a?e[a]-i[u]:e[Ke(a)],o}function Xe(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function Qe(t,e,n){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===n}));var i=Xe(t,(function(t){return t[e]===n}));return t.indexOf(i)}function Je(t,e,n){return(void 0===n?t:t.slice(0,Qe(t,"name",n))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&_e(n)&&(e.offsets.popper=Be(e.offsets.popper),e.offsets.reference=Be(e.offsets.reference),e=n(e,t))})),e}function tn(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=Ve(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=Ue(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=Ye(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=Je(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function en(t,e){return t.some((function(t){var n=t.name;return t.enabled&&n===e}))}function nn(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i<e.length;i++){var o=e[i],r=o?""+o+n:t;if(void 0!==document.body.style[r])return r}return null}function on(){return this.state.isDestroyed=!0,en(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[nn("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function rn(t){var e=t.ownerDocument;return e?e.defaultView:window}function sn(t,e,n,i){var o="BODY"===t.nodeName,r=o?t.ownerDocument.defaultView:t;r.addEventListener(e,n,{passive:!0}),o||sn(be(r.parentNode),e,n,i),i.push(r)}function an(t,e,n,i){n.updateBound=i,rn(t).addEventListener("resize",n.updateBound,{passive:!0});var o=be(t);return sn(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function ln(){this.state.eventsEnabled||(this.state=an(this.reference,this.options,this.state,this.scheduleUpdate))}function un(t,e){return rn(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach((function(t){t.removeEventListener("scroll",e.updateBound)})),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e}function cn(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=un(this.reference,this.state))}function hn(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function dn(t,e){Object.keys(e).forEach((function(n){var i="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&hn(e[n])&&(i="px"),t.style[n]=e[n]+i}))}function fn(t,e){Object.keys(e).forEach((function(n){!1!==e[n]?t.setAttribute(n,e[n]):t.removeAttribute(n)}))}function pn(t){return dn(t.instance.popper,t.styles),fn(t.instance.popper,t.attributes),t.arrowElement&&Object.keys(t.arrowStyles).length&&dn(t.arrowElement,t.arrowStyles),t}function mn(t,e,n,i,o){var r=Ve(o,e,t,n.positionFixed),s=Ue(n.placement,r,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",s),dn(e,{position:n.positionFixed?"fixed":"absolute"}),n}function gn(t,e){var n=t.offsets,i=n.popper,o=n.reference,r=Math.round,s=Math.floor,a=function(t){return t},l=r(o.width),u=r(i.width),c=-1!==["left","right"].indexOf(t.placement),h=-1!==t.placement.indexOf("-"),d=e?c||h||l%2==u%2?r:s:a,f=e?r:a;return{left:d(l%2==1&&u%2==1&&!h&&e?i.left-1:i.left),top:f(i.top),bottom:f(i.bottom),right:d(i.right)}}var _n=de&&/Firefox/i.test(navigator.userAgent);function vn(t,e){var n=e.x,i=e.y,o=t.offsets.popper,r=Xe(t.instance.modifiers,(function(t){return"applyStyle"===t.name})).gpuAcceleration;void 0!==r&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var s=void 0!==r?r:e.gpuAcceleration,a=Ee(t.instance.popper),l=je(a),u={position:o.position},c=gn(t,window.devicePixelRatio<2||!_n),h="bottom"===n?"top":"bottom",d="right"===i?"left":"right",f=nn("transform"),p=void 0,m=void 0;if(m="bottom"===h?"HTML"===a.nodeName?-a.clientHeight+c.bottom:-l.height+c.bottom:c.top,p="right"===d?"HTML"===a.nodeName?-a.clientWidth+c.right:-l.width+c.right:c.left,s&&f)u[f]="translate3d("+p+"px, "+m+"px, 0)",u[h]=0,u[d]=0,u.willChange="transform";else{var g="bottom"===h?-1:1,_="right"===d?-1:1;u[h]=m*g,u[d]=p*_,u.willChange=h+", "+d}var v={"x-placement":t.placement};return t.attributes=ze({},v,t.attributes),t.styles=ze({},u,t.styles),t.arrowStyles=ze({},t.offsets.arrow,t.arrowStyles),t}function yn(t,e,n){var i=Xe(t,(function(t){return t.name===e})),o=!!i&&t.some((function(t){return t.name===n&&t.enabled&&t.order<i.order}));if(!o){var r="`"+e+"`",s="`"+n+"`";console.warn(s+" modifier is required by "+r+" modifier in order to work, be sure to include it before "+r+"!")}return o}function bn(t,e){var n;if(!yn(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var o=t.placement.split("-")[0],r=t.offsets,s=r.popper,a=r.reference,l=-1!==["left","right"].indexOf(o),u=l?"height":"width",c=l?"Top":"Left",h=c.toLowerCase(),d=l?"left":"top",f=l?"bottom":"right",p=Ge(i)[u];a[f]-p<s[h]&&(t.offsets.popper[h]-=s[h]-(a[f]-p)),a[h]+p>s[f]&&(t.offsets.popper[h]+=a[h]+p-s[f]),t.offsets.popper=Be(t.offsets.popper);var m=a[h]+a[u]/2-p/2,g=ve(t.instance.popper),_=parseFloat(g["margin"+c]),v=parseFloat(g["border"+c+"Width"]),y=m-t.offsets.popper[h]-_-v;return y=Math.max(Math.min(s[u]-p,y),0),t.arrowElement=i,t.offsets.arrow=(Oe(n={},h,Math.round(y)),Oe(n,d,""),n),t}function xn(t){return"end"===t?"start":"start"===t?"end":t}var wn=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Tn=wn.slice(3);function Cn(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Tn.indexOf(t),i=Tn.slice(n+1).concat(Tn.slice(0,n));return e?i.reverse():i}var En={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function $n(t,e){if(en(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=Fe(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),i=t.placement.split("-")[0],o=Ke(i),r=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case En.FLIP:s=[i,o];break;case En.CLOCKWISE:s=Cn(i);break;case En.COUNTERCLOCKWISE:s=Cn(i,!0);break;default:s=e.behavior}return s.forEach((function(a,l){if(i!==a||s.length===l+1)return t;i=t.placement.split("-")[0],o=Ke(i);var u=t.offsets.popper,c=t.offsets.reference,h=Math.floor,d="left"===i&&h(u.right)>h(c.left)||"right"===i&&h(u.left)<h(c.right)||"top"===i&&h(u.bottom)>h(c.top)||"bottom"===i&&h(u.top)<h(c.bottom),f=h(u.left)<h(n.left),p=h(u.right)>h(n.right),m=h(u.top)<h(n.top),g=h(u.bottom)>h(n.bottom),_="left"===i&&f||"right"===i&&p||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),y=!!e.flipVariations&&(v&&"start"===r&&f||v&&"end"===r&&p||!v&&"start"===r&&m||!v&&"end"===r&&g),b=!!e.flipVariationsByContent&&(v&&"start"===r&&p||v&&"end"===r&&f||!v&&"start"===r&&g||!v&&"end"===r&&m),x=y||b;(d||_||x)&&(t.flipped=!0,(d||_)&&(i=s[l+1]),x&&(r=xn(r)),t.placement=i+(r?"-"+r:""),t.offsets.popper=ze({},t.offsets.popper,Ye(t.instance.popper,t.offsets.reference,t.placement)),t=Je(t.instance.modifiers,t,"flip"))})),t}function Ln(t){var e=t.offsets,n=e.popper,i=e.reference,o=t.placement.split("-")[0],r=Math.floor,s=-1!==["top","bottom"].indexOf(o),a=s?"right":"bottom",l=s?"left":"top",u=s?"width":"height";return n[a]<r(i[l])&&(t.offsets.popper[l]=r(i[l])-n[u]),n[l]>r(i[a])&&(t.offsets.popper[l]=r(i[a])),t}function kn(t,e,n,i){var o=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+o[1],s=o[2];if(!r)return t;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return Be(a)[e]/100*r}return"vh"===s||"vw"===s?("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*r:r}function Pn(t,e,n,i){var o=[0,0],r=-1!==["right","left"].indexOf(i),s=t.split(/(\+|\-)/).map((function(t){return t.trim()})),a=s.indexOf(Xe(s,(function(t){return-1!==t.search(/,|\s/)})));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(l)[0]]),[s[a].split(l)[1]].concat(s.slice(a+1))]:[s];return(u=u.map((function(t,i){var o=(1===i?!r:r)?"height":"width",s=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,s=!0,t):s?(t[t.length-1]+=e,s=!1,t):t.concat(e)}),[]).map((function(t){return kn(t,o,e,n)}))}))).forEach((function(t,e){t.forEach((function(n,i){hn(n)&&(o[e]+=n*("-"===t[i-1]?-1:1))}))})),o}function Sn(t,e){var n=e.offset,i=t.placement,o=t.offsets,r=o.popper,s=o.reference,a=i.split("-")[0],l=void 0;return l=hn(+n)?[+n,0]:Pn(n,r,s,a),"left"===a?(r.top+=l[0],r.left-=l[1]):"right"===a?(r.top+=l[0],r.left+=l[1]):"top"===a?(r.left+=l[0],r.top-=l[1]):"bottom"===a&&(r.left+=l[0],r.top+=l[1]),t.popper=r,t}function Mn(t,e){var n=e.boundariesElement||Ee(t.instance.popper);t.instance.reference===n&&(n=Ee(n));var i=nn("transform"),o=t.instance.popper.style,r=o.top,s=o.left,a=o[i];o.top="",o.left="",o[i]="";var l=Fe(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);o.top=r,o.left=s,o[i]=a,e.boundaries=l;var u=e.priority,c=t.offsets.popper,h={primary:function(t){var n=c[t];return c[t]<l[t]&&!e.escapeWithReference&&(n=Math.max(c[t],l[t])),Oe({},t,n)},secondary:function(t){var n="right"===t?"left":"top",i=c[n];return c[t]>l[t]&&!e.escapeWithReference&&(i=Math.min(c[n],l[t]-("right"===t?c.width:c.height))),Oe({},n,i)}};return u.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";c=ze({},c,h[e](t))})),t.offsets.popper=c,t}function An(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var o=t.offsets,r=o.reference,s=o.popper,a=-1!==["bottom","top"].indexOf(n),l=a?"left":"top",u=a?"width":"height",c={start:Oe({},l,r[l]),end:Oe({},l,r[l]+r[u]-s[u])};t.offsets.popper=ze({},s,c[i])}return t}function Nn(t){if(!yn(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=Xe(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}function Dn(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,o=i.popper,r=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return o[s?"left":"top"]=r[n]-(a?o[s?"width":"height"]:0),t.placement=Ke(e),t.offsets.popper=Be(o),t}var In={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:An},offset:{order:200,enabled:!0,fn:Sn,offset:0},preventOverflow:{order:300,enabled:!0,fn:Mn,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:Ln},arrow:{order:500,enabled:!0,fn:bn,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:$n,behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:Dn},hide:{order:800,enabled:!0,fn:Nn},computeStyle:{order:850,enabled:!0,fn:vn,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:pn,onLoad:mn,gpuAcceleration:void 0}}},On=function(){function t(e,n){var i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};De(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=ge(this.update.bind(this)),this.options=ze({},t.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(ze({},t.Defaults.modifiers,o.modifiers)).forEach((function(e){i.options.modifiers[e]=ze({},t.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return ze({name:t},i.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&_e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)})),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return Ie(t,[{key:"update",value:function(){return tn.call(this)}},{key:"destroy",value:function(){return on.call(this)}},{key:"enableEventListeners",value:function(){return ln.call(this)}},{key:"disableEventListeners",value:function(){return cn.call(this)}}]),t}();On.Utils=("undefined"!=typeof window?window:rt).PopperUtils,On.placements=wn,On.Defaults=In;var zn="dropdown",Bn="4.6.0",jn="bs.dropdown",Rn="."+jn,Zn=".data-api",Hn=i.default.fn[zn],qn=27,Fn=32,Wn=9,Un=38,Vn=40,Gn=3,Kn=new RegExp(Un+"|"+Vn+"|"+qn),Yn="hide"+Rn,Xn="hidden"+Rn,Qn="show"+Rn,Jn="shown"+Rn,ti="click"+Rn,ei="click"+Rn+Zn,ni="keydown"+Rn+Zn,ii="keyup"+Rn+Zn,oi="disabled",ri="show",si="dropup",ai="dropright",li="dropleft",ui="dropdown-menu-right",ci="position-static",hi='[data-toggle="dropdown"]',di=".dropdown form",fi=".dropdown-menu",pi=".navbar-nav",mi=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",gi="top-start",_i="top-end",vi="bottom-start",yi="bottom-end",bi="right-start",xi="left-start",wi={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},Ti={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},Ci=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var e=t.prototype;return e.toggle=function(){if(!this._element.disabled&&!i.default(this._element).hasClass(oi)){var e=i.default(this._menu).hasClass(ri);t._clearMenus(),e||this.show(!0)}},e.show=function(e){if(void 0===e&&(e=!1),!(this._element.disabled||i.default(this._element).hasClass(oi)||i.default(this._menu).hasClass(ri))){var n={relatedTarget:this._element},o=i.default.Event(Qn,n),r=t._getParentFromElement(this._element);if(i.default(r).trigger(o),!o.isDefaultPrevented()){if(!this._inNavbar&&e){if(void 0===On)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");var s=this._element;"parent"===this._config.reference?s=r:m.isElement(this._config.reference)&&(s=this._config.reference,void 0!==this._config.reference.jquery&&(s=this._config.reference[0])),"scrollParent"!==this._config.boundary&&i.default(r).addClass(ci),this._popper=new On(s,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===i.default(r).closest(pi).length&&i.default(document.body).children().on("mouseover",null,i.default.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),i.default(this._menu).toggleClass(ri),i.default(r).toggleClass(ri).trigger(i.default.Event(Jn,n))}}},e.hide=function(){if(!this._element.disabled&&!i.default(this._element).hasClass(oi)&&i.default(this._menu).hasClass(ri)){var e={relatedTarget:this._element},n=i.default.Event(Yn,e),o=t._getParentFromElement(this._element);i.default(o).trigger(n),n.isDefaultPrevented()||(this._popper&&this._popper.destroy(),i.default(this._menu).toggleClass(ri),i.default(o).toggleClass(ri).trigger(i.default.Event(Xn,e)))}},e.dispose=function(){i.default.removeData(this._element,jn),i.default(this._element).off(Rn),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},e.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},e._addEventListeners=function(){var t=this;i.default(this._element).on(ti,(function(e){e.preventDefault(),e.stopPropagation(),t.toggle()}))},e._getConfig=function(t){return t=s({},this.constructor.Default,i.default(this._element).data(),t),m.typeCheckConfig(zn,t,this.constructor.DefaultType),t},e._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(fi))}return this._menu},e._getPlacement=function(){var t=i.default(this._element.parentNode),e=vi;return t.hasClass(si)?e=i.default(this._menu).hasClass(ui)?_i:gi:t.hasClass(ai)?e=bi:t.hasClass(li)?e=xi:i.default(this._menu).hasClass(ui)&&(e=yi),e},e._detectNavbar=function(){return i.default(this._element).closest(".navbar").length>0},e._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=s({},e.offsets,t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},e._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),s({},t,this._config.popperConfig)},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this).data(jn);if(n||(n=new t(this,"object"==typeof e?e:null),i.default(this).data(jn,n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},t._clearMenus=function(e){if(!e||e.which!==Gn&&("keyup"!==e.type||e.which===Wn))for(var n=[].slice.call(document.querySelectorAll(hi)),o=0,r=n.length;o<r;o++){var s=t._getParentFromElement(n[o]),a=i.default(n[o]).data(jn),l={relatedTarget:n[o]};if(e&&"click"===e.type&&(l.clickEvent=e),a){var u=a._menu;if(i.default(s).hasClass(ri)&&!(e&&("click"===e.type&&/input|textarea/i.test(e.target.tagName)||"keyup"===e.type&&e.which===Wn)&&i.default.contains(s,e.target))){var c=i.default.Event(Yn,l);i.default(s).trigger(c),c.isDefaultPrevented()||("ontouchstart"in document.documentElement&&i.default(document.body).children().off("mouseover",null,i.default.noop),n[o].setAttribute("aria-expanded","false"),a._popper&&a._popper.destroy(),i.default(u).removeClass(ri),i.default(s).removeClass(ri).trigger(i.default.Event(Xn,l)))}}}},t._getParentFromElement=function(t){var e,n=m.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},t._dataApiKeydownHandler=function(e){if(!(/input|textarea/i.test(e.target.tagName)?e.which===Fn||e.which!==qn&&(e.which!==Vn&&e.which!==Un||i.default(e.target).closest(fi).length):!Kn.test(e.which))&&!this.disabled&&!i.default(this).hasClass(oi)){var n=t._getParentFromElement(this),o=i.default(n).hasClass(ri);if(o||e.which!==qn){if(e.preventDefault(),e.stopPropagation(),!o||e.which===qn||e.which===Fn)return e.which===qn&&i.default(n.querySelector(hi)).trigger("focus"),void i.default(this).trigger("click");var r=[].slice.call(n.querySelectorAll(mi)).filter((function(t){return i.default(t).is(":visible")}));if(0!==r.length){var s=r.indexOf(e.target);e.which===Un&&s>0&&s--,e.which===Vn&&s<r.length-1&&s++,s<0&&(s=0),r[s].focus()}}}},r(t,null,[{key:"VERSION",get:function(){return Bn}},{key:"Default",get:function(){return wi}},{key:"DefaultType",get:function(){return Ti}}]),t}();i.default(document).on(ni,hi,Ci._dataApiKeydownHandler).on(ni,fi,Ci._dataApiKeydownHandler).on(ei+" "+ii,Ci._clearMenus).on(ei,hi,(function(t){t.preventDefault(),t.stopPropagation(),Ci._jQueryInterface.call(i.default(this),"toggle")})).on(ei,di,(function(t){t.stopPropagation()})),i.default.fn[zn]=Ci._jQueryInterface,i.default.fn[zn].Constructor=Ci,i.default.fn[zn].noConflict=function(){return i.default.fn[zn]=Hn,Ci._jQueryInterface};var Ei="modal",$i="4.6.0",Li="bs.modal",ki="."+Li,Pi=".data-api",Si=i.default.fn[Ei],Mi=27,Ai={backdrop:!0,keyboard:!0,focus:!0,show:!0},Ni={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},Di="hide"+ki,Ii="hidePrevented"+ki,Oi="hidden"+ki,zi="show"+ki,Bi="shown"+ki,ji="focusin"+ki,Ri="resize"+ki,Zi="click.dismiss"+ki,Hi="keydown.dismiss"+ki,qi="mouseup.dismiss"+ki,Fi="mousedown.dismiss"+ki,Wi="click"+ki+Pi,Ui="modal-dialog-scrollable",Vi="modal-scrollbar-measure",Gi="modal-backdrop",Ki="modal-open",Yi="fade",Xi="show",Qi="modal-static",Ji=".modal-dialog",to=".modal-body",eo='[data-toggle="modal"]',no='[data-dismiss="modal"]',io=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",oo=".sticky-top",ro=function(){function t(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(Ji),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var e=t.prototype;return e.toggle=function(t){return this._isShown?this.hide():this.show(t)},e.show=function(t){var e=this;if(!this._isShown&&!this._isTransitioning){i.default(this._element).hasClass(Yi)&&(this._isTransitioning=!0);var n=i.default.Event(zi,{relatedTarget:t});i.default(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),i.default(this._element).on(Zi,no,(function(t){return e.hide(t)})),i.default(this._dialog).on(Fi,(function(){i.default(e._element).one(qi,(function(t){i.default(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)}))})),this._showBackdrop((function(){return e._showElement(t)})))}},e.hide=function(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=i.default.Event(Di);if(i.default(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var o=i.default(this._element).hasClass(Yi);if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),i.default(document).off(ji),i.default(this._element).removeClass(Xi),i.default(this._element).off(Zi),i.default(this._dialog).off(Fi),o){var r=m.getTransitionDurationFromElement(this._element);i.default(this._element).one(m.TRANSITION_END,(function(t){return e._hideModal(t)})).emulateTransitionEnd(r)}else this._hideModal()}}},e.dispose=function(){[window,this._element,this._dialog].forEach((function(t){return i.default(t).off(ki)})),i.default(document).off(ji),i.default.removeData(this._element,Li),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},e.handleUpdate=function(){this._adjustDialog()},e._getConfig=function(t){return t=s({},Ai,t),m.typeCheckConfig(Ei,t,Ni),t},e._triggerBackdropTransition=function(){var t=this,e=i.default.Event(Ii);if(i.default(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._element.scrollHeight>document.documentElement.clientHeight;n||(this._element.style.overflowY="hidden"),this._element.classList.add(Qi);var o=m.getTransitionDurationFromElement(this._dialog);i.default(this._element).off(m.TRANSITION_END),i.default(this._element).one(m.TRANSITION_END,(function(){t._element.classList.remove(Qi),n||i.default(t._element).one(m.TRANSITION_END,(function(){t._element.style.overflowY=""})).emulateTransitionEnd(t._element,o)})).emulateTransitionEnd(o),this._element.focus()}},e._showElement=function(t){var e=this,n=i.default(this._element).hasClass(Yi),o=this._dialog?this._dialog.querySelector(to):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),i.default(this._dialog).hasClass(Ui)&&o?o.scrollTop=0:this._element.scrollTop=0,n&&m.reflow(this._element),i.default(this._element).addClass(Xi),this._config.focus&&this._enforceFocus();var r=i.default.Event(Bi,{relatedTarget:t}),s=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,i.default(e._element).trigger(r)};if(n){var a=m.getTransitionDurationFromElement(this._dialog);i.default(this._dialog).one(m.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},e._enforceFocus=function(){var t=this;i.default(document).off(ji).on(ji,(function(e){document!==e.target&&t._element!==e.target&&0===i.default(t._element).has(e.target).length&&t._element.focus()}))},e._setEscapeEvent=function(){var t=this;this._isShown?i.default(this._element).on(Hi,(function(e){t._config.keyboard&&e.which===Mi?(e.preventDefault(),t.hide()):t._config.keyboard||e.which!==Mi||t._triggerBackdropTransition()})):this._isShown||i.default(this._element).off(Hi)},e._setResizeEvent=function(){var t=this;this._isShown?i.default(window).on(Ri,(function(e){return t.handleUpdate(e)})):i.default(window).off(Ri)},e._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop((function(){i.default(document.body).removeClass(Ki),t._resetAdjustments(),t._resetScrollbar(),i.default(t._element).trigger(Oi)}))},e._removeBackdrop=function(){this._backdrop&&(i.default(this._backdrop).remove(),this._backdrop=null)},e._showBackdrop=function(t){var e=this,n=i.default(this._element).hasClass(Yi)?Yi:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=Gi,n&&this._backdrop.classList.add(n),i.default(this._backdrop).appendTo(document.body),i.default(this._element).on(Zi,(function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._triggerBackdropTransition():e.hide())})),n&&m.reflow(this._backdrop),i.default(this._backdrop).addClass(Xi),!t)return;if(!n)return void t();var o=m.getTransitionDurationFromElement(this._backdrop);i.default(this._backdrop).one(m.TRANSITION_END,t).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){i.default(this._backdrop).removeClass(Xi);var r=function(){e._removeBackdrop(),t&&t()};if(i.default(this._element).hasClass(Yi)){var s=m.getTransitionDurationFromElement(this._backdrop);i.default(this._backdrop).one(m.TRANSITION_END,r).emulateTransitionEnd(s)}else r()}else t&&t()},e._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},e._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},e._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},e._setScrollbar=function(){var t=this;if(this._isBodyOverflowing){var e=[].slice.call(document.querySelectorAll(io)),n=[].slice.call(document.querySelectorAll(oo));i.default(e).each((function(e,n){var o=n.style.paddingRight,r=i.default(n).css("padding-right");i.default(n).data("padding-right",o).css("padding-right",parseFloat(r)+t._scrollbarWidth+"px")})),i.default(n).each((function(e,n){var o=n.style.marginRight,r=i.default(n).css("margin-right");i.default(n).data("margin-right",o).css("margin-right",parseFloat(r)-t._scrollbarWidth+"px")}));var o=document.body.style.paddingRight,r=i.default(document.body).css("padding-right");i.default(document.body).data("padding-right",o).css("padding-right",parseFloat(r)+this._scrollbarWidth+"px")}i.default(document.body).addClass(Ki)},e._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(io));i.default(t).each((function(t,e){var n=i.default(e).data("padding-right");i.default(e).removeData("padding-right"),e.style.paddingRight=n||""}));var e=[].slice.call(document.querySelectorAll(""+oo));i.default(e).each((function(t,e){var n=i.default(e).data("margin-right");void 0!==n&&i.default(e).css("margin-right",n).removeData("margin-right")}));var n=i.default(document.body).data("padding-right");i.default(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},e._getScrollbarWidth=function(){var t=document.createElement("div");t.className=Vi,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},t._jQueryInterface=function(e,n){return this.each((function(){var o=i.default(this).data(Li),r=s({},Ai,i.default(this).data(),"object"==typeof e&&e?e:{});if(o||(o=new t(this,r),i.default(this).data(Li,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e](n)}else r.show&&o.show(n)}))},r(t,null,[{key:"VERSION",get:function(){return $i}},{key:"Default",get:function(){return Ai}}]),t}();i.default(document).on(Wi,eo,(function(t){var e,n=this,o=m.getSelectorFromElement(this);o&&(e=document.querySelector(o));var r=i.default(e).data(Li)?"toggle":s({},i.default(e).data(),i.default(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var a=i.default(e).one(zi,(function(t){t.isDefaultPrevented()||a.one(Oi,(function(){i.default(n).is(":visible")&&n.focus()}))}));ro._jQueryInterface.call(i.default(e),r,this)})),i.default.fn[Ei]=ro._jQueryInterface,i.default.fn[Ei].Constructor=ro,i.default.fn[Ei].noConflict=function(){return i.default.fn[Ei]=Si,ro._jQueryInterface};var so=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],ao={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},lo=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi,uo=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;function co(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===so.indexOf(n)||Boolean(t.nodeValue.match(lo)||t.nodeValue.match(uo));for(var i=e.filter((function(t){return t instanceof RegExp})),o=0,r=i.length;o<r;o++)if(n.match(i[o]))return!0;return!1}function ho(t,e,n){if(0===t.length)return t;if(n&&"function"==typeof n)return n(t);for(var i=(new window.DOMParser).parseFromString(t,"text/html"),o=Object.keys(e),r=[].slice.call(i.body.querySelectorAll("*")),s=function(t,n){var i=r[t],s=i.nodeName.toLowerCase();if(-1===o.indexOf(i.nodeName.toLowerCase()))return i.parentNode.removeChild(i),"continue";var a=[].slice.call(i.attributes),l=[].concat(e["*"]||[],e[s]||[]);a.forEach((function(t){co(t,l)||i.removeAttribute(t.nodeName)}))},a=0,l=r.length;a<l;a++)s(a);return i.body.innerHTML}var fo="tooltip",po="4.6.0",mo="bs.tooltip",go="."+mo,_o=i.default.fn[fo],vo="bs-tooltip",yo=new RegExp("(^|\\s)"+vo+"\\S+","g"),bo=["sanitize","whiteList","sanitizeFn"],xo={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},wo={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},To={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",customClass:"",sanitize:!0,sanitizeFn:null,whiteList:ao,popperConfig:null},Co="show",Eo="out",$o={HIDE:"hide"+go,HIDDEN:"hidden"+go,SHOW:"show"+go,SHOWN:"shown"+go,INSERTED:"inserted"+go,CLICK:"click"+go,FOCUSIN:"focusin"+go,FOCUSOUT:"focusout"+go,MOUSEENTER:"mouseenter"+go,MOUSELEAVE:"mouseleave"+go},Lo="fade",ko="show",Po=".tooltip-inner",So=".arrow",Mo="hover",Ao="focus",No="click",Do="manual",Io=function(){function t(t,e){if(void 0===On)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var e=t.prototype;return e.enable=function(){this._isEnabled=!0},e.disable=function(){this._isEnabled=!1},e.toggleEnabled=function(){this._isEnabled=!this._isEnabled},e.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=i.default(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(i.default(this.getTipElement()).hasClass(ko))return void this._leave(null,this);this._enter(null,this)}},e.dispose=function(){clearTimeout(this._timeout),i.default.removeData(this.element,this.constructor.DATA_KEY),i.default(this.element).off(this.constructor.EVENT_KEY),i.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&i.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},e.show=function(){var t=this;if("none"===i.default(this.element).css("display"))throw new Error("Please use show on visible elements");var e=i.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){i.default(this.element).trigger(e);var n=m.findShadowRoot(this.element),o=i.default.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(e.isDefaultPrevented()||!o)return;var r=this.getTipElement(),s=m.getUID(this.constructor.NAME);r.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&i.default(r).addClass(Lo);var a="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,l=this._getAttachment(a);this.addAttachmentClass(l);var u=this._getContainer();i.default(r).data(this.constructor.DATA_KEY,this),i.default.contains(this.element.ownerDocument.documentElement,this.tip)||i.default(r).appendTo(u),i.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new On(this.element,r,this._getPopperConfig(l)),i.default(r).addClass(ko),i.default(r).addClass(this.config.customClass),"ontouchstart"in document.documentElement&&i.default(document.body).children().on("mouseover",null,i.default.noop);var c=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,i.default(t.element).trigger(t.constructor.Event.SHOWN),e===Eo&&t._leave(null,t)};if(i.default(this.tip).hasClass(Lo)){var h=m.getTransitionDurationFromElement(this.tip);i.default(this.tip).one(m.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},e.hide=function(t){var e=this,n=this.getTipElement(),o=i.default.Event(this.constructor.Event.HIDE),r=function(){e._hoverState!==Co&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),i.default(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(i.default(this.element).trigger(o),!o.isDefaultPrevented()){if(i.default(n).removeClass(ko),"ontouchstart"in document.documentElement&&i.default(document.body).children().off("mouseover",null,i.default.noop),this._activeTrigger[No]=!1,this._activeTrigger[Ao]=!1,this._activeTrigger[Mo]=!1,i.default(this.tip).hasClass(Lo)){var s=m.getTransitionDurationFromElement(n);i.default(n).one(m.TRANSITION_END,r).emulateTransitionEnd(s)}else r();this._hoverState=""}},e.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},e.isWithContent=function(){return Boolean(this.getTitle())},e.addAttachmentClass=function(t){i.default(this.getTipElement()).addClass(vo+"-"+t)},e.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},e.setContent=function(){var t=this.getTipElement();this.setElementContent(i.default(t.querySelectorAll(Po)),this.getTitle()),i.default(t).removeClass(Lo+" "+ko)},e.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=ho(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?i.default(e).parent().is(t)||t.empty().append(e):t.text(i.default(e).text())},e.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},e._getPopperConfig=function(t){var e=this;return s({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:So},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}},this.config.popperConfig)},e._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=s({},e.offsets,t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},e._getContainer=function(){return!1===this.config.container?document.body:m.isElement(this.config.container)?i.default(this.config.container):i.default(document).find(this.config.container)},e._getAttachment=function(t){return wo[t.toUpperCase()]},e._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(e){if("click"===e)i.default(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if(e!==Do){var n=e===Mo?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o=e===Mo?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;i.default(t.element).on(n,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},i.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=s({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},e._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},e._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||i.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Ao:Mo]=!0),i.default(e.getTipElement()).hasClass(ko)||e._hoverState===Co?e._hoverState=Co:(clearTimeout(e._timeout),e._hoverState=Co,e.config.delay&&e.config.delay.show?e._timeout=setTimeout((function(){e._hoverState===Co&&e.show()}),e.config.delay.show):e.show())},e._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||i.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Ao:Mo]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=Eo,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout((function(){e._hoverState===Eo&&e.hide()}),e.config.delay.hide):e.hide())},e._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},e._getConfig=function(t){var e=i.default(this.element).data();return Object.keys(e).forEach((function(t){-1!==bo.indexOf(t)&&delete e[t]})),"number"==typeof(t=s({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),m.typeCheckConfig(fo,t,this.constructor.DefaultType),t.sanitize&&(t.template=ho(t.template,t.whiteList,t.sanitizeFn)),t},e._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},e._cleanTipClass=function(){var t=i.default(this.getTipElement()),e=t.attr("class").match(yo);null!==e&&e.length&&t.removeClass(e.join(""))},e._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},e._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(i.default(t).removeClass(Lo),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(mo),r="object"==typeof e&&e;if((o||!/dispose|hide/.test(e))&&(o||(o=new t(this,r),n.data(mo,o)),"string"==typeof e)){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}}))},r(t,null,[{key:"VERSION",get:function(){return po}},{key:"Default",get:function(){return To}},{key:"NAME",get:function(){return fo}},{key:"DATA_KEY",get:function(){return mo}},{key:"Event",get:function(){return $o}},{key:"EVENT_KEY",get:function(){return go}},{key:"DefaultType",get:function(){return xo}}]),t}();i.default.fn[fo]=Io._jQueryInterface,i.default.fn[fo].Constructor=Io,i.default.fn[fo].noConflict=function(){return i.default.fn[fo]=_o,Io._jQueryInterface};var Oo="popover",zo="4.6.0",Bo="bs.popover",jo="."+Bo,Ro=i.default.fn[Oo],Zo="bs-popover",Ho=new RegExp("(^|\\s)"+Zo+"\\S+","g"),qo=s({},Io.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),Fo=s({},Io.DefaultType,{content:"(string|element|function)"}),Wo="fade",Uo="show",Vo=".popover-header",Go=".popover-body",Ko={HIDE:"hide"+jo,HIDDEN:"hidden"+jo,SHOW:"show"+jo,SHOWN:"shown"+jo,INSERTED:"inserted"+jo,CLICK:"click"+jo,FOCUSIN:"focusin"+jo,FOCUSOUT:"focusout"+jo,MOUSEENTER:"mouseenter"+jo,MOUSELEAVE:"mouseleave"+jo},Yo=function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var n=e.prototype;return n.isWithContent=function(){return this.getTitle()||this._getContent()},n.addAttachmentClass=function(t){i.default(this.getTipElement()).addClass(Zo+"-"+t)},n.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},n.setContent=function(){var t=i.default(this.getTipElement());this.setElementContent(t.find(Vo),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(Go),e),t.removeClass(Wo+" "+Uo)},n._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},n._cleanTipClass=function(){var t=i.default(this.getTipElement()),e=t.attr("class").match(Ho);null!==e&&e.length>0&&t.removeClass(e.join(""))},e._jQueryInterface=function(t){return this.each((function(){var n=i.default(this).data(Bo),o="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new e(this,o),i.default(this).data(Bo,n)),"string"==typeof t)){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},r(e,null,[{key:"VERSION",get:function(){return zo}},{key:"Default",get:function(){return qo}},{key:"NAME",get:function(){return Oo}},{key:"DATA_KEY",get:function(){return Bo}},{key:"Event",get:function(){return Ko}},{key:"EVENT_KEY",get:function(){return jo}},{key:"DefaultType",get:function(){return Fo}}]),e}(Io);i.default.fn[Oo]=Yo._jQueryInterface,i.default.fn[Oo].Constructor=Yo,i.default.fn[Oo].noConflict=function(){return i.default.fn[Oo]=Ro,Yo._jQueryInterface};var Xo="scrollspy",Qo="4.6.0",Jo="bs.scrollspy",tr="."+Jo,er=".data-api",nr=i.default.fn[Xo],ir={offset:10,method:"auto",target:""},or={offset:"number",method:"string",target:"(string|element)"},rr="activate"+tr,sr="scroll"+tr,ar="load"+tr+er,lr="dropdown-item",ur="active",cr='[data-spy="scroll"]',hr=".nav, .list-group",dr=".nav-link",fr=".nav-item",pr=".list-group-item",mr=".dropdown",gr=".dropdown-item",_r=".dropdown-toggle",vr="offset",yr="position",br=function(){function t(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+dr+","+this._config.target+" "+pr+","+this._config.target+" "+gr,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,i.default(this._scrollElement).on(sr,(function(t){return n._process(t)})),this.refresh(),this._process()}var e=t.prototype;return e.refresh=function(){var t=this,e=this._scrollElement===this._scrollElement.window?vr:yr,n="auto"===this._config.method?e:this._config.method,o=n===yr?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var e,r=m.getSelectorFromElement(t);if(r&&(e=document.querySelector(r)),e){var s=e.getBoundingClientRect();if(s.width||s.height)return[i.default(e)[n]().top+o,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},e.dispose=function(){i.default.removeData(this._element,Jo),i.default(this._scrollElement).off(tr),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},e._getConfig=function(t){if("string"!=typeof(t=s({},ir,"object"==typeof t&&t?t:{})).target&&m.isElement(t.target)){var e=i.default(t.target).attr("id");e||(e=m.getUID(Xo),i.default(t.target).attr("id",e)),t.target="#"+e}return m.typeCheckConfig(Xo,t,or),t},e._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},e._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},e._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},e._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}},e._activate=function(t){this._activeTarget=t,this._clear();var e=this._selector.split(",").map((function(e){return e+'[data-target="'+t+'"],'+e+'[href="'+t+'"]'})),n=i.default([].slice.call(document.querySelectorAll(e.join(","))));n.hasClass(lr)?(n.closest(mr).find(_r).addClass(ur),n.addClass(ur)):(n.addClass(ur),n.parents(hr).prev(dr+", "+pr).addClass(ur),n.parents(hr).prev(fr).children(dr).addClass(ur)),i.default(this._scrollElement).trigger(rr,{relatedTarget:t})},e._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter((function(t){return t.classList.contains(ur)})).forEach((function(t){return t.classList.remove(ur)}))},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this).data(Jo);if(n||(n=new t(this,"object"==typeof e&&e),i.default(this).data(Jo,n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},r(t,null,[{key:"VERSION",get:function(){return Qo}},{key:"Default",get:function(){return ir}}]),t}();i.default(window).on(ar,(function(){for(var t=[].slice.call(document.querySelectorAll(cr)),e=t.length;e--;){var n=i.default(t[e]);br._jQueryInterface.call(n,n.data())}})),i.default.fn[Xo]=br._jQueryInterface,i.default.fn[Xo].Constructor=br,i.default.fn[Xo].noConflict=function(){return i.default.fn[Xo]=nr,br._jQueryInterface};var xr="tab",wr="4.6.0",Tr="bs.tab",Cr="."+Tr,Er=".data-api",$r=i.default.fn[xr],Lr="hide"+Cr,kr="hidden"+Cr,Pr="show"+Cr,Sr="shown"+Cr,Mr="click"+Cr+Er,Ar="dropdown-menu",Nr="active",Dr="disabled",Ir="fade",Or="show",zr=".dropdown",Br=".nav, .list-group",jr=".active",Rr="> li > .active",Zr='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',Hr=".dropdown-toggle",qr="> .dropdown-menu .active",Fr=function(){function t(t){this._element=t}var e=t.prototype;return e.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&i.default(this._element).hasClass(Nr)||i.default(this._element).hasClass(Dr))){var e,n,o=i.default(this._element).closest(Br)[0],r=m.getSelectorFromElement(this._element);if(o){var s="UL"===o.nodeName||"OL"===o.nodeName?Rr:jr;n=(n=i.default.makeArray(i.default(o).find(s)))[n.length-1]}var a=i.default.Event(Lr,{relatedTarget:this._element}),l=i.default.Event(Pr,{relatedTarget:n});if(n&&i.default(n).trigger(a),i.default(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){r&&(e=document.querySelector(r)),this._activate(this._element,o);var u=function(){var e=i.default.Event(kr,{relatedTarget:t._element}),o=i.default.Event(Sr,{relatedTarget:n});i.default(n).trigger(e),i.default(t._element).trigger(o)};e?this._activate(e,e.parentNode,u):u()}}},e.dispose=function(){i.default.removeData(this._element,Tr),this._element=null},e._activate=function(t,e,n){var o=this,r=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?i.default(e).children(jr):i.default(e).find(Rr))[0],s=n&&r&&i.default(r).hasClass(Ir),a=function(){return o._transitionComplete(t,r,n)};if(r&&s){var l=m.getTransitionDurationFromElement(r);i.default(r).removeClass(Or).one(m.TRANSITION_END,a).emulateTransitionEnd(l)}else a()},e._transitionComplete=function(t,e,n){if(e){i.default(e).removeClass(Nr);var o=i.default(e.parentNode).find(qr)[0];o&&i.default(o).removeClass(Nr),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(i.default(t).addClass(Nr),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),m.reflow(t),t.classList.contains(Ir)&&t.classList.add(Or),t.parentNode&&i.default(t.parentNode).hasClass(Ar)){var r=i.default(t).closest(zr)[0];if(r){var s=[].slice.call(r.querySelectorAll(Hr));i.default(s).addClass(Nr)}t.setAttribute("aria-expanded",!0)}n&&n()},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(Tr);if(o||(o=new t(this),n.data(Tr,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}}))},r(t,null,[{key:"VERSION",get:function(){return wr}}]),t}();i.default(document).on(Mr,Zr,(function(t){t.preventDefault(),Fr._jQueryInterface.call(i.default(this),"show")})),i.default.fn[xr]=Fr._jQueryInterface,i.default.fn[xr].Constructor=Fr,i.default.fn[xr].noConflict=function(){return i.default.fn[xr]=$r,Fr._jQueryInterface};var Wr="toast",Ur="4.6.0",Vr="bs.toast",Gr="."+Vr,Kr=i.default.fn[Wr],Yr="click.dismiss"+Gr,Xr="hide"+Gr,Qr="hidden"+Gr,Jr="show"+Gr,ts="shown"+Gr,es="fade",ns="hide",is="show",os="showing",rs={animation:"boolean",autohide:"boolean",delay:"number"},ss={animation:!0,autohide:!0,delay:500},as='[data-dismiss="toast"]',ls=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var e=t.prototype;return e.show=function(){var t=this,e=i.default.Event(Jr);if(i.default(this._element).trigger(e),!e.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add(es);var n=function(){t._element.classList.remove(os),t._element.classList.add(is),i.default(t._element).trigger(ts),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove(ns),m.reflow(this._element),this._element.classList.add(os),this._config.animation){var o=m.getTransitionDurationFromElement(this._element);i.default(this._element).one(m.TRANSITION_END,n).emulateTransitionEnd(o)}else n()}},e.hide=function(){if(this._element.classList.contains(is)){var t=i.default.Event(Xr);i.default(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},e.dispose=function(){this._clearTimeout(),this._element.classList.contains(is)&&this._element.classList.remove(is),i.default(this._element).off(Yr),i.default.removeData(this._element,Vr),this._element=null,this._config=null},e._getConfig=function(t){return t=s({},ss,i.default(this._element).data(),"object"==typeof t&&t?t:{}),m.typeCheckConfig(Wr,t,this.constructor.DefaultType),t},e._setListeners=function(){var t=this;i.default(this._element).on(Yr,as,(function(){return t.hide()}))},e._close=function(){var t=this,e=function(){t._element.classList.add(ns),i.default(t._element).trigger(Qr)};if(this._element.classList.remove(is),this._config.animation){var n=m.getTransitionDurationFromElement(this._element);i.default(this._element).one(m.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},e._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(Vr);if(o||(o=new t(this,"object"==typeof e&&e),n.data(Vr,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e](this)}}))},r(t,null,[{key:"VERSION",get:function(){return Ur}},{key:"DefaultType",get:function(){return rs}},{key:"Default",get:function(){return ss}}]),t}();i.default.fn[Wr]=ls._jQueryInterface,i.default.fn[Wr].Constructor=ls,i.default.fn[Wr].noConflict=function(){return i.default.fn[Wr]=Kr,ls._jQueryInterface},t.Alert=P,t.Button=K,t.Carousel=qt,t.Collapse=he,t.Dropdown=Ci,t.Modal=ro,t.Popover=Yo,t.Scrollspy=br,t.Tab=Fr,t.Toast=ls,t.Tooltip=Io,t.Util=m,Object.defineProperty(t,"__esModule",{value:!0})}(e,at)}));const lt=[];function ut(e,n=t){let i;const o=[];function r(t){if(s(e,t)&&(e=t,i)){const t=!lt.length;for(let t=0;t<o.length;t+=1){const n=o[t];n[1](),lt.push(n,e)}if(t){for(let t=0;t<lt.length;t+=2)lt[t][0](lt[t+1]);lt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,a=t){const l=[s,a];return o.push(l),1===o.length&&(i=n(r)||t),s(e),()=>{const t=o.indexOf(l);-1!==t&&o.splice(t,1),0===o.length&&(i(),i=null)}}}}const ct=ut(),ht=ut(),dt=ut(),ft=ut(),pt=ut(),mt=["search","reverse","details","deletable","polygons","status","about"];function gt(t,e){if(void 0===t)t=window.location.pathname.replace(".html","").replace(/^.*\//,""),mt.includes(t)||(t="search"),e=new URLSearchParams(window.location.search);else{void 0===e&&(e=new URLSearchParams);let n=e.toString();n&&(n="?"+n);let i=t+".html"+n;window.location.protocol.match(/^http/)?window.history.pushState([],"",i):window.location.href=i}pt.set({tab:t,params:e}),dt.set(null),ft.set(null)}function _t(e){let n;return{c(){n=_("footer"),n.innerHTML='<p class="disclaimer svelte-1f2bd8l">Addresses and postcodes are approximate</p> \n <p class="copyright svelte-1f2bd8l">© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors</p>',C(n,"class","svelte-1f2bd8l")},m(t,e){p(t,n,e)},p:t,i:t,o:t,d(t){t&&m(n)}}}class vt extends ot{constructor(t){super(),it(this,t,null,_t,s,{})}}function yt(t){var e=document.getElementById("loading");e&&(e.style.display="start"===t?"block":null)}async function bt(t,e,n){var i=function(t,e){return Nominatim_Config.Nominatim_API_Endpoint+t+".php?"+Object.keys(function(t){for(var e=Object.keys(t),n=0;n<e.length;n+=1){var i=t[e[n]];void 0!==i&&""!==i&&null!==i||delete t[e[n]]}return t}(e)).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}(t,e);yt("start"),"status"!==t&&dt.set(null);try{await fetch(i).then((t=>t.json())).then((t=>{t.error&&ft.set(t.error.message),n(t),yt("finish")}))}catch(t){ft.set(`Error fetching data from ${i} (${t})`),yt("finish")}"status"!==t&&dt.set(i)}var xt={};async function wt(t,e){if(window.location.protocol.match(/^http/))if(xt[t])e.innerHTML=xt[t];else try{await fetch(t).then((t=>t.text())).then((n=>{n=n.replace("Nominatim_API_Endpoint",Nominatim_Config.Nominatim_API_Endpoint),e.innerHTML=n,xt[t]=n}))}catch(n){e.innerHTML=`Error fetching content from ${t} (${n})`}else e.innerHTML=`Cannot display data from ${t} here. Browser security prevents loading content from file:// URLs.`}function Tt(t){document.title=[t,Nominatim_Config.Page_Title].filter((t=>t&&t.length>1)).join(" | ")}function Ct(t){let e,n,i,o;const r=t[6].default,s=c(r,t,t[5],null);return{c(){e=_("a"),s&&s.c(),C(e,"href",t[1]),C(e,"class",t[0])},m(r,a){p(r,e,a),s&&s.m(e,null),n=!0,i||(o=x(e,"click",T(w(t[2]))),i=!0)},p(t,[i]){s&&s.p&&32&i&&d(s,r,t,t[5],i,null,null),(!n||2&i)&&C(e,"href",t[1]),(!n||1&i)&&C(e,"class",t[0])},i(t){n||(Y(s,t),n=!0)},o(t){X(s,t),n=!1},d(t){t&&m(e),s&&s.d(t),i=!1,o()}}}function Et(t,e,n){let{$$slots:i={},$$scope:o}=e,{page:r}=e,{params_hash:s={}}=e,{extra_classes:a=""}=e,l=r+".html";return t.$$set=t=>{"page"in t&&n(3,r=t.page),"params_hash"in t&&n(4,s=t.params_hash),"extra_classes"in t&&n(0,a=t.extra_classes),"$$scope"in t&&n(5,o=t.$$scope)},t.$$.update=()=>{if(24&t.$$.dirty){let t=new URLSearchParams(s).toString();n(1,l=r+".html"+(t?"?":"")+t)}},[a,l,function(){gt(r,new URLSearchParams(s))},r,s,o,i]}class $t extends ot{constructor(t){super(),it(this,t,Et,Ct,s,{page:3,params_hash:4,extra_classes:0})}}function Lt(t){let e,n,i,o;const r=t[7].default,s=c(r,t,t[6],null);return{c(){e=_("a"),s&&s.c(),C(e,"href",t[2]),C(e,"class",t[0])},m(r,a){p(r,e,a),s&&s.m(e,null),n=!0,i||(o=x(e,"click",T(w(t[8]))),i=!0)},p(t,[i]){s&&s.p&&64&i&&d(s,r,t,t[6],i,null,null),(!n||4&i)&&C(e,"href",t[2]),(!n||1&i)&&C(e,"class",t[0])},i(t){n||(Y(s,t),n=!0)},o(t){X(s,t),n=!1},d(t){t&&m(e),s&&s.d(t),i=!1,o()}}}function kt(t,e,n){let{$$slots:i={},$$scope:o}=e,{lat:r=null}=e,{lon:s=null}=e,{zoom:a=null}=e,{extra_classes:l=""}=e,u=new URLSearchParams,c="reverse.html";return t.$$set=t=>{"lat"in t&&n(3,r=t.lat),"lon"in t&&n(4,s=t.lon),"zoom"in t&&n(5,a=t.zoom),"extra_classes"in t&&n(0,l=t.extra_classes),"$$scope"in t&&n(6,o=t.$$scope)},t.$$.update=()=>{if(56&t.$$.dirty){let t=new URLSearchParams;r&&s&&(t.set("lat",r),t.set("lon",s),a&&t.set("zoom",a)),n(1,u=t)}if(2&t.$$.dirty){let t=u.toString();n(2,c="reverse.html"+(t?"?":"")+t)}},[l,u,c,r,s,a,o,i,()=>gt("reverse",u)]}class Pt extends ot{constructor(t){super(),it(this,t,kt,Lt,s,{lat:3,lon:4,zoom:5,extra_classes:0})}}var St=["second","minute","hour","day","week","month","year"];var Mt=["秒","分钟","小时","天","周","个月","年"];var At={},Nt=function(t,e){At[t]=e},Dt=[60,60,24,7,365/7/12,12];function It(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(parseInt(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(t))}var Ot=function(t,e,n){return function(t,e){for(var n=t<0?1:0,i=t=Math.abs(t),o=0;t>=Dt[o]&&o<Dt.length;o++)t/=Dt[o];return(t=Math.floor(t))>(0==(o*=2)?9:1)&&(o+=1),e(t,o,i)[n].replace("%s",t.toString())}(function(t,e){return(+(e?It(e):new Date)-+It(t))/1e3}(t,n&&n.relativeDate),function(t){return At[t]||At.en_US}(e))};function zt(t){let e,n,i,o,r,s,a,l,u,c,h;return{c(){e=_("div"),n=v("Data from "),i=_("a"),o=v("API request"),r=y(),s=_("span"),a=v("("),l=_("a"),u=v("debug output"),h=v(")"),C(i,"href",t[1]),C(l,"href",c=t[1]+"&debug=1"),C(s,"id","api-request-debug"),C(e,"id","api-request")},m(t,c){p(t,e,c),f(e,n),f(e,i),f(i,o),f(e,r),f(e,s),f(s,a),f(s,l),f(l,u),f(s,h)},p(t,e){2&e&&C(i,"href",t[1]),2&e&&c!==(c=t[1]+"&debug=1")&&C(l,"href",c)},d(t){t&&m(e)}}}function Bt(t){let e,n,i,o,r=Ot(new Date(t[0]))+"";return{c(){e=v("Data last updated:\n "),n=_("abbr"),i=v(r),C(n,"id","data-date"),C(n,"title",o=t[0]+" (UTC timezone)")},m(t,o){p(t,e,o),p(t,n,o),f(n,i)},p(t,e){1&e&&r!==(r=Ot(new Date(t[0]))+"")&&E(i,r),1&e&&o!==(o=t[0]+" (UTC timezone)")&&C(n,"title",o)},d(t){t&&m(e),t&&m(n)}}}function jt(t){let e;return{c(){e=v("Details")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Rt(t){let e,n,i,o,r,s,a,l,u,c,h,d=t[1]&&zt(t),g=t[0]&&Bt(t);return u=new $t({props:{page:"status",$$slots:{default:[jt]},$$scope:{ctx:t}}}),{c(){e=_("div"),n=_("div"),n.innerHTML='<div class="spinner-border spinner-border-sm text-primary mr-1" role="status"></div>\n Loading data from API ...',i=y(),o=_("div"),r=_("div"),d&&d.c(),s=y(),a=_("div"),g&&g.c(),l=v("\n ("),J(u.$$.fragment),c=v(")"),C(n,"id","loading"),C(n,"class","py-2 px-4 svelte-1i1228w"),C(r,"class","col-sm-6"),C(a,"class","col-sm-6 text-right"),C(o,"class","row"),C(e,"id","last-updated"),C(e,"class","container-fluid py-2 px-4 mb-3 svelte-1i1228w")},m(t,m){p(t,e,m),f(e,n),f(e,i),f(e,o),f(o,r),d&&d.m(r,null),f(o,s),f(o,a),g&&g.m(a,null),f(a,l),tt(u,a,null),f(a,c),h=!0},p(t,[e]){t[1]?d?d.p(t,e):(d=zt(t),d.c(),d.m(r,null)):d&&(d.d(1),d=null),t[0]?g?g.p(t,e):(g=Bt(t),g.c(),g.m(a,l)):g&&(g.d(1),g=null);const n={};8&e&&(n.$$scope={dirty:e,ctx:t}),u.$set(n)},i(t){h||(Y(u.$$.fragment,t),h=!0)},o(t){X(u.$$.fragment,t),h=!1},d(t){t&&m(e),d&&d.d(),g&&g.d(),et(u)}}}function Zt(t,e,n){let i,o,r=!1;return dt.subscribe((t=>{n(1,o=t),r||i||(r=!0,bt("status",{format:"json"},(function(t){n(0,i=t.data_updated),r=!1})))})),[i,o]}Nt("en_US",(function(t,e){if(0===e)return["just now","right now"];var n=St[Math.floor(e/2)];return t>1&&(n+="s"),[t+" "+n+" ago","in "+t+" "+n]})),Nt("zh_CN",(function(t,e){if(0===e)return["刚刚","片刻后"];var n=Mt[~~(e/2)];return[t+" "+n+"前",t+" "+n+"后"]}));class Ht extends ot{constructor(t){super(),it(this,t,Zt,Rt,s,{})}}function qt(t){let e,n,i,o,r,s;return{c(){e=_("div"),n=v(t[0]),i=y(),o=_("button"),o.innerHTML='<span aria-hidden="true">×</span>',C(o,"type","button"),C(o,"class","close"),C(o,"aria-label","dismiss"),C(e,"id","error"),C(e,"class","container-fluid alert-danger py-3 px-4")},m(a,l){p(a,e,l),f(e,n),f(e,i),f(e,o),r||(s=x(o,"click",t[1]),r=!0)},p(t,e){1&e&&E(n,t[0])},d(t){t&&m(e),r=!1,s()}}}function Ft(e){let n,i=e[0]&&qt(e);return{c(){i&&i.c(),n=b()},m(t,e){i&&i.m(t,e),p(t,n,e)},p(t,[e]){t[0]?i?i.p(t,e):(i=qt(t),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},i:t,o:t,d(t){i&&i.d(t),t&&m(n)}}}function Wt(t,e,n){let i;return ft.subscribe((t=>{n(0,i=t)})),[i,function(){ft.set(null)}]}class Ut extends ot{constructor(t){super(),it(this,t,Wt,Ft,s,{})}}function Vt(t){let e,n,i,o,r;return{c(){e=_("img"),i=y(),o=_("h1"),r=v(t[3]),C(e,"alt","logo"),C(e,"id","theme-logo"),e.src!==(n="theme/logo.png")&&C(e,"src","theme/logo.png"),C(e,"class","svelte-1q88nx"),C(o,"class","svelte-1q88nx")},m(t,n){p(t,e,n),p(t,i,n),p(t,o,n),f(o,r)},p(t,e){8&e&&E(r,t[3])},d(t){t&&m(e),t&&m(i),t&&m(o)}}}function Gt(t){let e;return{c(){e=v("Search")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Kt(t){let e;return{c(){e=v("Reverse")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Yt(t){let e;return{c(){e=v("Search By ID")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Xt(t){let e;return{c(){e=v("About & Help")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Qt(t){let e,n,i,o,r,s,a,l,u,h,g,b,x,w,T,$,L,k,P,S,M,A,N,D,I,O,z,B,j,R,Z,H,q,F,W,U;o=new $t({props:{page:"search",$$slots:{default:[Vt]},$$scope:{ctx:t}}}),g=new $t({props:{page:"search",extra_classes:"nav-link",$$slots:{default:[Gt]},$$scope:{ctx:t}}}),T=new Pt({props:{lat:t[0],lon:t[1],extra_classes:"nav-link",$$slots:{default:[Kt]},$$scope:{ctx:t}}}),P=new $t({props:{page:"details",extra_classes:"nav-link",$$slots:{default:[Yt]},$$scope:{ctx:t}}}),D=new $t({props:{page:"about",extra_classes:"nav-link",$$slots:{default:[Xt]},$$scope:{ctx:t}}});const V=t[5].default,G=c(V,t,t[6],null);return q=new Ut({}),W=new Ht({}),{c(){e=_("header"),n=_("nav"),i=_("div"),J(o.$$.fragment),r=y(),s=_("button"),s.innerHTML='<span class="navbar-toggler-icon"></span>',a=y(),l=_("div"),u=_("ul"),h=_("li"),J(g.$$.fragment),x=y(),w=_("li"),J(T.$$.fragment),L=y(),k=_("li"),J(P.$$.fragment),M=y(),A=_("ul"),N=_("li"),J(D.$$.fragment),O=y(),z=_("section"),B=_("h2"),j=v(t[2]),R=y(),Z=_("section"),G&&G.c(),H=y(),J(q.$$.fragment),F=y(),J(W.$$.fragment),C(i,"class","navbar-brand svelte-1q88nx"),C(s,"class","navbar-toggler"),C(s,"type","button"),C(s,"data-toggle","collapse"),C(s,"data-target","#navbarSupportedContent"),C(s,"aria-controls","navbarSupportedContent"),C(s,"aria-expanded","false"),C(s,"aria-label","Toggle navigation"),C(h,"class",b="nav-item "+("search"===t[2]?"active":"")+" svelte-1q88nx"),C(w,"class",$="nav-item "+("reverse"===t[2]?"active":"")+" svelte-1q88nx"),C(k,"class",S="nav-item "+("details"===t[2]?"active":"")+" svelte-1q88nx"),C(u,"class","navbar-nav mr-auto"),C(l,"class","collapse navbar-collapse"),C(l,"id","navbarSupportedContent"),C(N,"class",I="nav-item "+("about"===t[2]?"active":"")+" svelte-1q88nx"),C(A,"class","navbar-nav"),C(n,"class","navbar navbar-expand-sm navbar-light"),C(e,"class","container-fluid"),C(z,"class","page-title-section svelte-1q88nx"),C(Z,"class","search-section svelte-1q88nx")},m(t,c){p(t,e,c),f(e,n),f(n,i),tt(o,i,null),f(n,r),f(n,s),f(n,a),f(n,l),f(l,u),f(u,h),tt(g,h,null),f(u,x),f(u,w),tt(T,w,null),f(u,L),f(u,k),tt(P,k,null),f(n,M),f(n,A),f(A,N),tt(D,N,null),p(t,O,c),p(t,z,c),f(z,B),f(B,j),p(t,R,c),p(t,Z,c),G&&G.m(Z,null),p(t,H,c),tt(q,t,c),p(t,F,c),tt(W,t,c),U=!0},p(t,[e]){const n={};72&e&&(n.$$scope={dirty:e,ctx:t}),o.$set(n);const i={};64&e&&(i.$$scope={dirty:e,ctx:t}),g.$set(i),(!U||4&e&&b!==(b="nav-item "+("search"===t[2]?"active":"")+" svelte-1q88nx"))&&C(h,"class",b);const r={};1&e&&(r.lat=t[0]),2&e&&(r.lon=t[1]),64&e&&(r.$$scope={dirty:e,ctx:t}),T.$set(r),(!U||4&e&&$!==($="nav-item "+("reverse"===t[2]?"active":"")+" svelte-1q88nx"))&&C(w,"class",$);const s={};64&e&&(s.$$scope={dirty:e,ctx:t}),P.$set(s),(!U||4&e&&S!==(S="nav-item "+("details"===t[2]?"active":"")+" svelte-1q88nx"))&&C(k,"class",S);const a={};64&e&&(a.$$scope={dirty:e,ctx:t}),D.$set(a),(!U||4&e&&I!==(I="nav-item "+("about"===t[2]?"active":"")+" svelte-1q88nx"))&&C(N,"class",I),(!U||4&e)&&E(j,t[2]),G&&G.p&&64&e&&d(G,V,t,t[6],e,null,null)},i(t){U||(Y(o.$$.fragment,t),Y(g.$$.fragment,t),Y(T.$$.fragment,t),Y(P.$$.fragment,t),Y(D.$$.fragment,t),Y(G,t),Y(q.$$.fragment,t),Y(W.$$.fragment,t),U=!0)},o(t){X(o.$$.fragment,t),X(g.$$.fragment,t),X(T.$$.fragment,t),X(P.$$.fragment,t),X(D.$$.fragment,t),X(G,t),X(q.$$.fragment,t),X(W.$$.fragment,t),U=!1},d(t){t&&m(e),et(o),et(g),et(T),et(P),et(D),t&&m(O),t&&m(z),t&&m(R),t&&m(Z),G&&G.d(t),t&&m(H),et(q,t),t&&m(F),et(W,t)}}}function Jt(t,e,n){let i,o,r;u(t,pt,(t=>n(4,r=t)));let s,a,{$$slots:l={},$$scope:c}=e;return ct.subscribe((t=>{t&&t.on("move",(function(){n(0,s=t.getCenter().lat),n(1,a=t.getCenter().lng)}))})),t.$$set=t=>{"$$scope"in t&&n(6,c=t.$$scope)},t.$$.update=()=>{16&t.$$.dirty&&n(2,i=r.tab)},n(3,o=Nominatim_Config.Page_Title),[s,a,i,o,r,l,c]}class te extends ot{constructor(t){super(),it(this,t,Jt,Qt,s,{})}}function ee(t){let e,n,i,o;const r=t[3].default,s=c(r,t,t[2],null);return{c(){e=_("form"),s&&s.c(),C(e,"class","form-inline"),C(e,"role","search"),C(e,"accept-charset","UTF-8"),C(e,"action","")},m(r,a){p(r,e,a),s&&s.m(e,null),n=!0,i||(o=x(e,"submit",w(t[0])),i=!0)},p(t,[e]){s&&s.p&&4&e&&d(s,r,t,t[2],e,null,null)},i(t){n||(Y(s,t),n=!0)},o(t){X(s,t),n=!1},d(t){t&&m(e),s&&s.d(t),i=!1,o()}}}function ne(t,e,n){let{$$slots:i={},$$scope:o}=e,{page:r}=e;return t.$$set=t=>{"page"in t&&n(1,r=t.page),"$$scope"in t&&n(2,o=t.$$scope)},[function(t){let e=t.target,n=!0;Array.prototype.slice.call(e.elements).forEach((function(t){(function(t){return!("hidden"===t.type&&t.value.length&&t.pattern&&!t.value.match(t.pattern))&&t.checkValidity()})(t)||(alert("Invalid input in "+t.name),n=!1)})),n&>(r,function(t){var e=new URLSearchParams;return Array.prototype.slice.call(t.elements).forEach((function(t){!t.name||t.disabled||["submit","button"].indexOf(t.type)>-1||["checkbox","radio"].indexOf(t.type)>-1&&!t.checked||void 0!==t.value&&""!==t.value&&e.set(t.name,t.value)})),e}(e))},r,o,i]}class ie extends ot{constructor(t){super(),it(this,t,ne,ee,s,{page:1})}}function oe(t){let e,n,i,o,r,s,a,l,u,c,h,d,f,g,v,b,x,w,T,E,$,L,k,P,S;return{c(){e=_("input"),i=y(),o=_("button"),o.textContent="Search",r=y(),s=_("input"),l=y(),u=_("input"),h=y(),d=_("input"),g=y(),v=_("input"),x=y(),w=_("input"),E=y(),$=_("input"),k=y(),P=_("input"),C(e,"id","q"),C(e,"name","q"),C(e,"type","text"),C(e,"class","form-control form-control-sm svelte-1u2ltgo"),C(e,"placeholder","Search"),e.value=n=t[1].q||"",C(o,"type","submit"),C(o,"class","btn btn-primary btn-sm mx-1"),C(s,"type","hidden"),C(s,"name","viewbox"),s.value=a=t[2]||"",C(u,"type","hidden"),C(u,"name","dedupe"),u.value=c=t[1].dedupe?1:"",C(d,"type","hidden"),C(d,"name","bounded"),d.value=f=t[1].bounded?1:"",C(v,"type","hidden"),C(v,"name","accept-language"),v.value=b=t[1]["accept-language"]||"",C(w,"type","hidden"),C(w,"name","countrycodes"),w.value=T=t[1].countrycodes||"",C(w,"pattern","^[a-zA-Z]{2}(,[a-zA-Z]{2})*$"),C($,"type","hidden"),C($,"name","limit"),$.value=L=t[1].limit||"",C(P,"type","hidden"),C(P,"name","polygon_threshold"),P.value=S=t[1].polygon_threshold||""},m(t,n){p(t,e,n),p(t,i,n),p(t,o,n),p(t,r,n),p(t,s,n),p(t,l,n),p(t,u,n),p(t,h,n),p(t,d,n),p(t,g,n),p(t,v,n),p(t,x,n),p(t,w,n),p(t,E,n),p(t,$,n),p(t,k,n),p(t,P,n)},p(t,i){2&i&&n!==(n=t[1].q||"")&&e.value!==n&&(e.value=n),4&i&&a!==(a=t[2]||"")&&(s.value=a),2&i&&c!==(c=t[1].dedupe?1:"")&&(u.value=c),2&i&&f!==(f=t[1].bounded?1:"")&&(d.value=f),2&i&&b!==(b=t[1]["accept-language"]||"")&&(v.value=b),2&i&&T!==(T=t[1].countrycodes||"")&&(w.value=T),2&i&&L!==(L=t[1].limit||"")&&($.value=L),2&i&&S!==(S=t[1].polygon_threshold||"")&&(P.value=S)},d(t){t&&m(e),t&&m(i),t&&m(o),t&&m(r),t&&m(s),t&&m(l),t&&m(u),t&&m(h),t&&m(d),t&&m(g),t&&m(v),t&&m(x),t&&m(w),t&&m(E),t&&m($),t&&m(k),t&&m(P)}}}function re(t){let e,n,i,o,r,s,a,l,u,c,h,d,f,g,v,b,x,w,T,E,$,L,k,P,S,M,A,N,D,I,O,z,B,j,R,Z,H,q,F,W;return{c(){e=_("input"),i=y(),o=_("input"),s=y(),a=_("input"),u=y(),c=_("input"),d=y(),f=_("input"),v=y(),b=_("input"),w=y(),T=_("button"),T.textContent="Search",E=y(),$=_("input"),k=y(),P=_("input"),M=y(),A=_("input"),D=y(),I=_("input"),z=y(),B=_("input"),R=y(),Z=_("input"),q=y(),F=_("input"),C(e,"name","street"),C(e,"type","text"),C(e,"class","form-control form-control-sm mr-1"),C(e,"placeholder","House number/Street"),e.value=n=t[1].street||"",C(o,"name","city"),C(o,"type","text"),C(o,"class","form-control form-control-sm mr-1"),C(o,"placeholder","City"),o.value=r=t[1].city||"",C(a,"id","county"),C(a,"name","county"),C(a,"type","text"),C(a,"class","form-control form-control-sm mr-1"),C(a,"placeholder","County"),a.value=l=t[1].county||"",C(c,"name","state"),C(c,"type","text"),C(c,"class","form-control form-control-sm mr-1"),C(c,"placeholder","State"),c.value=h=t[1].state||"",C(f,"name","country"),C(f,"type","text"),C(f,"class","form-control form-control-sm mr-1"),C(f,"placeholder","Country"),f.value=g=t[1].country||"",C(b,"name","postalcode"),C(b,"type","text"),C(b,"class","form-control form-control-sm mr-1"),C(b,"placeholder","Postal Code"),b.value=x=t[1].postalcode||"",C(T,"type","submit"),C(T,"class","btn btn-primary btn-sm"),C($,"type","hidden"),C($,"name","viewbox"),$.value=L=t[2]||"",C(P,"type","hidden"),C(P,"name","dedupe"),P.value=S=t[1].dedupe?1:"",C(A,"type","hidden"),C(A,"name","bounded"),A.value=N=t[1].bounded?1:"",C(I,"type","hidden"),C(I,"name","accept-language"),I.value=O=t[1]["accept-language"]||"",C(B,"type","hidden"),C(B,"name","countrycodes"),B.value=j=t[1].countrycodes||"",C(B,"pattern","^[a-zA-Z]{2}(,[a-zA-Z]{2})*$"),C(Z,"type","hidden"),C(Z,"name","limit"),Z.value=H=t[1].limit||"",C(F,"type","hidden"),C(F,"name","polygon_threshold"),F.value=W=t[1].polygon_threshold||""},m(t,n){p(t,e,n),p(t,i,n),p(t,o,n),p(t,s,n),p(t,a,n),p(t,u,n),p(t,c,n),p(t,d,n),p(t,f,n),p(t,v,n),p(t,b,n),p(t,w,n),p(t,T,n),p(t,E,n),p(t,$,n),p(t,k,n),p(t,P,n),p(t,M,n),p(t,A,n),p(t,D,n),p(t,I,n),p(t,z,n),p(t,B,n),p(t,R,n),p(t,Z,n),p(t,q,n),p(t,F,n)},p(t,i){2&i&&n!==(n=t[1].street||"")&&e.value!==n&&(e.value=n),2&i&&r!==(r=t[1].city||"")&&o.value!==r&&(o.value=r),2&i&&l!==(l=t[1].county||"")&&a.value!==l&&(a.value=l),2&i&&h!==(h=t[1].state||"")&&c.value!==h&&(c.value=h),2&i&&g!==(g=t[1].country||"")&&f.value!==g&&(f.value=g),2&i&&x!==(x=t[1].postalcode||"")&&b.value!==x&&(b.value=x),4&i&&L!==(L=t[2]||"")&&($.value=L),2&i&&S!==(S=t[1].dedupe?1:"")&&(P.value=S),2&i&&N!==(N=t[1].bounded?1:"")&&(A.value=N),2&i&&O!==(O=t[1]["accept-language"]||"")&&(I.value=O),2&i&&j!==(j=t[1].countrycodes||"")&&(B.value=j),2&i&&H!==(H=t[1].limit||"")&&(Z.value=H),2&i&&W!==(W=t[1].polygon_threshold||"")&&(F.value=W)},d(t){t&&m(e),t&&m(i),t&&m(o),t&&m(s),t&&m(a),t&&m(u),t&&m(c),t&&m(d),t&&m(f),t&&m(v),t&&m(b),t&&m(w),t&&m(T),t&&m(E),t&&m($),t&&m(k),t&&m(P),t&&m(M),t&&m(A),t&&m(D),t&&m(I),t&&m(z),t&&m(B),t&&m(R),t&&m(Z),t&&m(q),t&&m(F)}}}function se(t){let e,n,i,r,s,a,l,u,c,h,d,g,v,b,w,T,E,$,L,k,S,M,A,N,D,I,O,z,B,j,R,Z,H,q,F,W,U,V,G,K,Q,nt,it,ot,rt,st,at,lt,ut,ct,ht,dt,ft,pt,mt,gt,_t,vt,yt,bt,xt,wt,Tt,Ct,Et;return h=new ie({props:{page:"search",$$slots:{default:[oe]},$$scope:{ctx:t}}}),v=new ie({props:{page:"search",$$slots:{default:[re]},$$scope:{ctx:t}}}),{c(){e=_("ul"),n=_("li"),i=_("a"),i.textContent="Simple",r=y(),s=_("li"),a=_("a"),a.textContent="Structured",l=y(),u=_("div"),c=_("div"),J(h.$$.fragment),d=y(),g=_("div"),J(v.$$.fragment),b=y(),w=_("details"),T=_("summary"),T.innerHTML="<small>Advanced options</small>",E=y(),$=_("ul"),L=_("li"),k=_("div"),S=_("label"),S.textContent="apply viewbox",M=y(),A=_("input"),D=y(),I=_("li"),O=_("div"),z=_("label"),z.textContent="bounded to viewbox",B=y(),j=_("input"),Z=y(),H=_("li"),q=_("div"),F=_("label"),F.textContent="deduplicate results",W=y(),U=_("input"),G=y(),K=_("li"),Q=_("label"),Q.textContent="Maximum number of results",nt=y(),it=_("input"),rt=y(),st=_("li"),at=_("label"),at.textContent="Polygon simplification",lt=y(),ut=_("input"),ht=y(),dt=_("li"),ft=_("label"),ft.textContent="Languages",pt=y(),mt=_("input"),_t=y(),vt=_("li"),yt=_("label"),yt.textContent="Country Codes",bt=y(),xt=_("input"),C(i,"class","nav-link svelte-1u2ltgo"),C(i,"data-toggle","tab"),C(i,"href","#simple"),P(i,"active",!t[0]),C(n,"class","nav-item"),C(a,"class","nav-link svelte-1u2ltgo"),C(a,"data-toggle","tab"),C(a,"href","#structured"),P(a,"active",t[0]),C(s,"class","nav-item"),C(e,"class","nav nav-tabs svelte-1u2ltgo"),C(c,"class","tab-pane"),C(c,"id","simple"),C(c,"role","tabpanel"),P(c,"active",!t[0]),C(g,"class","tab-pane"),C(g,"id","structured"),C(g,"role","tabpanel"),P(g,"active",t[0]),C(u,"class","tab-content py-2"),C(S,"class","form-check-label svelte-1u2ltgo"),C(S,"for","use_viewbox"),C(A,"type","checkbox"),C(A,"class","form-check-input api-param-setting"),C(A,"id","use_viewbox"),A.checked=N=t[1].viewbox,C(k,"class","form-check form-check-inline"),C(L,"class","svelte-1u2ltgo"),C(z,"class","form-check-label svelte-1u2ltgo"),C(z,"for","option_bounded"),C(j,"type","checkbox"),C(j,"class","form-check-input api-param-setting"),C(j,"id","option_bounded"),j.checked=R=!!t[1].bounded,C(O,"class","form-check form-check-inline"),C(I,"class","svelte-1u2ltgo"),C(F,"class","form-check-label svelte-1u2ltgo"),C(F,"for","option_dedupe"),C(U,"type","checkbox"),C(U,"class","form-check-input api-param-setting"),C(U,"id","option_dedupe"),U.checked=V=!!t[1].dedupe,C(q,"class","form-check form-check-inline"),C(H,"class","svelte-1u2ltgo"),C(Q,"for","option_limit"),C(Q,"class","svelte-1u2ltgo"),C(it,"type","number"),C(it,"class","form-control form-control-sm d-inline w-auto api-param-setting"),C(it,"data-api-param","limit"),C(it,"id","option_limit"),C(it,"min","1"),C(it,"max","50"),it.value=ot=t[1].limit||"",C(K,"class","svelte-1u2ltgo"),C(at,"for","option_polygon_threshold"),C(at,"class","svelte-1u2ltgo"),C(ut,"type","number"),C(ut,"class","form-control form-control-sm d-inline w-auto api-param-setting"),C(ut,"data-api-param","polygon_threshold"),C(ut,"id","option_polygon_threshold"),C(ut,"min","0.0"),C(ut,"max","1.0"),C(ut,"step","0.001"),ut.value=ct=t[1].polygon_threshold||"",C(st,"class","svelte-1u2ltgo"),C(ft,"for","accept_lang"),C(ft,"class","svelte-1u2ltgo"),C(mt,"type","text"),C(mt,"placeholder","e.g. en,zh-Hant"),C(mt,"class","form-control form-control-sm d-inline w-auto api-param-setting"),C(mt,"data-api-param","accept-language"),C(mt,"id","accept_lang"),C(mt,"size","15"),mt.value=gt=t[1]["accept-language"]||"",C(dt,"class","svelte-1u2ltgo"),C(yt,"for","option_ccode"),C(yt,"class","svelte-1u2ltgo"),C(xt,"type","text"),C(xt,"placeholder","e.g. de,gb"),C(xt,"class","form-control form-control-sm d-inline w-auto api-param-setting"),C(xt,"data-api-param","countrycodes"),C(xt,"id","option_ccode"),C(xt,"size","15"),xt.value=wt=t[1].countrycodes||"",C(xt,"pattern","^[a-zA-Z]{2}(,[a-zA-Z]{2})*$"),C(vt,"class","svelte-1u2ltgo"),C($,"class","svelte-1u2ltgo"),C(w,"id","searchAdvancedOptions"),C(w,"class","svelte-1u2ltgo")},m(o,m){p(o,e,m),f(e,n),f(n,i),f(e,r),f(e,s),f(s,a),p(o,l,m),p(o,u,m),f(u,c),tt(h,c,null),f(u,d),f(u,g),tt(v,g,null),p(o,b,m),p(o,w,m),f(w,T),f(w,E),f(w,$),f($,L),f(L,k),f(k,S),f(k,M),f(k,A),f($,D),f($,I),f(I,O),f(O,z),f(O,B),f(O,j),f($,Z),f($,H),f(H,q),f(q,F),f(q,W),f(q,U),f($,G),f($,K),f(K,Q),f(K,nt),f(K,it),f($,rt),f($,st),f(st,at),f(st,lt),f(st,ut),f($,ht),f($,dt),f(dt,ft),f(dt,pt),f(dt,mt),f($,_t),f($,vt),f(vt,yt),f(vt,bt),f(vt,xt),Tt=!0,Ct||(Et=[x(A,"change",t[3]),x(j,"change",ae),x(U,"change",le),x(it,"change",ue),x(ut,"change",ue),x(mt,"change",ue),x(xt,"change",ue)],Ct=!0)},p(t,[e]){1&e&&P(i,"active",!t[0]),1&e&&P(a,"active",t[0]);const n={};262&e&&(n.$$scope={dirty:e,ctx:t}),h.$set(n),1&e&&P(c,"active",!t[0]);const o={};262&e&&(o.$$scope={dirty:e,ctx:t}),v.$set(o),1&e&&P(g,"active",t[0]),(!Tt||2&e&&N!==(N=t[1].viewbox))&&(A.checked=N),(!Tt||2&e&&R!==(R=!!t[1].bounded))&&(j.checked=R),(!Tt||2&e&&V!==(V=!!t[1].dedupe))&&(U.checked=V),(!Tt||2&e&&ot!==(ot=t[1].limit||""))&&(it.value=ot),(!Tt||2&e&&ct!==(ct=t[1].polygon_threshold||""))&&(ut.value=ct),(!Tt||2&e&>!==(gt=t[1]["accept-language"]||"")&&mt.value!==gt)&&(mt.value=gt),(!Tt||2&e&&wt!==(wt=t[1].countrycodes||"")&&xt.value!==wt)&&(xt.value=wt)},i(t){Tt||(Y(h.$$.fragment,t),Y(v.$$.fragment,t),Tt=!0)},o(t){X(h.$$.fragment,t),X(v.$$.fragment,t),Tt=!1},d(t){t&&m(e),t&&m(l),t&&m(u),et(h),et(v),t&&m(b),t&&m(w),Ct=!1,o(Et)}}}function ae(t){document.querySelector("input[name=bounded]").value=t.target.checked?1:""}function le(t){document.querySelector("input[name=dedupe]").value=t.target.checked?1:""}function ue(t){document.querySelector("input[name="+t.target.dataset.apiParam+"]").value=t.target.value}function ce(t,e,n){let i,{bStructuredSearch:o=!1}=e,{api_request_params:r={}}=e;function s(t){let e=document.getElementById("use_viewbox");e&&e.checked?n(2,i=function(t){var e=t.getBounds(),n=e.getWest(),i=e.getEast();return i-n>=360&&(n=t.getCenter().lng-179.999,i=t.getCenter().lng+179.999),i=L.latLng(77,i).wrap().lng,[(n=L.latLng(77,n).wrap().lng).toFixed(5),e.getNorth().toFixed(5),i.toFixed(5),e.getSouth().toFixed(5)].join(",")}(t)):n(2,i="")}function a(t){let e=t.wrapLatLng(t.getCenter());e.lat.toFixed(5),e.lng.toFixed(5)}return ct.subscribe((t=>{t&&(t.on("move",(function(){s(t),a(t)})),t.on("load",(function(){s(t),a(t)})))})),t.$$set=t=>{"bStructuredSearch"in t&&n(0,o=t.bStructuredSearch),"api_request_params"in t&&n(1,r=t.api_request_params)},[o,r,i,function(){let t=l(ct);t&&s(t)}]}class he extends ot{constructor(t){super(),it(this,t,ce,se,s,{bStructuredSearch:0,api_request_params:1})}}
+/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
- */
-
- /**
- * Module variables.
- * @private
- */
-
- var matchHtmlRegExp = /["'&<>]/;
-
- /**
- * Module exports.
- * @public
- */
-
- var escapeHtml_1 = escapeHtml;
-
- /**
- * Escape special characters in the given string of html.
- *
- * @param {string} string The string to escape for inserting into HTML
- * @return {string}
- * @public
- */
-
- function escapeHtml(string) {
- var str = '' + string;
- var match = matchHtmlRegExp.exec(str);
-
- if (!match) {
- return str;
- }
-
- var escape;
- var html = '';
- var index = 0;
- var lastIndex = 0;
-
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34: // "
- escape = '"';
- break;
- case 38: // &
- escape = '&';
- break;
- case 39: // '
- escape = ''';
- break;
- case 60: // <
- escape = '<';
- break;
- case 62: // >
- escape = '>';
- break;
- default:
- continue;
- }
-
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
-
- lastIndex = index + 1;
- html += escape;
- }
-
- return lastIndex !== index
- ? html + str.substring(lastIndex, index)
- : html;
- }
-
- var formatOSMType_1 = formatOSMType;
- var osmLink_1 = osmLink;
- var formatLabel_1 = formatLabel;
- var detailsURL_1 = detailsURL;
- var wikipediaLink_1 = wikipediaLink;
- var coverageType_1 = coverageType;
- var isAdminBoundary_1 = isAdminBoundary;
- var formatAddressRank_1 = formatAddressRank;
- var formatPlaceType_1 = formatPlaceType;
- var formatAdminLevel_1 = formatAdminLevel;
- var formatDistance_1 = formatDistance;
- var formatKeywordToken_1 = formatKeywordToken;
- var zoomLevels_1 = zoomLevels;
-
-
-
- function formatOSMType(sType, bExcludeExternal) {
- if (sType === 'N') return 'node';
- if (sType === 'W') return 'way';
- if (sType === 'R') return 'relation';
-
- if (!bExcludeExternal) return '';
-
- if (sType === 'T') return 'way';
- if (sType === 'I') return 'way';
-
- return '';
- }
-
- function formatShortOSMType(sType) {
- if (sType === 'node') return 'N';
- if (sType === 'way') return 'W';
- if (sType === 'relation') return 'R';
- return '';
- }
-
- function osmLink(aPlace) {
- if (!aPlace.osm_type) return '';
- var sOSMType = formatOSMType(aPlace.osm_type, false);
- if (!sOSMType) return '';
-
- return '<a href="https://www.openstreetmap.org/' + sOSMType + '/' + aPlace.osm_id + '">' + sOSMType + ' ' + aPlace.osm_id + '</a>'
- }
-
- function formatLabel(aPlace) {
- if (aPlace.label) return aPlace.label;
-
- function capitalize(s) {
- return s && s[0].toUpperCase() + s.slice(1);
- }
-
- if (aPlace.type && aPlace.type === 'yes' && aPlace.class) {
- return capitalize(aPlace.class.replace(/_/g, ' '));
- }
- if (aPlace.type) {
- return capitalize(aPlace.type.replace(/_/g, ' '));
- }
- return '';
- }
-
- // 'details.html?osmtype=R&osmid=2181874&class=boundary'
- function detailsURL(aFeature) {
- if (!aFeature) return '';
-
- var sOSMType = aFeature.osm_type;
- if (sOSMType && sOSMType.length !== 1) {
- sOSMType = formatShortOSMType(aFeature.osm_type); // node => N
- }
- if (!sOSMType) return '';
-
- var sURL = 'details.html?osmtype=' + sOSMType + '&osmid=' + aFeature.osm_id;
- if (aFeature.class) {
- sURL = sURL + '&class=' + encodeURIComponent(aFeature.class);
- } else if (aFeature.category) {
- sURL = sURL + '&class=' +encodeURIComponent(aFeature.category);
- }
- return sURL;
- }
-
- /* en:London_Borough_of_Redbridge => https://en.wikipedia.org/wiki/London_Borough_of_Redbridge */
- function wikipediaLink(aPlace) {
- if (!aPlace.calculated_wikipedia) return '';
-
- var parts = aPlace.calculated_wikipedia.split(':', 2);
-
- var sTitle = escapeHtml_1(aPlace.calculated_wikipedia);
- var sLanguage = escapeHtml_1(parts[0]);
- var sArticle = escapeHtml_1(parts[1]);
-
- return '<a href="https://' + sLanguage + '.wikipedia.org/wiki/' + sArticle + '" target="_blank">' + sTitle + '</a>';
- }
-
- function coverageType(aPlace) {
- return (aPlace.isarea ? 'Polygon' : 'Point');
- }
-
- function isAdminBoundary(aPlace) {
- return aPlace.category === 'boundary' && aPlace.type === 'administrative';
- }
-
- function formatAddressRank(iRank) {
- if (iRank < 4) return 'other';
- if (iRank < 6) return 'country';
- if (iRank < 8) return 'region';
- if (iRank < 10) return 'state';
- if (iRank < 12) return 'state district';
- if (iRank < 14) return 'county';
- if (iRank < 16) return 'municipality';
- if (iRank < 18) return 'city / town / village';
- if (iRank < 20) return 'city / village district';
- if (iRank < 22) return 'suburb / hamlet';
- if (iRank < 24) return 'neighbourhood';
- if (iRank < 26) return 'city block / square';
- if (iRank === 26) return 'major street';
- if (iRank === 27) return 'minory street / path';
- if (iRank <= 30) return 'house / building';
- return 'other';
- }
-
- function formatPlaceType(aPlace) {
- var sOut = aPlace.class + ':' + aPlace.type;
- if (aPlace.type && aPlace.type === 'administrative' && aPlace.place_type) {
- sOut = sOut + ' (' + aPlace.place_type + ')';
- }
- return escapeHtml_1(sOut);
- }
-
- // Any over 15 are invalid data in OSM anyway
- function formatAdminLevel(iLevel) {
- return (iLevel < 15 ? iLevel : '');
- }
-
- function formatDistance(fDistance, bInMeters) {
- if (bInMeters) {
- if (fDistance < 1) return '0';
- var sFormatted = (fDistance >= 1000)
- ? Math.round(fDistance / 1000, 1) + ' km'
- : Math.round(fDistance, 0) + ' m';
-
- return '<abbr class="distance" title="' + fDistance + ' meters">~' + sFormatted + '</abbr>';
- }
-
- // spheric distance, http://postgis.net/docs/ST_Distance_Spheroid.html
- if (fDistance === 0) return '0';
-
- return '<abbr class="distance" title="spheric distance ' + fDistance + '">~'
- + (Math.round(fDistance * 1000, 4) / 1000)
- + '</abbr>';
- }
-
- // mark partial tokens (those starting with a space) with a star for readability
- function formatKeywordToken(sToken) {
- return (sToken[0] === ' ' ? '*' : '') + escapeHtml_1(sToken);
- }
-
- function zoomLevels() {
- const aZoomLevels = [
- /* 0 */ 'Continent / Sea',
- /* 1 */ '',
- /* 2 */ '',
- /* 3 */ 'Country',
- /* 4 */ '',
- /* 5 */ 'State',
- /* 6 */ 'Region',
- /* 7 */ '',
- /* 8 */ 'County',
- /* 9 */ '',
- /* 10 */ 'City',
- /* 11 */ '',
- /* 12 */ 'Town / Village',
- /* 13 */ '',
- /* 14 */ 'Suburb',
- /* 15 */ '',
- /* 16 */ 'Street',
- /* 17 */ '',
- /* 18 */ 'Building',
- /* 19 */ '',
- /* 20 */ '',
- /* 21 */ ''
- ];
- return aZoomLevels;
-
- }
-
- /* src/components/SearchBar.svelte generated by Svelte v3.31.2 */
-
- const { console: console_1 } = globals;
- const file$3 = "src/components/SearchBar.svelte";
-
- function get_each_context(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[6] = list[i];
- child_ctx[8] = i;
- return child_ctx;
- }
-
- // (129:0) {:else}
- function create_else_block(ctx) {
- let div11;
- let ul;
- let li0;
- let a0;
- let t1;
- let li1;
- let a1;
- let t3;
- let div0;
- let a2;
- let t5;
- let a3;
- let t7;
- let div10;
- let div2;
- let form0;
- let input0;
- let input0_value_value;
- let t8;
- let div1;
- let button0;
- let t10;
- let input1;
- let input1_value_value;
- let t11;
- let input2;
- let input2_value_value;
- let t12;
- let input3;
- let input3_value_value;
- let t13;
- let input4;
- let input4_value_value;
- let t14;
- let input5;
- let input5_value_value;
- let t15;
- let input6;
- let input6_value_value;
- let t16;
- let input7;
- let input7_value_value;
- let t17;
- let div4;
- let form1;
- let input8;
- let input8_value_value;
- let t18;
- let input9;
- let input9_value_value;
- let t19;
- let input10;
- let input10_value_value;
- let t20;
- let input11;
- let input11_value_value;
- let t21;
- let input12;
- let input12_value_value;
- let t22;
- let input13;
- let input13_value_value;
- let t23;
- let div3;
- let button1;
- let t25;
- let input14;
- let input14_value_value;
- let t26;
- let input15;
- let input15_value_value;
- let t27;
- let input16;
- let input16_value_value;
- let t28;
- let input17;
- let input17_value_value;
- let t29;
- let input18;
- let input18_value_value;
- let t30;
- let input19;
- let input19_value_value;
- let t31;
- let input20;
- let input20_value_value;
- let t32;
- let a4;
- let t34;
- let div9;
- let div8;
- let div5;
- let span0;
- let input21;
- let input21_checked_value;
- let t35;
- let label0;
- let t37;
- let span1;
- let input22;
- let input22_checked_value;
- let t38;
- let label1;
- let t40;
- let span2;
- let input23;
- let input23_checked_value;
- let t41;
- let label2;
- let t43;
- let div6;
- let span3;
- let label3;
- let t45;
- let input24;
- let input24_value_value;
- let t46;
- let span4;
- let label4;
- let t48;
- let input25;
- let input25_value_value;
- let t49;
- let div7;
- let span5;
- let label5;
- let t51;
- let input26;
- let input26_value_value;
- let t52;
- let span6;
- let label6;
- let t54;
- let input27;
- let input27_value_value;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- div11 = element("div");
- ul = element("ul");
- li0 = element("li");
- a0 = element("a");
- a0.textContent = "simple";
- t1 = space();
- li1 = element("li");
- a1 = element("a");
- a1.textContent = "structured";
- t3 = space();
- div0 = element("div");
- a2 = element("a");
- a2.textContent = "search by id";
- t5 = space();
- a3 = element("a");
- a3.textContent = "reverse search";
- t7 = space();
- div10 = element("div");
- div2 = element("div");
- form0 = element("form");
- input0 = element("input");
- t8 = space();
- div1 = element("div");
- button0 = element("button");
- button0.textContent = "Search";
- t10 = space();
- input1 = element("input");
- t11 = space();
- input2 = element("input");
- t12 = space();
- input3 = element("input");
- t13 = space();
- input4 = element("input");
- t14 = space();
- input5 = element("input");
- t15 = space();
- input6 = element("input");
- t16 = space();
- input7 = element("input");
- t17 = space();
- div4 = element("div");
- form1 = element("form");
- input8 = element("input");
- t18 = space();
- input9 = element("input");
- t19 = space();
- input10 = element("input");
- t20 = space();
- input11 = element("input");
- t21 = space();
- input12 = element("input");
- t22 = space();
- input13 = element("input");
- t23 = space();
- div3 = element("div");
- button1 = element("button");
- button1.textContent = "Search";
- t25 = space();
- input14 = element("input");
- t26 = space();
- input15 = element("input");
- t27 = space();
- input16 = element("input");
- t28 = space();
- input17 = element("input");
- t29 = space();
- input18 = element("input");
- t30 = space();
- input19 = element("input");
- t31 = space();
- input20 = element("input");
- t32 = space();
- a4 = element("a");
- a4.textContent = "Advanced options";
- t34 = space();
- div9 = element("div");
- div8 = element("div");
- div5 = element("div");
- span0 = element("span");
- input21 = element("input");
- t35 = space();
- label0 = element("label");
- label0.textContent = "apply viewbox";
- t37 = space();
- span1 = element("span");
- input22 = element("input");
- t38 = space();
- label1 = element("label");
- label1.textContent = "bounded to viewbox";
- t40 = space();
- span2 = element("span");
- input23 = element("input");
- t41 = space();
- label2 = element("label");
- label2.textContent = "deduplicate results";
- t43 = space();
- div6 = element("div");
- span3 = element("span");
- label3 = element("label");
- label3.textContent = "Maximum number of results:";
- t45 = space();
- input24 = element("input");
- t46 = space();
- span4 = element("span");
- label4 = element("label");
- label4.textContent = "Polygon simplification:";
- t48 = space();
- input25 = element("input");
- t49 = space();
- div7 = element("div");
- span5 = element("span");
- label5 = element("label");
- label5.textContent = "Languages:";
- t51 = space();
- input26 = element("input");
- t52 = space();
- span6 = element("span");
- label6 = element("label");
- label6.textContent = "Countries:";
- t54 = space();
- input27 = element("input");
- attr_dev(a0, "class", "nav-link");
- attr_dev(a0, "data-toggle", "tab");
- attr_dev(a0, "href", "#simple");
- toggle_class(a0, "active", !/*bStructuredSearch*/ ctx[0]);
- add_location(a0, file$3, 133, 8, 4140);
- attr_dev(li0, "class", "nav-item");
- add_location(li0, file$3, 132, 6, 4110);
- attr_dev(a1, "class", "nav-link");
- attr_dev(a1, "data-toggle", "tab");
- attr_dev(a1, "href", "#structured");
- toggle_class(a1, "active", /*bStructuredSearch*/ ctx[0]);
- add_location(a1, file$3, 136, 8, 4286);
- attr_dev(li1, "class", "nav-item");
- add_location(li1, file$3, 135, 6, 4256);
- attr_dev(a2, "href", "details.html");
- attr_dev(a2, "class", "mr-2");
- add_location(a2, file$3, 139, 8, 4448);
- attr_dev(a3, "id", "switch-to-reverse");
- attr_dev(a3, "href", "reverse.html");
- add_location(a3, file$3, 140, 8, 4509);
- attr_dev(div0, "class", "search-type-link svelte-i44z6l");
- add_location(div0, file$3, 138, 6, 4409);
- attr_dev(ul, "class", "nav nav-tabs");
- add_location(ul, file$3, 131, 4, 4078);
- attr_dev(input0, "id", "q");
- attr_dev(input0, "name", "q");
- attr_dev(input0, "type", "text");
- attr_dev(input0, "class", "form-control form-control-sm svelte-i44z6l");
- attr_dev(input0, "placeholder", "Search");
- input0.value = input0_value_value = /*api_request_params*/ ctx[2].q || "";
- add_location(input0, file$3, 146, 10, 4814);
- attr_dev(button0, "type", "submit");
- attr_dev(button0, "class", "btn btn-primary btn-sm mx-1");
- add_location(button0, file$3, 154, 12, 5100);
- attr_dev(input1, "type", "hidden");
- attr_dev(input1, "name", "viewbox");
- input1.value = input1_value_value = /*sViewBox*/ ctx[3] || "";
- add_location(input1, file$3, 155, 12, 5186);
- attr_dev(input2, "type", "hidden");
- attr_dev(input2, "name", "dedupe");
- input2.value = input2_value_value = !/*api_request_params*/ ctx[2].dedupe ? "" : 1;
- add_location(input2, file$3, 156, 12, 5262);
- attr_dev(input3, "type", "hidden");
- attr_dev(input3, "name", "bounded");
- input3.value = input3_value_value = /*api_request_params*/ ctx[2].bounded ? 1 : "";
- add_location(input3, file$3, 157, 12, 5358);
- attr_dev(input4, "type", "hidden");
- attr_dev(input4, "name", "accept-language");
- input4.value = input4_value_value = /*api_request_params*/ ctx[2]["accept-language"] || "";
- add_location(input4, file$3, 158, 12, 5455);
- attr_dev(input5, "type", "hidden");
- attr_dev(input5, "name", "countrycodes");
- input5.value = input5_value_value = /*api_request_params*/ ctx[2].countrycodes || "";
- add_location(input5, file$3, 159, 12, 5568);
- attr_dev(input6, "type", "hidden");
- attr_dev(input6, "name", "limit");
- input6.value = input6_value_value = /*api_request_params*/ ctx[2].limit || "";
- add_location(input6, file$3, 160, 12, 5672);
- attr_dev(input7, "type", "hidden");
- attr_dev(input7, "name", "polygon_threshold");
- input7.value = input7_value_value = /*api_request_params*/ ctx[2].polygon_threshold || "";
- add_location(input7, file$3, 161, 12, 5762);
- attr_dev(div1, "class", "form-group search-button-group svelte-i44z6l");
- add_location(div1, file$3, 153, 10, 5043);
- attr_dev(form0, "class", "form-inline svelte-i44z6l");
- attr_dev(form0, "role", "search");
- attr_dev(form0, "accept-charset", "UTF-8");
- attr_dev(form0, "action", "");
- add_location(form0, file$3, 145, 8, 4730);
- attr_dev(div2, "class", "tab-pane");
- attr_dev(div2, "id", "simple");
- attr_dev(div2, "role", "tabpanel");
- toggle_class(div2, "active", !/*bStructuredSearch*/ ctx[0]);
- add_location(div2, file$3, 144, 6, 4637);
- attr_dev(input8, "name", "street");
- attr_dev(input8, "type", "text");
- attr_dev(input8, "class", "form-control form-control-sm mr-1");
- attr_dev(input8, "placeholder", "House number/Street");
- input8.value = input8_value_value = /*api_request_params*/ ctx[2].street || "";
- add_location(input8, file$3, 167, 10, 6096);
- attr_dev(input9, "name", "city");
- attr_dev(input9, "type", "text");
- attr_dev(input9, "class", "form-control form-control-sm mr-1");
- attr_dev(input9, "placeholder", "City");
- input9.value = input9_value_value = /*api_request_params*/ ctx[2].city || "";
- add_location(input9, file$3, 170, 10, 6294);
- attr_dev(input10, "id", "county");
- attr_dev(input10, "name", "county");
- attr_dev(input10, "type", "text");
- attr_dev(input10, "class", "form-control form-control-sm mr-1");
- attr_dev(input10, "placeholder", "County");
- input10.value = input10_value_value = /*api_request_params*/ ctx[2].county || "";
- add_location(input10, file$3, 173, 10, 6473);
- attr_dev(input11, "name", "state");
- attr_dev(input11, "type", "text");
- attr_dev(input11, "class", "form-control form-control-sm mr-1");
- attr_dev(input11, "placeholder", "State");
- input11.value = input11_value_value = /*api_request_params*/ ctx[2].state || "";
- add_location(input11, file$3, 176, 10, 6670);
- attr_dev(input12, "name", "country");
- attr_dev(input12, "type", "text");
- attr_dev(input12, "class", "form-control form-control-sm mr-1");
- attr_dev(input12, "placeholder", "Country");
- input12.value = input12_value_value = /*api_request_params*/ ctx[2].country || "";
- add_location(input12, file$3, 179, 10, 6852);
- attr_dev(input13, "name", "postalcode");
- attr_dev(input13, "type", "text");
- attr_dev(input13, "class", "form-control form-control-sm mr-1");
- attr_dev(input13, "placeholder", "Postal Code");
- input13.value = input13_value_value = /*api_request_params*/ ctx[2].postalcode || "";
- add_location(input13, file$3, 182, 10, 7040);
- attr_dev(button1, "type", "submit");
- attr_dev(button1, "class", "btn btn-primary btn-sm mx-1");
- add_location(button1, file$3, 187, 12, 7296);
- attr_dev(input14, "type", "hidden");
- attr_dev(input14, "name", "viewbox");
- input14.value = input14_value_value = /*sViewBox*/ ctx[3] || "";
- add_location(input14, file$3, 188, 12, 7382);
- attr_dev(input15, "type", "hidden");
- attr_dev(input15, "name", "dedupe");
- input15.value = input15_value_value = !/*api_request_params*/ ctx[2].dedupe ? "" : 1;
- add_location(input15, file$3, 189, 12, 7458);
- attr_dev(input16, "type", "hidden");
- attr_dev(input16, "name", "bounded");
- input16.value = input16_value_value = /*api_request_params*/ ctx[2].bounded ? 1 : "";
- add_location(input16, file$3, 190, 12, 7554);
- attr_dev(input17, "type", "hidden");
- attr_dev(input17, "name", "accept-language");
- input17.value = input17_value_value = /*api_request_params*/ ctx[2]["accept-language"] || "";
- add_location(input17, file$3, 191, 12, 7651);
- attr_dev(input18, "type", "hidden");
- attr_dev(input18, "name", "countrycodes");
- input18.value = input18_value_value = /*api_request_params*/ ctx[2].countrycodes || "";
- add_location(input18, file$3, 192, 12, 7764);
- attr_dev(input19, "type", "hidden");
- attr_dev(input19, "name", "limit");
- input19.value = input19_value_value = /*api_request_params*/ ctx[2].limit || "";
- add_location(input19, file$3, 193, 12, 7868);
- attr_dev(input20, "type", "hidden");
- attr_dev(input20, "name", "polygon_threshold");
- input20.value = input20_value_value = /*api_request_params*/ ctx[2].polygon_threshold || "";
- add_location(input20, file$3, 194, 12, 7958);
- attr_dev(div3, "class", "form-group search-button-group svelte-i44z6l");
- add_location(div3, file$3, 186, 10, 7239);
- attr_dev(form1, "class", "form-inline");
- attr_dev(form1, "role", "search");
- attr_dev(form1, "accept-charset", "UTF-8");
- attr_dev(form1, "action", "");
- add_location(form1, file$3, 166, 8, 6012);
- attr_dev(div4, "class", "tab-pane");
- attr_dev(div4, "id", "structured");
- attr_dev(div4, "role", "tabpanel");
- toggle_class(div4, "active", /*bStructuredSearch*/ ctx[0]);
- add_location(div4, file$3, 165, 6, 5916);
- attr_dev(a4, "href", "#advanced");
- attr_dev(a4, "class", "btn btn-outline-secondary btn-sm");
- attr_dev(a4, "data-toggle", "collapse");
- attr_dev(a4, "data-target", "#searchAdvancedOptions");
- attr_dev(a4, "role", "button");
- attr_dev(a4, "aria-expanded", "false");
- attr_dev(a4, "aria-controls", "collapseAdvancedOptions");
- add_location(a4, file$3, 199, 6, 8146);
- attr_dev(input21, "type", "checkbox");
- attr_dev(input21, "class", "form-check-input api-param-setting");
- attr_dev(input21, "id", "use_viewbox");
- input21.checked = input21_checked_value = /*api_request_params*/ ctx[2].viewbox;
- add_location(input21, file$3, 205, 20, 8559);
- attr_dev(label0, "class", "form-check-label svelte-i44z6l");
- attr_dev(label0, "for", "use_viewbox");
- add_location(label0, file$3, 207, 14, 8741);
- attr_dev(span0, "class", "svelte-i44z6l");
- add_location(span0, file$3, 205, 14, 8553);
- attr_dev(input22, "type", "checkbox");
- attr_dev(input22, "class", "form-check-input api-param-setting");
- attr_dev(input22, "id", "option_bounded");
- input22.checked = input22_checked_value = !!/*api_request_params*/ ctx[2].bounded;
- add_location(input22, file$3, 208, 20, 8840);
- attr_dev(label1, "class", "form-check-label svelte-i44z6l");
- attr_dev(label1, "for", "option_bounded");
- add_location(label1, file$3, 210, 14, 9025);
- attr_dev(span1, "class", "svelte-i44z6l");
- add_location(span1, file$3, 208, 14, 8834);
- attr_dev(input23, "type", "checkbox");
- attr_dev(input23, "class", "form-check-input api-param-setting");
- attr_dev(input23, "id", "option_dedupe");
- input23.checked = input23_checked_value = !!/*api_request_params*/ ctx[2].dedupe;
- add_location(input23, file$3, 211, 20, 9132);
- attr_dev(label2, "class", "form-check-label svelte-i44z6l");
- attr_dev(label2, "for", "option_dedupe");
- add_location(label2, file$3, 213, 14, 9314);
- attr_dev(span2, "class", "svelte-i44z6l");
- add_location(span2, file$3, 211, 14, 9126);
- attr_dev(div5, "class", "form-check form-check-inline");
- add_location(div5, file$3, 204, 12, 8496);
- attr_dev(label3, "class", "form-check-label svelte-i44z6l");
- attr_dev(label3, "for", "option_limit");
- add_location(label3, file$3, 216, 20, 9495);
- attr_dev(input24, "type", "number");
- attr_dev(input24, "class", "form-check-input api-param-setting");
- attr_dev(input24, "data-api-param", "limit");
- attr_dev(input24, "id", "option_limit");
- attr_dev(input24, "size", "5");
- attr_dev(input24, "min", "1");
- attr_dev(input24, "max", "50");
- input24.value = input24_value_value = /*api_request_params*/ ctx[2].limit || "";
- add_location(input24, file$3, 217, 14, 9596);
- attr_dev(span3, "class", "svelte-i44z6l");
- add_location(span3, file$3, 216, 14, 9489);
- attr_dev(label4, "class", "form-check-label svelte-i44z6l");
- attr_dev(label4, "for", "option_polygon_threashold");
- add_location(label4, file$3, 218, 20, 9822);
- attr_dev(input25, "type", "number");
- attr_dev(input25, "class", "form-check-input api-param-setting");
- attr_dev(input25, "data-api-param", "polygon_threshold");
- attr_dev(input25, "id", "option_polygon_threshold");
- attr_dev(input25, "size", "5");
- attr_dev(input25, "min", "0.0");
- attr_dev(input25, "step", "0.01");
- input25.value = input25_value_value = /*api_request_params*/ ctx[2].polygon_threshold || "";
- add_location(input25, file$3, 219, 14, 9933);
- attr_dev(span4, "class", "svelte-i44z6l");
- add_location(span4, file$3, 218, 14, 9816);
- attr_dev(div6, "class", "form-check form-check-inline");
- add_location(div6, file$3, 215, 12, 9432);
- attr_dev(label5, "class", "form-check-label svelte-i44z6l");
- attr_dev(label5, "for", "accept_lang");
- add_location(label5, file$3, 222, 20, 10274);
- attr_dev(input26, "type", "text");
- attr_dev(input26, "placeholder", "e.g. en,zh-Hant");
- attr_dev(input26, "class", "form-check-input api-param-setting");
- attr_dev(input26, "data-api-param", "accept-language");
- attr_dev(input26, "id", "accept_lang");
- attr_dev(input26, "size", "15");
- input26.value = input26_value_value = /*api_request_params*/ ctx[2]["accept-language"] || "";
- add_location(input26, file$3, 223, 14, 10358);
- attr_dev(span5, "class", "svelte-i44z6l");
- add_location(span5, file$3, 222, 14, 10268);
- attr_dev(label6, "class", "form-check-label svelte-i44z6l");
- attr_dev(label6, "for", "option_ccode");
- add_location(label6, file$3, 224, 20, 10618);
- attr_dev(input27, "type", "text");
- attr_dev(input27, "placeholder", "e.g. de,gb");
- attr_dev(input27, "class", "form-check-input api-param-setting");
- attr_dev(input27, "data-api-param", "countrycodes");
- attr_dev(input27, "id", "option_ccode");
- attr_dev(input27, "size", "15");
- input27.value = input27_value_value = /*api_request_params*/ ctx[2].countrycodes || "";
- add_location(input27, file$3, 225, 14, 10703);
- attr_dev(span6, "class", "svelte-i44z6l");
- add_location(span6, file$3, 224, 14, 10612);
- attr_dev(div7, "class", "form-check form-check-inline");
- add_location(div7, file$3, 221, 12, 10211);
- attr_dev(div8, "id", "searchAdvancedOptionsContent");
- attr_dev(div8, "class", "svelte-i44z6l");
- add_location(div8, file$3, 203, 8, 8444);
- attr_dev(div9, "class", "collapse");
- attr_dev(div9, "id", "searchAdvancedOptions");
- add_location(div9, file$3, 202, 6, 8386);
- attr_dev(div10, "class", "tab-content p-2 svelte-i44z6l");
- add_location(div10, file$3, 143, 4, 4601);
- attr_dev(div11, "class", "top-bar svelte-i44z6l");
- add_location(div11, file$3, 130, 2, 4052);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div11, anchor);
- append_dev(div11, ul);
- append_dev(ul, li0);
- append_dev(li0, a0);
- append_dev(ul, t1);
- append_dev(ul, li1);
- append_dev(li1, a1);
- append_dev(ul, t3);
- append_dev(ul, div0);
- append_dev(div0, a2);
- append_dev(div0, t5);
- append_dev(div0, a3);
- append_dev(div11, t7);
- append_dev(div11, div10);
- append_dev(div10, div2);
- append_dev(div2, form0);
- append_dev(form0, input0);
- append_dev(form0, t8);
- append_dev(form0, div1);
- append_dev(div1, button0);
- append_dev(div1, t10);
- append_dev(div1, input1);
- append_dev(div1, t11);
- append_dev(div1, input2);
- append_dev(div1, t12);
- append_dev(div1, input3);
- append_dev(div1, t13);
- append_dev(div1, input4);
- append_dev(div1, t14);
- append_dev(div1, input5);
- append_dev(div1, t15);
- append_dev(div1, input6);
- append_dev(div1, t16);
- append_dev(div1, input7);
- append_dev(div10, t17);
- append_dev(div10, div4);
- append_dev(div4, form1);
- append_dev(form1, input8);
- append_dev(form1, t18);
- append_dev(form1, input9);
- append_dev(form1, t19);
- append_dev(form1, input10);
- append_dev(form1, t20);
- append_dev(form1, input11);
- append_dev(form1, t21);
- append_dev(form1, input12);
- append_dev(form1, t22);
- append_dev(form1, input13);
- append_dev(form1, t23);
- append_dev(form1, div3);
- append_dev(div3, button1);
- append_dev(div3, t25);
- append_dev(div3, input14);
- append_dev(div3, t26);
- append_dev(div3, input15);
- append_dev(div3, t27);
- append_dev(div3, input16);
- append_dev(div3, t28);
- append_dev(div3, input17);
- append_dev(div3, t29);
- append_dev(div3, input18);
- append_dev(div3, t30);
- append_dev(div3, input19);
- append_dev(div3, t31);
- append_dev(div3, input20);
- append_dev(div10, t32);
- append_dev(div10, a4);
- append_dev(div10, t34);
- append_dev(div10, div9);
- append_dev(div9, div8);
- append_dev(div8, div5);
- append_dev(div5, span0);
- append_dev(span0, input21);
- append_dev(span0, t35);
- append_dev(span0, label0);
- append_dev(div5, t37);
- append_dev(div5, span1);
- append_dev(span1, input22);
- append_dev(span1, t38);
- append_dev(span1, label1);
- append_dev(div5, t40);
- append_dev(div5, span2);
- append_dev(span2, input23);
- append_dev(span2, t41);
- append_dev(span2, label2);
- append_dev(div8, t43);
- append_dev(div8, div6);
- append_dev(div6, span3);
- append_dev(span3, label3);
- append_dev(span3, t45);
- append_dev(span3, input24);
- append_dev(div6, t46);
- append_dev(div6, span4);
- append_dev(span4, label4);
- append_dev(span4, t48);
- append_dev(span4, input25);
- append_dev(div8, t49);
- append_dev(div8, div7);
- append_dev(div7, span5);
- append_dev(span5, label5);
- append_dev(span5, t51);
- append_dev(span5, input26);
- append_dev(div7, t52);
- append_dev(div7, span6);
- append_dev(span6, label6);
- append_dev(span6, t54);
- append_dev(span6, input27);
-
- if (!mounted) {
- dispose = [
- listen_dev(input21, "change", /*reset_viewbox*/ ctx[4], false, false, false),
- listen_dev(input22, "change", set_bounded, false, false, false),
- listen_dev(input23, "change", set_dedupe, false, false, false),
- listen_dev(input24, "change", set_api_param, false, false, false),
- listen_dev(input25, "change", set_api_param, false, false, false),
- listen_dev(input26, "change", set_api_param, false, false, false),
- listen_dev(input27, "change", set_api_param, false, false, false)
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*bStructuredSearch*/ 1) {
- toggle_class(a0, "active", !/*bStructuredSearch*/ ctx[0]);
- }
-
- if (dirty & /*bStructuredSearch*/ 1) {
- toggle_class(a1, "active", /*bStructuredSearch*/ ctx[0]);
- }
-
- if (dirty & /*api_request_params*/ 4 && input0_value_value !== (input0_value_value = /*api_request_params*/ ctx[2].q || "") && input0.value !== input0_value_value) {
- prop_dev(input0, "value", input0_value_value);
- }
-
- if (dirty & /*sViewBox*/ 8 && input1_value_value !== (input1_value_value = /*sViewBox*/ ctx[3] || "")) {
- prop_dev(input1, "value", input1_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input2_value_value !== (input2_value_value = !/*api_request_params*/ ctx[2].dedupe ? "" : 1)) {
- prop_dev(input2, "value", input2_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input3_value_value !== (input3_value_value = /*api_request_params*/ ctx[2].bounded ? 1 : "")) {
- prop_dev(input3, "value", input3_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input4_value_value !== (input4_value_value = /*api_request_params*/ ctx[2]["accept-language"] || "")) {
- prop_dev(input4, "value", input4_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input5_value_value !== (input5_value_value = /*api_request_params*/ ctx[2].countrycodes || "")) {
- prop_dev(input5, "value", input5_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input6_value_value !== (input6_value_value = /*api_request_params*/ ctx[2].limit || "")) {
- prop_dev(input6, "value", input6_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input7_value_value !== (input7_value_value = /*api_request_params*/ ctx[2].polygon_threshold || "")) {
- prop_dev(input7, "value", input7_value_value);
- }
-
- if (dirty & /*bStructuredSearch*/ 1) {
- toggle_class(div2, "active", !/*bStructuredSearch*/ ctx[0]);
- }
-
- if (dirty & /*api_request_params*/ 4 && input8_value_value !== (input8_value_value = /*api_request_params*/ ctx[2].street || "") && input8.value !== input8_value_value) {
- prop_dev(input8, "value", input8_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input9_value_value !== (input9_value_value = /*api_request_params*/ ctx[2].city || "") && input9.value !== input9_value_value) {
- prop_dev(input9, "value", input9_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input10_value_value !== (input10_value_value = /*api_request_params*/ ctx[2].county || "") && input10.value !== input10_value_value) {
- prop_dev(input10, "value", input10_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input11_value_value !== (input11_value_value = /*api_request_params*/ ctx[2].state || "") && input11.value !== input11_value_value) {
- prop_dev(input11, "value", input11_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input12_value_value !== (input12_value_value = /*api_request_params*/ ctx[2].country || "") && input12.value !== input12_value_value) {
- prop_dev(input12, "value", input12_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input13_value_value !== (input13_value_value = /*api_request_params*/ ctx[2].postalcode || "") && input13.value !== input13_value_value) {
- prop_dev(input13, "value", input13_value_value);
- }
-
- if (dirty & /*sViewBox*/ 8 && input14_value_value !== (input14_value_value = /*sViewBox*/ ctx[3] || "")) {
- prop_dev(input14, "value", input14_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input15_value_value !== (input15_value_value = !/*api_request_params*/ ctx[2].dedupe ? "" : 1)) {
- prop_dev(input15, "value", input15_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input16_value_value !== (input16_value_value = /*api_request_params*/ ctx[2].bounded ? 1 : "")) {
- prop_dev(input16, "value", input16_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input17_value_value !== (input17_value_value = /*api_request_params*/ ctx[2]["accept-language"] || "")) {
- prop_dev(input17, "value", input17_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input18_value_value !== (input18_value_value = /*api_request_params*/ ctx[2].countrycodes || "")) {
- prop_dev(input18, "value", input18_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input19_value_value !== (input19_value_value = /*api_request_params*/ ctx[2].limit || "")) {
- prop_dev(input19, "value", input19_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input20_value_value !== (input20_value_value = /*api_request_params*/ ctx[2].polygon_threshold || "")) {
- prop_dev(input20, "value", input20_value_value);
- }
-
- if (dirty & /*bStructuredSearch*/ 1) {
- toggle_class(div4, "active", /*bStructuredSearch*/ ctx[0]);
- }
-
- if (dirty & /*api_request_params*/ 4 && input21_checked_value !== (input21_checked_value = /*api_request_params*/ ctx[2].viewbox)) {
- prop_dev(input21, "checked", input21_checked_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input22_checked_value !== (input22_checked_value = !!/*api_request_params*/ ctx[2].bounded)) {
- prop_dev(input22, "checked", input22_checked_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input23_checked_value !== (input23_checked_value = !!/*api_request_params*/ ctx[2].dedupe)) {
- prop_dev(input23, "checked", input23_checked_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input24_value_value !== (input24_value_value = /*api_request_params*/ ctx[2].limit || "")) {
- prop_dev(input24, "value", input24_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input25_value_value !== (input25_value_value = /*api_request_params*/ ctx[2].polygon_threshold || "")) {
- prop_dev(input25, "value", input25_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input26_value_value !== (input26_value_value = /*api_request_params*/ ctx[2]["accept-language"] || "") && input26.value !== input26_value_value) {
- prop_dev(input26, "value", input26_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input27_value_value !== (input27_value_value = /*api_request_params*/ ctx[2].countrycodes || "") && input27.value !== input27_value_value) {
- prop_dev(input27, "value", input27_value_value);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div11);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block.name,
- type: "else",
- source: "(129:0) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (90:0) {#if reverse_search}
- function create_if_block$1(ctx) {
- let div2;
- let form;
- let div0;
- let input0;
- let t0;
- let label0;
- let t2;
- let input1;
- let input1_value_value;
- let t3;
- let a0;
- let t5;
- let label1;
- let t7;
- let input2;
- let input2_value_value;
- let t8;
- let label2;
- let t10;
- let select;
- let option;
- let t11;
- let option_selected_value;
- let select_value_value;
- let t12;
- let button;
- let t14;
- let div1;
- let a1;
- let t16;
- let a2;
- let mounted;
- let dispose;
- let each_value = zoomLevels_1();
- validate_each_argument(each_value);
- let each_blocks = [];
-
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
- }
-
- const block = {
- c: function create() {
- div2 = element("div");
- form = element("form");
- div0 = element("div");
- input0 = element("input");
- t0 = space();
- label0 = element("label");
- label0.textContent = "lat";
- t2 = space();
- input1 = element("input");
- t3 = space();
- a0 = element("a");
- a0.textContent = "<>";
- t5 = space();
- label1 = element("label");
- label1.textContent = "lon";
- t7 = space();
- input2 = element("input");
- t8 = space();
- label2 = element("label");
- label2.textContent = "max zoom";
- t10 = space();
- select = element("select");
- option = element("option");
- t11 = text("---");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t12 = space();
- button = element("button");
- button.textContent = "Search";
- t14 = space();
- div1 = element("div");
- a1 = element("a");
- a1.textContent = "search by id";
- t16 = space();
- a2 = element("a");
- a2.textContent = "forward search";
- attr_dev(input0, "name", "format");
- attr_dev(input0, "type", "hidden");
- input0.value = "html";
- add_location(input0, file$3, 93, 8, 2644);
- attr_dev(label0, "class", "svelte-i44z6l");
- add_location(label0, file$3, 94, 8, 2701);
- attr_dev(input1, "name", "lat");
- attr_dev(input1, "type", "text");
- attr_dev(input1, "class", "form-control form-control-sm");
- attr_dev(input1, "placeholder", "latitude");
- input1.value = input1_value_value = /*api_request_params*/ ctx[2].lat || "";
- add_location(input1, file$3, 95, 8, 2728);
- attr_dev(a0, "id", "switch-coords");
- attr_dev(a0, "class", "btn btn-outline-secondary btn-sm svelte-i44z6l");
- attr_dev(a0, "title", "switch lat and lon");
- add_location(a0, file$3, 100, 8, 2928);
- attr_dev(label1, "class", "svelte-i44z6l");
- add_location(label1, file$3, 104, 8, 3133);
- attr_dev(input2, "name", "lon");
- attr_dev(input2, "type", "text");
- attr_dev(input2, "class", "form-control form-control-sm");
- attr_dev(input2, "placeholder", "longitude");
- input2.value = input2_value_value = /*api_request_params*/ ctx[2].lon || "";
- add_location(input2, file$3, 105, 8, 3160);
- attr_dev(label2, "class", "svelte-i44z6l");
- add_location(label2, file$3, 110, 8, 3361);
- option.__value = "";
- option.value = option.__value;
- option.selected = option_selected_value = !/*api_request_params*/ ctx[2].zoom;
- add_location(option, file$3, 112, 10, 3495);
- attr_dev(select, "name", "zoom");
- attr_dev(select, "class", "form-control form-control-sm");
- add_location(select, file$3, 111, 8, 3393);
- attr_dev(button, "type", "submit");
- attr_dev(button, "class", "btn btn-primary btn-sm mx-1");
- add_location(button, file$3, 117, 8, 3752);
- attr_dev(div0, "class", "form-group");
- add_location(div0, file$3, 92, 6, 2611);
- attr_dev(a1, "href", "details.html");
- attr_dev(a1, "class", "mr-2");
- add_location(a1, file$3, 122, 8, 3904);
- attr_dev(a2, "href", "search.html");
- add_location(a2, file$3, 123, 8, 3965);
- attr_dev(div1, "class", "search-type-link svelte-i44z6l");
- add_location(div1, file$3, 121, 6, 3865);
- attr_dev(form, "class", "form-inline svelte-i44z6l");
- attr_dev(form, "role", "search");
- attr_dev(form, "accept-charset", "UTF-8");
- attr_dev(form, "action", "");
- add_location(form, file$3, 91, 4, 2531);
- attr_dev(div2, "class", "top-bar svelte-i44z6l");
- add_location(div2, file$3, 90, 2, 2505);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div2, anchor);
- append_dev(div2, form);
- append_dev(form, div0);
- append_dev(div0, input0);
- append_dev(div0, t0);
- append_dev(div0, label0);
- append_dev(div0, t2);
- append_dev(div0, input1);
- append_dev(div0, t3);
- append_dev(div0, a0);
- append_dev(div0, t5);
- append_dev(div0, label1);
- append_dev(div0, t7);
- append_dev(div0, input2);
- append_dev(div0, t8);
- append_dev(div0, label2);
- append_dev(div0, t10);
- append_dev(div0, select);
- append_dev(select, option);
- append_dev(option, t11);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(select, null);
- }
-
- select_option(select, /*api_request_params*/ ctx[2].zoom);
- append_dev(div0, t12);
- append_dev(div0, button);
- append_dev(form, t14);
- append_dev(form, div1);
- append_dev(div1, a1);
- append_dev(div1, t16);
- append_dev(div1, a2);
-
- if (!mounted) {
- dispose = listen_dev(a0, "click", stop_propagation(prevent_default(handleSwitchCoords)), false, true, true);
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*api_request_params*/ 4 && input1_value_value !== (input1_value_value = /*api_request_params*/ ctx[2].lat || "") && input1.value !== input1_value_value) {
- prop_dev(input1, "value", input1_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && input2_value_value !== (input2_value_value = /*api_request_params*/ ctx[2].lon || "") && input2.value !== input2_value_value) {
- prop_dev(input2, "value", input2_value_value);
- }
-
- if (dirty & /*api_request_params*/ 4 && option_selected_value !== (option_selected_value = !/*api_request_params*/ ctx[2].zoom)) {
- prop_dev(option, "selected", option_selected_value);
- }
-
- if (dirty & /*api_request_params, zoomLevels*/ 4) {
- each_value = zoomLevels_1();
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(select, null);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value.length;
- }
-
- if (dirty & /*api_request_params*/ 4 && select_value_value !== (select_value_value = /*api_request_params*/ ctx[2].zoom)) {
- select_option(select, /*api_request_params*/ ctx[2].zoom);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- destroy_each(each_blocks, detaching);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$1.name,
- type: "if",
- source: "(90:0) {#if reverse_search}",
- ctx
- });
-
- return block;
- }
-
- // (114:10) {#each zoomLevels() as zoomTitle, i}
- function create_each_block(ctx) {
- let option;
- let t0;
- let t1;
- let t2_value = /*zoomTitle*/ ctx[6] + "";
- let t2;
- let option_selected_value;
-
- const block = {
- c: function create() {
- option = element("option");
- t0 = text(/*i*/ ctx[8]);
- t1 = text(" - ");
- t2 = text(t2_value);
- option.__value = /*i*/ ctx[8];
- option.value = option.__value;
- option.selected = option_selected_value = /*i*/ ctx[8] === /*api_request_params*/ ctx[2].zoom;
- add_location(option, file$3, 114, 12, 3620);
- },
- m: function mount(target, anchor) {
- insert_dev(target, option, anchor);
- append_dev(option, t0);
- append_dev(option, t1);
- append_dev(option, t2);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*api_request_params*/ 4 && option_selected_value !== (option_selected_value = /*i*/ ctx[8] === /*api_request_params*/ ctx[2].zoom)) {
- prop_dev(option, "selected", option_selected_value);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(option);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block.name,
- type: "each",
- source: "(114:10) {#each zoomLevels() as zoomTitle, i}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$3(ctx) {
- let if_block_anchor;
-
- function select_block_type(ctx, dirty) {
- if (/*reverse_search*/ ctx[1]) return create_if_block$1;
- return create_else_block;
- }
-
- let current_block_type = select_block_type(ctx);
- let if_block = current_block_type(ctx);
-
- const block = {
- c: function create() {
- if_block.c();
- if_block_anchor = empty();
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- if_block.m(target, anchor);
- insert_dev(target, if_block_anchor, anchor);
- },
- p: function update(ctx, [dirty]) {
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block.d(1);
- if_block = current_block_type(ctx);
-
- if (if_block) {
- if_block.c();
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
- }
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if_block.d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$3.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function map_viewbox_as_string(map) {
- var bounds = map.getBounds();
- var west = bounds.getWest();
- var east = bounds.getEast();
-
- if (east - west >= 360) {
- // covers more than whole planet
- west = map.getCenter().lng - 179.999;
-
- east = map.getCenter().lng + 179.999;
- }
-
- east = L.latLng(77, east).wrap().lng;
- west = L.latLng(77, west).wrap().lng;
-
- return [
- west.toFixed(5),
- bounds.getNorth().toFixed(5),
- east.toFixed(5),
- bounds.getSouth().toFixed(5)
- ].join(","); // left
- // top
- // right
- // bottom
- }
-
- function update_reverse_link(map) {
- let link = document.getElementById("switch-to-reverse");
-
- if (link) {
- let center_lat_lng = map.wrapLatLng(map.getCenter());
- link.href = "reverse.html?lat=" + center_lat_lng.lat.toFixed(5) + "&lon=" + center_lat_lng.lng.toFixed(5);
- }
- }
-
- function set_bounded(e) {
- console.log("setting", e.target);
- document.querySelector("input[name=bounded]").value = e.target.checked ? 1 : "";
- }
-
- function set_dedupe(e) {
- document.querySelector("input[name=dedupe]").value = e.target.checked ? 1 : "";
- }
-
- function set_api_param(e) {
- document.querySelector("input[name=" + e.target.dataset["apiParam"] + "]").value = e.target.value;
- }
-
- function handleSwitchCoords() {
- let lat = document.querySelector("input[name=lat]").value;
- let lon = document.querySelector("input[name=lon]").value;
- document.querySelector("input[name=lat]").value = lon;
- document.querySelector("input[name=lon]").value = lat;
- document.querySelector("form").submit();
- }
-
- function instance$3($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("SearchBar", slots, []);
- let { bStructuredSearch = false } = $$props;
- let { reverse_search = false } = $$props;
- let { api_request_params = {} } = $$props;
- let sViewBox;
-
- function set_viewbox(map) {
- let set_viewbox = document.getElementById("use_viewbox");
-
- if (set_viewbox && set_viewbox.checked) {
- $$invalidate(3, sViewBox = map_viewbox_as_string(map));
- } else {
- $$invalidate(3, sViewBox = "");
- }
- }
-
- map_store.subscribe(map => {
- if (!map) {
- return;
- }
-
- map.on("move", function () {
- set_viewbox(map);
- update_reverse_link(map);
- });
-
- map.on("load", function () {
- set_viewbox(map);
- update_reverse_link(map);
- });
- });
-
- function reset_viewbox() {
- let map = get_store_value(map_store);
-
- if (map) {
- set_viewbox(map);
- }
-
-
- }
-
- const writable_props = ["bStructuredSearch", "reverse_search", "api_request_params"];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(`<SearchBar> was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ("bStructuredSearch" in $$props) $$invalidate(0, bStructuredSearch = $$props.bStructuredSearch);
- if ("reverse_search" in $$props) $$invalidate(1, reverse_search = $$props.reverse_search);
- if ("api_request_params" in $$props) $$invalidate(2, api_request_params = $$props.api_request_params);
- };
-
- $$self.$capture_state = () => ({
- zoomLevels: zoomLevels_1,
- map_store,
- get: get_store_value,
- bStructuredSearch,
- reverse_search,
- api_request_params,
- sViewBox,
- map_viewbox_as_string,
- set_viewbox,
- update_reverse_link,
- reset_viewbox,
- set_bounded,
- set_dedupe,
- set_api_param,
- handleSwitchCoords
- });
-
- $$self.$inject_state = $$props => {
- if ("bStructuredSearch" in $$props) $$invalidate(0, bStructuredSearch = $$props.bStructuredSearch);
- if ("reverse_search" in $$props) $$invalidate(1, reverse_search = $$props.reverse_search);
- if ("api_request_params" in $$props) $$invalidate(2, api_request_params = $$props.api_request_params);
- if ("sViewBox" in $$props) $$invalidate(3, sViewBox = $$props.sViewBox);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [bStructuredSearch, reverse_search, api_request_params, sViewBox, reset_viewbox];
- }
-
- class SearchBar extends SvelteComponentDev {
- constructor(options) {
- super(options);
-
- init(this, options, instance$3, create_fragment$3, safe_not_equal, {
- bStructuredSearch: 0,
- reverse_search: 1,
- api_request_params: 2
- });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "SearchBar",
- options,
- id: create_fragment$3.name
- });
- }
-
- get bStructuredSearch() {
- throw new Error("<SearchBar>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set bStructuredSearch(value) {
- throw new Error("<SearchBar>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- get reverse_search() {
- throw new Error("<SearchBar>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set reverse_search(value) {
- throw new Error("<SearchBar>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- get api_request_params() {
- throw new Error("<SearchBar>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set api_request_params(value) {
- throw new Error("<SearchBar>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
- }
-
- /* src/components/Welcome.svelte generated by Svelte v3.31.2 */
-
- const file$4 = "src/components/Welcome.svelte";
-
- function create_fragment$4(ctx) {
- let div;
- let h2;
- let t1;
- let p;
- let t2;
- let a0;
- let t4;
- let t5;
- let a1;
- let t7;
-
- const block = {
- c: function create() {
- div = element("div");
- h2 = element("h2");
- h2.textContent = "Welcome to Nominatim";
- t1 = space();
- p = element("p");
- t2 = text("Nominatim is a search engine for\n ");
- a0 = element("a");
- a0.textContent = "OpenStreetMap";
- t4 = text(" data. This\n is the debugging interface. You may search for a name or address\n (forward search) or look up data by its geographic coordinate (reverse\n search). Each result comes with a link to a details page where you\n can inspect what data about the object is saved in the database and\n investigate how the address of the object has been computed.");
- t5 = text("\n\n For more information visit the\n ");
- a1 = element("a");
- a1.textContent = "Nominatim home page";
- t7 = text(".");
- add_location(h2, file$4, 1, 2, 21);
- attr_dev(a0, "href", "https://www.openstreetmap.org");
- add_location(a0, file$4, 5, 4, 99);
- add_location(p, file$4, 3, 2, 54);
- attr_dev(a1, "href", "https://nominatim.org");
- add_location(a1, file$4, 14, 2, 563);
- attr_dev(div, "id", "welcome");
- add_location(div, file$4, 0, 0, 0);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, h2);
- append_dev(div, t1);
- append_dev(div, p);
- append_dev(p, t2);
- append_dev(p, a0);
- append_dev(p, t4);
- append_dev(div, t5);
- append_dev(div, a1);
- append_dev(div, t7);
- },
- p: noop,
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$4.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$4($$self, $$props) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Welcome", slots, []);
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Welcome> was created with unknown prop '${key}'`);
- });
-
- return [];
- }
-
- class Welcome extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$4, create_fragment$4, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Welcome",
- options,
- id: create_fragment$4.name
- });
- }
- }
-
- /* src/components/MapIcon.svelte generated by Svelte v3.31.2 */
- const file$5 = "src/components/MapIcon.svelte";
-
- // (109:0) {#if sIcon}
- function create_if_block$2(ctx) {
- let img;
- let img_src_value;
-
- const block = {
- c: function create() {
- img = element("img");
- attr_dev(img, "class", "mapicon svelte-180cawe");
- if (img.src !== (img_src_value = /*url*/ ctx[2])) attr_dev(img, "src", img_src_value);
- attr_dev(img, "alt", /*title*/ ctx[1]);
- add_location(img, file$5, 109, 2, 4543);
- },
- m: function mount(target, anchor) {
- insert_dev(target, img, anchor);
- },
- p: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(img);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$2.name,
- type: "if",
- source: "(109:0) {#if sIcon}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$5(ctx) {
- let if_block_anchor;
- let if_block = /*sIcon*/ ctx[0] && create_if_block$2(ctx);
-
- const block = {
- c: function create() {
- if (if_block) if_block.c();
- if_block_anchor = empty();
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- if (if_block) if_block.m(target, anchor);
- insert_dev(target, if_block_anchor, anchor);
- },
- p: function update(ctx, [dirty]) {
- if (/*sIcon*/ ctx[0]) if_block.p(ctx, dirty);
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (if_block) if_block.d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$5.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function getIcon(aPlace) {
- // equivalent to PHP Nominatim::ClassTypes::getIcon
- // covers 83 of 214 available icon filenames, e.g. transport_roundabout_anticlockwise
- // transport_rental_bicycle or place_of_worship_christian would need more data from
- // the place.
- var aIcons = {
- "boundary:administrative": "poi_boundary_administrative",
- "place:city": "poi_place_city",
- "place:town": "poi_place_town",
- "place:village": "poi_place_village",
- "place:hamlet": "poi_place_village",
- "place:suburb": "poi_place_village",
- "place:locality": "poi_place_village",
- "place:airport": "transport_airport2",
- "aeroway:aerodrome": "transport_airport2",
- "railway:station": "transport_train_station2",
- "amenity:place_of_worship": "place_of_worship_unknown3",
- "amenity:pub": "food_pub",
- "amenity:bar": "food_bar",
- "amenity:university": "education_university",
- "tourism:museum": "tourist_museum",
- "amenity:arts_centre": "tourist_art_gallery2",
- "tourism:zoo": "tourist_zoo",
- "tourism:theme_park": "poi_point_of_interest",
- "tourism:attraction": "poi_point_of_interest",
- "leisure:golf_course": "sport_golf",
- "historic:castle": "tourist_castle",
- "amenity:hospital": "health_hospital",
- "amenity:school": "education_school",
- "amenity:theatre": "tourist_theatre",
- "amenity:library": "amenity_library",
- "amenity:fire_station": "amenity_firestation3",
- "amenity:police": "amenity_police2",
- "amenity:bank": "money_bank2",
- "amenity:post_office": "amenity_post_office",
- "tourism:hotel": "accommodation_hotel2",
- "amenity:cinema": "tourist_cinema",
- "tourism:artwork": "tourist_art_gallery2",
- "historic:archaeological_site": "tourist_archaeological2",
- "amenity:doctors": "health_doctors",
- "leisure:sports_centre": "sport_leisure_centre",
- "leisure:swimming_pool": "sport_swimming_outdoor",
- "shop:supermarket": "shopping_supermarket",
- "shop:convenience": "shopping_convenience",
- "amenity:restaurant": "food_restaurant",
- "amenity:fast_food": "food_fastfood",
- "amenity:cafe": "food_cafe",
- "tourism:guest_house": "accommodation_bed_and_breakfast",
- "amenity:pharmacy": "health_pharmacy_dispensing",
- "amenity:fuel": "transport_fuel",
- "natural:peak": "poi_peak",
- "natural:wood": "landuse_coniferous_and_deciduous",
- "shop:bicycle": "shopping_bicycle",
- "shop:clothes": "shopping_clothes",
- "shop:hairdresser": "shopping_hairdresser",
- "shop:doityourself": "shopping_diy",
- "shop:estate_agent": "shopping_estateagent2",
- "shop:car": "shopping_car",
- "shop:garden_centre": "shopping_garden_centre",
- "shop:car_repair": "shopping_car_repair",
- "shop:bakery": "shopping_bakery",
- "shop:butcher": "shopping_butcher",
- "shop:apparel": "shopping_clothes",
- "shop:laundry": "shopping_laundrette",
- "shop:beverages": "shopping_alcohol",
- "shop:alcohol": "shopping_alcohol",
- "shop:optician": "health_opticians",
- "shop:chemist": "health_pharmacy",
- "shop:gallery": "tourist_art_gallery2",
- "shop:jewelry": "shopping_jewelry",
- "tourism:information": "amenity_information",
- "historic:ruins": "tourist_ruin",
- "amenity:college": "education_school",
- "historic:monument": "tourist_monument",
- "historic:memorial": "tourist_monument",
- "historic:mine": "poi_mine",
- "tourism:caravan_site": "accommodation_caravan_park",
- "amenity:bus_station": "transport_bus_station",
- "amenity:atm": "money_atm2",
- "tourism:viewpoint": "tourist_view_point",
- "tourism:guesthouse": "accommodation_bed_and_breakfast",
- "railway:tram": "transport_tram_stop",
- "amenity:courthouse": "amenity_court",
- "amenity:recycling": "amenity_recycling",
- "amenity:dentist": "health_dentist",
- "natural:beach": "tourist_beach",
- "railway:tram_stop": "transport_tram_stop",
- "amenity:prison": "amenity_prison",
- "highway:bus_stop": "transport_bus_stop2"
- };
-
- var sCategoryPlace = aPlace.category + ":" + aPlace.type;
- return aIcons[sCategoryPlace];
- }
-
- function instance$5($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("MapIcon", slots, []);
- let { aPlace } = $$props;
- let sIcon = getIcon(aPlace);
- let title = "icon for " + aPlace.category + " " + aPlace.type;
- let url = get_config_value_1("Images_Base_Url") + sIcon + ".p.20.png";
- const writable_props = ["aPlace"];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<MapIcon> was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ("aPlace" in $$props) $$invalidate(3, aPlace = $$props.aPlace);
- };
-
- $$self.$capture_state = () => ({
- aPlace,
- get_config_value: get_config_value_1,
- sIcon,
- title,
- url,
- getIcon
- });
-
- $$self.$inject_state = $$props => {
- if ("aPlace" in $$props) $$invalidate(3, aPlace = $$props.aPlace);
- if ("sIcon" in $$props) $$invalidate(0, sIcon = $$props.sIcon);
- if ("title" in $$props) $$invalidate(1, title = $$props.title);
- if ("url" in $$props) $$invalidate(2, url = $$props.url);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [sIcon, title, url, aPlace];
- }
-
- class MapIcon extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$5, create_fragment$5, safe_not_equal, { aPlace: 3 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "MapIcon",
- options,
- id: create_fragment$5.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*aPlace*/ ctx[3] === undefined && !("aPlace" in props)) {
- console.warn("<MapIcon> was created without expected prop 'aPlace'");
- }
- }
-
- get aPlace() {
- throw new Error("<MapIcon>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set aPlace(value) {
- throw new Error("<MapIcon>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
- }
-
- /* src/components/ResultsList.svelte generated by Svelte v3.31.2 */
- const file$6 = "src/components/ResultsList.svelte";
-
- function get_each_context$1(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[5] = list[i];
- child_ctx[7] = i;
- return child_ctx;
- }
-
- // (83:0) {:else}
- function create_else_block_1(ctx) {
- let welcome;
- let current;
- welcome = new Welcome({ $$inline: true });
-
- const block = {
- c: function create() {
- create_component(welcome.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(welcome, target, anchor);
- current = true;
- },
- p: noop,
- i: function intro(local) {
- if (current) return;
- transition_in(welcome.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(welcome.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(welcome, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block_1.name,
- type: "else",
- source: "(83:0) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (77:25)
- function create_if_block_2(ctx) {
- let if_block_anchor;
-
- function select_block_type_1(ctx, dirty) {
- if (/*reverse_search*/ ctx[0]) return create_if_block_3;
- return create_else_block$1;
- }
-
- let current_block_type = select_block_type_1(ctx);
- let if_block = current_block_type(ctx);
-
- const block = {
- c: function create() {
- if_block.c();
- if_block_anchor = empty();
- },
- m: function mount(target, anchor) {
- if_block.m(target, anchor);
- insert_dev(target, if_block_anchor, anchor);
- },
- p: function update(ctx, dirty) {
- if (current_block_type !== (current_block_type = select_block_type_1(ctx))) {
- if_block.d(1);
- if_block = current_block_type(ctx);
-
- if (if_block) {
- if_block.c();
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
- }
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if_block.d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_2.name,
- type: "if",
- source: "(77:25) ",
- ctx
- });
-
- return block;
- }
-
- // (53:0) {#if aSearchResults && aSearchResults.length > 0}
- function create_if_block$3(ctx) {
- let div;
- let t;
- let current;
- let each_value = /*aSearchResults*/ ctx[1];
- validate_each_argument(each_value);
- let each_blocks = [];
-
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- let if_block = /*sMoreURL*/ ctx[3] && !/*reverse_search*/ ctx[0] && create_if_block_1(ctx);
-
- const block = {
- c: function create() {
- div = element("div");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t = space();
- if (if_block) if_block.c();
- attr_dev(div, "id", "searchresults");
- add_location(div, file$6, 53, 2, 1681);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(div, null);
- }
-
- append_dev(div, t);
- if (if_block) if_block.m(div, null);
- current = true;
- },
- p: function update(ctx, dirty) {
- if (dirty & /*iHighlightNum, handleClick, detailsURL, aSearchResults, formatLabel*/ 22) {
- each_value = /*aSearchResults*/ ctx[1];
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$1(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block$1(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(div, t);
- }
- }
-
- group_outros();
-
- for (i = each_value.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
-
- if (/*sMoreURL*/ ctx[3] && !/*reverse_search*/ ctx[0]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block_1(ctx);
- if_block.c();
- if_block.m(div, null);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- destroy_each(each_blocks, detaching);
- if (if_block) if_block.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$3.name,
- type: "if",
- source: "(53:0) {#if aSearchResults && aSearchResults.length > 0}",
- ctx
- });
-
- return block;
- }
-
- // (80:2) {:else}
- function create_else_block$1(ctx) {
- let div;
-
- const block = {
- c: function create() {
- div = element("div");
- div.textContent = "No search results found";
- attr_dev(div, "class", "noresults svelte-d36c6n");
- add_location(div, file$6, 80, 4, 2634);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block$1.name,
- type: "else",
- source: "(80:2) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (78:2) {#if reverse_search}
- function create_if_block_3(ctx) {
- let div;
-
- const block = {
- c: function create() {
- div = element("div");
- div.textContent = "Search for coordinates or click anywhere on the map.";
- attr_dev(div, "id", "intro");
- attr_dev(div, "class", "sidebar");
- add_location(div, file$6, 78, 4, 2529);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_3.name,
- type: "if",
- source: "(78:2) {#if reverse_search}",
- ctx
- });
-
- return block;
- }
-
- // (56:4) {#each aSearchResults as aResult, iResNum}
- function create_each_block$1(ctx) {
- let div1;
- let div0;
- let mapicon;
- let t0;
- let span0;
- let t1_value = /*aResult*/ ctx[5].display_name + "";
- let t1;
- let t2;
- let span1;
- let t3_value = formatLabel_1(/*aResult*/ ctx[5]) + "";
- let t3;
- let t4;
- let p;
- let t5_value = /*aResult*/ ctx[5].lat + "";
- let t5;
- let t6;
- let t7_value = /*aResult*/ ctx[5].lon + "";
- let t7;
- let t8;
- let a;
- let t9;
- let a_href_value;
- let current;
- let mounted;
- let dispose;
-
- mapicon = new MapIcon({
- props: { aPlace: /*aResult*/ ctx[5] },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- div1 = element("div");
- div0 = element("div");
- create_component(mapicon.$$.fragment);
- t0 = space();
- span0 = element("span");
- t1 = text(t1_value);
- t2 = space();
- span1 = element("span");
- t3 = text(t3_value);
- t4 = space();
- p = element("p");
- t5 = text(t5_value);
- t6 = text(",");
- t7 = text(t7_value);
- t8 = space();
- a = element("a");
- t9 = text("details");
- set_style(div0, "float", "right");
- add_location(div0, file$6, 57, 8, 1898);
- attr_dev(span0, "class", "name");
- add_location(span0, file$6, 60, 8, 1986);
- attr_dev(span1, "class", "type svelte-d36c6n");
- add_location(span1, file$6, 61, 8, 2043);
- attr_dev(p, "class", "coords svelte-d36c6n");
- add_location(p, file$6, 62, 8, 2100);
- attr_dev(a, "class", "details btn btn-outline-secondary btn-sm svelte-d36c6n");
- attr_dev(a, "href", a_href_value = detailsURL_1(/*aResult*/ ctx[5]));
- add_location(a, file$6, 64, 8, 2161);
- attr_dev(div1, "class", "result svelte-d36c6n");
- attr_dev(div1, "data-position", /*iResNum*/ ctx[7]);
- toggle_class(div1, "highlight", /*iResNum*/ ctx[7] === /*iHighlightNum*/ ctx[2]);
- add_location(div1, file$6, 56, 6, 1760);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div1, anchor);
- append_dev(div1, div0);
- mount_component(mapicon, div0, null);
- append_dev(div1, t0);
- append_dev(div1, span0);
- append_dev(span0, t1);
- append_dev(div1, t2);
- append_dev(div1, span1);
- append_dev(span1, t3);
- append_dev(div1, t4);
- append_dev(div1, p);
- append_dev(p, t5);
- append_dev(p, t6);
- append_dev(p, t7);
- append_dev(div1, t8);
- append_dev(div1, a);
- append_dev(a, t9);
- current = true;
-
- if (!mounted) {
- dispose = listen_dev(div1, "click", stop_propagation(/*handleClick*/ ctx[4]), false, false, true);
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- const mapicon_changes = {};
- if (dirty & /*aSearchResults*/ 2) mapicon_changes.aPlace = /*aResult*/ ctx[5];
- mapicon.$set(mapicon_changes);
- if ((!current || dirty & /*aSearchResults*/ 2) && t1_value !== (t1_value = /*aResult*/ ctx[5].display_name + "")) set_data_dev(t1, t1_value);
- if ((!current || dirty & /*aSearchResults*/ 2) && t3_value !== (t3_value = formatLabel_1(/*aResult*/ ctx[5]) + "")) set_data_dev(t3, t3_value);
- if ((!current || dirty & /*aSearchResults*/ 2) && t5_value !== (t5_value = /*aResult*/ ctx[5].lat + "")) set_data_dev(t5, t5_value);
- if ((!current || dirty & /*aSearchResults*/ 2) && t7_value !== (t7_value = /*aResult*/ ctx[5].lon + "")) set_data_dev(t7, t7_value);
-
- if (!current || dirty & /*aSearchResults*/ 2 && a_href_value !== (a_href_value = detailsURL_1(/*aResult*/ ctx[5]))) {
- attr_dev(a, "href", a_href_value);
- }
-
- if (dirty & /*iHighlightNum*/ 4) {
- toggle_class(div1, "highlight", /*iResNum*/ ctx[7] === /*iHighlightNum*/ ctx[2]);
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(mapicon.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(mapicon.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div1);
- destroy_component(mapicon);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$1.name,
- type: "each",
- source: "(56:4) {#each aSearchResults as aResult, iResNum}",
- ctx
- });
-
- return block;
- }
-
- // (69:4) {#if sMoreURL && !reverse_search}
- function create_if_block_1(ctx) {
- let div;
- let a;
- let t;
-
- const block = {
- c: function create() {
- div = element("div");
- a = element("a");
- t = text("Search for more results");
- attr_dev(a, "class", "btn btn-primary");
- attr_dev(a, "href", /*sMoreURL*/ ctx[3]);
- add_location(a, file$6, 70, 8, 2351);
- attr_dev(div, "class", "more svelte-d36c6n");
- add_location(div, file$6, 69, 6, 2324);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, a);
- append_dev(a, t);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*sMoreURL*/ 8) {
- attr_dev(a, "href", /*sMoreURL*/ ctx[3]);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_1.name,
- type: "if",
- source: "(69:4) {#if sMoreURL && !reverse_search}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$6(ctx) {
- let current_block_type_index;
- let if_block;
- let if_block_anchor;
- let current;
- const if_block_creators = [create_if_block$3, create_if_block_2, create_else_block_1];
- const if_blocks = [];
-
- function select_block_type(ctx, dirty) {
- if (/*aSearchResults*/ ctx[1] && /*aSearchResults*/ ctx[1].length > 0) return 0;
- if (/*aSearchResults*/ ctx[1]) return 1;
- return 2;
- }
-
- current_block_type_index = select_block_type(ctx);
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
-
- const block = {
- c: function create() {
- if_block.c();
- if_block_anchor = empty();
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- if_blocks[current_block_type_index].m(target, anchor);
- insert_dev(target, if_block_anchor, anchor);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- let previous_block_index = current_block_type_index;
- current_block_type_index = select_block_type(ctx);
-
- if (current_block_type_index === previous_block_index) {
- if_blocks[current_block_type_index].p(ctx, dirty);
- } else {
- group_outros();
-
- transition_out(if_blocks[previous_block_index], 1, 1, () => {
- if_blocks[previous_block_index] = null;
- });
-
- check_outros();
- if_block = if_blocks[current_block_type_index];
-
- if (!if_block) {
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
- if_block.c();
- } else {
- if_block.p(ctx, dirty);
- }
-
- transition_in(if_block, 1);
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(if_block);
- current = true;
- },
- o: function outro(local) {
- transition_out(if_block);
- current = false;
- },
- d: function destroy(detaching) {
- if_blocks[current_block_type_index].d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$6.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$6($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("ResultsList", slots, []);
- let { reverse_search = false } = $$props;
- let aSearchResults;
- let iHighlightNum;
- let sMoreURL;
-
- results_store.subscribe(data => {
- if (!data) {
- return;
- }
-
- $$invalidate(1, aSearchResults = data);
- $$invalidate(2, iHighlightNum = 0);
- current_result_store.set(aSearchResults[0]);
- let search_params = new URLSearchParams(window.location.search);
- let aResults = data;
-
- // lonvia wrote: https://github.com/osm-search/nominatim-ui/issues/24
- // I would suggest to remove the guessing and always show the link. Nominatim only returns
- // one or two results when it believes the result to be a good enough match.
- // if (aResults.length >= 10) {
- var aExcludePlaceIds = [];
-
- if (search_params.has("exclude_place_ids")) {
- aExcludePlaceIds = search_params.get("exclude_place_ids").split(",");
- }
-
- for (var i = 0; i < aResults.length; i += 1) {
- aExcludePlaceIds.push(aResults[i].place_id);
- }
-
- var parsed_url = new URLSearchParams(window.location.search);
- parsed_url.set("exclude_place_ids", aExcludePlaceIds.join(","));
- $$invalidate(3, sMoreURL = "?" + parsed_url.toString());
- });
-
- function handleClick(e) {
- let result_el = e.target;
-
- if (!result_el.className.match("result")) {
- result_el = result_el.parentElement;
- }
-
- let pos = Number(result_el.dataset.position);
- current_result_store.set(aSearchResults[pos]);
- $$invalidate(2, iHighlightNum = pos);
- }
-
- const writable_props = ["reverse_search"];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<ResultsList> was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ("reverse_search" in $$props) $$invalidate(0, reverse_search = $$props.reverse_search);
- };
-
- $$self.$capture_state = () => ({
- results_store,
- current_result_store,
- formatLabel: formatLabel_1,
- detailsURL: detailsURL_1,
- Welcome,
- MapIcon,
- reverse_search,
- aSearchResults,
- iHighlightNum,
- sMoreURL,
- handleClick
- });
-
- $$self.$inject_state = $$props => {
- if ("reverse_search" in $$props) $$invalidate(0, reverse_search = $$props.reverse_search);
- if ("aSearchResults" in $$props) $$invalidate(1, aSearchResults = $$props.aSearchResults);
- if ("iHighlightNum" in $$props) $$invalidate(2, iHighlightNum = $$props.iHighlightNum);
- if ("sMoreURL" in $$props) $$invalidate(3, sMoreURL = $$props.sMoreURL);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [reverse_search, aSearchResults, iHighlightNum, sMoreURL, handleClick];
- }
-
- class ResultsList extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$6, create_fragment$6, safe_not_equal, { reverse_search: 0 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "ResultsList",
- options,
- id: create_fragment$6.name
- });
- }
-
- get reverse_search() {
- throw new Error("<ResultsList>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set reverse_search(value) {
- throw new Error("<ResultsList>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
- }
-
- /* @preserve
+ */var de=/["'&<>]/,fe=function(t){var e,n=""+t,i=de.exec(n);if(!i)return n;var o="",r=0,s=0;for(r=i.index;r<n.length;r++){switch(n.charCodeAt(r)){case 34:e=""";break;case 38:e="&";break;case 39:e="'";break;case 60:e="<";break;case 62:e=">";break;default:continue}s!==r&&(o+=n.substring(s,r)),s=r+1,o+=e}return s!==r?o+n.substring(s,r):o};var pe=$e,me=function(t){if(!t.osm_type)return"";var e=$e(t.osm_type,!1);return e?'<a href="https://www.openstreetmap.org/'+e+"/"+t.osm_id+'">'+e+" "+t.osm_id+"</a>":""},ge=function(t){if(t.label)return t.label;function e(t){return t&&t[0].toUpperCase()+t.slice(1)}if(t.type&&"yes"===t.type&&t.class)return e(t.class.replace(/_/g," "));if(t.type)return e(t.type.replace(/_/g," "));return""},_e=function(t){if(!t.calculated_wikipedia)return"";var e=t.calculated_wikipedia.split(":",2),n=fe(t.calculated_wikipedia),i=fe(e[0]),o=fe(e[1]);return'<a href="https://'+i+".wikipedia.org/wiki/"+o+'" target="_blank">'+n+"</a>"},ve=function(t){return t.isarea?"Polygon":"Point"},ye=function(t){return"boundary"===t.category&&"administrative"===t.type},be=function(t){return t<4?"other":t<6?"country":t<8?"region":t<10?"state":t<12?"state district":t<14?"county":t<16?"municipality":t<18?"city / town / village":t<20?"city / village district":t<22?"suburb / hamlet":t<24?"neighbourhood":t<26?"city block / square":26===t?"major street":27===t?"minory street / path":t<=30?"house / building":"other"},xe=function(t){var e=t.class+":"+t.type;t.type&&"administrative"===t.type&&t.place_type&&(e=e+" ("+t.place_type+")");return fe(e)},we=function(t){return t&&t<15?t:""},Te=function(t,e){if(e){if(t<1)return"0";var n=t>=1e3?Math.round(t/1e3,1)+" km":Math.round(t,0)+" m";return'<abbr class="distance" title="'+t+' meters">~'+n+"</abbr>"}return 0===t?"0":'<abbr class="distance" title="spheric distance '+t+'">~'+Math.round(1e3*t,4)/1e3+"</abbr>"},Ce=function(t){return(" "===t[0]?"*":"")+fe(t)},Ee=function(){return["Continent / Sea","","","Country","","State","Region","","County","","City","","Town / Village","","Suburb","","Street","","Building","","",""]};function $e(t,e){return"N"===t?"node":"W"===t?"way":"R"===t?"relation":e&&("T"===t||"I"===t)?"way":""}function Le(t){let e,n,i,o;const r=t[6].default,s=c(r,t,t[5],null);return{c(){e=_("a"),s&&s.c(),C(e,"href",t[1]),C(e,"class",t[0])},m(r,a){p(r,e,a),s&&s.m(e,null),n=!0,i||(o=x(e,"click",T(w(t[2]))),i=!0)},p(t,[i]){s&&s.p&&32&i&&d(s,r,t,t[5],i,null,null),(!n||2&i)&&C(e,"href",t[1]),(!n||1&i)&&C(e,"class",t[0])},i(t){n||(Y(s,t),n=!0)},o(t){X(s,t),n=!1},d(t){t&&m(e),s&&s.d(t),i=!1,o()}}}function ke(t,e,n){let{$$slots:i={},$$scope:o}=e,{extra_classes:r=""}=e,{feature:s=null}=e,a=new URLSearchParams,l="details.html";return t.$$set=t=>{"extra_classes"in t&&n(0,r=t.extra_classes),"feature"in t&&n(3,s=t.feature),"$$scope"in t&&n(5,o=t.$$scope)},t.$$.update=()=>{if(8&t.$$.dirty){let t=new URLSearchParams;null!==s&&(s.osm_type?(1===s.osm_type.length?t.set("osmtype",s.osm_type):t.set("osmtype","node"===(e=s.osm_type)?"N":"way"===e?"W":"relation"===e?"R":""),t.set("osmid",s.osm_id),s.class?t.set("class",s.class):s.category&&t.set("class",s.category)):s.place_id&&t.set("place_id",s.place_id)),n(4,a=t)}var e;if(16&t.$$.dirty){let t=a.toString();n(1,l="details.html"+(t?"?":"")+t)}},[r,l,function(){gt("details",a)},s,a,o,i]}class Pe extends ot{constructor(t){super(),it(this,t,ke,Le,s,{extra_classes:0,feature:3})}}function Se(e){let n;return{c(){n=_("div"),C(n,"id","welcome")},m(t,e){p(t,n,e)},p:t,i:t,o:t,d(t){t&&m(n)}}}function Me(t){return N((()=>{wt("theme/welcome.html",document.getElementById("welcome"))})),[]}class Ae extends ot{constructor(t){super(),it(this,t,Me,Se,s,{})}}function Ne(t){let e,n;return{c(){e=_("img"),C(e,"class","mapicon svelte-180cawe"),e.src!==(n=t[2])&&C(e,"src",n),C(e,"alt",t[1])},m(t,n){p(t,e,n)},p(t,i){4&i&&e.src!==(n=t[2])&&C(e,"src",n),2&i&&C(e,"alt",t[1])},d(t){t&&m(e)}}}function De(e){let n,i=e[0]&&Ne(e);return{c(){i&&i.c(),n=b()},m(t,e){i&&i.m(t,e),p(t,n,e)},p(t,[e]){t[0]?i?i.p(t,e):(i=Ne(t),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},i:t,o:t,d(t){i&&i.d(t),t&&m(n)}}}function Ie(t,e,n){let i,o,r,{aPlace:s}=e;return t.$$set=t=>{"aPlace"in t&&n(3,s=t.aPlace)},t.$$.update=()=>{var e,a;8&t.$$.dirty&&n(0,(e=s.category,a=s.type,i={"boundary:administrative":"poi_boundary_administrative","place:city":"poi_place_city","place:town":"poi_place_town","place:village":"poi_place_village","place:hamlet":"poi_place_village","place:suburb":"poi_place_village","place:locality":"poi_place_village","place:airport":"transport_airport2","aeroway:aerodrome":"transport_airport2","railway:station":"transport_train_station2","amenity:place_of_worship":"place_of_worship_unknown3","amenity:pub":"food_pub","amenity:bar":"food_bar","amenity:university":"education_university","tourism:museum":"tourist_museum","amenity:arts_centre":"tourist_art_gallery2","tourism:zoo":"tourist_zoo","tourism:theme_park":"poi_point_of_interest","tourism:attraction":"poi_point_of_interest","leisure:golf_course":"sport_golf","historic:castle":"tourist_castle","amenity:hospital":"health_hospital","amenity:school":"education_school","amenity:theatre":"tourist_theatre","amenity:library":"amenity_library","amenity:fire_station":"amenity_firestation3","amenity:police":"amenity_police2","amenity:bank":"money_bank2","amenity:post_office":"amenity_post_office","tourism:hotel":"accommodation_hotel2","amenity:cinema":"tourist_cinema","tourism:artwork":"tourist_art_gallery2","historic:archaeological_site":"tourist_archaeological2","amenity:doctors":"health_doctors","leisure:sports_centre":"sport_leisure_centre","leisure:swimming_pool":"sport_swimming_outdoor","shop:supermarket":"shopping_supermarket","shop:convenience":"shopping_convenience","amenity:restaurant":"food_restaurant","amenity:fast_food":"food_fastfood","amenity:cafe":"food_cafe","tourism:guest_house":"accommodation_bed_and_breakfast","amenity:pharmacy":"health_pharmacy_dispensing","amenity:fuel":"transport_fuel","natural:peak":"poi_peak","natural:wood":"landuse_coniferous_and_deciduous","shop:bicycle":"shopping_bicycle","shop:clothes":"shopping_clothes","shop:hairdresser":"shopping_hairdresser","shop:doityourself":"shopping_diy","shop:estate_agent":"shopping_estateagent2","shop:car":"shopping_car","shop:garden_centre":"shopping_garden_centre","shop:car_repair":"shopping_car_repair","shop:bakery":"shopping_bakery","shop:butcher":"shopping_butcher","shop:apparel":"shopping_clothes","shop:laundry":"shopping_laundrette","shop:beverages":"shopping_alcohol","shop:alcohol":"shopping_alcohol","shop:optician":"health_opticians","shop:chemist":"health_pharmacy","shop:gallery":"tourist_art_gallery2","shop:jewelry":"shopping_jewelry","tourism:information":"amenity_information","historic:ruins":"tourist_ruin","amenity:college":"education_school","historic:monument":"tourist_monument","historic:memorial":"tourist_monument","historic:mine":"poi_mine","tourism:caravan_site":"accommodation_caravan_park","amenity:bus_station":"transport_bus_station","amenity:atm":"money_atm2","tourism:viewpoint":"tourist_view_point","tourism:guesthouse":"accommodation_bed_and_breakfast","railway:tram":"transport_tram_stop","amenity:courthouse":"amenity_court","amenity:recycling":"amenity_recycling","amenity:dentist":"health_dentist","natural:beach":"tourist_beach","railway:tram_stop":"transport_tram_stop","amenity:prison":"amenity_prison","highway:bus_stop":"transport_bus_stop2"}[e+":"+a])),8&t.$$.dirty&&n(1,o="icon for "+s.category+" "+s.type),1&t.$$.dirty&&n(2,r=Nominatim_Config.Images_Base_Url+i+".p.20.png")},[i,o,r,s]}class Oe extends ot{constructor(t){super(),it(this,t,Ie,De,s,{aPlace:3})}}function ze(t,e,n){const i=t.slice();return i[6]=e[n],i[8]=n,i}function Be(e){let n,i;return n=new Ae({}),{c(){J(n.$$.fragment)},m(t,e){tt(n,t,e),i=!0},p:t,i(t){i||(Y(n.$$.fragment,t),i=!0)},o(t){X(n.$$.fragment,t),i=!1},d(t){et(n,t)}}}function je(e){let n;function i(t,e){return t[0]?He:Ze}let o=i(e),r=o(e);return{c(){r.c(),n=b()},m(t,e){r.m(t,e),p(t,n,e)},p(t,e){o!==(o=i(t))&&(r.d(1),r=o(t),r&&(r.c(),r.m(n.parentNode,n)))},i:t,o:t,d(t){r.d(t),t&&m(n)}}}function Re(t){let e,n,i,o=t[1],r=[];for(let e=0;e<o.length;e+=1)r[e]=Fe(ze(t,o,e));const s=t=>X(r[t],1,1,(()=>{r[t]=null}));let a=t[3]&&!t[0]&&We(t);return{c(){e=_("div");for(let t=0;t<r.length;t+=1)r[t].c();n=y(),a&&a.c(),C(e,"id","searchresults")},m(t,o){p(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);f(e,n),a&&a.m(e,null),i=!0},p(t,i){if(22&i){let a;for(o=t[1],a=0;a<o.length;a+=1){const s=ze(t,o,a);r[a]?(r[a].p(s,i),Y(r[a],1)):(r[a]=Fe(s),r[a].c(),Y(r[a],1),r[a].m(e,n))}for(G(),a=o.length;a<r.length;a+=1)s(a);K()}t[3]&&!t[0]?a?a.p(t,i):(a=We(t),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(t){if(!i){for(let t=0;t<o.length;t+=1)Y(r[t]);i=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)X(r[t]);i=!1},d(t){t&&m(e),g(r,t),a&&a.d()}}}function Ze(t){let e;return{c(){e=_("div"),e.textContent="No search results found",C(e,"class","noresults svelte-5fm7ib")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function He(t){let e;return{c(){e=_("div"),e.textContent="Search for coordinates or click anywhere on the map.",C(e,"id","intro"),C(e,"class","sidebar")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function qe(t){let e;return{c(){e=v("details")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Fe(t){let e,n,i,o,r,s,a,l,u,c,h,d,g,b,w,$,L,k,S,M=t[6].display_name+"",A=ge(t[6])+"",N=t[6].lat+"",D=t[6].lon+"";return i=new Oe({props:{aPlace:t[6]}}),$=new Pe({props:{extra_classes:"btn btn-outline-secondary btn-sm",feature:t[6],$$slots:{default:[qe]},$$scope:{ctx:t}}}),{c(){var f,p,m;e=_("div"),n=_("div"),J(i.$$.fragment),o=y(),r=_("span"),s=v(M),a=y(),l=_("span"),u=v(A),c=y(),h=_("p"),d=v(N),g=v(","),b=v(D),w=y(),J($.$$.fragment),f="float",p="right",n.style.setProperty(f,p,m?"important":""),C(r,"class","name"),C(l,"class","type svelte-5fm7ib"),C(h,"class","coords svelte-5fm7ib"),C(e,"class","result svelte-5fm7ib"),C(e,"data-position",t[8]),P(e,"highlight",t[8]===t[2])},m(m,_){p(m,e,_),f(e,n),tt(i,n,null),f(e,o),f(e,r),f(r,s),f(e,a),f(e,l),f(l,u),f(e,c),f(e,h),f(h,d),f(h,g),f(h,b),f(e,w),tt($,e,null),L=!0,k||(S=x(e,"click",T(t[4])),k=!0)},p(t,n){const o={};2&n&&(o.aPlace=t[6]),i.$set(o),(!L||2&n)&&M!==(M=t[6].display_name+"")&&E(s,M),(!L||2&n)&&A!==(A=ge(t[6])+"")&&E(u,A),(!L||2&n)&&N!==(N=t[6].lat+"")&&E(d,N),(!L||2&n)&&D!==(D=t[6].lon+"")&&E(b,D);const r={};2&n&&(r.feature=t[6]),512&n&&(r.$$scope={dirty:n,ctx:t}),$.$set(r),4&n&&P(e,"highlight",t[8]===t[2])},i(t){L||(Y(i.$$.fragment,t),Y($.$$.fragment,t),L=!0)},o(t){X(i.$$.fragment,t),X($.$$.fragment,t),L=!1},d(t){t&&m(e),et(i),et($),k=!1,S()}}}function We(t){let e,n,i;return{c(){e=_("div"),n=_("a"),i=v("Search for more results"),C(n,"class","btn btn-primary"),C(n,"href",t[3]),C(e,"class","more svelte-5fm7ib")},m(t,o){p(t,e,o),f(e,n),f(n,i)},p(t,e){8&e&&C(n,"href",t[3])},d(t){t&&m(e)}}}function Ue(t){let e,n,i,o;const r=[Re,je,Be],s=[];function a(t,e){return t[1]&&t[1].length>0?0:t[1]?1:2}return e=a(t),n=s[e]=r[e](t),{c(){n.c(),i=b()},m(t,n){s[e].m(t,n),p(t,i,n),o=!0},p(t,[o]){let l=e;e=a(t),e===l?s[e].p(t,o):(G(),X(s[l],1,1,(()=>{s[l]=null})),K(),n=s[e],n?n.p(t,o):(n=s[e]=r[e](t),n.c()),Y(n,1),n.m(i.parentNode,i))},i(t){o||(Y(n),o=!0)},o(t){X(n),o=!1},d(t){s[e].d(t),t&&m(i)}}}function Ve(t,e,n){let i,o,r,{reverse_search:s=!1}=e,{current_result:a=null}=e;return ht.subscribe((t=>{if(!t)return;n(1,i=t),n(2,o=0),n(5,a=i[0]);let e=new URLSearchParams(window.location.search),s=t;var l=[];e.has("exclude_place_ids")&&(l=e.get("exclude_place_ids").split(","));for(var u=0;u<s.length;u+=1)l.push(s[u].place_id);var c=new URLSearchParams(window.location.search);c.set("exclude_place_ids",l.join(",")),n(3,r="?"+c.toString())})),t.$$set=t=>{"reverse_search"in t&&n(0,s=t.reverse_search),"current_result"in t&&n(5,a=t.current_result)},[s,i,o,r,function(t){let e=t.target;e.className.match("result")||(e=e.parentElement);let r=Number(e.dataset.position);n(5,a=i[r]),n(2,o=r)},a]}class Ge extends ot{constructor(t){super(),it(this,t,Ve,Ue,s,{reverse_search:0,current_result:5})}}
+/* @preserve
* Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
- */
-
- var leafletSrc = createCommonjsModule(function (module, exports) {
- (function (global, factory) {
- factory(exports) ;
- }(commonjsGlobal, (function (exports) {
- var version = "1.7.1";
-
- /*\r
- * @namespace Util\r
- *\r
- * Various utility functions, used by Leaflet internally.\r
- */\r
-\r
- // @function extend(dest: Object, src?: Object): Object\r
- // Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r
- function extend(dest) {\r
- var i, j, len, src;\r
-\r
- for (j = 1, len = arguments.length; j < len; j++) {\r
- src = arguments[j];\r
- for (i in src) {\r
- dest[i] = src[i];\r
- }\r
- }\r
- return dest;\r
- }\r
-\r
- // @function create(proto: Object, properties?: Object): Object\r
- // Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r
- var create = Object.create || (function () {\r
- function F() {}\r
- return function (proto) {\r
- F.prototype = proto;\r
- return new F();\r
- };\r
- })();\r
-\r
- // @function bind(fn: Function, …): Function\r
- // Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r
- // Has a `L.bind()` shortcut.\r
- function bind(fn, obj) {\r
- var slice = Array.prototype.slice;\r
-\r
- if (fn.bind) {\r
- return fn.bind.apply(fn, slice.call(arguments, 1));\r
- }\r
-\r
- var args = slice.call(arguments, 2);\r
-\r
- return function () {\r
- return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r
- };\r
- }\r
-\r
- // @property lastId: Number\r
- // Last unique ID used by [`stamp()`](#util-stamp)\r
- var lastId = 0;\r
-\r
- // @function stamp(obj: Object): Number\r
- // Returns the unique ID of an object, assigning it one if it doesn't have it.\r
- function stamp(obj) {\r
- /*eslint-disable */\r
- obj._leaflet_id = obj._leaflet_id || ++lastId;\r
- return obj._leaflet_id;\r
- /* eslint-enable */\r
- }\r
-\r
- // @function throttle(fn: Function, time: Number, context: Object): Function\r
- // Returns a function which executes function `fn` with the given scope `context`\r
- // (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r
- // `fn` will be called no more than one time per given amount of `time`. The arguments\r
- // received by the bound function will be any arguments passed when binding the\r
- // function, followed by any arguments passed when invoking the bound function.\r
- // Has an `L.throttle` shortcut.\r
- function throttle(fn, time, context) {\r
- var lock, args, wrapperFn, later;\r
-\r
- later = function () {\r
- // reset lock and call if queued\r
- lock = false;\r
- if (args) {\r
- wrapperFn.apply(context, args);\r
- args = false;\r
- }\r
- };\r
-\r
- wrapperFn = function () {\r
- if (lock) {\r
- // called too soon, queue to call later\r
- args = arguments;\r
-\r
- } else {\r
- // call and lock until later\r
- fn.apply(context, arguments);\r
- setTimeout(later, time);\r
- lock = true;\r
- }\r
- };\r
-\r
- return wrapperFn;\r
- }\r
-\r
- // @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\r
- // Returns the number `num` modulo `range` in such a way so it lies within\r
- // `range[0]` and `range[1]`. The returned value will be always smaller than\r
- // `range[1]` unless `includeMax` is set to `true`.\r
- function wrapNum(x, range, includeMax) {\r
- var max = range[1],\r
- min = range[0],\r
- d = max - min;\r
- return x === max && includeMax ? x : ((x - min) % d + d) % d + min;\r
- }\r
-\r
- // @function falseFn(): Function\r
- // Returns a function which always returns `false`.\r
- function falseFn() { return false; }\r
-\r
- // @function formatNum(num: Number, digits?: Number): Number\r
- // Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default.\r
- function formatNum(num, digits) {\r
- var pow = Math.pow(10, (digits === undefined ? 6 : digits));\r
- return Math.round(num * pow) / pow;\r
- }\r
-\r
- // @function trim(str: String): String\r
- // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\r
- function trim(str) {\r
- return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');\r
- }\r
-\r
- // @function splitWords(str: String): String[]\r
- // Trims and splits the string on whitespace and returns the array of parts.\r
- function splitWords(str) {\r
- return trim(str).split(/\s+/);\r
- }\r
-\r
- // @function setOptions(obj: Object, options: Object): Object\r
- // Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\r
- function setOptions(obj, options) {\r
- if (!Object.prototype.hasOwnProperty.call(obj, 'options')) {\r
- obj.options = obj.options ? create(obj.options) : {};\r
- }\r
- for (var i in options) {\r
- obj.options[i] = options[i];\r
- }\r
- return obj.options;\r
- }\r
-\r
- // @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\r
- // Converts an object into a parameter URL string, e.g. `{a: "foo", b: "bar"}`\r
- // translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\r
- // be appended at the end. If `uppercase` is `true`, the parameter names will\r
- // be uppercased (e.g. `'?A=foo&B=bar'`)\r
- function getParamString(obj, existingUrl, uppercase) {\r
- var params = [];\r
- for (var i in obj) {\r
- params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\r
- }\r
- return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\r
- }\r
-\r
- var templateRe = /\{ *([\w_-]+) *\}/g;\r
-\r
- // @function template(str: String, data: Object): String\r
- // Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\r
- // and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\r
- // `('Hello foo, bar')`. You can also specify functions instead of strings for\r
- // data values — they will be evaluated passing `data` as an argument.\r
- function template(str, data) {\r
- return str.replace(templateRe, function (str, key) {\r
- var value = data[key];\r
-\r
- if (value === undefined) {\r
- throw new Error('No value provided for variable ' + str);\r
-\r
- } else if (typeof value === 'function') {\r
- value = value(data);\r
- }\r
- return value;\r
- });\r
- }\r
-\r
- // @function isArray(obj): Boolean\r
- // Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\r
- var isArray = Array.isArray || function (obj) {\r
- return (Object.prototype.toString.call(obj) === '[object Array]');\r
- };\r
-\r
- // @function indexOf(array: Array, el: Object): Number\r
- // Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\r
- function indexOf(array, el) {\r
- for (var i = 0; i < array.length; i++) {\r
- if (array[i] === el) { return i; }\r
- }\r
- return -1;\r
- }\r
-\r
- // @property emptyImageUrl: String\r
- // Data URI string containing a base64-encoded empty GIF image.\r
- // Used as a hack to free memory from unused images on WebKit-powered\r
- // mobile devices (by setting image `src` to this string).\r
- var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\r
-\r
- // inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/\r
-\r
- function getPrefixed(name) {\r
- return window['webkit' + name] || window['moz' + name] || window['ms' + name];\r
- }\r
-\r
- var lastTime = 0;\r
-\r
- // fallback for IE 7-8\r
- function timeoutDefer(fn) {\r
- var time = +new Date(),\r
- timeToCall = Math.max(0, 16 - (time - lastTime));\r
-\r
- lastTime = time + timeToCall;\r
- return window.setTimeout(fn, timeToCall);\r
- }\r
-\r
- var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\r
- var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\r
- getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\r
-\r
- // @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\r
- // Schedules `fn` to be executed when the browser repaints. `fn` is bound to\r
- // `context` if given. When `immediate` is set, `fn` is called immediately if\r
- // the browser doesn't have native support for\r
- // [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\r
- // otherwise it's delayed. Returns a request ID that can be used to cancel the request.\r
- function requestAnimFrame(fn, context, immediate) {\r
- if (immediate && requestFn === timeoutDefer) {\r
- fn.call(context);\r
- } else {\r
- return requestFn.call(window, bind(fn, context));\r
- }\r
- }\r
-\r
- // @function cancelAnimFrame(id: Number): undefined\r
- // Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\r
- function cancelAnimFrame(id) {\r
- if (id) {\r
- cancelFn.call(window, id);\r
- }\r
- }
-
- var Util = ({
- extend: extend,
- create: create,
- bind: bind,
- lastId: lastId,
- stamp: stamp,
- throttle: throttle,
- wrapNum: wrapNum,
- falseFn: falseFn,
- formatNum: formatNum,
- trim: trim,
- splitWords: splitWords,
- setOptions: setOptions,
- getParamString: getParamString,
- template: template,
- isArray: isArray,
- indexOf: indexOf,
- emptyImageUrl: emptyImageUrl,
- requestFn: requestFn,
- cancelFn: cancelFn,
- requestAnimFrame: requestAnimFrame,
- cancelAnimFrame: cancelAnimFrame
- });
-
- // @class Class\r
- // @aka L.Class\r
-\r
- // @section\r
- // @uninheritable\r
-\r
- // Thanks to John Resig and Dean Edwards for inspiration!\r
-\r
- function Class() {}\r
-\r
- Class.extend = function (props) {\r
-\r
- // @function extend(props: Object): Function\r
- // [Extends the current class](#class-inheritance) given the properties to be included.\r
- // Returns a Javascript function that is a class constructor (to be called with `new`).\r
- var NewClass = function () {\r
-\r
- // call the constructor\r
- if (this.initialize) {\r
- this.initialize.apply(this, arguments);\r
- }\r
-\r
- // call all constructor hooks\r
- this.callInitHooks();\r
- };\r
-\r
- var parentProto = NewClass.__super__ = this.prototype;\r
-\r
- var proto = create(parentProto);\r
- proto.constructor = NewClass;\r
-\r
- NewClass.prototype = proto;\r
-\r
- // inherit parent's statics\r
- for (var i in this) {\r
- if (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') {\r
- NewClass[i] = this[i];\r
- }\r
- }\r
-\r
- // mix static properties into the class\r
- if (props.statics) {\r
- extend(NewClass, props.statics);\r
- delete props.statics;\r
- }\r
-\r
- // mix includes into the prototype\r
- if (props.includes) {\r
- checkDeprecatedMixinEvents(props.includes);\r
- extend.apply(null, [proto].concat(props.includes));\r
- delete props.includes;\r
- }\r
-\r
- // merge options\r
- if (proto.options) {\r
- props.options = extend(create(proto.options), props.options);\r
- }\r
-\r
- // mix given properties into the prototype\r
- extend(proto, props);\r
-\r
- proto._initHooks = [];\r
-\r
- // add method for calling all hooks\r
- proto.callInitHooks = function () {\r
-\r
- if (this._initHooksCalled) { return; }\r
-\r
- if (parentProto.callInitHooks) {\r
- parentProto.callInitHooks.call(this);\r
- }\r
-\r
- this._initHooksCalled = true;\r
-\r
- for (var i = 0, len = proto._initHooks.length; i < len; i++) {\r
- proto._initHooks[i].call(this);\r
- }\r
- };\r
-\r
- return NewClass;\r
- };\r
-\r
-\r
- // @function include(properties: Object): this\r
- // [Includes a mixin](#class-includes) into the current class.\r
- Class.include = function (props) {\r
- extend(this.prototype, props);\r
- return this;\r
- };\r
-\r
- // @function mergeOptions(options: Object): this\r
- // [Merges `options`](#class-options) into the defaults of the class.\r
- Class.mergeOptions = function (options) {\r
- extend(this.prototype.options, options);\r
- return this;\r
- };\r
-\r
- // @function addInitHook(fn: Function): this\r
- // Adds a [constructor hook](#class-constructor-hooks) to the class.\r
- Class.addInitHook = function (fn) { // (Function) || (String, args...)\r
- var args = Array.prototype.slice.call(arguments, 1);\r
-\r
- var init = typeof fn === 'function' ? fn : function () {\r
- this[fn].apply(this, args);\r
- };\r
-\r
- this.prototype._initHooks = this.prototype._initHooks || [];\r
- this.prototype._initHooks.push(init);\r
- return this;\r
- };\r
-\r
- function checkDeprecatedMixinEvents(includes) {\r
- if (typeof L === 'undefined' || !L || !L.Mixin) { return; }\r
-\r
- includes = isArray(includes) ? includes : [includes];\r
-\r
- for (var i = 0; i < includes.length; i++) {\r
- if (includes[i] === L.Mixin.Events) {\r
- console.warn('Deprecated include of L.Mixin.Events: ' +\r
- 'this property will be removed in future releases, ' +\r
- 'please inherit from L.Evented instead.', new Error().stack);\r
- }\r
- }\r
- }
-
- /*\r
- * @class Evented\r
- * @aka L.Evented\r
- * @inherits Class\r
- *\r
- * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * map.on('click', function(e) {\r
- * alert(e.latlng);\r
- * } );\r
- * ```\r
- *\r
- * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:\r
- *\r
- * ```js\r
- * function onClick(e) { ... }\r
- *\r
- * map.on('click', onClick);\r
- * map.off('click', onClick);\r
- * ```\r
- */\r
-\r
- var Events = {\r
- /* @method on(type: String, fn: Function, context?: Object): this\r
- * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).\r
- *\r
- * @alternative\r
- * @method on(eventMap: Object): this\r
- * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r
- */\r
- on: function (types, fn, context) {\r
-\r
- // types can be a map of types/handlers\r
- if (typeof types === 'object') {\r
- for (var type in types) {\r
- // we don't process space-separated events here for performance;\r
- // it's a hot path since Layer uses the on(obj) syntax\r
- this._on(type, types[type], fn);\r
- }\r
-\r
- } else {\r
- // types can be a string of space-separated words\r
- types = splitWords(types);\r
-\r
- for (var i = 0, len = types.length; i < len; i++) {\r
- this._on(types[i], fn, context);\r
- }\r
- }\r
-\r
- return this;\r
- },\r
-\r
- /* @method off(type: String, fn?: Function, context?: Object): this\r
- * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.\r
- *\r
- * @alternative\r
- * @method off(eventMap: Object): this\r
- * Removes a set of type/listener pairs.\r
- *\r
- * @alternative\r
- * @method off: this\r
- * Removes all listeners to all events on the object. This includes implicitly attached events.\r
- */\r
- off: function (types, fn, context) {\r
-\r
- if (!types) {\r
- // clear all listeners if called without arguments\r
- delete this._events;\r
-\r
- } else if (typeof types === 'object') {\r
- for (var type in types) {\r
- this._off(type, types[type], fn);\r
- }\r
-\r
- } else {\r
- types = splitWords(types);\r
-\r
- for (var i = 0, len = types.length; i < len; i++) {\r
- this._off(types[i], fn, context);\r
- }\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // attach listener (without syntactic sugar now)\r
- _on: function (type, fn, context) {\r
- this._events = this._events || {};\r
-\r
- /* get/init listeners for type */\r
- var typeListeners = this._events[type];\r
- if (!typeListeners) {\r
- typeListeners = [];\r
- this._events[type] = typeListeners;\r
- }\r
-\r
- if (context === this) {\r
- // Less memory footprint.\r
- context = undefined;\r
- }\r
- var newListener = {fn: fn, ctx: context},\r
- listeners = typeListeners;\r
-\r
- // check if fn already there\r
- for (var i = 0, len = listeners.length; i < len; i++) {\r
- if (listeners[i].fn === fn && listeners[i].ctx === context) {\r
- return;\r
- }\r
- }\r
-\r
- listeners.push(newListener);\r
- },\r
-\r
- _off: function (type, fn, context) {\r
- var listeners,\r
- i,\r
- len;\r
-\r
- if (!this._events) { return; }\r
-\r
- listeners = this._events[type];\r
-\r
- if (!listeners) {\r
- return;\r
- }\r
-\r
- if (!fn) {\r
- // Set all removed listeners to noop so they are not called if remove happens in fire\r
- for (i = 0, len = listeners.length; i < len; i++) {\r
- listeners[i].fn = falseFn;\r
- }\r
- // clear all listeners for a type if function isn't specified\r
- delete this._events[type];\r
- return;\r
- }\r
-\r
- if (context === this) {\r
- context = undefined;\r
- }\r
-\r
- if (listeners) {\r
-\r
- // find fn and remove it\r
- for (i = 0, len = listeners.length; i < len; i++) {\r
- var l = listeners[i];\r
- if (l.ctx !== context) { continue; }\r
- if (l.fn === fn) {\r
-\r
- // set the removed listener to noop so that's not called if remove happens in fire\r
- l.fn = falseFn;\r
-\r
- if (this._firingCount) {\r
- /* copy array in case events are being fired */\r
- this._events[type] = listeners = listeners.slice();\r
- }\r
- listeners.splice(i, 1);\r
-\r
- return;\r
- }\r
- }\r
- }\r
- },\r
-\r
- // @method fire(type: String, data?: Object, propagate?: Boolean): this\r
- // Fires an event of the specified type. You can optionally provide an data\r
- // object — the first argument of the listener function will contain its\r
- // properties. The event can optionally be propagated to event parents.\r
- fire: function (type, data, propagate) {\r
- if (!this.listens(type, propagate)) { return this; }\r
-\r
- var event = extend({}, data, {\r
- type: type,\r
- target: this,\r
- sourceTarget: data && data.sourceTarget || this\r
- });\r
-\r
- if (this._events) {\r
- var listeners = this._events[type];\r
-\r
- if (listeners) {\r
- this._firingCount = (this._firingCount + 1) || 1;\r
- for (var i = 0, len = listeners.length; i < len; i++) {\r
- var l = listeners[i];\r
- l.fn.call(l.ctx || this, event);\r
- }\r
-\r
- this._firingCount--;\r
- }\r
- }\r
-\r
- if (propagate) {\r
- // propagate the event to parents (set with addEventParent)\r
- this._propagateEvent(event);\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method listens(type: String): Boolean\r
- // Returns `true` if a particular event type has any listeners attached to it.\r
- listens: function (type, propagate) {\r
- var listeners = this._events && this._events[type];\r
- if (listeners && listeners.length) { return true; }\r
-\r
- if (propagate) {\r
- // also check parents for listeners if event propagates\r
- for (var id in this._eventParents) {\r
- if (this._eventParents[id].listens(type, propagate)) { return true; }\r
- }\r
- }\r
- return false;\r
- },\r
-\r
- // @method once(…): this\r
- // Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.\r
- once: function (types, fn, context) {\r
-\r
- if (typeof types === 'object') {\r
- for (var type in types) {\r
- this.once(type, types[type], fn);\r
- }\r
- return this;\r
- }\r
-\r
- var handler = bind(function () {\r
- this\r
- .off(types, fn, context)\r
- .off(types, handler, context);\r
- }, this);\r
-\r
- // add a listener that's executed once and removed after that\r
- return this\r
- .on(types, fn, context)\r
- .on(types, handler, context);\r
- },\r
-\r
- // @method addEventParent(obj: Evented): this\r
- // Adds an event parent - an `Evented` that will receive propagated events\r
- addEventParent: function (obj) {\r
- this._eventParents = this._eventParents || {};\r
- this._eventParents[stamp(obj)] = obj;\r
- return this;\r
- },\r
-\r
- // @method removeEventParent(obj: Evented): this\r
- // Removes an event parent, so it will stop receiving propagated events\r
- removeEventParent: function (obj) {\r
- if (this._eventParents) {\r
- delete this._eventParents[stamp(obj)];\r
- }\r
- return this;\r
- },\r
-\r
- _propagateEvent: function (e) {\r
- for (var id in this._eventParents) {\r
- this._eventParents[id].fire(e.type, extend({\r
- layer: e.target,\r
- propagatedFrom: e.target\r
- }, e), true);\r
- }\r
- }\r
- };\r
-\r
- // aliases; we should ditch those eventually\r
-\r
- // @method addEventListener(…): this\r
- // Alias to [`on(…)`](#evented-on)\r
- Events.addEventListener = Events.on;\r
-\r
- // @method removeEventListener(…): this\r
- // Alias to [`off(…)`](#evented-off)\r
-\r
- // @method clearAllEventListeners(…): this\r
- // Alias to [`off()`](#evented-off)\r
- Events.removeEventListener = Events.clearAllEventListeners = Events.off;\r
-\r
- // @method addOneTimeEventListener(…): this\r
- // Alias to [`once(…)`](#evented-once)\r
- Events.addOneTimeEventListener = Events.once;\r
-\r
- // @method fireEvent(…): this\r
- // Alias to [`fire(…)`](#evented-fire)\r
- Events.fireEvent = Events.fire;\r
-\r
- // @method hasEventListeners(…): Boolean\r
- // Alias to [`listens(…)`](#evented-listens)\r
- Events.hasEventListeners = Events.listens;\r
-\r
- var Evented = Class.extend(Events);
-
- /*\r
- * @class Point\r
- * @aka L.Point\r
- *\r
- * Represents a point with `x` and `y` coordinates in pixels.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var point = L.point(200, 300);\r
- * ```\r
- *\r
- * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:\r
- *\r
- * ```js\r
- * map.panBy([200, 300]);\r
- * map.panBy(L.point(200, 300));\r
- * ```\r
- *\r
- * Note that `Point` does not inherit from Leaflet's `Class` object,\r
- * which means new classes can't inherit from it, and new methods\r
- * can't be added to it with the `include` function.\r
- */\r
-\r
- function Point(x, y, round) {\r
- // @property x: Number; The `x` coordinate of the point\r
- this.x = (round ? Math.round(x) : x);\r
- // @property y: Number; The `y` coordinate of the point\r
- this.y = (round ? Math.round(y) : y);\r
- }\r
-\r
- var trunc = Math.trunc || function (v) {\r
- return v > 0 ? Math.floor(v) : Math.ceil(v);\r
- };\r
-\r
- Point.prototype = {\r
-\r
- // @method clone(): Point\r
- // Returns a copy of the current point.\r
- clone: function () {\r
- return new Point(this.x, this.y);\r
- },\r
-\r
- // @method add(otherPoint: Point): Point\r
- // Returns the result of addition of the current and the given points.\r
- add: function (point) {\r
- // non-destructive, returns a new point\r
- return this.clone()._add(toPoint(point));\r
- },\r
-\r
- _add: function (point) {\r
- // destructive, used directly for performance in situations where it's safe to modify existing point\r
- this.x += point.x;\r
- this.y += point.y;\r
- return this;\r
- },\r
-\r
- // @method subtract(otherPoint: Point): Point\r
- // Returns the result of subtraction of the given point from the current.\r
- subtract: function (point) {\r
- return this.clone()._subtract(toPoint(point));\r
- },\r
-\r
- _subtract: function (point) {\r
- this.x -= point.x;\r
- this.y -= point.y;\r
- return this;\r
- },\r
-\r
- // @method divideBy(num: Number): Point\r
- // Returns the result of division of the current point by the given number.\r
- divideBy: function (num) {\r
- return this.clone()._divideBy(num);\r
- },\r
-\r
- _divideBy: function (num) {\r
- this.x /= num;\r
- this.y /= num;\r
- return this;\r
- },\r
-\r
- // @method multiplyBy(num: Number): Point\r
- // Returns the result of multiplication of the current point by the given number.\r
- multiplyBy: function (num) {\r
- return this.clone()._multiplyBy(num);\r
- },\r
-\r
- _multiplyBy: function (num) {\r
- this.x *= num;\r
- this.y *= num;\r
- return this;\r
- },\r
-\r
- // @method scaleBy(scale: Point): Point\r
- // Multiply each coordinate of the current point by each coordinate of\r
- // `scale`. In linear algebra terms, multiply the point by the\r
- // [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r
- // defined by `scale`.\r
- scaleBy: function (point) {\r
- return new Point(this.x * point.x, this.y * point.y);\r
- },\r
-\r
- // @method unscaleBy(scale: Point): Point\r
- // Inverse of `scaleBy`. Divide each coordinate of the current point by\r
- // each coordinate of `scale`.\r
- unscaleBy: function (point) {\r
- return new Point(this.x / point.x, this.y / point.y);\r
- },\r
-\r
- // @method round(): Point\r
- // Returns a copy of the current point with rounded coordinates.\r
- round: function () {\r
- return this.clone()._round();\r
- },\r
-\r
- _round: function () {\r
- this.x = Math.round(this.x);\r
- this.y = Math.round(this.y);\r
- return this;\r
- },\r
-\r
- // @method floor(): Point\r
- // Returns a copy of the current point with floored coordinates (rounded down).\r
- floor: function () {\r
- return this.clone()._floor();\r
- },\r
-\r
- _floor: function () {\r
- this.x = Math.floor(this.x);\r
- this.y = Math.floor(this.y);\r
- return this;\r
- },\r
-\r
- // @method ceil(): Point\r
- // Returns a copy of the current point with ceiled coordinates (rounded up).\r
- ceil: function () {\r
- return this.clone()._ceil();\r
- },\r
-\r
- _ceil: function () {\r
- this.x = Math.ceil(this.x);\r
- this.y = Math.ceil(this.y);\r
- return this;\r
- },\r
-\r
- // @method trunc(): Point\r
- // Returns a copy of the current point with truncated coordinates (rounded towards zero).\r
- trunc: function () {\r
- return this.clone()._trunc();\r
- },\r
-\r
- _trunc: function () {\r
- this.x = trunc(this.x);\r
- this.y = trunc(this.y);\r
- return this;\r
- },\r
-\r
- // @method distanceTo(otherPoint: Point): Number\r
- // Returns the cartesian distance between the current and the given points.\r
- distanceTo: function (point) {\r
- point = toPoint(point);\r
-\r
- var x = point.x - this.x,\r
- y = point.y - this.y;\r
-\r
- return Math.sqrt(x * x + y * y);\r
- },\r
-\r
- // @method equals(otherPoint: Point): Boolean\r
- // Returns `true` if the given point has the same coordinates.\r
- equals: function (point) {\r
- point = toPoint(point);\r
-\r
- return point.x === this.x &&\r
- point.y === this.y;\r
- },\r
-\r
- // @method contains(otherPoint: Point): Boolean\r
- // Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r
- contains: function (point) {\r
- point = toPoint(point);\r
-\r
- return Math.abs(point.x) <= Math.abs(this.x) &&\r
- Math.abs(point.y) <= Math.abs(this.y);\r
- },\r
-\r
- // @method toString(): String\r
- // Returns a string representation of the point for debugging purposes.\r
- toString: function () {\r
- return 'Point(' +\r
- formatNum(this.x) + ', ' +\r
- formatNum(this.y) + ')';\r
- }\r
- };\r
-\r
- // @factory L.point(x: Number, y: Number, round?: Boolean)\r
- // Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.\r
-\r
- // @alternative\r
- // @factory L.point(coords: Number[])\r
- // Expects an array of the form `[x, y]` instead.\r
-\r
- // @alternative\r
- // @factory L.point(coords: Object)\r
- // Expects a plain object of the form `{x: Number, y: Number}` instead.\r
- function toPoint(x, y, round) {\r
- if (x instanceof Point) {\r
- return x;\r
- }\r
- if (isArray(x)) {\r
- return new Point(x[0], x[1]);\r
- }\r
- if (x === undefined || x === null) {\r
- return x;\r
- }\r
- if (typeof x === 'object' && 'x' in x && 'y' in x) {\r
- return new Point(x.x, x.y);\r
- }\r
- return new Point(x, y, round);\r
- }
-
- /*\r
- * @class Bounds\r
- * @aka L.Bounds\r
- *\r
- * Represents a rectangular area in pixel coordinates.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var p1 = L.point(10, 10),\r
- * p2 = L.point(40, 60),\r
- * bounds = L.bounds(p1, p2);\r
- * ```\r
- *\r
- * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r
- *\r
- * ```js\r
- * otherBounds.intersects([[10, 10], [40, 60]]);\r
- * ```\r
- *\r
- * Note that `Bounds` does not inherit from Leaflet's `Class` object,\r
- * which means new classes can't inherit from it, and new methods\r
- * can't be added to it with the `include` function.\r
- */\r
-\r
- function Bounds(a, b) {\r
- if (!a) { return; }\r
-\r
- var points = b ? [a, b] : a;\r
-\r
- for (var i = 0, len = points.length; i < len; i++) {\r
- this.extend(points[i]);\r
- }\r
- }\r
-\r
- Bounds.prototype = {\r
- // @method extend(point: Point): this\r
- // Extends the bounds to contain the given point.\r
- extend: function (point) { // (Point)\r
- point = toPoint(point);\r
-\r
- // @property min: Point\r
- // The top left corner of the rectangle.\r
- // @property max: Point\r
- // The bottom right corner of the rectangle.\r
- if (!this.min && !this.max) {\r
- this.min = point.clone();\r
- this.max = point.clone();\r
- } else {\r
- this.min.x = Math.min(point.x, this.min.x);\r
- this.max.x = Math.max(point.x, this.max.x);\r
- this.min.y = Math.min(point.y, this.min.y);\r
- this.max.y = Math.max(point.y, this.max.y);\r
- }\r
- return this;\r
- },\r
-\r
- // @method getCenter(round?: Boolean): Point\r
- // Returns the center point of the bounds.\r
- getCenter: function (round) {\r
- return new Point(\r
- (this.min.x + this.max.x) / 2,\r
- (this.min.y + this.max.y) / 2, round);\r
- },\r
-\r
- // @method getBottomLeft(): Point\r
- // Returns the bottom-left point of the bounds.\r
- getBottomLeft: function () {\r
- return new Point(this.min.x, this.max.y);\r
- },\r
-\r
- // @method getTopRight(): Point\r
- // Returns the top-right point of the bounds.\r
- getTopRight: function () { // -> Point\r
- return new Point(this.max.x, this.min.y);\r
- },\r
-\r
- // @method getTopLeft(): Point\r
- // Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).\r
- getTopLeft: function () {\r
- return this.min; // left, top\r
- },\r
-\r
- // @method getBottomRight(): Point\r
- // Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).\r
- getBottomRight: function () {\r
- return this.max; // right, bottom\r
- },\r
-\r
- // @method getSize(): Point\r
- // Returns the size of the given bounds\r
- getSize: function () {\r
- return this.max.subtract(this.min);\r
- },\r
-\r
- // @method contains(otherBounds: Bounds): Boolean\r
- // Returns `true` if the rectangle contains the given one.\r
- // @alternative\r
- // @method contains(point: Point): Boolean\r
- // Returns `true` if the rectangle contains the given point.\r
- contains: function (obj) {\r
- var min, max;\r
-\r
- if (typeof obj[0] === 'number' || obj instanceof Point) {\r
- obj = toPoint(obj);\r
- } else {\r
- obj = toBounds(obj);\r
- }\r
-\r
- if (obj instanceof Bounds) {\r
- min = obj.min;\r
- max = obj.max;\r
- } else {\r
- min = max = obj;\r
- }\r
-\r
- return (min.x >= this.min.x) &&\r
- (max.x <= this.max.x) &&\r
- (min.y >= this.min.y) &&\r
- (max.y <= this.max.y);\r
- },\r
-\r
- // @method intersects(otherBounds: Bounds): Boolean\r
- // Returns `true` if the rectangle intersects the given bounds. Two bounds\r
- // intersect if they have at least one point in common.\r
- intersects: function (bounds) { // (Bounds) -> Boolean\r
- bounds = toBounds(bounds);\r
-\r
- var min = this.min,\r
- max = this.max,\r
- min2 = bounds.min,\r
- max2 = bounds.max,\r
- xIntersects = (max2.x >= min.x) && (min2.x <= max.x),\r
- yIntersects = (max2.y >= min.y) && (min2.y <= max.y);\r
-\r
- return xIntersects && yIntersects;\r
- },\r
-\r
- // @method overlaps(otherBounds: Bounds): Boolean\r
- // Returns `true` if the rectangle overlaps the given bounds. Two bounds\r
- // overlap if their intersection is an area.\r
- overlaps: function (bounds) { // (Bounds) -> Boolean\r
- bounds = toBounds(bounds);\r
-\r
- var min = this.min,\r
- max = this.max,\r
- min2 = bounds.min,\r
- max2 = bounds.max,\r
- xOverlaps = (max2.x > min.x) && (min2.x < max.x),\r
- yOverlaps = (max2.y > min.y) && (min2.y < max.y);\r
-\r
- return xOverlaps && yOverlaps;\r
- },\r
-\r
- isValid: function () {\r
- return !!(this.min && this.max);\r
- }\r
- };\r
-\r
-\r
- // @factory L.bounds(corner1: Point, corner2: Point)\r
- // Creates a Bounds object from two corners coordinate pairs.\r
- // @alternative\r
- // @factory L.bounds(points: Point[])\r
- // Creates a Bounds object from the given array of points.\r
- function toBounds(a, b) {\r
- if (!a || a instanceof Bounds) {\r
- return a;\r
- }\r
- return new Bounds(a, b);\r
- }
-
- /*\r
- * @class LatLngBounds\r
- * @aka L.LatLngBounds\r
- *\r
- * Represents a rectangular geographical area on a map.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var corner1 = L.latLng(40.712, -74.227),\r
- * corner2 = L.latLng(40.774, -74.125),\r
- * bounds = L.latLngBounds(corner1, corner2);\r
- * ```\r
- *\r
- * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r
- *\r
- * ```js\r
- * map.fitBounds([\r
- * [40.712, -74.227],\r
- * [40.774, -74.125]\r
- * ]);\r
- * ```\r
- *\r
- * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.\r
- *\r
- * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object,\r
- * which means new classes can't inherit from it, and new methods\r
- * can't be added to it with the `include` function.\r
- */\r
-\r
- function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\r
- if (!corner1) { return; }\r
-\r
- var latlngs = corner2 ? [corner1, corner2] : corner1;\r
-\r
- for (var i = 0, len = latlngs.length; i < len; i++) {\r
- this.extend(latlngs[i]);\r
- }\r
- }\r
-\r
- LatLngBounds.prototype = {\r
-\r
- // @method extend(latlng: LatLng): this\r
- // Extend the bounds to contain the given point\r
-\r
- // @alternative\r
- // @method extend(otherBounds: LatLngBounds): this\r
- // Extend the bounds to contain the given bounds\r
- extend: function (obj) {\r
- var sw = this._southWest,\r
- ne = this._northEast,\r
- sw2, ne2;\r
-\r
- if (obj instanceof LatLng) {\r
- sw2 = obj;\r
- ne2 = obj;\r
-\r
- } else if (obj instanceof LatLngBounds) {\r
- sw2 = obj._southWest;\r
- ne2 = obj._northEast;\r
-\r
- if (!sw2 || !ne2) { return this; }\r
-\r
- } else {\r
- return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;\r
- }\r
-\r
- if (!sw && !ne) {\r
- this._southWest = new LatLng(sw2.lat, sw2.lng);\r
- this._northEast = new LatLng(ne2.lat, ne2.lng);\r
- } else {\r
- sw.lat = Math.min(sw2.lat, sw.lat);\r
- sw.lng = Math.min(sw2.lng, sw.lng);\r
- ne.lat = Math.max(ne2.lat, ne.lat);\r
- ne.lng = Math.max(ne2.lng, ne.lng);\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method pad(bufferRatio: Number): LatLngBounds\r
- // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r
- // For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r
- // Negative values will retract the bounds.\r
- pad: function (bufferRatio) {\r
- var sw = this._southWest,\r
- ne = this._northEast,\r
- heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\r
- widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\r
-\r
- return new LatLngBounds(\r
- new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\r
- new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\r
- },\r
-\r
- // @method getCenter(): LatLng\r
- // Returns the center point of the bounds.\r
- getCenter: function () {\r
- return new LatLng(\r
- (this._southWest.lat + this._northEast.lat) / 2,\r
- (this._southWest.lng + this._northEast.lng) / 2);\r
- },\r
-\r
- // @method getSouthWest(): LatLng\r
- // Returns the south-west point of the bounds.\r
- getSouthWest: function () {\r
- return this._southWest;\r
- },\r
-\r
- // @method getNorthEast(): LatLng\r
- // Returns the north-east point of the bounds.\r
- getNorthEast: function () {\r
- return this._northEast;\r
- },\r
-\r
- // @method getNorthWest(): LatLng\r
- // Returns the north-west point of the bounds.\r
- getNorthWest: function () {\r
- return new LatLng(this.getNorth(), this.getWest());\r
- },\r
-\r
- // @method getSouthEast(): LatLng\r
- // Returns the south-east point of the bounds.\r
- getSouthEast: function () {\r
- return new LatLng(this.getSouth(), this.getEast());\r
- },\r
-\r
- // @method getWest(): Number\r
- // Returns the west longitude of the bounds\r
- getWest: function () {\r
- return this._southWest.lng;\r
- },\r
-\r
- // @method getSouth(): Number\r
- // Returns the south latitude of the bounds\r
- getSouth: function () {\r
- return this._southWest.lat;\r
- },\r
-\r
- // @method getEast(): Number\r
- // Returns the east longitude of the bounds\r
- getEast: function () {\r
- return this._northEast.lng;\r
- },\r
-\r
- // @method getNorth(): Number\r
- // Returns the north latitude of the bounds\r
- getNorth: function () {\r
- return this._northEast.lat;\r
- },\r
-\r
- // @method contains(otherBounds: LatLngBounds): Boolean\r
- // Returns `true` if the rectangle contains the given one.\r
-\r
- // @alternative\r
- // @method contains (latlng: LatLng): Boolean\r
- // Returns `true` if the rectangle contains the given point.\r
- contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean\r
- if (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {\r
- obj = toLatLng(obj);\r
- } else {\r
- obj = toLatLngBounds(obj);\r
- }\r
-\r
- var sw = this._southWest,\r
- ne = this._northEast,\r
- sw2, ne2;\r
-\r
- if (obj instanceof LatLngBounds) {\r
- sw2 = obj.getSouthWest();\r
- ne2 = obj.getNorthEast();\r
- } else {\r
- sw2 = ne2 = obj;\r
- }\r
-\r
- return (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\r
- (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\r
- },\r
-\r
- // @method intersects(otherBounds: LatLngBounds): Boolean\r
- // Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.\r
- intersects: function (bounds) {\r
- bounds = toLatLngBounds(bounds);\r
-\r
- var sw = this._southWest,\r
- ne = this._northEast,\r
- sw2 = bounds.getSouthWest(),\r
- ne2 = bounds.getNorthEast(),\r
-\r
- latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\r
- lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\r
-\r
- return latIntersects && lngIntersects;\r
- },\r
-\r
- // @method overlaps(otherBounds: LatLngBounds): Boolean\r
- // Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.\r
- overlaps: function (bounds) {\r
- bounds = toLatLngBounds(bounds);\r
-\r
- var sw = this._southWest,\r
- ne = this._northEast,\r
- sw2 = bounds.getSouthWest(),\r
- ne2 = bounds.getNorthEast(),\r
-\r
- latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\r
- lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\r
-\r
- return latOverlaps && lngOverlaps;\r
- },\r
-\r
- // @method toBBoxString(): String\r
- // Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.\r
- toBBoxString: function () {\r
- return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\r
- },\r
-\r
- // @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean\r
- // Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.\r
- equals: function (bounds, maxMargin) {\r
- if (!bounds) { return false; }\r
-\r
- bounds = toLatLngBounds(bounds);\r
-\r
- return this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\r
- this._northEast.equals(bounds.getNorthEast(), maxMargin);\r
- },\r
-\r
- // @method isValid(): Boolean\r
- // Returns `true` if the bounds are properly initialized.\r
- isValid: function () {\r
- return !!(this._southWest && this._northEast);\r
- }\r
- };\r
-\r
- // TODO International date line?\r
-\r
- // @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)\r
- // Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.\r
-\r
- // @alternative\r
- // @factory L.latLngBounds(latlngs: LatLng[])\r
- // Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds).\r
- function toLatLngBounds(a, b) {\r
- if (a instanceof LatLngBounds) {\r
- return a;\r
- }\r
- return new LatLngBounds(a, b);\r
- }
-
- /* @class LatLng\r
- * @aka L.LatLng\r
- *\r
- * Represents a geographical point with a certain latitude and longitude.\r
- *\r
- * @example\r
- *\r
- * ```\r
- * var latlng = L.latLng(50.5, 30.5);\r
- * ```\r
- *\r
- * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:\r
- *\r
- * ```\r
- * map.panTo([50, 30]);\r
- * map.panTo({lon: 30, lat: 50});\r
- * map.panTo({lat: 50, lng: 30});\r
- * map.panTo(L.latLng(50, 30));\r
- * ```\r
- *\r
- * Note that `LatLng` does not inherit from Leaflet's `Class` object,\r
- * which means new classes can't inherit from it, and new methods\r
- * can't be added to it with the `include` function.\r
- */\r
-\r
- function LatLng(lat, lng, alt) {\r
- if (isNaN(lat) || isNaN(lng)) {\r
- throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\r
- }\r
-\r
- // @property lat: Number\r
- // Latitude in degrees\r
- this.lat = +lat;\r
-\r
- // @property lng: Number\r
- // Longitude in degrees\r
- this.lng = +lng;\r
-\r
- // @property alt: Number\r
- // Altitude in meters (optional)\r
- if (alt !== undefined) {\r
- this.alt = +alt;\r
- }\r
- }\r
-\r
- LatLng.prototype = {\r
- // @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean\r
- // Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.\r
- equals: function (obj, maxMargin) {\r
- if (!obj) { return false; }\r
-\r
- obj = toLatLng(obj);\r
-\r
- var margin = Math.max(\r
- Math.abs(this.lat - obj.lat),\r
- Math.abs(this.lng - obj.lng));\r
-\r
- return margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);\r
- },\r
-\r
- // @method toString(): String\r
- // Returns a string representation of the point (for debugging purposes).\r
- toString: function (precision) {\r
- return 'LatLng(' +\r
- formatNum(this.lat, precision) + ', ' +\r
- formatNum(this.lng, precision) + ')';\r
- },\r
-\r
- // @method distanceTo(otherLatLng: LatLng): Number\r
- // Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).\r
- distanceTo: function (other) {\r
- return Earth.distance(this, toLatLng(other));\r
- },\r
-\r
- // @method wrap(): LatLng\r
- // Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.\r
- wrap: function () {\r
- return Earth.wrapLatLng(this);\r
- },\r
-\r
- // @method toBounds(sizeInMeters: Number): LatLngBounds\r
- // Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.\r
- toBounds: function (sizeInMeters) {\r
- var latAccuracy = 180 * sizeInMeters / 40075017,\r
- lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);\r
-\r
- return toLatLngBounds(\r
- [this.lat - latAccuracy, this.lng - lngAccuracy],\r
- [this.lat + latAccuracy, this.lng + lngAccuracy]);\r
- },\r
-\r
- clone: function () {\r
- return new LatLng(this.lat, this.lng, this.alt);\r
- }\r
- };\r
-\r
-\r
-\r
- // @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng\r
- // Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).\r
-\r
- // @alternative\r
- // @factory L.latLng(coords: Array): LatLng\r
- // Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.\r
-\r
- // @alternative\r
- // @factory L.latLng(coords: Object): LatLng\r
- // Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.\r
-\r
- function toLatLng(a, b, c) {\r
- if (a instanceof LatLng) {\r
- return a;\r
- }\r
- if (isArray(a) && typeof a[0] !== 'object') {\r
- if (a.length === 3) {\r
- return new LatLng(a[0], a[1], a[2]);\r
- }\r
- if (a.length === 2) {\r
- return new LatLng(a[0], a[1]);\r
- }\r
- return null;\r
- }\r
- if (a === undefined || a === null) {\r
- return a;\r
- }\r
- if (typeof a === 'object' && 'lat' in a) {\r
- return new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\r
- }\r
- if (b === undefined) {\r
- return null;\r
- }\r
- return new LatLng(a, b, c);\r
- }
-
- /*\r
- * @namespace CRS\r
- * @crs L.CRS.Base\r
- * Object that defines coordinate reference systems for projecting\r
- * geographical points into pixel (screen) coordinates and back (and to\r
- * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See\r
- * [spatial reference system](http://en.wikipedia.org/wiki/Coordinate_reference_system).\r
- *\r
- * Leaflet defines the most usual CRSs by default. If you want to use a\r
- * CRS not defined by default, take a look at the\r
- * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin.\r
- *\r
- * Note that the CRS instances do not inherit from Leaflet's `Class` object,\r
- * and can't be instantiated. Also, new classes can't inherit from them,\r
- * and methods can't be added to them with the `include` function.\r
- */\r
-\r
- var CRS = {\r
- // @method latLngToPoint(latlng: LatLng, zoom: Number): Point\r
- // Projects geographical coordinates into pixel coordinates for a given zoom.\r
- latLngToPoint: function (latlng, zoom) {\r
- var projectedPoint = this.projection.project(latlng),\r
- scale = this.scale(zoom);\r
-\r
- return this.transformation._transform(projectedPoint, scale);\r
- },\r
-\r
- // @method pointToLatLng(point: Point, zoom: Number): LatLng\r
- // The inverse of `latLngToPoint`. Projects pixel coordinates on a given\r
- // zoom into geographical coordinates.\r
- pointToLatLng: function (point, zoom) {\r
- var scale = this.scale(zoom),\r
- untransformedPoint = this.transformation.untransform(point, scale);\r
-\r
- return this.projection.unproject(untransformedPoint);\r
- },\r
-\r
- // @method project(latlng: LatLng): Point\r
- // Projects geographical coordinates into coordinates in units accepted for\r
- // this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).\r
- project: function (latlng) {\r
- return this.projection.project(latlng);\r
- },\r
-\r
- // @method unproject(point: Point): LatLng\r
- // Given a projected coordinate returns the corresponding LatLng.\r
- // The inverse of `project`.\r
- unproject: function (point) {\r
- return this.projection.unproject(point);\r
- },\r
-\r
- // @method scale(zoom: Number): Number\r
- // Returns the scale used when transforming projected coordinates into\r
- // pixel coordinates for a particular zoom. For example, it returns\r
- // `256 * 2^zoom` for Mercator-based CRS.\r
- scale: function (zoom) {\r
- return 256 * Math.pow(2, zoom);\r
- },\r
-\r
- // @method zoom(scale: Number): Number\r
- // Inverse of `scale()`, returns the zoom level corresponding to a scale\r
- // factor of `scale`.\r
- zoom: function (scale) {\r
- return Math.log(scale / 256) / Math.LN2;\r
- },\r
-\r
- // @method getProjectedBounds(zoom: Number): Bounds\r
- // Returns the projection's bounds scaled and transformed for the provided `zoom`.\r
- getProjectedBounds: function (zoom) {\r
- if (this.infinite) { return null; }\r
-\r
- var b = this.projection.bounds,\r
- s = this.scale(zoom),\r
- min = this.transformation.transform(b.min, s),\r
- max = this.transformation.transform(b.max, s);\r
-\r
- return new Bounds(min, max);\r
- },\r
-\r
- // @method distance(latlng1: LatLng, latlng2: LatLng): Number\r
- // Returns the distance between two geographical coordinates.\r
-\r
- // @property code: String\r
- // Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)\r
- //\r
- // @property wrapLng: Number[]\r
- // An array of two numbers defining whether the longitude (horizontal) coordinate\r
- // axis wraps around a given range and how. Defaults to `[-180, 180]` in most\r
- // geographical CRSs. If `undefined`, the longitude axis does not wrap around.\r
- //\r
- // @property wrapLat: Number[]\r
- // Like `wrapLng`, but for the latitude (vertical) axis.\r
-\r
- // wrapLng: [min, max],\r
- // wrapLat: [min, max],\r
-\r
- // @property infinite: Boolean\r
- // If true, the coordinate space will be unbounded (infinite in both axes)\r
- infinite: false,\r
-\r
- // @method wrapLatLng(latlng: LatLng): LatLng\r
- // Returns a `LatLng` where lat and lng has been wrapped according to the\r
- // CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.\r
- wrapLatLng: function (latlng) {\r
- var lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,\r
- lat = this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,\r
- alt = latlng.alt;\r
-\r
- return new LatLng(lat, lng, alt);\r
- },\r
-\r
- // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r
- // Returns a `LatLngBounds` with the same size as the given one, ensuring\r
- // that its center is within the CRS's bounds.\r
- // Only accepts actual `L.LatLngBounds` instances, not arrays.\r
- wrapLatLngBounds: function (bounds) {\r
- var center = bounds.getCenter(),\r
- newCenter = this.wrapLatLng(center),\r
- latShift = center.lat - newCenter.lat,\r
- lngShift = center.lng - newCenter.lng;\r
-\r
- if (latShift === 0 && lngShift === 0) {\r
- return bounds;\r
- }\r
-\r
- var sw = bounds.getSouthWest(),\r
- ne = bounds.getNorthEast(),\r
- newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift),\r
- newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift);\r
-\r
- return new LatLngBounds(newSw, newNe);\r
- }\r
- };
-
- /*
- * @namespace CRS
- * @crs L.CRS.Earth
- *
- * Serves as the base for CRS that are global such that they cover the earth.
- * Can only be used as the base for other CRS and cannot be used directly,
- * since it does not have a `code`, `projection` or `transformation`. `distance()` returns
- * meters.
- */
-
- var Earth = extend({}, CRS, {
- wrapLng: [-180, 180],
-
- // Mean Earth Radius, as recommended for use by
- // the International Union of Geodesy and Geophysics,
- // see http://rosettacode.org/wiki/Haversine_formula
- R: 6371000,
-
- // distance between two geographical points using spherical law of cosines approximation
- distance: function (latlng1, latlng2) {
- var rad = Math.PI / 180,
- lat1 = latlng1.lat * rad,
- lat2 = latlng2.lat * rad,
- sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),
- sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),
- a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,
- c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
- return this.R * c;
- }
- });
-
- /*\r
- * @namespace Projection\r
- * @projection L.Projection.SphericalMercator\r
- *\r
- * Spherical Mercator projection — the most common projection for online maps,\r
- * used by almost all free and commercial tile providers. Assumes that Earth is\r
- * a sphere. Used by the `EPSG:3857` CRS.\r
- */\r
-\r
- var earthRadius = 6378137;\r
-\r
- var SphericalMercator = {\r
-\r
- R: earthRadius,\r
- MAX_LATITUDE: 85.0511287798,\r
-\r
- project: function (latlng) {\r
- var d = Math.PI / 180,\r
- max = this.MAX_LATITUDE,\r
- lat = Math.max(Math.min(max, latlng.lat), -max),\r
- sin = Math.sin(lat * d);\r
-\r
- return new Point(\r
- this.R * latlng.lng * d,\r
- this.R * Math.log((1 + sin) / (1 - sin)) / 2);\r
- },\r
-\r
- unproject: function (point) {\r
- var d = 180 / Math.PI;\r
-\r
- return new LatLng(\r
- (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\r
- point.x * d / this.R);\r
- },\r
-\r
- bounds: (function () {\r
- var d = earthRadius * Math.PI;\r
- return new Bounds([-d, -d], [d, d]);\r
- })()\r
- };
-
- /*\r
- * @class Transformation\r
- * @aka L.Transformation\r
- *\r
- * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d`\r
- * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing\r
- * the reverse. Used by Leaflet in its projections code.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var transformation = L.transformation(2, 5, -1, 10),\r
- * p = L.point(1, 2),\r
- * p2 = transformation.transform(p), // L.point(7, 8)\r
- * p3 = transformation.untransform(p2); // L.point(1, 2)\r
- * ```\r
- */\r
-\r
-\r
- // factory new L.Transformation(a: Number, b: Number, c: Number, d: Number)\r
- // Creates a `Transformation` object with the given coefficients.\r
- function Transformation(a, b, c, d) {\r
- if (isArray(a)) {\r
- // use array properties\r
- this._a = a[0];\r
- this._b = a[1];\r
- this._c = a[2];\r
- this._d = a[3];\r
- return;\r
- }\r
- this._a = a;\r
- this._b = b;\r
- this._c = c;\r
- this._d = d;\r
- }\r
-\r
- Transformation.prototype = {\r
- // @method transform(point: Point, scale?: Number): Point\r
- // Returns a transformed point, optionally multiplied by the given scale.\r
- // Only accepts actual `L.Point` instances, not arrays.\r
- transform: function (point, scale) { // (Point, Number) -> Point\r
- return this._transform(point.clone(), scale);\r
- },\r
-\r
- // destructive transform (faster)\r
- _transform: function (point, scale) {\r
- scale = scale || 1;\r
- point.x = scale * (this._a * point.x + this._b);\r
- point.y = scale * (this._c * point.y + this._d);\r
- return point;\r
- },\r
-\r
- // @method untransform(point: Point, scale?: Number): Point\r
- // Returns the reverse transformation of the given point, optionally divided\r
- // by the given scale. Only accepts actual `L.Point` instances, not arrays.\r
- untransform: function (point, scale) {\r
- scale = scale || 1;\r
- return new Point(\r
- (point.x / scale - this._b) / this._a,\r
- (point.y / scale - this._d) / this._c);\r
- }\r
- };\r
-\r
- // factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r
-\r
- // @factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r
- // Instantiates a Transformation object with the given coefficients.\r
-\r
- // @alternative\r
- // @factory L.transformation(coefficients: Array): Transformation\r
- // Expects an coefficients array of the form\r
- // `[a: Number, b: Number, c: Number, d: Number]`.\r
-\r
- function toTransformation(a, b, c, d) {\r
- return new Transformation(a, b, c, d);\r
- }
-
- /*\r
- * @namespace CRS\r
- * @crs L.CRS.EPSG3857\r
- *\r
- * The most common CRS for online maps, used by almost all free and commercial\r
- * tile providers. Uses Spherical Mercator projection. Set in by default in\r
- * Map's `crs` option.\r
- */\r
-\r
- var EPSG3857 = extend({}, Earth, {\r
- code: 'EPSG:3857',\r
- projection: SphericalMercator,\r
-\r
- transformation: (function () {\r
- var scale = 0.5 / (Math.PI * SphericalMercator.R);\r
- return toTransformation(scale, 0.5, -scale, 0.5);\r
- }())\r
- });\r
-\r
- var EPSG900913 = extend({}, EPSG3857, {\r
- code: 'EPSG:900913'\r
- });
-
- // @namespace SVG; @section
- // There are several static functions which can be called without instantiating L.SVG:
-
- // @function create(name: String): SVGElement
- // Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),
- // corresponding to the class name passed. For example, using 'line' will return
- // an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).
- function svgCreate(name) {
- return document.createElementNS('http://www.w3.org/2000/svg', name);
- }
-
- // @function pointsToPath(rings: Point[], closed: Boolean): String
- // Generates a SVG path string for multiple rings, with each ring turning
- // into "M..L..L.." instructions
- function pointsToPath(rings, closed) {
- var str = '',
- i, j, len, len2, points, p;
-
- for (i = 0, len = rings.length; i < len; i++) {
- points = rings[i];
-
- for (j = 0, len2 = points.length; j < len2; j++) {
- p = points[j];
- str += (j ? 'L' : 'M') + p.x + ' ' + p.y;
- }
-
- // closes the ring for polygons; "x" is VML syntax
- str += closed ? (svg ? 'z' : 'x') : '';
- }
-
- // SVG complains about empty path strings
- return str || 'M0 0';
- }
-
- /*\r
- * @namespace Browser\r
- * @aka L.Browser\r
- *\r
- * A namespace with static properties for browser/feature detection used by Leaflet internally.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * if (L.Browser.ielt9) {\r
- * alert('Upgrade your browser, dude!');\r
- * }\r
- * ```\r
- */\r
-\r
- var style$1 = document.documentElement.style;\r
-\r
- // @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\r
- var ie = 'ActiveXObject' in window;\r
-\r
- // @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\r
- var ielt9 = ie && !document.addEventListener;\r
-\r
- // @property edge: Boolean; `true` for the Edge web browser.\r
- var edge = 'msLaunchUri' in navigator && !('documentMode' in document);\r
-\r
- // @property webkit: Boolean;\r
- // `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\r
- var webkit = userAgentContains('webkit');\r
-\r
- // @property android: Boolean\r
- // `true` for any browser running on an Android platform.\r
- var android = userAgentContains('android');\r
-\r
- // @property android23: Boolean; `true` for browsers running on Android 2 or Android 3.\r
- var android23 = userAgentContains('android 2') || userAgentContains('android 3');\r
-\r
- /* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */\r
- var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit\r
- // @property androidStock: Boolean; `true` for the Android stock browser (i.e. not Chrome)\r
- var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);\r
-\r
- // @property opera: Boolean; `true` for the Opera browser\r
- var opera = !!window.opera;\r
-\r
- // @property chrome: Boolean; `true` for the Chrome browser.\r
- var chrome = !edge && userAgentContains('chrome');\r
-\r
- // @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\r
- var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\r
-\r
- // @property safari: Boolean; `true` for the Safari browser.\r
- var safari = !chrome && userAgentContains('safari');\r
-\r
- var phantom = userAgentContains('phantom');\r
-\r
- // @property opera12: Boolean\r
- // `true` for the Opera browser supporting CSS transforms (version 12 or later).\r
- var opera12 = 'OTransition' in style$1;\r
-\r
- // @property win: Boolean; `true` when the browser is running in a Windows platform\r
- var win = navigator.platform.indexOf('Win') === 0;\r
-\r
- // @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\r
- var ie3d = ie && ('transition' in style$1);\r
-\r
- // @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\r
- var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\r
-\r
- // @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\r
- var gecko3d = 'MozPerspective' in style$1;\r
-\r
- // @property any3d: Boolean\r
- // `true` for all browsers supporting CSS transforms.\r
- var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\r
-\r
- // @property mobile: Boolean; `true` for all browsers running in a mobile device.\r
- var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\r
-\r
- // @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\r
- var mobileWebkit = mobile && webkit;\r
-\r
- // @property mobileWebkit3d: Boolean\r
- // `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\r
- var mobileWebkit3d = mobile && webkit3d;\r
-\r
- // @property msPointer: Boolean\r
- // `true` for browsers implementing the Microsoft touch events model (notably IE10).\r
- var msPointer = !window.PointerEvent && window.MSPointerEvent;\r
-\r
- // @property pointer: Boolean\r
- // `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\r
- var pointer = !!(window.PointerEvent || msPointer);\r
-\r
- // @property touch: Boolean\r
- // `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\r
- // This does not necessarily mean that the browser is running in a computer with\r
- // a touchscreen, it only means that the browser is capable of understanding\r
- // touch events.\r
- var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window ||\r
- (window.DocumentTouch && document instanceof window.DocumentTouch));\r
-\r
- // @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\r
- var mobileOpera = mobile && opera;\r
-\r
- // @property mobileGecko: Boolean\r
- // `true` for gecko-based browsers running in a mobile device.\r
- var mobileGecko = mobile && gecko;\r
-\r
- // @property retina: Boolean\r
- // `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.\r
- var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\r
-\r
- // @property passiveEvents: Boolean\r
- // `true` for browsers that support passive events.\r
- var passiveEvents = (function () {\r
- var supportsPassiveOption = false;\r
- try {\r
- var opts = Object.defineProperty({}, 'passive', {\r
- get: function () { // eslint-disable-line getter-return\r
- supportsPassiveOption = true;\r
- }\r
- });\r
- window.addEventListener('testPassiveEventSupport', falseFn, opts);\r
- window.removeEventListener('testPassiveEventSupport', falseFn, opts);\r
- } catch (e) {\r
- // Errors can safely be ignored since this is only a browser support test.\r
- }\r
- return supportsPassiveOption;\r
- }());\r
-\r
- // @property canvas: Boolean\r
- // `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).\r
- var canvas = (function () {\r
- return !!document.createElement('canvas').getContext;\r
- }());\r
-\r
- // @property svg: Boolean\r
- // `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\r
- var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);\r
-\r
- // @property vml: Boolean\r
- // `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\r
- var vml = !svg && (function () {\r
- try {\r
- var div = document.createElement('div');\r
- div.innerHTML = '<v:shape adj="1"/>';\r
-\r
- var shape = div.firstChild;\r
- shape.style.behavior = 'url(#default#VML)';\r
-\r
- return shape && (typeof shape.adj === 'object');\r
-\r
- } catch (e) {\r
- return false;\r
- }\r
- }());\r
-\r
-\r
- function userAgentContains(str) {\r
- return navigator.userAgent.toLowerCase().indexOf(str) >= 0;\r
- }
-
- var Browser = ({
- ie: ie,
- ielt9: ielt9,
- edge: edge,
- webkit: webkit,
- android: android,
- android23: android23,
- androidStock: androidStock,
- opera: opera,
- chrome: chrome,
- gecko: gecko,
- safari: safari,
- phantom: phantom,
- opera12: opera12,
- win: win,
- ie3d: ie3d,
- webkit3d: webkit3d,
- gecko3d: gecko3d,
- any3d: any3d,
- mobile: mobile,
- mobileWebkit: mobileWebkit,
- mobileWebkit3d: mobileWebkit3d,
- msPointer: msPointer,
- pointer: pointer,
- touch: touch,
- mobileOpera: mobileOpera,
- mobileGecko: mobileGecko,
- retina: retina,
- passiveEvents: passiveEvents,
- canvas: canvas,
- svg: svg,
- vml: vml
- });
-
- /*
- * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.
- */
-
-
- var POINTER_DOWN = msPointer ? 'MSPointerDown' : 'pointerdown';
- var POINTER_MOVE = msPointer ? 'MSPointerMove' : 'pointermove';
- var POINTER_UP = msPointer ? 'MSPointerUp' : 'pointerup';
- var POINTER_CANCEL = msPointer ? 'MSPointerCancel' : 'pointercancel';
-
- var _pointers = {};
- var _pointerDocListener = false;
-
- // Provides a touch events wrapper for (ms)pointer events.
- // ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890
-
- function addPointerListener(obj, type, handler, id) {
- if (type === 'touchstart') {
- _addPointerStart(obj, handler, id);
-
- } else if (type === 'touchmove') {
- _addPointerMove(obj, handler, id);
-
- } else if (type === 'touchend') {
- _addPointerEnd(obj, handler, id);
- }
-
- return this;
- }
-
- function removePointerListener(obj, type, id) {
- var handler = obj['_leaflet_' + type + id];
-
- if (type === 'touchstart') {
- obj.removeEventListener(POINTER_DOWN, handler, false);
-
- } else if (type === 'touchmove') {
- obj.removeEventListener(POINTER_MOVE, handler, false);
-
- } else if (type === 'touchend') {
- obj.removeEventListener(POINTER_UP, handler, false);
- obj.removeEventListener(POINTER_CANCEL, handler, false);
- }
-
- return this;
- }
-
- function _addPointerStart(obj, handler, id) {
- var onDown = bind(function (e) {
- // IE10 specific: MsTouch needs preventDefault. See #2000
- if (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {
- preventDefault(e);
- }
-
- _handlePointer(e, handler);
- });
-
- obj['_leaflet_touchstart' + id] = onDown;
- obj.addEventListener(POINTER_DOWN, onDown, false);
-
- // need to keep track of what pointers and how many are active to provide e.touches emulation
- if (!_pointerDocListener) {
- // we listen document as any drags that end by moving the touch off the screen get fired there
- document.addEventListener(POINTER_DOWN, _globalPointerDown, true);
- document.addEventListener(POINTER_MOVE, _globalPointerMove, true);
- document.addEventListener(POINTER_UP, _globalPointerUp, true);
- document.addEventListener(POINTER_CANCEL, _globalPointerUp, true);
-
- _pointerDocListener = true;
- }
- }
-
- function _globalPointerDown(e) {
- _pointers[e.pointerId] = e;
- }
-
- function _globalPointerMove(e) {
- if (_pointers[e.pointerId]) {
- _pointers[e.pointerId] = e;
- }
- }
-
- function _globalPointerUp(e) {
- delete _pointers[e.pointerId];
- }
-
- function _handlePointer(e, handler) {
- e.touches = [];
- for (var i in _pointers) {
- e.touches.push(_pointers[i]);
- }
- e.changedTouches = [e];
-
- handler(e);
- }
-
- function _addPointerMove(obj, handler, id) {
- var onMove = function (e) {
- // don't fire touch moves when mouse isn't down
- if ((e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) && e.buttons === 0) {
- return;
- }
-
- _handlePointer(e, handler);
- };
-
- obj['_leaflet_touchmove' + id] = onMove;
- obj.addEventListener(POINTER_MOVE, onMove, false);
- }
-
- function _addPointerEnd(obj, handler, id) {
- var onUp = function (e) {
- _handlePointer(e, handler);
- };
-
- obj['_leaflet_touchend' + id] = onUp;
- obj.addEventListener(POINTER_UP, onUp, false);
- obj.addEventListener(POINTER_CANCEL, onUp, false);
- }
-
- /*\r
- * Extends the event handling code with double tap support for mobile browsers.\r
- */\r
-\r
- var _touchstart = msPointer ? 'MSPointerDown' : pointer ? 'pointerdown' : 'touchstart';\r
- var _touchend = msPointer ? 'MSPointerUp' : pointer ? 'pointerup' : 'touchend';\r
- var _pre = '_leaflet_';\r
-\r
- // inspired by Zepto touch code by Thomas Fuchs\r
- function addDoubleTapListener(obj, handler, id) {\r
- var last, touch$$1,\r
- doubleTap = false,\r
- delay = 250;\r
-\r
- function onTouchStart(e) {\r
-\r
- if (pointer) {\r
- if (!e.isPrimary) { return; }\r
- if (e.pointerType === 'mouse') { return; } // mouse fires native dblclick\r
- } else if (e.touches.length > 1) {\r
- return;\r
- }\r
-\r
- var now = Date.now(),\r
- delta = now - (last || now);\r
-\r
- touch$$1 = e.touches ? e.touches[0] : e;\r
- doubleTap = (delta > 0 && delta <= delay);\r
- last = now;\r
- }\r
-\r
- function onTouchEnd(e) {\r
- if (doubleTap && !touch$$1.cancelBubble) {\r
- if (pointer) {\r
- if (e.pointerType === 'mouse') { return; }\r
- // work around .type being readonly with MSPointer* events\r
- var newTouch = {},\r
- prop, i;\r
-\r
- for (i in touch$$1) {\r
- prop = touch$$1[i];\r
- newTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r
- }\r
- touch$$1 = newTouch;\r
- }\r
- touch$$1.type = 'dblclick';\r
- touch$$1.button = 0;\r
- handler(touch$$1);\r
- last = null;\r
- }\r
- }\r
-\r
- obj[_pre + _touchstart + id] = onTouchStart;\r
- obj[_pre + _touchend + id] = onTouchEnd;\r
- obj[_pre + 'dblclick' + id] = handler;\r
-\r
- obj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);\r
- obj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);\r
-\r
- // On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r
- // the browser doesn't fire touchend/pointerup events but does fire\r
- // native dblclicks. See #4127.\r
- // Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r
- obj.addEventListener('dblclick', handler, false);\r
-\r
- return this;\r
- }\r
-\r
- function removeDoubleTapListener(obj, id) {\r
- var touchstart = obj[_pre + _touchstart + id],\r
- touchend = obj[_pre + _touchend + id],\r
- dblclick = obj[_pre + 'dblclick' + id];\r
-\r
- obj.removeEventListener(_touchstart, touchstart, passiveEvents ? {passive: false} : false);\r
- obj.removeEventListener(_touchend, touchend, passiveEvents ? {passive: false} : false);\r
- obj.removeEventListener('dblclick', dblclick, false);\r
-\r
- return this;\r
- }
-
- /*\r
- * @namespace DomUtil\r
- *\r
- * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)\r
- * tree, used by Leaflet internally.\r
- *\r
- * Most functions expecting or returning a `HTMLElement` also work for\r
- * SVG elements. The only difference is that classes refer to CSS classes\r
- * in HTML and SVG classes in SVG.\r
- */\r
-\r
-\r
- // @property TRANSFORM: String\r
- // Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit).\r
- var TRANSFORM = testProp(\r
- ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\r
-\r
- // webkitTransition comes first because some browser versions that drop vendor prefix don't do\r
- // the same for the transitionend event, in particular the Android 4.1 stock browser\r
-\r
- // @property TRANSITION: String\r
- // Vendor-prefixed transition style name.\r
- var TRANSITION = testProp(\r
- ['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\r
-\r
- // @property TRANSITION_END: String\r
- // Vendor-prefixed transitionend event name.\r
- var TRANSITION_END =\r
- TRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';\r
-\r
-\r
- // @function get(id: String|HTMLElement): HTMLElement\r
- // Returns an element given its DOM id, or returns the element itself\r
- // if it was passed directly.\r
- function get(id) {\r
- return typeof id === 'string' ? document.getElementById(id) : id;\r
- }\r
-\r
- // @function getStyle(el: HTMLElement, styleAttrib: String): String\r
- // Returns the value for a certain style attribute on an element,\r
- // including computed values or values set through CSS.\r
- function getStyle(el, style) {\r
- var value = el.style[style] || (el.currentStyle && el.currentStyle[style]);\r
-\r
- if ((!value || value === 'auto') && document.defaultView) {\r
- var css = document.defaultView.getComputedStyle(el, null);\r
- value = css ? css[style] : null;\r
- }\r
- return value === 'auto' ? null : value;\r
- }\r
-\r
- // @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement\r
- // Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.\r
- function create$1(tagName, className, container) {\r
- var el = document.createElement(tagName);\r
- el.className = className || '';\r
-\r
- if (container) {\r
- container.appendChild(el);\r
- }\r
- return el;\r
- }\r
-\r
- // @function remove(el: HTMLElement)\r
- // Removes `el` from its parent element\r
- function remove(el) {\r
- var parent = el.parentNode;\r
- if (parent) {\r
- parent.removeChild(el);\r
- }\r
- }\r
-\r
- // @function empty(el: HTMLElement)\r
- // Removes all of `el`'s children elements from `el`\r
- function empty(el) {\r
- while (el.firstChild) {\r
- el.removeChild(el.firstChild);\r
- }\r
- }\r
-\r
- // @function toFront(el: HTMLElement)\r
- // Makes `el` the last child of its parent, so it renders in front of the other children.\r
- function toFront(el) {\r
- var parent = el.parentNode;\r
- if (parent && parent.lastChild !== el) {\r
- parent.appendChild(el);\r
- }\r
- }\r
-\r
- // @function toBack(el: HTMLElement)\r
- // Makes `el` the first child of its parent, so it renders behind the other children.\r
- function toBack(el) {\r
- var parent = el.parentNode;\r
- if (parent && parent.firstChild !== el) {\r
- parent.insertBefore(el, parent.firstChild);\r
- }\r
- }\r
-\r
- // @function hasClass(el: HTMLElement, name: String): Boolean\r
- // Returns `true` if the element's class attribute contains `name`.\r
- function hasClass(el, name) {\r
- if (el.classList !== undefined) {\r
- return el.classList.contains(name);\r
- }\r
- var className = getClass(el);\r
- return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className);\r
- }\r
-\r
- // @function addClass(el: HTMLElement, name: String)\r
- // Adds `name` to the element's class attribute.\r
- function addClass(el, name) {\r
- if (el.classList !== undefined) {\r
- var classes = splitWords(name);\r
- for (var i = 0, len = classes.length; i < len; i++) {\r
- el.classList.add(classes[i]);\r
- }\r
- } else if (!hasClass(el, name)) {\r
- var className = getClass(el);\r
- setClass(el, (className ? className + ' ' : '') + name);\r
- }\r
- }\r
-\r
- // @function removeClass(el: HTMLElement, name: String)\r
- // Removes `name` from the element's class attribute.\r
- function removeClass(el, name) {\r
- if (el.classList !== undefined) {\r
- el.classList.remove(name);\r
- } else {\r
- setClass(el, trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));\r
- }\r
- }\r
-\r
- // @function setClass(el: HTMLElement, name: String)\r
- // Sets the element's class.\r
- function setClass(el, name) {\r
- if (el.className.baseVal === undefined) {\r
- el.className = name;\r
- } else {\r
- // in case of SVG element\r
- el.className.baseVal = name;\r
- }\r
- }\r
-\r
- // @function getClass(el: HTMLElement): String\r
- // Returns the element's class.\r
- function getClass(el) {\r
- // Check if the element is an SVGElementInstance and use the correspondingElement instead\r
- // (Required for linked SVG elements in IE11.)\r
- if (el.correspondingElement) {\r
- el = el.correspondingElement;\r
- }\r
- return el.className.baseVal === undefined ? el.className : el.className.baseVal;\r
- }\r
-\r
- // @function setOpacity(el: HTMLElement, opacity: Number)\r
- // Set the opacity of an element (including old IE support).\r
- // `opacity` must be a number from `0` to `1`.\r
- function setOpacity(el, value) {\r
- if ('opacity' in el.style) {\r
- el.style.opacity = value;\r
- } else if ('filter' in el.style) {\r
- _setOpacityIE(el, value);\r
- }\r
- }\r
-\r
- function _setOpacityIE(el, value) {\r
- var filter = false,\r
- filterName = 'DXImageTransform.Microsoft.Alpha';\r
-\r
- // filters collection throws an error if we try to retrieve a filter that doesn't exist\r
- try {\r
- filter = el.filters.item(filterName);\r
- } catch (e) {\r
- // don't set opacity to 1 if we haven't already set an opacity,\r
- // it isn't needed and breaks transparent pngs.\r
- if (value === 1) { return; }\r
- }\r
-\r
- value = Math.round(value * 100);\r
-\r
- if (filter) {\r
- filter.Enabled = (value !== 100);\r
- filter.Opacity = value;\r
- } else {\r
- el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';\r
- }\r
- }\r
-\r
- // @function testProp(props: String[]): String|false\r
- // Goes through the array of style names and returns the first name\r
- // that is a valid style name for an element. If no such name is found,\r
- // it returns false. Useful for vendor-prefixed styles like `transform`.\r
- function testProp(props) {\r
- var style = document.documentElement.style;\r
-\r
- for (var i = 0; i < props.length; i++) {\r
- if (props[i] in style) {\r
- return props[i];\r
- }\r
- }\r
- return false;\r
- }\r
-\r
- // @function setTransform(el: HTMLElement, offset: Point, scale?: Number)\r
- // Resets the 3D CSS transform of `el` so it is translated by `offset` pixels\r
- // and optionally scaled by `scale`. Does not have an effect if the\r
- // browser doesn't support 3D CSS transforms.\r
- function setTransform(el, offset, scale) {\r
- var pos = offset || new Point(0, 0);\r
-\r
- el.style[TRANSFORM] =\r
- (ie3d ?\r
- 'translate(' + pos.x + 'px,' + pos.y + 'px)' :\r
- 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +\r
- (scale ? ' scale(' + scale + ')' : '');\r
- }\r
-\r
- // @function setPosition(el: HTMLElement, position: Point)\r
- // Sets the position of `el` to coordinates specified by `position`,\r
- // using CSS translate or top/left positioning depending on the browser\r
- // (used by Leaflet internally to position its layers).\r
- function setPosition(el, point) {\r
-\r
- /*eslint-disable */\r
- el._leaflet_pos = point;\r
- /* eslint-enable */\r
-\r
- if (any3d) {\r
- setTransform(el, point);\r
- } else {\r
- el.style.left = point.x + 'px';\r
- el.style.top = point.y + 'px';\r
- }\r
- }\r
-\r
- // @function getPosition(el: HTMLElement): Point\r
- // Returns the coordinates of an element previously positioned with setPosition.\r
- function getPosition(el) {\r
- // this method is only used for elements previously positioned using setPosition,\r
- // so it's safe to cache the position for performance\r
-\r
- return el._leaflet_pos || new Point(0, 0);\r
- }\r
-\r
- // @function disableTextSelection()\r
- // Prevents the user from generating `selectstart` DOM events, usually generated\r
- // when the user drags the mouse through a page with text. Used internally\r
- // by Leaflet to override the behaviour of any click-and-drag interaction on\r
- // the map. Affects drag interactions on the whole document.\r
-\r
- // @function enableTextSelection()\r
- // Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).\r
- var disableTextSelection;\r
- var enableTextSelection;\r
- var _userSelect;\r
- if ('onselectstart' in document) {\r
- disableTextSelection = function () {\r
- on(window, 'selectstart', preventDefault);\r
- };\r
- enableTextSelection = function () {\r
- off(window, 'selectstart', preventDefault);\r
- };\r
- } else {\r
- var userSelectProperty = testProp(\r
- ['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);\r
-\r
- disableTextSelection = function () {\r
- if (userSelectProperty) {\r
- var style = document.documentElement.style;\r
- _userSelect = style[userSelectProperty];\r
- style[userSelectProperty] = 'none';\r
- }\r
- };\r
- enableTextSelection = function () {\r
- if (userSelectProperty) {\r
- document.documentElement.style[userSelectProperty] = _userSelect;\r
- _userSelect = undefined;\r
- }\r
- };\r
- }\r
-\r
- // @function disableImageDrag()\r
- // As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but\r
- // for `dragstart` DOM events, usually generated when the user drags an image.\r
- function disableImageDrag() {\r
- on(window, 'dragstart', preventDefault);\r
- }\r
-\r
- // @function enableImageDrag()\r
- // Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).\r
- function enableImageDrag() {\r
- off(window, 'dragstart', preventDefault);\r
- }\r
-\r
- var _outlineElement, _outlineStyle;\r
- // @function preventOutline(el: HTMLElement)\r
- // Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)\r
- // of the element `el` invisible. Used internally by Leaflet to prevent\r
- // focusable elements from displaying an outline when the user performs a\r
- // drag interaction on them.\r
- function preventOutline(element) {\r
- while (element.tabIndex === -1) {\r
- element = element.parentNode;\r
- }\r
- if (!element.style) { return; }\r
- restoreOutline();\r
- _outlineElement = element;\r
- _outlineStyle = element.style.outline;\r
- element.style.outline = 'none';\r
- on(window, 'keydown', restoreOutline);\r
- }\r
-\r
- // @function restoreOutline()\r
- // Cancels the effects of a previous [`L.DomUtil.preventOutline`]().\r
- function restoreOutline() {\r
- if (!_outlineElement) { return; }\r
- _outlineElement.style.outline = _outlineStyle;\r
- _outlineElement = undefined;\r
- _outlineStyle = undefined;\r
- off(window, 'keydown', restoreOutline);\r
- }\r
-\r
- // @function getSizedParentNode(el: HTMLElement): HTMLElement\r
- // Finds the closest parent node which size (width and height) is not null.\r
- function getSizedParentNode(element) {\r
- do {\r
- element = element.parentNode;\r
- } while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body);\r
- return element;\r
- }\r
-\r
- // @function getScale(el: HTMLElement): Object\r
- // Computes the CSS scale currently applied on the element.\r
- // Returns an object with `x` and `y` members as horizontal and vertical scales respectively,\r
- // and `boundingClientRect` as the result of [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\r
- function getScale(element) {\r
- var rect = element.getBoundingClientRect(); // Read-only in old browsers.\r
-\r
- return {\r
- x: rect.width / element.offsetWidth || 1,\r
- y: rect.height / element.offsetHeight || 1,\r
- boundingClientRect: rect\r
- };\r
- }
-
- var DomUtil = ({
- TRANSFORM: TRANSFORM,
- TRANSITION: TRANSITION,
- TRANSITION_END: TRANSITION_END,
- get: get,
- getStyle: getStyle,
- create: create$1,
- remove: remove,
- empty: empty,
- toFront: toFront,
- toBack: toBack,
- hasClass: hasClass,
- addClass: addClass,
- removeClass: removeClass,
- setClass: setClass,
- getClass: getClass,
- setOpacity: setOpacity,
- testProp: testProp,
- setTransform: setTransform,
- setPosition: setPosition,
- getPosition: getPosition,
- disableTextSelection: disableTextSelection,
- enableTextSelection: enableTextSelection,
- disableImageDrag: disableImageDrag,
- enableImageDrag: enableImageDrag,
- preventOutline: preventOutline,
- restoreOutline: restoreOutline,
- getSizedParentNode: getSizedParentNode,
- getScale: getScale
- });
-
- /*\r
- * @namespace DomEvent\r
- * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.\r
- */\r
-\r
- // Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\r
-\r
- // @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this\r
- // Adds a listener function (`fn`) to a particular DOM event type of the\r
- // element `el`. You can optionally specify the context of the listener\r
- // (object the `this` keyword will point to). You can also pass several\r
- // space-separated types (e.g. `'click dblclick'`).\r
-\r
- // @alternative\r
- // @function on(el: HTMLElement, eventMap: Object, context?: Object): this\r
- // Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r
- function on(obj, types, fn, context) {\r
-\r
- if (typeof types === 'object') {\r
- for (var type in types) {\r
- addOne(obj, type, types[type], fn);\r
- }\r
- } else {\r
- types = splitWords(types);\r
-\r
- for (var i = 0, len = types.length; i < len; i++) {\r
- addOne(obj, types[i], fn, context);\r
- }\r
- }\r
-\r
- return this;\r
- }\r
-\r
- var eventsKey = '_leaflet_events';\r
-\r
- // @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this\r
- // Removes a previously added listener function.\r
- // Note that if you passed a custom context to on, you must pass the same\r
- // context to `off` in order to remove the listener.\r
-\r
- // @alternative\r
- // @function off(el: HTMLElement, eventMap: Object, context?: Object): this\r
- // Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r
- function off(obj, types, fn, context) {\r
-\r
- if (typeof types === 'object') {\r
- for (var type in types) {\r
- removeOne(obj, type, types[type], fn);\r
- }\r
- } else if (types) {\r
- types = splitWords(types);\r
-\r
- for (var i = 0, len = types.length; i < len; i++) {\r
- removeOne(obj, types[i], fn, context);\r
- }\r
- } else {\r
- for (var j in obj[eventsKey]) {\r
- removeOne(obj, j, obj[eventsKey][j]);\r
- }\r
- delete obj[eventsKey];\r
- }\r
-\r
- return this;\r
- }\r
-\r
- function browserFiresNativeDblClick() {\r
- // See https://github.com/w3c/pointerevents/issues/171\r
- if (pointer) {\r
- return !(edge || safari);\r
- }\r
- }\r
-\r
- var mouseSubst = {\r
- mouseenter: 'mouseover',\r
- mouseleave: 'mouseout',\r
- wheel: !('onwheel' in window) && 'mousewheel'\r
- };\r
-\r
- function addOne(obj, type, fn, context) {\r
- var id = type + stamp(fn) + (context ? '_' + stamp(context) : '');\r
-\r
- if (obj[eventsKey] && obj[eventsKey][id]) { return this; }\r
-\r
- var handler = function (e) {\r
- return fn.call(context || obj, e || window.event);\r
- };\r
-\r
- var originalHandler = handler;\r
-\r
- if (pointer && type.indexOf('touch') === 0) {\r
- // Needs DomEvent.Pointer.js\r
- addPointerListener(obj, type, handler, id);\r
-\r
- } else if (touch && (type === 'dblclick') && !browserFiresNativeDblClick()) {\r
- addDoubleTapListener(obj, handler, id);\r
-\r
- } else if ('addEventListener' in obj) {\r
-\r
- if (type === 'touchstart' || type === 'touchmove' || type === 'wheel' || type === 'mousewheel') {\r
- obj.addEventListener(mouseSubst[type] || type, handler, passiveEvents ? {passive: false} : false);\r
-\r
- } else if (type === 'mouseenter' || type === 'mouseleave') {\r
- handler = function (e) {\r
- e = e || window.event;\r
- if (isExternalTarget(obj, e)) {\r
- originalHandler(e);\r
- }\r
- };\r
- obj.addEventListener(mouseSubst[type], handler, false);\r
-\r
- } else {\r
- obj.addEventListener(type, originalHandler, false);\r
- }\r
-\r
- } else if ('attachEvent' in obj) {\r
- obj.attachEvent('on' + type, handler);\r
- }\r
-\r
- obj[eventsKey] = obj[eventsKey] || {};\r
- obj[eventsKey][id] = handler;\r
- }\r
-\r
- function removeOne(obj, type, fn, context) {\r
-\r
- var id = type + stamp(fn) + (context ? '_' + stamp(context) : ''),\r
- handler = obj[eventsKey] && obj[eventsKey][id];\r
-\r
- if (!handler) { return this; }\r
-\r
- if (pointer && type.indexOf('touch') === 0) {\r
- removePointerListener(obj, type, id);\r
-\r
- } else if (touch && (type === 'dblclick') && !browserFiresNativeDblClick()) {\r
- removeDoubleTapListener(obj, id);\r
-\r
- } else if ('removeEventListener' in obj) {\r
-\r
- obj.removeEventListener(mouseSubst[type] || type, handler, false);\r
-\r
- } else if ('detachEvent' in obj) {\r
- obj.detachEvent('on' + type, handler);\r
- }\r
-\r
- obj[eventsKey][id] = null;\r
- }\r
-\r
- // @function stopPropagation(ev: DOMEvent): this\r
- // Stop the given event from propagation to parent elements. Used inside the listener functions:\r
- // ```js\r
- // L.DomEvent.on(div, 'click', function (ev) {\r
- // L.DomEvent.stopPropagation(ev);\r
- // });\r
- // ```\r
- function stopPropagation(e) {\r
-\r
- if (e.stopPropagation) {\r
- e.stopPropagation();\r
- } else if (e.originalEvent) { // In case of Leaflet event.\r
- e.originalEvent._stopped = true;\r
- } else {\r
- e.cancelBubble = true;\r
- }\r
- skipped(e);\r
-\r
- return this;\r
- }\r
-\r
- // @function disableScrollPropagation(el: HTMLElement): this\r
- // Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants).\r
- function disableScrollPropagation(el) {\r
- addOne(el, 'wheel', stopPropagation);\r
- return this;\r
- }\r
-\r
- // @function disableClickPropagation(el: HTMLElement): this\r
- // Adds `stopPropagation` to the element's `'click'`, `'doubleclick'`,\r
- // `'mousedown'` and `'touchstart'` events (plus browser variants).\r
- function disableClickPropagation(el) {\r
- on(el, 'mousedown touchstart dblclick', stopPropagation);\r
- addOne(el, 'click', fakeStop);\r
- return this;\r
- }\r
-\r
- // @function preventDefault(ev: DOMEvent): this\r
- // Prevents the default action of the DOM Event `ev` from happening (such as\r
- // following a link in the href of the a element, or doing a POST request\r
- // with page reload when a `<form>` is submitted).\r
- // Use it inside listener functions.\r
- function preventDefault(e) {\r
- if (e.preventDefault) {\r
- e.preventDefault();\r
- } else {\r
- e.returnValue = false;\r
- }\r
- return this;\r
- }\r
-\r
- // @function stop(ev: DOMEvent): this\r
- // Does `stopPropagation` and `preventDefault` at the same time.\r
- function stop(e) {\r
- preventDefault(e);\r
- stopPropagation(e);\r
- return this;\r
- }\r
-\r
- // @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point\r
- // Gets normalized mouse position from a DOM event relative to the\r
- // `container` (border excluded) or to the whole page if not specified.\r
- function getMousePosition(e, container) {\r
- if (!container) {\r
- return new Point(e.clientX, e.clientY);\r
- }\r
-\r
- var scale = getScale(container),\r
- offset = scale.boundingClientRect; // left and top values are in page scale (like the event clientX/Y)\r
-\r
- return new Point(\r
- // offset.left/top values are in page scale (like clientX/Y),\r
- // whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\r
- (e.clientX - offset.left) / scale.x - container.clientLeft,\r
- (e.clientY - offset.top) / scale.y - container.clientTop\r
- );\r
- }\r
-\r
- // Chrome on Win scrolls double the pixels as in other platforms (see #4538),\r
- // and Firefox scrolls device pixels, not CSS pixels\r
- var wheelPxFactor =\r
- (win && chrome) ? 2 * window.devicePixelRatio :\r
- gecko ? window.devicePixelRatio : 1;\r
-\r
- // @function getWheelDelta(ev: DOMEvent): Number\r
- // Gets normalized wheel delta from a wheel DOM event, in vertical\r
- // pixels scrolled (negative if scrolling down).\r
- // Events from pointing devices without precise scrolling are mapped to\r
- // a best guess of 60 pixels.\r
- function getWheelDelta(e) {\r
- return (edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta\r
- (e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels\r
- (e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\r
- (e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\r
- (e.deltaX || e.deltaZ) ? 0 : // Skip horizontal/depth wheel events\r
- e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels\r
- (e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines\r
- e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages\r
- 0;\r
- }\r
-\r
- var skipEvents = {};\r
-\r
- function fakeStop(e) {\r
- // fakes stopPropagation by setting a special event flag, checked/reset with skipped(e)\r
- skipEvents[e.type] = true;\r
- }\r
-\r
- function skipped(e) {\r
- var events = skipEvents[e.type];\r
- // reset when checking, as it's only used in map container and propagates outside of the map\r
- skipEvents[e.type] = false;\r
- return events;\r
- }\r
-\r
- // check if element really left/entered the event target (for mouseenter/mouseleave)\r
- function isExternalTarget(el, e) {\r
-\r
- var related = e.relatedTarget;\r
-\r
- if (!related) { return true; }\r
-\r
- try {\r
- while (related && (related !== el)) {\r
- related = related.parentNode;\r
- }\r
- } catch (err) {\r
- return false;\r
- }\r
- return (related !== el);\r
- }
-
- var DomEvent = ({
- on: on,
- off: off,
- stopPropagation: stopPropagation,
- disableScrollPropagation: disableScrollPropagation,
- disableClickPropagation: disableClickPropagation,
- preventDefault: preventDefault,
- stop: stop,
- getMousePosition: getMousePosition,
- getWheelDelta: getWheelDelta,
- fakeStop: fakeStop,
- skipped: skipped,
- isExternalTarget: isExternalTarget,
- addListener: on,
- removeListener: off
- });
-
- /*
- * @class PosAnimation
- * @aka L.PosAnimation
- * @inherits Evented
- * Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
- *
- * @example
- * ```js
- * var fx = new L.PosAnimation();
- * fx.run(el, [300, 500], 0.5);
- * ```
- *
- * @constructor L.PosAnimation()
- * Creates a `PosAnimation` object.
- *
- */
-
- var PosAnimation = Evented.extend({
-
- // @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)
- // Run an animation of a given element to a new position, optionally setting
- // duration in seconds (`0.25` by default) and easing linearity factor (3rd
- // argument of the [cubic bezier curve](http://cubic-bezier.com/#0,0,.5,1),
- // `0.5` by default).
- run: function (el, newPos, duration, easeLinearity) {
- this.stop();
-
- this._el = el;
- this._inProgress = true;
- this._duration = duration || 0.25;
- this._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2);
-
- this._startPos = getPosition(el);
- this._offset = newPos.subtract(this._startPos);
- this._startTime = +new Date();
-
- // @event start: Event
- // Fired when the animation starts
- this.fire('start');
-
- this._animate();
- },
-
- // @method stop()
- // Stops the animation (if currently running).
- stop: function () {
- if (!this._inProgress) { return; }
-
- this._step(true);
- this._complete();
- },
-
- _animate: function () {
- // animation loop
- this._animId = requestAnimFrame(this._animate, this);
- this._step();
- },
-
- _step: function (round) {
- var elapsed = (+new Date()) - this._startTime,
- duration = this._duration * 1000;
-
- if (elapsed < duration) {
- this._runFrame(this._easeOut(elapsed / duration), round);
- } else {
- this._runFrame(1);
- this._complete();
- }
- },
-
- _runFrame: function (progress, round) {
- var pos = this._startPos.add(this._offset.multiplyBy(progress));
- if (round) {
- pos._round();
- }
- setPosition(this._el, pos);
-
- // @event step: Event
- // Fired continuously during the animation.
- this.fire('step');
- },
-
- _complete: function () {
- cancelAnimFrame(this._animId);
-
- this._inProgress = false;
- // @event end: Event
- // Fired when the animation ends.
- this.fire('end');
- },
-
- _easeOut: function (t) {
- return 1 - Math.pow(1 - t, this._easeOutPower);
- }
- });
-
- /*\r
- * @class Map\r
- * @aka L.Map\r
- * @inherits Evented\r
- *\r
- * The central class of the API — it is used to create a map on a page and manipulate it.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * // initialize the map on the "map" div with a given center and zoom\r
- * var map = L.map('map', {\r
- * center: [51.505, -0.09],\r
- * zoom: 13\r
- * });\r
- * ```\r
- *\r
- */\r
-\r
- var Map = Evented.extend({\r
-\r
- options: {\r
- // @section Map State Options\r
- // @option crs: CRS = L.CRS.EPSG3857\r
- // The [Coordinate Reference System](#crs) to use. Don't change this if you're not\r
- // sure what it means.\r
- crs: EPSG3857,\r
-\r
- // @option center: LatLng = undefined\r
- // Initial geographic center of the map\r
- center: undefined,\r
-\r
- // @option zoom: Number = undefined\r
- // Initial map zoom level\r
- zoom: undefined,\r
-\r
- // @option minZoom: Number = *\r
- // Minimum zoom level of the map.\r
- // If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r
- // the lowest of their `minZoom` options will be used instead.\r
- minZoom: undefined,\r
-\r
- // @option maxZoom: Number = *\r
- // Maximum zoom level of the map.\r
- // If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r
- // the highest of their `maxZoom` options will be used instead.\r
- maxZoom: undefined,\r
-\r
- // @option layers: Layer[] = []\r
- // Array of layers that will be added to the map initially\r
- layers: [],\r
-\r
- // @option maxBounds: LatLngBounds = null\r
- // When this option is set, the map restricts the view to the given\r
- // geographical bounds, bouncing the user back if the user tries to pan\r
- // outside the view. To set the restriction dynamically, use\r
- // [`setMaxBounds`](#map-setmaxbounds) method.\r
- maxBounds: undefined,\r
-\r
- // @option renderer: Renderer = *\r
- // The default method for drawing vector layers on the map. `L.SVG`\r
- // or `L.Canvas` by default depending on browser support.\r
- renderer: undefined,\r
-\r
-\r
- // @section Animation Options\r
- // @option zoomAnimation: Boolean = true\r
- // Whether the map zoom animation is enabled. By default it's enabled\r
- // in all browsers that support CSS3 Transitions except Android.\r
- zoomAnimation: true,\r
-\r
- // @option zoomAnimationThreshold: Number = 4\r
- // Won't animate zoom if the zoom difference exceeds this value.\r
- zoomAnimationThreshold: 4,\r
-\r
- // @option fadeAnimation: Boolean = true\r
- // Whether the tile fade animation is enabled. By default it's enabled\r
- // in all browsers that support CSS3 Transitions except Android.\r
- fadeAnimation: true,\r
-\r
- // @option markerZoomAnimation: Boolean = true\r
- // Whether markers animate their zoom with the zoom animation, if disabled\r
- // they will disappear for the length of the animation. By default it's\r
- // enabled in all browsers that support CSS3 Transitions except Android.\r
- markerZoomAnimation: true,\r
-\r
- // @option transform3DLimit: Number = 2^23\r
- // Defines the maximum size of a CSS translation transform. The default\r
- // value should not be changed unless a web browser positions layers in\r
- // the wrong place after doing a large `panBy`.\r
- transform3DLimit: 8388608, // Precision limit of a 32-bit float\r
-\r
- // @section Interaction Options\r
- // @option zoomSnap: Number = 1\r
- // Forces the map's zoom level to always be a multiple of this, particularly\r
- // right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.\r
- // By default, the zoom level snaps to the nearest integer; lower values\r
- // (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0`\r
- // means the zoom level will not be snapped after `fitBounds` or a pinch-zoom.\r
- zoomSnap: 1,\r
-\r
- // @option zoomDelta: Number = 1\r
- // Controls how much the map's zoom level will change after a\r
- // [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+`\r
- // or `-` on the keyboard, or using the [zoom controls](#control-zoom).\r
- // Values smaller than `1` (e.g. `0.5`) allow for greater granularity.\r
- zoomDelta: 1,\r
-\r
- // @option trackResize: Boolean = true\r
- // Whether the map automatically handles browser window resize to update itself.\r
- trackResize: true\r
- },\r
-\r
- initialize: function (id, options) { // (HTMLElement or String, Object)\r
- options = setOptions(this, options);\r
-\r
- // Make sure to assign internal flags at the beginning,\r
- // to avoid inconsistent state in some edge cases.\r
- this._handlers = [];\r
- this._layers = {};\r
- this._zoomBoundLayers = {};\r
- this._sizeChanged = true;\r
-\r
- this._initContainer(id);\r
- this._initLayout();\r
-\r
- // hack for https://github.com/Leaflet/Leaflet/issues/1980\r
- this._onResize = bind(this._onResize, this);\r
-\r
- this._initEvents();\r
-\r
- if (options.maxBounds) {\r
- this.setMaxBounds(options.maxBounds);\r
- }\r
-\r
- if (options.zoom !== undefined) {\r
- this._zoom = this._limitZoom(options.zoom);\r
- }\r
-\r
- if (options.center && options.zoom !== undefined) {\r
- this.setView(toLatLng(options.center), options.zoom, {reset: true});\r
- }\r
-\r
- this.callInitHooks();\r
-\r
- // don't animate on browsers without hardware-accelerated transitions or old Android/Opera\r
- this._zoomAnimated = TRANSITION && any3d && !mobileOpera &&\r
- this.options.zoomAnimation;\r
-\r
- // zoom transitions run with the same duration for all layers, so if one of transitionend events\r
- // happens after starting zoom animation (propagating to the map pane), we know that it ended globally\r
- if (this._zoomAnimated) {\r
- this._createAnimProxy();\r
- on(this._proxy, TRANSITION_END, this._catchTransitionEnd, this);\r
- }\r
-\r
- this._addLayers(this.options.layers);\r
- },\r
-\r
-\r
- // @section Methods for modifying map state\r
-\r
- // @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this\r
- // Sets the view of the map (geographical center and zoom) with the given\r
- // animation options.\r
- setView: function (center, zoom, options) {\r
-\r
- zoom = zoom === undefined ? this._zoom : this._limitZoom(zoom);\r
- center = this._limitCenter(toLatLng(center), zoom, this.options.maxBounds);\r
- options = options || {};\r
-\r
- this._stop();\r
-\r
- if (this._loaded && !options.reset && options !== true) {\r
-\r
- if (options.animate !== undefined) {\r
- options.zoom = extend({animate: options.animate}, options.zoom);\r
- options.pan = extend({animate: options.animate, duration: options.duration}, options.pan);\r
- }\r
-\r
- // try animating pan or zoom\r
- var moved = (this._zoom !== zoom) ?\r
- this._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom, options.zoom) :\r
- this._tryAnimatedPan(center, options.pan);\r
-\r
- if (moved) {\r
- // prevent resize handler call, the view will refresh after animation anyway\r
- clearTimeout(this._sizeTimer);\r
- return this;\r
- }\r
- }\r
-\r
- // animation didn't start, just reset the map view\r
- this._resetView(center, zoom);\r
-\r
- return this;\r
- },\r
-\r
- // @method setZoom(zoom: Number, options?: Zoom/pan options): this\r
- // Sets the zoom of the map.\r
- setZoom: function (zoom, options) {\r
- if (!this._loaded) {\r
- this._zoom = zoom;\r
- return this;\r
- }\r
- return this.setView(this.getCenter(), zoom, {zoom: options});\r
- },\r
-\r
- // @method zoomIn(delta?: Number, options?: Zoom options): this\r
- // Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r
- zoomIn: function (delta, options) {\r
- delta = delta || (any3d ? this.options.zoomDelta : 1);\r
- return this.setZoom(this._zoom + delta, options);\r
- },\r
-\r
- // @method zoomOut(delta?: Number, options?: Zoom options): this\r
- // Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r
- zoomOut: function (delta, options) {\r
- delta = delta || (any3d ? this.options.zoomDelta : 1);\r
- return this.setZoom(this._zoom - delta, options);\r
- },\r
-\r
- // @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this\r
- // Zooms the map while keeping a specified geographical point on the map\r
- // stationary (e.g. used internally for scroll zoom and double-click zoom).\r
- // @alternative\r
- // @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this\r
- // Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.\r
- setZoomAround: function (latlng, zoom, options) {\r
- var scale = this.getZoomScale(zoom),\r
- viewHalf = this.getSize().divideBy(2),\r
- containerPoint = latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng),\r
-\r
- centerOffset = containerPoint.subtract(viewHalf).multiplyBy(1 - 1 / scale),\r
- newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset));\r
-\r
- return this.setView(newCenter, zoom, {zoom: options});\r
- },\r
-\r
- _getBoundsCenterZoom: function (bounds, options) {\r
-\r
- options = options || {};\r
- bounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds);\r
-\r
- var paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r
- paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r
-\r
- zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\r
-\r
- zoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;\r
-\r
- if (zoom === Infinity) {\r
- return {\r
- center: bounds.getCenter(),\r
- zoom: zoom\r
- };\r
- }\r
-\r
- var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),\r
-\r
- swPoint = this.project(bounds.getSouthWest(), zoom),\r
- nePoint = this.project(bounds.getNorthEast(), zoom),\r
- center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);\r
-\r
- return {\r
- center: center,\r
- zoom: zoom\r
- };\r
- },\r
-\r
- // @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this\r
- // Sets a map view that contains the given geographical bounds with the\r
- // maximum zoom level possible.\r
- fitBounds: function (bounds, options) {\r
-\r
- bounds = toLatLngBounds(bounds);\r
-\r
- if (!bounds.isValid()) {\r
- throw new Error('Bounds are not valid.');\r
- }\r
-\r
- var target = this._getBoundsCenterZoom(bounds, options);\r
- return this.setView(target.center, target.zoom, options);\r
- },\r
-\r
- // @method fitWorld(options?: fitBounds options): this\r
- // Sets a map view that mostly contains the whole world with the maximum\r
- // zoom level possible.\r
- fitWorld: function (options) {\r
- return this.fitBounds([[-90, -180], [90, 180]], options);\r
- },\r
-\r
- // @method panTo(latlng: LatLng, options?: Pan options): this\r
- // Pans the map to a given center.\r
- panTo: function (center, options) { // (LatLng)\r
- return this.setView(center, this._zoom, {pan: options});\r
- },\r
-\r
- // @method panBy(offset: Point, options?: Pan options): this\r
- // Pans the map by a given number of pixels (animated).\r
- panBy: function (offset, options) {\r
- offset = toPoint(offset).round();\r
- options = options || {};\r
-\r
- if (!offset.x && !offset.y) {\r
- return this.fire('moveend');\r
- }\r
- // If we pan too far, Chrome gets issues with tiles\r
- // and makes them disappear or appear in the wrong place (slightly offset) #2602\r
- if (options.animate !== true && !this.getSize().contains(offset)) {\r
- this._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom());\r
- return this;\r
- }\r
-\r
- if (!this._panAnim) {\r
- this._panAnim = new PosAnimation();\r
-\r
- this._panAnim.on({\r
- 'step': this._onPanTransitionStep,\r
- 'end': this._onPanTransitionEnd\r
- }, this);\r
- }\r
-\r
- // don't fire movestart if animating inertia\r
- if (!options.noMoveStart) {\r
- this.fire('movestart');\r
- }\r
-\r
- // animate pan unless animate: false specified\r
- if (options.animate !== false) {\r
- addClass(this._mapPane, 'leaflet-pan-anim');\r
-\r
- var newPos = this._getMapPanePos().subtract(offset).round();\r
- this._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity);\r
- } else {\r
- this._rawPanBy(offset);\r
- this.fire('move').fire('moveend');\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this\r
- // Sets the view of the map (geographical center and zoom) performing a smooth\r
- // pan-zoom animation.\r
- flyTo: function (targetCenter, targetZoom, options) {\r
-\r
- options = options || {};\r
- if (options.animate === false || !any3d) {\r
- return this.setView(targetCenter, targetZoom, options);\r
- }\r
-\r
- this._stop();\r
-\r
- var from = this.project(this.getCenter()),\r
- to = this.project(targetCenter),\r
- size = this.getSize(),\r
- startZoom = this._zoom;\r
-\r
- targetCenter = toLatLng(targetCenter);\r
- targetZoom = targetZoom === undefined ? startZoom : targetZoom;\r
-\r
- var w0 = Math.max(size.x, size.y),\r
- w1 = w0 * this.getZoomScale(startZoom, targetZoom),\r
- u1 = (to.distanceTo(from)) || 1,\r
- rho = 1.42,\r
- rho2 = rho * rho;\r
-\r
- function r(i) {\r
- var s1 = i ? -1 : 1,\r
- s2 = i ? w1 : w0,\r
- t1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1,\r
- b1 = 2 * s2 * rho2 * u1,\r
- b = t1 / b1,\r
- sq = Math.sqrt(b * b + 1) - b;\r
-\r
- // workaround for floating point precision bug when sq = 0, log = -Infinite,\r
- // thus triggering an infinite loop in flyTo\r
- var log = sq < 0.000000001 ? -18 : Math.log(sq);\r
-\r
- return log;\r
- }\r
-\r
- function sinh(n) { return (Math.exp(n) - Math.exp(-n)) / 2; }\r
- function cosh(n) { return (Math.exp(n) + Math.exp(-n)) / 2; }\r
- function tanh(n) { return sinh(n) / cosh(n); }\r
-\r
- var r0 = r(0);\r
-\r
- function w(s) { return w0 * (cosh(r0) / cosh(r0 + rho * s)); }\r
- function u(s) { return w0 * (cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2; }\r
-\r
- function easeOut(t) { return 1 - Math.pow(1 - t, 1.5); }\r
-\r
- var start = Date.now(),\r
- S = (r(1) - r0) / rho,\r
- duration = options.duration ? 1000 * options.duration : 1000 * S * 0.8;\r
-\r
- function frame() {\r
- var t = (Date.now() - start) / duration,\r
- s = easeOut(t) * S;\r
-\r
- if (t <= 1) {\r
- this._flyToFrame = requestAnimFrame(frame, this);\r
-\r
- this._move(\r
- this.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom),\r
- this.getScaleZoom(w0 / w(s), startZoom),\r
- {flyTo: true});\r
-\r
- } else {\r
- this\r
- ._move(targetCenter, targetZoom)\r
- ._moveEnd(true);\r
- }\r
- }\r
-\r
- this._moveStart(true, options.noMoveStart);\r
-\r
- frame.call(this);\r
- return this;\r
- },\r
-\r
- // @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this\r
- // Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\r
- // but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\r
- flyToBounds: function (bounds, options) {\r
- var target = this._getBoundsCenterZoom(bounds, options);\r
- return this.flyTo(target.center, target.zoom, options);\r
- },\r
-\r
- // @method setMaxBounds(bounds: LatLngBounds): this\r
- // Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).\r
- setMaxBounds: function (bounds) {\r
- bounds = toLatLngBounds(bounds);\r
-\r
- if (!bounds.isValid()) {\r
- this.options.maxBounds = null;\r
- return this.off('moveend', this._panInsideMaxBounds);\r
- } else if (this.options.maxBounds) {\r
- this.off('moveend', this._panInsideMaxBounds);\r
- }\r
-\r
- this.options.maxBounds = bounds;\r
-\r
- if (this._loaded) {\r
- this._panInsideMaxBounds();\r
- }\r
-\r
- return this.on('moveend', this._panInsideMaxBounds);\r
- },\r
-\r
- // @method setMinZoom(zoom: Number): this\r
- // Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).\r
- setMinZoom: function (zoom) {\r
- var oldZoom = this.options.minZoom;\r
- this.options.minZoom = zoom;\r
-\r
- if (this._loaded && oldZoom !== zoom) {\r
- this.fire('zoomlevelschange');\r
-\r
- if (this.getZoom() < this.options.minZoom) {\r
- return this.setZoom(zoom);\r
- }\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method setMaxZoom(zoom: Number): this\r
- // Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).\r
- setMaxZoom: function (zoom) {\r
- var oldZoom = this.options.maxZoom;\r
- this.options.maxZoom = zoom;\r
-\r
- if (this._loaded && oldZoom !== zoom) {\r
- this.fire('zoomlevelschange');\r
-\r
- if (this.getZoom() > this.options.maxZoom) {\r
- return this.setZoom(zoom);\r
- }\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this\r
- // Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.\r
- panInsideBounds: function (bounds, options) {\r
- this._enforcingBounds = true;\r
- var center = this.getCenter(),\r
- newCenter = this._limitCenter(center, this._zoom, toLatLngBounds(bounds));\r
-\r
- if (!center.equals(newCenter)) {\r
- this.panTo(newCenter, options);\r
- }\r
-\r
- this._enforcingBounds = false;\r
- return this;\r
- },\r
-\r
- // @method panInside(latlng: LatLng, options?: options): this\r
- // Pans the map the minimum amount to make the `latlng` visible. Use\r
- // `padding`, `paddingTopLeft` and `paddingTopRight` options to fit\r
- // the display to more restricted bounds, like [`fitBounds`](#map-fitbounds).\r
- // If `latlng` is already within the (optionally padded) display bounds,\r
- // the map will not be panned.\r
- panInside: function (latlng, options) {\r
- options = options || {};\r
-\r
- var paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r
- paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r
- center = this.getCenter(),\r
- pixelCenter = this.project(center),\r
- pixelPoint = this.project(latlng),\r
- pixelBounds = this.getPixelBounds(),\r
- halfPixelBounds = pixelBounds.getSize().divideBy(2),\r
- paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]);\r
-\r
- if (!paddedBounds.contains(pixelPoint)) {\r
- this._enforcingBounds = true;\r
- var diff = pixelCenter.subtract(pixelPoint),\r
- newCenter = toPoint(pixelPoint.x + diff.x, pixelPoint.y + diff.y);\r
-\r
- if (pixelPoint.x < paddedBounds.min.x || pixelPoint.x > paddedBounds.max.x) {\r
- newCenter.x = pixelCenter.x - diff.x;\r
- if (diff.x > 0) {\r
- newCenter.x += halfPixelBounds.x - paddingTL.x;\r
- } else {\r
- newCenter.x -= halfPixelBounds.x - paddingBR.x;\r
- }\r
- }\r
- if (pixelPoint.y < paddedBounds.min.y || pixelPoint.y > paddedBounds.max.y) {\r
- newCenter.y = pixelCenter.y - diff.y;\r
- if (diff.y > 0) {\r
- newCenter.y += halfPixelBounds.y - paddingTL.y;\r
- } else {\r
- newCenter.y -= halfPixelBounds.y - paddingBR.y;\r
- }\r
- }\r
- this.panTo(this.unproject(newCenter), options);\r
- this._enforcingBounds = false;\r
- }\r
- return this;\r
- },\r
-\r
- // @method invalidateSize(options: Zoom/pan options): this\r
- // Checks if the map container size changed and updates the map if so —\r
- // call it after you've changed the map size dynamically, also animating\r
- // pan by default. If `options.pan` is `false`, panning will not occur.\r
- // If `options.debounceMoveend` is `true`, it will delay `moveend` event so\r
- // that it doesn't happen often even if the method is called many\r
- // times in a row.\r
-\r
- // @alternative\r
- // @method invalidateSize(animate: Boolean): this\r
- // Checks if the map container size changed and updates the map if so —\r
- // call it after you've changed the map size dynamically, also animating\r
- // pan by default.\r
- invalidateSize: function (options) {\r
- if (!this._loaded) { return this; }\r
-\r
- options = extend({\r
- animate: false,\r
- pan: true\r
- }, options === true ? {animate: true} : options);\r
-\r
- var oldSize = this.getSize();\r
- this._sizeChanged = true;\r
- this._lastCenter = null;\r
-\r
- var newSize = this.getSize(),\r
- oldCenter = oldSize.divideBy(2).round(),\r
- newCenter = newSize.divideBy(2).round(),\r
- offset = oldCenter.subtract(newCenter);\r
-\r
- if (!offset.x && !offset.y) { return this; }\r
-\r
- if (options.animate && options.pan) {\r
- this.panBy(offset);\r
-\r
- } else {\r
- if (options.pan) {\r
- this._rawPanBy(offset);\r
- }\r
-\r
- this.fire('move');\r
-\r
- if (options.debounceMoveend) {\r
- clearTimeout(this._sizeTimer);\r
- this._sizeTimer = setTimeout(bind(this.fire, this, 'moveend'), 200);\r
- } else {\r
- this.fire('moveend');\r
- }\r
- }\r
-\r
- // @section Map state change events\r
- // @event resize: ResizeEvent\r
- // Fired when the map is resized.\r
- return this.fire('resize', {\r
- oldSize: oldSize,\r
- newSize: newSize\r
- });\r
- },\r
-\r
- // @section Methods for modifying map state\r
- // @method stop(): this\r
- // Stops the currently running `panTo` or `flyTo` animation, if any.\r
- stop: function () {\r
- this.setZoom(this._limitZoom(this._zoom));\r
- if (!this.options.zoomSnap) {\r
- this.fire('viewreset');\r
- }\r
- return this._stop();\r
- },\r
-\r
- // @section Geolocation methods\r
- // @method locate(options?: Locate options): this\r
- // Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound)\r
- // event with location data on success or a [`locationerror`](#map-locationerror) event on failure,\r
- // and optionally sets the map view to the user's location with respect to\r
- // detection accuracy (or to the world view if geolocation failed).\r
- // Note that, if your page doesn't use HTTPS, this method will fail in\r
- // modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))\r
- // See `Locate options` for more details.\r
- locate: function (options) {\r
-\r
- options = this._locateOptions = extend({\r
- timeout: 10000,\r
- watch: false\r
- // setView: false\r
- // maxZoom: <Number>\r
- // maximumAge: 0\r
- // enableHighAccuracy: false\r
- }, options);\r
-\r
- if (!('geolocation' in navigator)) {\r
- this._handleGeolocationError({\r
- code: 0,\r
- message: 'Geolocation not supported.'\r
- });\r
- return this;\r
- }\r
-\r
- var onResponse = bind(this._handleGeolocationResponse, this),\r
- onError = bind(this._handleGeolocationError, this);\r
-\r
- if (options.watch) {\r
- this._locationWatchId =\r
- navigator.geolocation.watchPosition(onResponse, onError, options);\r
- } else {\r
- navigator.geolocation.getCurrentPosition(onResponse, onError, options);\r
- }\r
- return this;\r
- },\r
-\r
- // @method stopLocate(): this\r
- // Stops watching location previously initiated by `map.locate({watch: true})`\r
- // and aborts resetting the map view if map.locate was called with\r
- // `{setView: true}`.\r
- stopLocate: function () {\r
- if (navigator.geolocation && navigator.geolocation.clearWatch) {\r
- navigator.geolocation.clearWatch(this._locationWatchId);\r
- }\r
- if (this._locateOptions) {\r
- this._locateOptions.setView = false;\r
- }\r
- return this;\r
- },\r
-\r
- _handleGeolocationError: function (error) {\r
- var c = error.code,\r
- message = error.message ||\r
- (c === 1 ? 'permission denied' :\r
- (c === 2 ? 'position unavailable' : 'timeout'));\r
-\r
- if (this._locateOptions.setView && !this._loaded) {\r
- this.fitWorld();\r
- }\r
-\r
- // @section Location events\r
- // @event locationerror: ErrorEvent\r
- // Fired when geolocation (using the [`locate`](#map-locate) method) failed.\r
- this.fire('locationerror', {\r
- code: c,\r
- message: 'Geolocation error: ' + message + '.'\r
- });\r
- },\r
-\r
- _handleGeolocationResponse: function (pos) {\r
- var lat = pos.coords.latitude,\r
- lng = pos.coords.longitude,\r
- latlng = new LatLng(lat, lng),\r
- bounds = latlng.toBounds(pos.coords.accuracy * 2),\r
- options = this._locateOptions;\r
-\r
- if (options.setView) {\r
- var zoom = this.getBoundsZoom(bounds);\r
- this.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\r
- }\r
-\r
- var data = {\r
- latlng: latlng,\r
- bounds: bounds,\r
- timestamp: pos.timestamp\r
- };\r
-\r
- for (var i in pos.coords) {\r
- if (typeof pos.coords[i] === 'number') {\r
- data[i] = pos.coords[i];\r
- }\r
- }\r
-\r
- // @event locationfound: LocationEvent\r
- // Fired when geolocation (using the [`locate`](#map-locate) method)\r
- // went successfully.\r
- this.fire('locationfound', data);\r
- },\r
-\r
- // TODO Appropriate docs section?\r
- // @section Other Methods\r
- // @method addHandler(name: String, HandlerClass: Function): this\r
- // Adds a new `Handler` to the map, given its name and constructor function.\r
- addHandler: function (name, HandlerClass) {\r
- if (!HandlerClass) { return this; }\r
-\r
- var handler = this[name] = new HandlerClass(this);\r
-\r
- this._handlers.push(handler);\r
-\r
- if (this.options[name]) {\r
- handler.enable();\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method remove(): this\r
- // Destroys the map and clears all related event listeners.\r
- remove: function () {\r
-\r
- this._initEvents(true);\r
- this.off('moveend', this._panInsideMaxBounds);\r
-\r
- if (this._containerId !== this._container._leaflet_id) {\r
- throw new Error('Map container is being reused by another instance');\r
- }\r
-\r
- try {\r
- // throws error in IE6-8\r
- delete this._container._leaflet_id;\r
- delete this._containerId;\r
- } catch (e) {\r
- /*eslint-disable */\r
- this._container._leaflet_id = undefined;\r
- /* eslint-enable */\r
- this._containerId = undefined;\r
- }\r
-\r
- if (this._locationWatchId !== undefined) {\r
- this.stopLocate();\r
- }\r
-\r
- this._stop();\r
-\r
- remove(this._mapPane);\r
-\r
- if (this._clearControlPos) {\r
- this._clearControlPos();\r
- }\r
- if (this._resizeRequest) {\r
- cancelAnimFrame(this._resizeRequest);\r
- this._resizeRequest = null;\r
- }\r
-\r
- this._clearHandlers();\r
-\r
- if (this._loaded) {\r
- // @section Map state change events\r
- // @event unload: Event\r
- // Fired when the map is destroyed with [remove](#map-remove) method.\r
- this.fire('unload');\r
- }\r
-\r
- var i;\r
- for (i in this._layers) {\r
- this._layers[i].remove();\r
- }\r
- for (i in this._panes) {\r
- remove(this._panes[i]);\r
- }\r
-\r
- this._layers = [];\r
- this._panes = [];\r
- delete this._mapPane;\r
- delete this._renderer;\r
-\r
- return this;\r
- },\r
-\r
- // @section Other Methods\r
- // @method createPane(name: String, container?: HTMLElement): HTMLElement\r
- // Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,\r
- // then returns it. The pane is created as a child of `container`, or\r
- // as a child of the main map pane if not set.\r
- createPane: function (name, container) {\r
- var className = 'leaflet-pane' + (name ? ' leaflet-' + name.replace('Pane', '') + '-pane' : ''),\r
- pane = create$1('div', className, container || this._mapPane);\r
-\r
- if (name) {\r
- this._panes[name] = pane;\r
- }\r
- return pane;\r
- },\r
-\r
- // @section Methods for Getting Map State\r
-\r
- // @method getCenter(): LatLng\r
- // Returns the geographical center of the map view\r
- getCenter: function () {\r
- this._checkIfLoaded();\r
-\r
- if (this._lastCenter && !this._moved()) {\r
- return this._lastCenter;\r
- }\r
- return this.layerPointToLatLng(this._getCenterLayerPoint());\r
- },\r
-\r
- // @method getZoom(): Number\r
- // Returns the current zoom level of the map view\r
- getZoom: function () {\r
- return this._zoom;\r
- },\r
-\r
- // @method getBounds(): LatLngBounds\r
- // Returns the geographical bounds visible in the current map view\r
- getBounds: function () {\r
- var bounds = this.getPixelBounds(),\r
- sw = this.unproject(bounds.getBottomLeft()),\r
- ne = this.unproject(bounds.getTopRight());\r
-\r
- return new LatLngBounds(sw, ne);\r
- },\r
-\r
- // @method getMinZoom(): Number\r
- // Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default.\r
- getMinZoom: function () {\r
- return this.options.minZoom === undefined ? this._layersMinZoom || 0 : this.options.minZoom;\r
- },\r
-\r
- // @method getMaxZoom(): Number\r
- // Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers).\r
- getMaxZoom: function () {\r
- return this.options.maxZoom === undefined ?\r
- (this._layersMaxZoom === undefined ? Infinity : this._layersMaxZoom) :\r
- this.options.maxZoom;\r
- },\r
-\r
- // @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number\r
- // Returns the maximum zoom level on which the given bounds fit to the map\r
- // view in its entirety. If `inside` (optional) is set to `true`, the method\r
- // instead returns the minimum zoom level on which the map view fits into\r
- // the given bounds in its entirety.\r
- getBoundsZoom: function (bounds, inside, padding) { // (LatLngBounds[, Boolean, Point]) -> Number\r
- bounds = toLatLngBounds(bounds);\r
- padding = toPoint(padding || [0, 0]);\r
-\r
- var zoom = this.getZoom() || 0,\r
- min = this.getMinZoom(),\r
- max = this.getMaxZoom(),\r
- nw = bounds.getNorthWest(),\r
- se = bounds.getSouthEast(),\r
- size = this.getSize().subtract(padding),\r
- boundsSize = toBounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),\r
- snap = any3d ? this.options.zoomSnap : 1,\r
- scalex = size.x / boundsSize.x,\r
- scaley = size.y / boundsSize.y,\r
- scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\r
-\r
- zoom = this.getScaleZoom(scale, zoom);\r
-\r
- if (snap) {\r
- zoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\r
- zoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\r
- }\r
-\r
- return Math.max(min, Math.min(max, zoom));\r
- },\r
-\r
- // @method getSize(): Point\r
- // Returns the current size of the map container (in pixels).\r
- getSize: function () {\r
- if (!this._size || this._sizeChanged) {\r
- this._size = new Point(\r
- this._container.clientWidth || 0,\r
- this._container.clientHeight || 0);\r
-\r
- this._sizeChanged = false;\r
- }\r
- return this._size.clone();\r
- },\r
-\r
- // @method getPixelBounds(): Bounds\r
- // Returns the bounds of the current map view in projected pixel\r
- // coordinates (sometimes useful in layer and overlay implementations).\r
- getPixelBounds: function (center, zoom) {\r
- var topLeftPoint = this._getTopLeftPoint(center, zoom);\r
- return new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\r
- },\r
-\r
- // TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to\r
- // the map pane? "left point of the map layer" can be confusing, specially\r
- // since there can be negative offsets.\r
- // @method getPixelOrigin(): Point\r
- // Returns the projected pixel coordinates of the top left point of\r
- // the map layer (useful in custom layer and overlay implementations).\r
- getPixelOrigin: function () {\r
- this._checkIfLoaded();\r
- return this._pixelOrigin;\r
- },\r
-\r
- // @method getPixelWorldBounds(zoom?: Number): Bounds\r
- // Returns the world's bounds in pixel coordinates for zoom level `zoom`.\r
- // If `zoom` is omitted, the map's current zoom level is used.\r
- getPixelWorldBounds: function (zoom) {\r
- return this.options.crs.getProjectedBounds(zoom === undefined ? this.getZoom() : zoom);\r
- },\r
-\r
- // @section Other Methods\r
-\r
- // @method getPane(pane: String|HTMLElement): HTMLElement\r
- // Returns a [map pane](#map-pane), given its name or its HTML element (its identity).\r
- getPane: function (pane) {\r
- return typeof pane === 'string' ? this._panes[pane] : pane;\r
- },\r
-\r
- // @method getPanes(): Object\r
- // Returns a plain object containing the names of all [panes](#map-pane) as keys and\r
- // the panes as values.\r
- getPanes: function () {\r
- return this._panes;\r
- },\r
-\r
- // @method getContainer: HTMLElement\r
- // Returns the HTML element that contains the map.\r
- getContainer: function () {\r
- return this._container;\r
- },\r
-\r
-\r
- // @section Conversion Methods\r
-\r
- // @method getZoomScale(toZoom: Number, fromZoom: Number): Number\r
- // Returns the scale factor to be applied to a map transition from zoom level\r
- // `fromZoom` to `toZoom`. Used internally to help with zoom animations.\r
- getZoomScale: function (toZoom, fromZoom) {\r
- // TODO replace with universal implementation after refactoring projections\r
- var crs = this.options.crs;\r
- fromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r
- return crs.scale(toZoom) / crs.scale(fromZoom);\r
- },\r
-\r
- // @method getScaleZoom(scale: Number, fromZoom: Number): Number\r
- // Returns the zoom level that the map would end up at, if it is at `fromZoom`\r
- // level and everything is scaled by a factor of `scale`. Inverse of\r
- // [`getZoomScale`](#map-getZoomScale).\r
- getScaleZoom: function (scale, fromZoom) {\r
- var crs = this.options.crs;\r
- fromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r
- var zoom = crs.zoom(scale * crs.scale(fromZoom));\r
- return isNaN(zoom) ? Infinity : zoom;\r
- },\r
-\r
- // @method project(latlng: LatLng, zoom: Number): Point\r
- // Projects a geographical coordinate `LatLng` according to the projection\r
- // of the map's CRS, then scales it according to `zoom` and the CRS's\r
- // `Transformation`. The result is pixel coordinate relative to\r
- // the CRS origin.\r
- project: function (latlng, zoom) {\r
- zoom = zoom === undefined ? this._zoom : zoom;\r
- return this.options.crs.latLngToPoint(toLatLng(latlng), zoom);\r
- },\r
-\r
- // @method unproject(point: Point, zoom: Number): LatLng\r
- // Inverse of [`project`](#map-project).\r
- unproject: function (point, zoom) {\r
- zoom = zoom === undefined ? this._zoom : zoom;\r
- return this.options.crs.pointToLatLng(toPoint(point), zoom);\r
- },\r
-\r
- // @method layerPointToLatLng(point: Point): LatLng\r
- // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r
- // returns the corresponding geographical coordinate (for the current zoom level).\r
- layerPointToLatLng: function (point) {\r
- var projectedPoint = toPoint(point).add(this.getPixelOrigin());\r
- return this.unproject(projectedPoint);\r
- },\r
-\r
- // @method latLngToLayerPoint(latlng: LatLng): Point\r
- // Given a geographical coordinate, returns the corresponding pixel coordinate\r
- // relative to the [origin pixel](#map-getpixelorigin).\r
- latLngToLayerPoint: function (latlng) {\r
- var projectedPoint = this.project(toLatLng(latlng))._round();\r
- return projectedPoint._subtract(this.getPixelOrigin());\r
- },\r
-\r
- // @method wrapLatLng(latlng: LatLng): LatLng\r
- // Returns a `LatLng` where `lat` and `lng` has been wrapped according to the\r
- // map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the\r
- // CRS's bounds.\r
- // By default this means longitude is wrapped around the dateline so its\r
- // value is between -180 and +180 degrees.\r
- wrapLatLng: function (latlng) {\r
- return this.options.crs.wrapLatLng(toLatLng(latlng));\r
- },\r
-\r
- // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r
- // Returns a `LatLngBounds` with the same size as the given one, ensuring that\r
- // its center is within the CRS's bounds.\r
- // By default this means the center longitude is wrapped around the dateline so its\r
- // value is between -180 and +180 degrees, and the majority of the bounds\r
- // overlaps the CRS's bounds.\r
- wrapLatLngBounds: function (latlng) {\r
- return this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng));\r
- },\r
-\r
- // @method distance(latlng1: LatLng, latlng2: LatLng): Number\r
- // Returns the distance between two geographical coordinates according to\r
- // the map's CRS. By default this measures distance in meters.\r
- distance: function (latlng1, latlng2) {\r
- return this.options.crs.distance(toLatLng(latlng1), toLatLng(latlng2));\r
- },\r
-\r
- // @method containerPointToLayerPoint(point: Point): Point\r
- // Given a pixel coordinate relative to the map container, returns the corresponding\r
- // pixel coordinate relative to the [origin pixel](#map-getpixelorigin).\r
- containerPointToLayerPoint: function (point) { // (Point)\r
- return toPoint(point).subtract(this._getMapPanePos());\r
- },\r
-\r
- // @method layerPointToContainerPoint(point: Point): Point\r
- // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r
- // returns the corresponding pixel coordinate relative to the map container.\r
- layerPointToContainerPoint: function (point) { // (Point)\r
- return toPoint(point).add(this._getMapPanePos());\r
- },\r
-\r
- // @method containerPointToLatLng(point: Point): LatLng\r
- // Given a pixel coordinate relative to the map container, returns\r
- // the corresponding geographical coordinate (for the current zoom level).\r
- containerPointToLatLng: function (point) {\r
- var layerPoint = this.containerPointToLayerPoint(toPoint(point));\r
- return this.layerPointToLatLng(layerPoint);\r
- },\r
-\r
- // @method latLngToContainerPoint(latlng: LatLng): Point\r
- // Given a geographical coordinate, returns the corresponding pixel coordinate\r
- // relative to the map container.\r
- latLngToContainerPoint: function (latlng) {\r
- return this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng)));\r
- },\r
-\r
- // @method mouseEventToContainerPoint(ev: MouseEvent): Point\r
- // Given a MouseEvent object, returns the pixel coordinate relative to the\r
- // map container where the event took place.\r
- mouseEventToContainerPoint: function (e) {\r
- return getMousePosition(e, this._container);\r
- },\r
-\r
- // @method mouseEventToLayerPoint(ev: MouseEvent): Point\r
- // Given a MouseEvent object, returns the pixel coordinate relative to\r
- // the [origin pixel](#map-getpixelorigin) where the event took place.\r
- mouseEventToLayerPoint: function (e) {\r
- return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e));\r
- },\r
-\r
- // @method mouseEventToLatLng(ev: MouseEvent): LatLng\r
- // Given a MouseEvent object, returns geographical coordinate where the\r
- // event took place.\r
- mouseEventToLatLng: function (e) { // (MouseEvent)\r
- return this.layerPointToLatLng(this.mouseEventToLayerPoint(e));\r
- },\r
-\r
-\r
- // map initialization methods\r
-\r
- _initContainer: function (id) {\r
- var container = this._container = get(id);\r
-\r
- if (!container) {\r
- throw new Error('Map container not found.');\r
- } else if (container._leaflet_id) {\r
- throw new Error('Map container is already initialized.');\r
- }\r
-\r
- on(container, 'scroll', this._onScroll, this);\r
- this._containerId = stamp(container);\r
- },\r
-\r
- _initLayout: function () {\r
- var container = this._container;\r
-\r
- this._fadeAnimated = this.options.fadeAnimation && any3d;\r
-\r
- addClass(container, 'leaflet-container' +\r
- (touch ? ' leaflet-touch' : '') +\r
- (retina ? ' leaflet-retina' : '') +\r
- (ielt9 ? ' leaflet-oldie' : '') +\r
- (safari ? ' leaflet-safari' : '') +\r
- (this._fadeAnimated ? ' leaflet-fade-anim' : ''));\r
-\r
- var position = getStyle(container, 'position');\r
-\r
- if (position !== 'absolute' && position !== 'relative' && position !== 'fixed') {\r
- container.style.position = 'relative';\r
- }\r
-\r
- this._initPanes();\r
-\r
- if (this._initControlPos) {\r
- this._initControlPos();\r
- }\r
- },\r
-\r
- _initPanes: function () {\r
- var panes = this._panes = {};\r
- this._paneRenderers = {};\r
-\r
- // @section\r
- //\r
- // Panes are DOM elements used to control the ordering of layers on the map. You\r
- // can access panes with [`map.getPane`](#map-getpane) or\r
- // [`map.getPanes`](#map-getpanes) methods. New panes can be created with the\r
- // [`map.createPane`](#map-createpane) method.\r
- //\r
- // Every map has the following default panes that differ only in zIndex.\r
- //\r
- // @pane mapPane: HTMLElement = 'auto'\r
- // Pane that contains all other map panes\r
-\r
- this._mapPane = this.createPane('mapPane', this._container);\r
- setPosition(this._mapPane, new Point(0, 0));\r
-\r
- // @pane tilePane: HTMLElement = 200\r
- // Pane for `GridLayer`s and `TileLayer`s\r
- this.createPane('tilePane');\r
- // @pane overlayPane: HTMLElement = 400\r
- // Pane for overlay shadows (e.g. `Marker` shadows)\r
- this.createPane('shadowPane');\r
- // @pane shadowPane: HTMLElement = 500\r
- // Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s\r
- this.createPane('overlayPane');\r
- // @pane markerPane: HTMLElement = 600\r
- // Pane for `Icon`s of `Marker`s\r
- this.createPane('markerPane');\r
- // @pane tooltipPane: HTMLElement = 650\r
- // Pane for `Tooltip`s.\r
- this.createPane('tooltipPane');\r
- // @pane popupPane: HTMLElement = 700\r
- // Pane for `Popup`s.\r
- this.createPane('popupPane');\r
-\r
- if (!this.options.markerZoomAnimation) {\r
- addClass(panes.markerPane, 'leaflet-zoom-hide');\r
- addClass(panes.shadowPane, 'leaflet-zoom-hide');\r
- }\r
- },\r
-\r
-\r
- // private methods that modify map state\r
-\r
- // @section Map state change events\r
- _resetView: function (center, zoom) {\r
- setPosition(this._mapPane, new Point(0, 0));\r
-\r
- var loading = !this._loaded;\r
- this._loaded = true;\r
- zoom = this._limitZoom(zoom);\r
-\r
- this.fire('viewprereset');\r
-\r
- var zoomChanged = this._zoom !== zoom;\r
- this\r
- ._moveStart(zoomChanged, false)\r
- ._move(center, zoom)\r
- ._moveEnd(zoomChanged);\r
-\r
- // @event viewreset: Event\r
- // Fired when the map needs to redraw its content (this usually happens\r
- // on map zoom or load). Very useful for creating custom overlays.\r
- this.fire('viewreset');\r
-\r
- // @event load: Event\r
- // Fired when the map is initialized (when its center and zoom are set\r
- // for the first time).\r
- if (loading) {\r
- this.fire('load');\r
- }\r
- },\r
-\r
- _moveStart: function (zoomChanged, noMoveStart) {\r
- // @event zoomstart: Event\r
- // Fired when the map zoom is about to change (e.g. before zoom animation).\r
- // @event movestart: Event\r
- // Fired when the view of the map starts changing (e.g. user starts dragging the map).\r
- if (zoomChanged) {\r
- this.fire('zoomstart');\r
- }\r
- if (!noMoveStart) {\r
- this.fire('movestart');\r
- }\r
- return this;\r
- },\r
-\r
- _move: function (center, zoom, data) {\r
- if (zoom === undefined) {\r
- zoom = this._zoom;\r
- }\r
- var zoomChanged = this._zoom !== zoom;\r
-\r
- this._zoom = zoom;\r
- this._lastCenter = center;\r
- this._pixelOrigin = this._getNewPixelOrigin(center);\r
-\r
- // @event zoom: Event\r
- // Fired repeatedly during any change in zoom level, including zoom\r
- // and fly animations.\r
- if (zoomChanged || (data && data.pinch)) { // Always fire 'zoom' if pinching because #3530\r
- this.fire('zoom', data);\r
- }\r
-\r
- // @event move: Event\r
- // Fired repeatedly during any movement of the map, including pan and\r
- // fly animations.\r
- return this.fire('move', data);\r
- },\r
-\r
- _moveEnd: function (zoomChanged) {\r
- // @event zoomend: Event\r
- // Fired when the map has changed, after any animations.\r
- if (zoomChanged) {\r
- this.fire('zoomend');\r
- }\r
-\r
- // @event moveend: Event\r
- // Fired when the center of the map stops changing (e.g. user stopped\r
- // dragging the map).\r
- return this.fire('moveend');\r
- },\r
-\r
- _stop: function () {\r
- cancelAnimFrame(this._flyToFrame);\r
- if (this._panAnim) {\r
- this._panAnim.stop();\r
- }\r
- return this;\r
- },\r
-\r
- _rawPanBy: function (offset) {\r
- setPosition(this._mapPane, this._getMapPanePos().subtract(offset));\r
- },\r
-\r
- _getZoomSpan: function () {\r
- return this.getMaxZoom() - this.getMinZoom();\r
- },\r
-\r
- _panInsideMaxBounds: function () {\r
- if (!this._enforcingBounds) {\r
- this.panInsideBounds(this.options.maxBounds);\r
- }\r
- },\r
-\r
- _checkIfLoaded: function () {\r
- if (!this._loaded) {\r
- throw new Error('Set map center and zoom first.');\r
- }\r
- },\r
-\r
- // DOM event handling\r
-\r
- // @section Interaction events\r
- _initEvents: function (remove$$1) {\r
- this._targets = {};\r
- this._targets[stamp(this._container)] = this;\r
-\r
- var onOff = remove$$1 ? off : on;\r
-\r
- // @event click: MouseEvent\r
- // Fired when the user clicks (or taps) the map.\r
- // @event dblclick: MouseEvent\r
- // Fired when the user double-clicks (or double-taps) the map.\r
- // @event mousedown: MouseEvent\r
- // Fired when the user pushes the mouse button on the map.\r
- // @event mouseup: MouseEvent\r
- // Fired when the user releases the mouse button on the map.\r
- // @event mouseover: MouseEvent\r
- // Fired when the mouse enters the map.\r
- // @event mouseout: MouseEvent\r
- // Fired when the mouse leaves the map.\r
- // @event mousemove: MouseEvent\r
- // Fired while the mouse moves over the map.\r
- // @event contextmenu: MouseEvent\r
- // Fired when the user pushes the right mouse button on the map, prevents\r
- // default browser context menu from showing if there are listeners on\r
- // this event. Also fired on mobile when the user holds a single touch\r
- // for a second (also called long press).\r
- // @event keypress: KeyboardEvent\r
- // Fired when the user presses a key from the keyboard that produces a character value while the map is focused.\r
- // @event keydown: KeyboardEvent\r
- // Fired when the user presses a key from the keyboard while the map is focused. Unlike the `keypress` event,\r
- // the `keydown` event is fired for keys that produce a character value and for keys\r
- // that do not produce a character value.\r
- // @event keyup: KeyboardEvent\r
- // Fired when the user releases a key from the keyboard while the map is focused.\r
- onOff(this._container, 'click dblclick mousedown mouseup ' +\r
- 'mouseover mouseout mousemove contextmenu keypress keydown keyup', this._handleDOMEvent, this);\r
-\r
- if (this.options.trackResize) {\r
- onOff(window, 'resize', this._onResize, this);\r
- }\r
-\r
- if (any3d && this.options.transform3DLimit) {\r
- (remove$$1 ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\r
- }\r
- },\r
-\r
- _onResize: function () {\r
- cancelAnimFrame(this._resizeRequest);\r
- this._resizeRequest = requestAnimFrame(\r
- function () { this.invalidateSize({debounceMoveend: true}); }, this);\r
- },\r
-\r
- _onScroll: function () {\r
- this._container.scrollTop = 0;\r
- this._container.scrollLeft = 0;\r
- },\r
-\r
- _onMoveEnd: function () {\r
- var pos = this._getMapPanePos();\r
- if (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) {\r
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have\r
- // a pixel offset on very high values, see: http://jsfiddle.net/dg6r5hhb/\r
- this._resetView(this.getCenter(), this.getZoom());\r
- }\r
- },\r
-\r
- _findEventTargets: function (e, type) {\r
- var targets = [],\r
- target,\r
- isHover = type === 'mouseout' || type === 'mouseover',\r
- src = e.target || e.srcElement,\r
- dragging = false;\r
-\r
- while (src) {\r
- target = this._targets[stamp(src)];\r
- if (target && (type === 'click' || type === 'preclick') && !e._simulated && this._draggableMoved(target)) {\r
- // Prevent firing click after you just dragged an object.\r
- dragging = true;\r
- break;\r
- }\r
- if (target && target.listens(type, true)) {\r
- if (isHover && !isExternalTarget(src, e)) { break; }\r
- targets.push(target);\r
- if (isHover) { break; }\r
- }\r
- if (src === this._container) { break; }\r
- src = src.parentNode;\r
- }\r
- if (!targets.length && !dragging && !isHover && isExternalTarget(src, e)) {\r
- targets = [this];\r
- }\r
- return targets;\r
- },\r
-\r
- _handleDOMEvent: function (e) {\r
- if (!this._loaded || skipped(e)) { return; }\r
-\r
- var type = e.type;\r
-\r
- if (type === 'mousedown' || type === 'keypress' || type === 'keyup' || type === 'keydown') {\r
- // prevents outline when clicking on keyboard-focusable element\r
- preventOutline(e.target || e.srcElement);\r
- }\r
-\r
- this._fireDOMEvent(e, type);\r
- },\r
-\r
- _mouseEvents: ['click', 'dblclick', 'mouseover', 'mouseout', 'contextmenu'],\r
-\r
- _fireDOMEvent: function (e, type, targets) {\r
-\r
- if (e.type === 'click') {\r
- // Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\r
- // @event preclick: MouseEvent\r
- // Fired before mouse click on the map (sometimes useful when you\r
- // want something to happen on click before any existing click\r
- // handlers start running).\r
- var synth = extend({}, e);\r
- synth.type = 'preclick';\r
- this._fireDOMEvent(synth, synth.type, targets);\r
- }\r
-\r
- if (e._stopped) { return; }\r
-\r
- // Find the layer the event is propagating from and its parents.\r
- targets = (targets || []).concat(this._findEventTargets(e, type));\r
-\r
- if (!targets.length) { return; }\r
-\r
- var target = targets[0];\r
- if (type === 'contextmenu' && target.listens(type, true)) {\r
- preventDefault(e);\r
- }\r
-\r
- var data = {\r
- originalEvent: e\r
- };\r
-\r
- if (e.type !== 'keypress' && e.type !== 'keydown' && e.type !== 'keyup') {\r
- var isMarker = target.getLatLng && (!target._radius || target._radius <= 10);\r
- data.containerPoint = isMarker ?\r
- this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);\r
- data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\r
- data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);\r
- }\r
-\r
- for (var i = 0; i < targets.length; i++) {\r
- targets[i].fire(type, data, true);\r
- if (data.originalEvent._stopped ||\r
- (targets[i].options.bubblingMouseEvents === false && indexOf(this._mouseEvents, type) !== -1)) { return; }\r
- }\r
- },\r
-\r
- _draggableMoved: function (obj) {\r
- obj = obj.dragging && obj.dragging.enabled() ? obj : this;\r
- return (obj.dragging && obj.dragging.moved()) || (this.boxZoom && this.boxZoom.moved());\r
- },\r
-\r
- _clearHandlers: function () {\r
- for (var i = 0, len = this._handlers.length; i < len; i++) {\r
- this._handlers[i].disable();\r
- }\r
- },\r
-\r
- // @section Other Methods\r
-\r
- // @method whenReady(fn: Function, context?: Object): this\r
- // Runs the given function `fn` when the map gets initialized with\r
- // a view (center and zoom) and at least one layer, or immediately\r
- // if it's already initialized, optionally passing a function context.\r
- whenReady: function (callback, context) {\r
- if (this._loaded) {\r
- callback.call(context || this, {target: this});\r
- } else {\r
- this.on('load', callback, context);\r
- }\r
- return this;\r
- },\r
-\r
-\r
- // private methods for getting map state\r
-\r
- _getMapPanePos: function () {\r
- return getPosition(this._mapPane) || new Point(0, 0);\r
- },\r
-\r
- _moved: function () {\r
- var pos = this._getMapPanePos();\r
- return pos && !pos.equals([0, 0]);\r
- },\r
-\r
- _getTopLeftPoint: function (center, zoom) {\r
- var pixelOrigin = center && zoom !== undefined ?\r
- this._getNewPixelOrigin(center, zoom) :\r
- this.getPixelOrigin();\r
- return pixelOrigin.subtract(this._getMapPanePos());\r
- },\r
-\r
- _getNewPixelOrigin: function (center, zoom) {\r
- var viewHalf = this.getSize()._divideBy(2);\r
- return this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos())._round();\r
- },\r
-\r
- _latLngToNewLayerPoint: function (latlng, zoom, center) {\r
- var topLeft = this._getNewPixelOrigin(center, zoom);\r
- return this.project(latlng, zoom)._subtract(topLeft);\r
- },\r
-\r
- _latLngBoundsToNewLayerBounds: function (latLngBounds, zoom, center) {\r
- var topLeft = this._getNewPixelOrigin(center, zoom);\r
- return toBounds([\r
- this.project(latLngBounds.getSouthWest(), zoom)._subtract(topLeft),\r
- this.project(latLngBounds.getNorthWest(), zoom)._subtract(topLeft),\r
- this.project(latLngBounds.getSouthEast(), zoom)._subtract(topLeft),\r
- this.project(latLngBounds.getNorthEast(), zoom)._subtract(topLeft)\r
- ]);\r
- },\r
-\r
- // layer point of the current center\r
- _getCenterLayerPoint: function () {\r
- return this.containerPointToLayerPoint(this.getSize()._divideBy(2));\r
- },\r
-\r
- // offset of the specified place to the current center in pixels\r
- _getCenterOffset: function (latlng) {\r
- return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint());\r
- },\r
-\r
- // adjust center for view to get inside bounds\r
- _limitCenter: function (center, zoom, bounds) {\r
-\r
- if (!bounds) { return center; }\r
-\r
- var centerPoint = this.project(center, zoom),\r
- viewHalf = this.getSize().divideBy(2),\r
- viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\r
- offset = this._getBoundsOffset(viewBounds, bounds, zoom);\r
-\r
- // If offset is less than a pixel, ignore.\r
- // This prevents unstable projections from getting into\r
- // an infinite loop of tiny offsets.\r
- if (offset.round().equals([0, 0])) {\r
- return center;\r
- }\r
-\r
- return this.unproject(centerPoint.add(offset), zoom);\r
- },\r
-\r
- // adjust offset for view to get inside bounds\r
- _limitOffset: function (offset, bounds) {\r
- if (!bounds) { return offset; }\r
-\r
- var viewBounds = this.getPixelBounds(),\r
- newBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));\r
-\r
- return offset.add(this._getBoundsOffset(newBounds, bounds));\r
- },\r
-\r
- // returns offset needed for pxBounds to get inside maxBounds at a specified zoom\r
- _getBoundsOffset: function (pxBounds, maxBounds, zoom) {\r
- var projectedMaxBounds = toBounds(\r
- this.project(maxBounds.getNorthEast(), zoom),\r
- this.project(maxBounds.getSouthWest(), zoom)\r
- ),\r
- minOffset = projectedMaxBounds.min.subtract(pxBounds.min),\r
- maxOffset = projectedMaxBounds.max.subtract(pxBounds.max),\r
-\r
- dx = this._rebound(minOffset.x, -maxOffset.x),\r
- dy = this._rebound(minOffset.y, -maxOffset.y);\r
-\r
- return new Point(dx, dy);\r
- },\r
-\r
- _rebound: function (left, right) {\r
- return left + right > 0 ?\r
- Math.round(left - right) / 2 :\r
- Math.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));\r
- },\r
-\r
- _limitZoom: function (zoom) {\r
- var min = this.getMinZoom(),\r
- max = this.getMaxZoom(),\r
- snap = any3d ? this.options.zoomSnap : 1;\r
- if (snap) {\r
- zoom = Math.round(zoom / snap) * snap;\r
- }\r
- return Math.max(min, Math.min(max, zoom));\r
- },\r
-\r
- _onPanTransitionStep: function () {\r
- this.fire('move');\r
- },\r
-\r
- _onPanTransitionEnd: function () {\r
- removeClass(this._mapPane, 'leaflet-pan-anim');\r
- this.fire('moveend');\r
- },\r
-\r
- _tryAnimatedPan: function (center, options) {\r
- // difference between the new and current centers in pixels\r
- var offset = this._getCenterOffset(center)._trunc();\r
-\r
- // don't animate too far unless animate: true specified in options\r
- if ((options && options.animate) !== true && !this.getSize().contains(offset)) { return false; }\r
-\r
- this.panBy(offset, options);\r
-\r
- return true;\r
- },\r
-\r
- _createAnimProxy: function () {\r
-\r
- var proxy = this._proxy = create$1('div', 'leaflet-proxy leaflet-zoom-animated');\r
- this._panes.mapPane.appendChild(proxy);\r
-\r
- this.on('zoomanim', function (e) {\r
- var prop = TRANSFORM,\r
- transform = this._proxy.style[prop];\r
-\r
- setTransform(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1));\r
-\r
- // workaround for case when transform is the same and so transitionend event is not fired\r
- if (transform === this._proxy.style[prop] && this._animatingZoom) {\r
- this._onZoomTransitionEnd();\r
- }\r
- }, this);\r
-\r
- this.on('load moveend', this._animMoveEnd, this);\r
-\r
- this._on('unload', this._destroyAnimProxy, this);\r
- },\r
-\r
- _destroyAnimProxy: function () {\r
- remove(this._proxy);\r
- this.off('load moveend', this._animMoveEnd, this);\r
- delete this._proxy;\r
- },\r
-\r
- _animMoveEnd: function () {\r
- var c = this.getCenter(),\r
- z = this.getZoom();\r
- setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1));\r
- },\r
-\r
- _catchTransitionEnd: function (e) {\r
- if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) {\r
- this._onZoomTransitionEnd();\r
- }\r
- },\r
-\r
- _nothingToAnimate: function () {\r
- return !this._container.getElementsByClassName('leaflet-zoom-animated').length;\r
- },\r
-\r
- _tryAnimatedZoom: function (center, zoom, options) {\r
-\r
- if (this._animatingZoom) { return true; }\r
-\r
- options = options || {};\r
-\r
- // don't animate if disabled, not supported or zoom difference is too large\r
- if (!this._zoomAnimated || options.animate === false || this._nothingToAnimate() ||\r
- Math.abs(zoom - this._zoom) > this.options.zoomAnimationThreshold) { return false; }\r
-\r
- // offset is the pixel coords of the zoom origin relative to the current center\r
- var scale = this.getZoomScale(zoom),\r
- offset = this._getCenterOffset(center)._divideBy(1 - 1 / scale);\r
-\r
- // don't animate if the zoom origin isn't within one screen from the current center, unless forced\r
- if (options.animate !== true && !this.getSize().contains(offset)) { return false; }\r
-\r
- requestAnimFrame(function () {\r
- this\r
- ._moveStart(true, false)\r
- ._animateZoom(center, zoom, true);\r
- }, this);\r
-\r
- return true;\r
- },\r
-\r
- _animateZoom: function (center, zoom, startAnim, noUpdate) {\r
- if (!this._mapPane) { return; }\r
-\r
- if (startAnim) {\r
- this._animatingZoom = true;\r
-\r
- // remember what center/zoom to set after animation\r
- this._animateToCenter = center;\r
- this._animateToZoom = zoom;\r
-\r
- addClass(this._mapPane, 'leaflet-zoom-anim');\r
- }\r
-\r
- // @section Other Events\r
- // @event zoomanim: ZoomAnimEvent\r
- // Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.\r
- this.fire('zoomanim', {\r
- center: center,\r
- zoom: zoom,\r
- noUpdate: noUpdate\r
- });\r
-\r
- // Work around webkit not firing 'transitionend', see https://github.com/Leaflet/Leaflet/issues/3689, 2693\r
- setTimeout(bind(this._onZoomTransitionEnd, this), 250);\r
- },\r
-\r
- _onZoomTransitionEnd: function () {\r
- if (!this._animatingZoom) { return; }\r
-\r
- if (this._mapPane) {\r
- removeClass(this._mapPane, 'leaflet-zoom-anim');\r
- }\r
-\r
- this._animatingZoom = false;\r
-\r
- this._move(this._animateToCenter, this._animateToZoom);\r
-\r
- // This anim frame should prevent an obscure iOS webkit tile loading race condition.\r
- requestAnimFrame(function () {\r
- this._moveEnd(true);\r
- }, this);\r
- }\r
- });\r
-\r
- // @section\r
-\r
- // @factory L.map(id: String, options?: Map options)\r
- // Instantiates a map object given the DOM ID of a `<div>` element\r
- // and optionally an object literal with `Map options`.\r
- //\r
- // @alternative\r
- // @factory L.map(el: HTMLElement, options?: Map options)\r
- // Instantiates a map object given an instance of a `<div>` HTML element\r
- // and optionally an object literal with `Map options`.\r
- function createMap(id, options) {\r
- return new Map(id, options);\r
- }
-
- /*\r
- * @class Control\r
- * @aka L.Control\r
- * @inherits Class\r
- *\r
- * L.Control is a base class for implementing map controls. Handles positioning.\r
- * All other controls extend from this class.\r
- */\r
-\r
- var Control = Class.extend({\r
- // @section\r
- // @aka Control options\r
- options: {\r
- // @option position: String = 'topright'\r
- // The position of the control (one of the map corners). Possible values are `'topleft'`,\r
- // `'topright'`, `'bottomleft'` or `'bottomright'`\r
- position: 'topright'\r
- },\r
-\r
- initialize: function (options) {\r
- setOptions(this, options);\r
- },\r
-\r
- /* @section\r
- * Classes extending L.Control will inherit the following methods:\r
- *\r
- * @method getPosition: string\r
- * Returns the position of the control.\r
- */\r
- getPosition: function () {\r
- return this.options.position;\r
- },\r
-\r
- // @method setPosition(position: string): this\r
- // Sets the position of the control.\r
- setPosition: function (position) {\r
- var map = this._map;\r
-\r
- if (map) {\r
- map.removeControl(this);\r
- }\r
-\r
- this.options.position = position;\r
-\r
- if (map) {\r
- map.addControl(this);\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method getContainer: HTMLElement\r
- // Returns the HTMLElement that contains the control.\r
- getContainer: function () {\r
- return this._container;\r
- },\r
-\r
- // @method addTo(map: Map): this\r
- // Adds the control to the given map.\r
- addTo: function (map) {\r
- this.remove();\r
- this._map = map;\r
-\r
- var container = this._container = this.onAdd(map),\r
- pos = this.getPosition(),\r
- corner = map._controlCorners[pos];\r
-\r
- addClass(container, 'leaflet-control');\r
-\r
- if (pos.indexOf('bottom') !== -1) {\r
- corner.insertBefore(container, corner.firstChild);\r
- } else {\r
- corner.appendChild(container);\r
- }\r
-\r
- this._map.on('unload', this.remove, this);\r
-\r
- return this;\r
- },\r
-\r
- // @method remove: this\r
- // Removes the control from the map it is currently active on.\r
- remove: function () {\r
- if (!this._map) {\r
- return this;\r
- }\r
-\r
- remove(this._container);\r
-\r
- if (this.onRemove) {\r
- this.onRemove(this._map);\r
- }\r
-\r
- this._map.off('unload', this.remove, this);\r
- this._map = null;\r
-\r
- return this;\r
- },\r
-\r
- _refocusOnMap: function (e) {\r
- // if map exists and event is not a keyboard event\r
- if (this._map && e && e.screenX > 0 && e.screenY > 0) {\r
- this._map.getContainer().focus();\r
- }\r
- }\r
- });\r
-\r
- var control = function (options) {\r
- return new Control(options);\r
- };\r
-\r
- /* @section Extension methods\r
- * @uninheritable\r
- *\r
- * Every control should extend from `L.Control` and (re-)implement the following methods.\r
- *\r
- * @method onAdd(map: Map): HTMLElement\r
- * Should return the container DOM element for the control and add listeners on relevant map events. Called on [`control.addTo(map)`](#control-addTo).\r
- *\r
- * @method onRemove(map: Map)\r
- * Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove).\r
- */\r
-\r
- /* @namespace Map\r
- * @section Methods for Layers and Controls\r
- */\r
- Map.include({\r
- // @method addControl(control: Control): this\r
- // Adds the given control to the map\r
- addControl: function (control) {\r
- control.addTo(this);\r
- return this;\r
- },\r
-\r
- // @method removeControl(control: Control): this\r
- // Removes the given control from the map\r
- removeControl: function (control) {\r
- control.remove();\r
- return this;\r
- },\r
-\r
- _initControlPos: function () {\r
- var corners = this._controlCorners = {},\r
- l = 'leaflet-',\r
- container = this._controlContainer =\r
- create$1('div', l + 'control-container', this._container);\r
-\r
- function createCorner(vSide, hSide) {\r
- var className = l + vSide + ' ' + l + hSide;\r
-\r
- corners[vSide + hSide] = create$1('div', className, container);\r
- }\r
-\r
- createCorner('top', 'left');\r
- createCorner('top', 'right');\r
- createCorner('bottom', 'left');\r
- createCorner('bottom', 'right');\r
- },\r
-\r
- _clearControlPos: function () {\r
- for (var i in this._controlCorners) {\r
- remove(this._controlCorners[i]);\r
- }\r
- remove(this._controlContainer);\r
- delete this._controlCorners;\r
- delete this._controlContainer;\r
- }\r
- });
-
- /*\r
- * @class Control.Layers\r
- * @aka L.Control.Layers\r
- * @inherits Control\r
- *\r
- * The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](http://leafletjs.com/examples/layers-control/)). Extends `Control`.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var baseLayers = {\r
- * "Mapbox": mapbox,\r
- * "OpenStreetMap": osm\r
- * };\r
- *\r
- * var overlays = {\r
- * "Marker": marker,\r
- * "Roads": roadsLayer\r
- * };\r
- *\r
- * L.control.layers(baseLayers, overlays).addTo(map);\r
- * ```\r
- *\r
- * The `baseLayers` and `overlays` parameters are object literals with layer names as keys and `Layer` objects as values:\r
- *\r
- * ```js\r
- * {\r
- * "<someName1>": layer1,\r
- * "<someName2>": layer2\r
- * }\r
- * ```\r
- *\r
- * The layer names can contain HTML, which allows you to add additional styling to the items:\r
- *\r
- * ```js\r
- * {"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}\r
- * ```\r
- */\r
-\r
- var Layers = Control.extend({\r
- // @section\r
- // @aka Control.Layers options\r
- options: {\r
- // @option collapsed: Boolean = true\r
- // If `true`, the control will be collapsed into an icon and expanded on mouse hover or touch.\r
- collapsed: true,\r
- position: 'topright',\r
-\r
- // @option autoZIndex: Boolean = true\r
- // If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.\r
- autoZIndex: true,\r
-\r
- // @option hideSingleBase: Boolean = false\r
- // If `true`, the base layers in the control will be hidden when there is only one.\r
- hideSingleBase: false,\r
-\r
- // @option sortLayers: Boolean = false\r
- // Whether to sort the layers. When `false`, layers will keep the order\r
- // in which they were added to the control.\r
- sortLayers: false,\r
-\r
- // @option sortFunction: Function = *\r
- // A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\r
- // that will be used for sorting the layers, when `sortLayers` is `true`.\r
- // The function receives both the `L.Layer` instances and their names, as in\r
- // `sortFunction(layerA, layerB, nameA, nameB)`.\r
- // By default, it sorts layers alphabetically by their name.\r
- sortFunction: function (layerA, layerB, nameA, nameB) {\r
- return nameA < nameB ? -1 : (nameB < nameA ? 1 : 0);\r
- }\r
- },\r
-\r
- initialize: function (baseLayers, overlays, options) {\r
- setOptions(this, options);\r
-\r
- this._layerControlInputs = [];\r
- this._layers = [];\r
- this._lastZIndex = 0;\r
- this._handlingClick = false;\r
-\r
- for (var i in baseLayers) {\r
- this._addLayer(baseLayers[i], i);\r
- }\r
-\r
- for (i in overlays) {\r
- this._addLayer(overlays[i], i, true);\r
- }\r
- },\r
-\r
- onAdd: function (map) {\r
- this._initLayout();\r
- this._update();\r
-\r
- this._map = map;\r
- map.on('zoomend', this._checkDisabledLayers, this);\r
-\r
- for (var i = 0; i < this._layers.length; i++) {\r
- this._layers[i].layer.on('add remove', this._onLayerChange, this);\r
- }\r
-\r
- return this._container;\r
- },\r
-\r
- addTo: function (map) {\r
- Control.prototype.addTo.call(this, map);\r
- // Trigger expand after Layers Control has been inserted into DOM so that is now has an actual height.\r
- return this._expandIfNotCollapsed();\r
- },\r
-\r
- onRemove: function () {\r
- this._map.off('zoomend', this._checkDisabledLayers, this);\r
-\r
- for (var i = 0; i < this._layers.length; i++) {\r
- this._layers[i].layer.off('add remove', this._onLayerChange, this);\r
- }\r
- },\r
-\r
- // @method addBaseLayer(layer: Layer, name: String): this\r
- // Adds a base layer (radio button entry) with the given name to the control.\r
- addBaseLayer: function (layer, name) {\r
- this._addLayer(layer, name);\r
- return (this._map) ? this._update() : this;\r
- },\r
-\r
- // @method addOverlay(layer: Layer, name: String): this\r
- // Adds an overlay (checkbox entry) with the given name to the control.\r
- addOverlay: function (layer, name) {\r
- this._addLayer(layer, name, true);\r
- return (this._map) ? this._update() : this;\r
- },\r
-\r
- // @method removeLayer(layer: Layer): this\r
- // Remove the given layer from the control.\r
- removeLayer: function (layer) {\r
- layer.off('add remove', this._onLayerChange, this);\r
-\r
- var obj = this._getLayer(stamp(layer));\r
- if (obj) {\r
- this._layers.splice(this._layers.indexOf(obj), 1);\r
- }\r
- return (this._map) ? this._update() : this;\r
- },\r
-\r
- // @method expand(): this\r
- // Expand the control container if collapsed.\r
- expand: function () {\r
- addClass(this._container, 'leaflet-control-layers-expanded');\r
- this._section.style.height = null;\r
- var acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50);\r
- if (acceptableHeight < this._section.clientHeight) {\r
- addClass(this._section, 'leaflet-control-layers-scrollbar');\r
- this._section.style.height = acceptableHeight + 'px';\r
- } else {\r
- removeClass(this._section, 'leaflet-control-layers-scrollbar');\r
- }\r
- this._checkDisabledLayers();\r
- return this;\r
- },\r
-\r
- // @method collapse(): this\r
- // Collapse the control container if expanded.\r
- collapse: function () {\r
- removeClass(this._container, 'leaflet-control-layers-expanded');\r
- return this;\r
- },\r
-\r
- _initLayout: function () {\r
- var className = 'leaflet-control-layers',\r
- container = this._container = create$1('div', className),\r
- collapsed = this.options.collapsed;\r
-\r
- // makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released\r
- container.setAttribute('aria-haspopup', true);\r
-\r
- disableClickPropagation(container);\r
- disableScrollPropagation(container);\r
-\r
- var section = this._section = create$1('section', className + '-list');\r
-\r
- if (collapsed) {\r
- this._map.on('click', this.collapse, this);\r
-\r
- if (!android) {\r
- on(container, {\r
- mouseenter: this.expand,\r
- mouseleave: this.collapse\r
- }, this);\r
- }\r
- }\r
-\r
- var link = this._layersLink = create$1('a', className + '-toggle', container);\r
- link.href = '#';\r
- link.title = 'Layers';\r
-\r
- if (touch) {\r
- on(link, 'click', stop);\r
- on(link, 'click', this.expand, this);\r
- } else {\r
- on(link, 'focus', this.expand, this);\r
- }\r
-\r
- if (!collapsed) {\r
- this.expand();\r
- }\r
-\r
- this._baseLayersList = create$1('div', className + '-base', section);\r
- this._separator = create$1('div', className + '-separator', section);\r
- this._overlaysList = create$1('div', className + '-overlays', section);\r
-\r
- container.appendChild(section);\r
- },\r
-\r
- _getLayer: function (id) {\r
- for (var i = 0; i < this._layers.length; i++) {\r
-\r
- if (this._layers[i] && stamp(this._layers[i].layer) === id) {\r
- return this._layers[i];\r
- }\r
- }\r
- },\r
-\r
- _addLayer: function (layer, name, overlay) {\r
- if (this._map) {\r
- layer.on('add remove', this._onLayerChange, this);\r
- }\r
-\r
- this._layers.push({\r
- layer: layer,\r
- name: name,\r
- overlay: overlay\r
- });\r
-\r
- if (this.options.sortLayers) {\r
- this._layers.sort(bind(function (a, b) {\r
- return this.options.sortFunction(a.layer, b.layer, a.name, b.name);\r
- }, this));\r
- }\r
-\r
- if (this.options.autoZIndex && layer.setZIndex) {\r
- this._lastZIndex++;\r
- layer.setZIndex(this._lastZIndex);\r
- }\r
-\r
- this._expandIfNotCollapsed();\r
- },\r
-\r
- _update: function () {\r
- if (!this._container) { return this; }\r
-\r
- empty(this._baseLayersList);\r
- empty(this._overlaysList);\r
-\r
- this._layerControlInputs = [];\r
- var baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0;\r
-\r
- for (i = 0; i < this._layers.length; i++) {\r
- obj = this._layers[i];\r
- this._addItem(obj);\r
- overlaysPresent = overlaysPresent || obj.overlay;\r
- baseLayersPresent = baseLayersPresent || !obj.overlay;\r
- baseLayersCount += !obj.overlay ? 1 : 0;\r
- }\r
-\r
- // Hide base layers section if there's only one layer.\r
- if (this.options.hideSingleBase) {\r
- baseLayersPresent = baseLayersPresent && baseLayersCount > 1;\r
- this._baseLayersList.style.display = baseLayersPresent ? '' : 'none';\r
- }\r
-\r
- this._separator.style.display = overlaysPresent && baseLayersPresent ? '' : 'none';\r
-\r
- return this;\r
- },\r
-\r
- _onLayerChange: function (e) {\r
- if (!this._handlingClick) {\r
- this._update();\r
- }\r
-\r
- var obj = this._getLayer(stamp(e.target));\r
-\r
- // @namespace Map\r
- // @section Layer events\r
- // @event baselayerchange: LayersControlEvent\r
- // Fired when the base layer is changed through the [layers control](#control-layers).\r
- // @event overlayadd: LayersControlEvent\r
- // Fired when an overlay is selected through the [layers control](#control-layers).\r
- // @event overlayremove: LayersControlEvent\r
- // Fired when an overlay is deselected through the [layers control](#control-layers).\r
- // @namespace Control.Layers\r
- var type = obj.overlay ?\r
- (e.type === 'add' ? 'overlayadd' : 'overlayremove') :\r
- (e.type === 'add' ? 'baselayerchange' : null);\r
-\r
- if (type) {\r
- this._map.fire(type, obj);\r
- }\r
- },\r
-\r
- // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)\r
- _createRadioElement: function (name, checked) {\r
-\r
- var radioHtml = '<input type="radio" class="leaflet-control-layers-selector" name="' +\r
- name + '"' + (checked ? ' checked="checked"' : '') + '/>';\r
-\r
- var radioFragment = document.createElement('div');\r
- radioFragment.innerHTML = radioHtml;\r
-\r
- return radioFragment.firstChild;\r
- },\r
-\r
- _addItem: function (obj) {\r
- var label = document.createElement('label'),\r
- checked = this._map.hasLayer(obj.layer),\r
- input;\r
-\r
- if (obj.overlay) {\r
- input = document.createElement('input');\r
- input.type = 'checkbox';\r
- input.className = 'leaflet-control-layers-selector';\r
- input.defaultChecked = checked;\r
- } else {\r
- input = this._createRadioElement('leaflet-base-layers_' + stamp(this), checked);\r
- }\r
-\r
- this._layerControlInputs.push(input);\r
- input.layerId = stamp(obj.layer);\r
-\r
- on(input, 'click', this._onInputClick, this);\r
-\r
- var name = document.createElement('span');\r
- name.innerHTML = ' ' + obj.name;\r
-\r
- // Helps from preventing layer control flicker when checkboxes are disabled\r
- // https://github.com/Leaflet/Leaflet/issues/2771\r
- var holder = document.createElement('div');\r
-\r
- label.appendChild(holder);\r
- holder.appendChild(input);\r
- holder.appendChild(name);\r
-\r
- var container = obj.overlay ? this._overlaysList : this._baseLayersList;\r
- container.appendChild(label);\r
-\r
- this._checkDisabledLayers();\r
- return label;\r
- },\r
-\r
- _onInputClick: function () {\r
- var inputs = this._layerControlInputs,\r
- input, layer;\r
- var addedLayers = [],\r
- removedLayers = [];\r
-\r
- this._handlingClick = true;\r
-\r
- for (var i = inputs.length - 1; i >= 0; i--) {\r
- input = inputs[i];\r
- layer = this._getLayer(input.layerId).layer;\r
-\r
- if (input.checked) {\r
- addedLayers.push(layer);\r
- } else if (!input.checked) {\r
- removedLayers.push(layer);\r
- }\r
- }\r
-\r
- // Bugfix issue 2318: Should remove all old layers before readding new ones\r
- for (i = 0; i < removedLayers.length; i++) {\r
- if (this._map.hasLayer(removedLayers[i])) {\r
- this._map.removeLayer(removedLayers[i]);\r
- }\r
- }\r
- for (i = 0; i < addedLayers.length; i++) {\r
- if (!this._map.hasLayer(addedLayers[i])) {\r
- this._map.addLayer(addedLayers[i]);\r
- }\r
- }\r
-\r
- this._handlingClick = false;\r
-\r
- this._refocusOnMap();\r
- },\r
-\r
- _checkDisabledLayers: function () {\r
- var inputs = this._layerControlInputs,\r
- input,\r
- layer,\r
- zoom = this._map.getZoom();\r
-\r
- for (var i = inputs.length - 1; i >= 0; i--) {\r
- input = inputs[i];\r
- layer = this._getLayer(input.layerId).layer;\r
- input.disabled = (layer.options.minZoom !== undefined && zoom < layer.options.minZoom) ||\r
- (layer.options.maxZoom !== undefined && zoom > layer.options.maxZoom);\r
-\r
- }\r
- },\r
-\r
- _expandIfNotCollapsed: function () {\r
- if (this._map && !this.options.collapsed) {\r
- this.expand();\r
- }\r
- return this;\r
- },\r
-\r
- _expand: function () {\r
- // Backward compatibility, remove me in 1.1.\r
- return this.expand();\r
- },\r
-\r
- _collapse: function () {\r
- // Backward compatibility, remove me in 1.1.\r
- return this.collapse();\r
- }\r
-\r
- });\r
-\r
-\r
- // @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)\r
- // Creates a layers control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.\r
- var layers = function (baseLayers, overlays, options) {\r
- return new Layers(baseLayers, overlays, options);\r
- };
-
- /*\r
- * @class Control.Zoom\r
- * @aka L.Control.Zoom\r
- * @inherits Control\r
- *\r
- * A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its [`zoomControl` option](#map-zoomcontrol) to `false`. Extends `Control`.\r
- */\r
-\r
- var Zoom = Control.extend({\r
- // @section\r
- // @aka Control.Zoom options\r
- options: {\r
- position: 'topleft',\r
-\r
- // @option zoomInText: String = '+'\r
- // The text set on the 'zoom in' button.\r
- zoomInText: '+',\r
-\r
- // @option zoomInTitle: String = 'Zoom in'\r
- // The title set on the 'zoom in' button.\r
- zoomInTitle: 'Zoom in',\r
-\r
- // @option zoomOutText: String = '−'\r
- // The text set on the 'zoom out' button.\r
- zoomOutText: '−',\r
-\r
- // @option zoomOutTitle: String = 'Zoom out'\r
- // The title set on the 'zoom out' button.\r
- zoomOutTitle: 'Zoom out'\r
- },\r
-\r
- onAdd: function (map) {\r
- var zoomName = 'leaflet-control-zoom',\r
- container = create$1('div', zoomName + ' leaflet-bar'),\r
- options = this.options;\r
-\r
- this._zoomInButton = this._createButton(options.zoomInText, options.zoomInTitle,\r
- zoomName + '-in', container, this._zoomIn);\r
- this._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle,\r
- zoomName + '-out', container, this._zoomOut);\r
-\r
- this._updateDisabled();\r
- map.on('zoomend zoomlevelschange', this._updateDisabled, this);\r
-\r
- return container;\r
- },\r
-\r
- onRemove: function (map) {\r
- map.off('zoomend zoomlevelschange', this._updateDisabled, this);\r
- },\r
-\r
- disable: function () {\r
- this._disabled = true;\r
- this._updateDisabled();\r
- return this;\r
- },\r
-\r
- enable: function () {\r
- this._disabled = false;\r
- this._updateDisabled();\r
- return this;\r
- },\r
-\r
- _zoomIn: function (e) {\r
- if (!this._disabled && this._map._zoom < this._map.getMaxZoom()) {\r
- this._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r
- }\r
- },\r
-\r
- _zoomOut: function (e) {\r
- if (!this._disabled && this._map._zoom > this._map.getMinZoom()) {\r
- this._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r
- }\r
- },\r
-\r
- _createButton: function (html, title, className, container, fn) {\r
- var link = create$1('a', className, container);\r
- link.innerHTML = html;\r
- link.href = '#';\r
- link.title = title;\r
-\r
- /*\r
- * Will force screen readers like VoiceOver to read this as "Zoom in - button"\r
- */\r
- link.setAttribute('role', 'button');\r
- link.setAttribute('aria-label', title);\r
-\r
- disableClickPropagation(link);\r
- on(link, 'click', stop);\r
- on(link, 'click', fn, this);\r
- on(link, 'click', this._refocusOnMap, this);\r
-\r
- return link;\r
- },\r
-\r
- _updateDisabled: function () {\r
- var map = this._map,\r
- className = 'leaflet-disabled';\r
-\r
- removeClass(this._zoomInButton, className);\r
- removeClass(this._zoomOutButton, className);\r
-\r
- if (this._disabled || map._zoom === map.getMinZoom()) {\r
- addClass(this._zoomOutButton, className);\r
- }\r
- if (this._disabled || map._zoom === map.getMaxZoom()) {\r
- addClass(this._zoomInButton, className);\r
- }\r
- }\r
- });\r
-\r
- // @namespace Map\r
- // @section Control options\r
- // @option zoomControl: Boolean = true\r
- // Whether a [zoom control](#control-zoom) is added to the map by default.\r
- Map.mergeOptions({\r
- zoomControl: true\r
- });\r
-\r
- Map.addInitHook(function () {\r
- if (this.options.zoomControl) {\r
- // @section Controls\r
- // @property zoomControl: Control.Zoom\r
- // The default zoom control (only available if the\r
- // [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map).\r
- this.zoomControl = new Zoom();\r
- this.addControl(this.zoomControl);\r
- }\r
- });\r
-\r
- // @namespace Control.Zoom\r
- // @factory L.control.zoom(options: Control.Zoom options)\r
- // Creates a zoom control\r
- var zoom = function (options) {\r
- return new Zoom(options);\r
- };
-
- /*
- * @class Control.Scale
- * @aka L.Control.Scale
- * @inherits Control
- *
- * A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends `Control`.
- *
- * @example
- *
- * ```js
- * L.control.scale().addTo(map);
- * ```
- */
-
- var Scale = Control.extend({
- // @section
- // @aka Control.Scale options
- options: {
- position: 'bottomleft',
-
- // @option maxWidth: Number = 100
- // Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
- maxWidth: 100,
-
- // @option metric: Boolean = True
- // Whether to show the metric scale line (m/km).
- metric: true,
-
- // @option imperial: Boolean = True
- // Whether to show the imperial scale line (mi/ft).
- imperial: true
-
- // @option updateWhenIdle: Boolean = false
- // If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).
- },
-
- onAdd: function (map) {
- var className = 'leaflet-control-scale',
- container = create$1('div', className),
- options = this.options;
-
- this._addScales(options, className + '-line', container);
-
- map.on(options.updateWhenIdle ? 'moveend' : 'move', this._update, this);
- map.whenReady(this._update, this);
-
- return container;
- },
-
- onRemove: function (map) {
- map.off(this.options.updateWhenIdle ? 'moveend' : 'move', this._update, this);
- },
-
- _addScales: function (options, className, container) {
- if (options.metric) {
- this._mScale = create$1('div', className, container);
- }
- if (options.imperial) {
- this._iScale = create$1('div', className, container);
- }
- },
-
- _update: function () {
- var map = this._map,
- y = map.getSize().y / 2;
-
- var maxMeters = map.distance(
- map.containerPointToLatLng([0, y]),
- map.containerPointToLatLng([this.options.maxWidth, y]));
-
- this._updateScales(maxMeters);
- },
-
- _updateScales: function (maxMeters) {
- if (this.options.metric && maxMeters) {
- this._updateMetric(maxMeters);
- }
- if (this.options.imperial && maxMeters) {
- this._updateImperial(maxMeters);
- }
- },
-
- _updateMetric: function (maxMeters) {
- var meters = this._getRoundNum(maxMeters),
- label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km';
-
- this._updateScale(this._mScale, label, meters / maxMeters);
- },
-
- _updateImperial: function (maxMeters) {
- var maxFeet = maxMeters * 3.2808399,
- maxMiles, miles, feet;
-
- if (maxFeet > 5280) {
- maxMiles = maxFeet / 5280;
- miles = this._getRoundNum(maxMiles);
- this._updateScale(this._iScale, miles + ' mi', miles / maxMiles);
-
- } else {
- feet = this._getRoundNum(maxFeet);
- this._updateScale(this._iScale, feet + ' ft', feet / maxFeet);
- }
- },
-
- _updateScale: function (scale, text, ratio) {
- scale.style.width = Math.round(this.options.maxWidth * ratio) + 'px';
- scale.innerHTML = text;
- },
-
- _getRoundNum: function (num) {
- var pow10 = Math.pow(10, (Math.floor(num) + '').length - 1),
- d = num / pow10;
-
- d = d >= 10 ? 10 :
- d >= 5 ? 5 :
- d >= 3 ? 3 :
- d >= 2 ? 2 : 1;
-
- return pow10 * d;
- }
- });
-
-
- // @factory L.control.scale(options?: Control.Scale options)
- // Creates an scale control with the given options.
- var scale = function (options) {
- return new Scale(options);
- };
-
- /*\r
- * @class Control.Attribution\r
- * @aka L.Control.Attribution\r
- * @inherits Control\r
- *\r
- * The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. Extends Control.\r
- */\r
-\r
- var Attribution = Control.extend({\r
- // @section\r
- // @aka Control.Attribution options\r
- options: {\r
- position: 'bottomright',\r
-\r
- // @option prefix: String = 'Leaflet'\r
- // The HTML text shown before the attributions. Pass `false` to disable.\r
- prefix: '<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'\r
- },\r
-\r
- initialize: function (options) {\r
- setOptions(this, options);\r
-\r
- this._attributions = {};\r
- },\r
-\r
- onAdd: function (map) {\r
- map.attributionControl = this;\r
- this._container = create$1('div', 'leaflet-control-attribution');\r
- disableClickPropagation(this._container);\r
-\r
- // TODO ugly, refactor\r
- for (var i in map._layers) {\r
- if (map._layers[i].getAttribution) {\r
- this.addAttribution(map._layers[i].getAttribution());\r
- }\r
- }\r
-\r
- this._update();\r
-\r
- return this._container;\r
- },\r
-\r
- // @method setPrefix(prefix: String): this\r
- // Sets the text before the attributions.\r
- setPrefix: function (prefix) {\r
- this.options.prefix = prefix;\r
- this._update();\r
- return this;\r
- },\r
-\r
- // @method addAttribution(text: String): this\r
- // Adds an attribution text (e.g. `'Vector data © Mapbox'`).\r
- addAttribution: function (text) {\r
- if (!text) { return this; }\r
-\r
- if (!this._attributions[text]) {\r
- this._attributions[text] = 0;\r
- }\r
- this._attributions[text]++;\r
-\r
- this._update();\r
-\r
- return this;\r
- },\r
-\r
- // @method removeAttribution(text: String): this\r
- // Removes an attribution text.\r
- removeAttribution: function (text) {\r
- if (!text) { return this; }\r
-\r
- if (this._attributions[text]) {\r
- this._attributions[text]--;\r
- this._update();\r
- }\r
-\r
- return this;\r
- },\r
-\r
- _update: function () {\r
- if (!this._map) { return; }\r
-\r
- var attribs = [];\r
-\r
- for (var i in this._attributions) {\r
- if (this._attributions[i]) {\r
- attribs.push(i);\r
- }\r
- }\r
-\r
- var prefixAndAttribs = [];\r
-\r
- if (this.options.prefix) {\r
- prefixAndAttribs.push(this.options.prefix);\r
- }\r
- if (attribs.length) {\r
- prefixAndAttribs.push(attribs.join(', '));\r
- }\r
-\r
- this._container.innerHTML = prefixAndAttribs.join(' | ');\r
- }\r
- });\r
-\r
- // @namespace Map\r
- // @section Control options\r
- // @option attributionControl: Boolean = true\r
- // Whether a [attribution control](#control-attribution) is added to the map by default.\r
- Map.mergeOptions({\r
- attributionControl: true\r
- });\r
-\r
- Map.addInitHook(function () {\r
- if (this.options.attributionControl) {\r
- new Attribution().addTo(this);\r
- }\r
- });\r
-\r
- // @namespace Control.Attribution\r
- // @factory L.control.attribution(options: Control.Attribution options)\r
- // Creates an attribution control.\r
- var attribution = function (options) {\r
- return new Attribution(options);\r
- };
-
- Control.Layers = Layers;
- Control.Zoom = Zoom;
- Control.Scale = Scale;
- Control.Attribution = Attribution;
-
- control.layers = layers;
- control.zoom = zoom;
- control.scale = scale;
- control.attribution = attribution;
-
- /*
- L.Handler is a base class for handler classes that are used internally to inject
- interaction features like dragging to classes like Map and Marker.
- */
-
- // @class Handler
- // @aka L.Handler
- // Abstract class for map interaction handlers
-
- var Handler = Class.extend({
- initialize: function (map) {
- this._map = map;
- },
-
- // @method enable(): this
- // Enables the handler
- enable: function () {
- if (this._enabled) { return this; }
-
- this._enabled = true;
- this.addHooks();
- return this;
- },
-
- // @method disable(): this
- // Disables the handler
- disable: function () {
- if (!this._enabled) { return this; }
-
- this._enabled = false;
- this.removeHooks();
- return this;
- },
-
- // @method enabled(): Boolean
- // Returns `true` if the handler is enabled
- enabled: function () {
- return !!this._enabled;
- }
-
- // @section Extension methods
- // Classes inheriting from `Handler` must implement the two following methods:
- // @method addHooks()
- // Called when the handler is enabled, should add event hooks.
- // @method removeHooks()
- // Called when the handler is disabled, should remove the event hooks added previously.
- });
-
- // @section There is static function which can be called without instantiating L.Handler:
- // @function addTo(map: Map, name: String): this
- // Adds a new Handler to the given map with the given name.
- Handler.addTo = function (map, name) {
- map.addHandler(name, this);
- return this;
- };
-
- var Mixin = {Events: Events};
-
- /*\r
- * @class Draggable\r
- * @aka L.Draggable\r
- * @inherits Evented\r
- *\r
- * A class for making DOM elements draggable (including touch support).\r
- * Used internally for map and marker dragging. Only works for elements\r
- * that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).\r
- *\r
- * @example\r
- * ```js\r
- * var draggable = new L.Draggable(elementToDrag);\r
- * draggable.enable();\r
- * ```\r
- */\r
-\r
- var START = touch ? 'touchstart mousedown' : 'mousedown';\r
- var END = {\r
- mousedown: 'mouseup',\r
- touchstart: 'touchend',\r
- pointerdown: 'touchend',\r
- MSPointerDown: 'touchend'\r
- };\r
- var MOVE = {\r
- mousedown: 'mousemove',\r
- touchstart: 'touchmove',\r
- pointerdown: 'touchmove',\r
- MSPointerDown: 'touchmove'\r
- };\r
-\r
-\r
- var Draggable = Evented.extend({\r
-\r
- options: {\r
- // @section\r
- // @aka Draggable options\r
- // @option clickTolerance: Number = 3\r
- // The max number of pixels a user can shift the mouse pointer during a click\r
- // for it to be considered a valid click (as opposed to a mouse drag).\r
- clickTolerance: 3\r
- },\r
-\r
- // @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)\r
- // Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).\r
- initialize: function (element, dragStartTarget, preventOutline$$1, options) {\r
- setOptions(this, options);\r
-\r
- this._element = element;\r
- this._dragStartTarget = dragStartTarget || element;\r
- this._preventOutline = preventOutline$$1;\r
- },\r
-\r
- // @method enable()\r
- // Enables the dragging ability\r
- enable: function () {\r
- if (this._enabled) { return; }\r
-\r
- on(this._dragStartTarget, START, this._onDown, this);\r
-\r
- this._enabled = true;\r
- },\r
-\r
- // @method disable()\r
- // Disables the dragging ability\r
- disable: function () {\r
- if (!this._enabled) { return; }\r
-\r
- // If we're currently dragging this draggable,\r
- // disabling it counts as first ending the drag.\r
- if (Draggable._dragging === this) {\r
- this.finishDrag();\r
- }\r
-\r
- off(this._dragStartTarget, START, this._onDown, this);\r
-\r
- this._enabled = false;\r
- this._moved = false;\r
- },\r
-\r
- _onDown: function (e) {\r
- // Ignore simulated events, since we handle both touch and\r
- // mouse explicitly; otherwise we risk getting duplicates of\r
- // touch events, see #4315.\r
- // Also ignore the event if disabled; this happens in IE11\r
- // under some circumstances, see #3666.\r
- if (e._simulated || !this._enabled) { return; }\r
-\r
- this._moved = false;\r
-\r
- if (hasClass(this._element, 'leaflet-zoom-anim')) { return; }\r
-\r
- if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }\r
- Draggable._dragging = this; // Prevent dragging multiple objects at once.\r
-\r
- if (this._preventOutline) {\r
- preventOutline(this._element);\r
- }\r
-\r
- disableImageDrag();\r
- disableTextSelection();\r
-\r
- if (this._moving) { return; }\r
-\r
- // @event down: Event\r
- // Fired when a drag is about to start.\r
- this.fire('down');\r
-\r
- var first = e.touches ? e.touches[0] : e,\r
- sizedParent = getSizedParentNode(this._element);\r
-\r
- this._startPoint = new Point(first.clientX, first.clientY);\r
-\r
- // Cache the scale, so that we can continuously compensate for it during drag (_onMove).\r
- this._parentScale = getScale(sizedParent);\r
-\r
- on(document, MOVE[e.type], this._onMove, this);\r
- on(document, END[e.type], this._onUp, this);\r
- },\r
-\r
- _onMove: function (e) {\r
- // Ignore simulated events, since we handle both touch and\r
- // mouse explicitly; otherwise we risk getting duplicates of\r
- // touch events, see #4315.\r
- // Also ignore the event if disabled; this happens in IE11\r
- // under some circumstances, see #3666.\r
- if (e._simulated || !this._enabled) { return; }\r
-\r
- if (e.touches && e.touches.length > 1) {\r
- this._moved = true;\r
- return;\r
- }\r
-\r
- var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e),\r
- offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint);\r
-\r
- if (!offset.x && !offset.y) { return; }\r
- if (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { return; }\r
-\r
- // We assume that the parent container's position, border and scale do not change for the duration of the drag.\r
- // Therefore there is no need to account for the position and border (they are eliminated by the subtraction)\r
- // and we can use the cached value for the scale.\r
- offset.x /= this._parentScale.x;\r
- offset.y /= this._parentScale.y;\r
-\r
- preventDefault(e);\r
-\r
- if (!this._moved) {\r
- // @event dragstart: Event\r
- // Fired when a drag starts\r
- this.fire('dragstart');\r
-\r
- this._moved = true;\r
- this._startPos = getPosition(this._element).subtract(offset);\r
-\r
- addClass(document.body, 'leaflet-dragging');\r
-\r
- this._lastTarget = e.target || e.srcElement;\r
- // IE and Edge do not give the <use> element, so fetch it\r
- // if necessary\r
- if (window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance) {\r
- this._lastTarget = this._lastTarget.correspondingUseElement;\r
- }\r
- addClass(this._lastTarget, 'leaflet-drag-target');\r
- }\r
-\r
- this._newPos = this._startPos.add(offset);\r
- this._moving = true;\r
-\r
- cancelAnimFrame(this._animRequest);\r
- this._lastEvent = e;\r
- this._animRequest = requestAnimFrame(this._updatePosition, this, true);\r
- },\r
-\r
- _updatePosition: function () {\r
- var e = {originalEvent: this._lastEvent};\r
-\r
- // @event predrag: Event\r
- // Fired continuously during dragging *before* each corresponding\r
- // update of the element's position.\r
- this.fire('predrag', e);\r
- setPosition(this._element, this._newPos);\r
-\r
- // @event drag: Event\r
- // Fired continuously during dragging.\r
- this.fire('drag', e);\r
- },\r
-\r
- _onUp: function (e) {\r
- // Ignore simulated events, since we handle both touch and\r
- // mouse explicitly; otherwise we risk getting duplicates of\r
- // touch events, see #4315.\r
- // Also ignore the event if disabled; this happens in IE11\r
- // under some circumstances, see #3666.\r
- if (e._simulated || !this._enabled) { return; }\r
- this.finishDrag();\r
- },\r
-\r
- finishDrag: function () {\r
- removeClass(document.body, 'leaflet-dragging');\r
-\r
- if (this._lastTarget) {\r
- removeClass(this._lastTarget, 'leaflet-drag-target');\r
- this._lastTarget = null;\r
- }\r
-\r
- for (var i in MOVE) {\r
- off(document, MOVE[i], this._onMove, this);\r
- off(document, END[i], this._onUp, this);\r
- }\r
-\r
- enableImageDrag();\r
- enableTextSelection();\r
-\r
- if (this._moved && this._moving) {\r
- // ensure drag is not fired after dragend\r
- cancelAnimFrame(this._animRequest);\r
-\r
- // @event dragend: DragEndEvent\r
- // Fired when the drag ends.\r
- this.fire('dragend', {\r
- distance: this._newPos.distanceTo(this._startPos)\r
- });\r
- }\r
-\r
- this._moving = false;\r
- Draggable._dragging = false;\r
- }\r
-\r
- });
-
- /*\r
- * @namespace LineUtil\r
- *\r
- * Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.\r
- */\r
-\r
- // Simplify polyline with vertex reduction and Douglas-Peucker simplification.\r
- // Improves rendering performance dramatically by lessening the number of points to draw.\r
-\r
- // @function simplify(points: Point[], tolerance: Number): Point[]\r
- // Dramatically reduces the number of points in a polyline while retaining\r
- // its shape and returns a new array of simplified points, using the\r
- // [Douglas-Peucker algorithm](http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm).\r
- // Used for a huge performance boost when processing/displaying Leaflet polylines for\r
- // each zoom level and also reducing visual noise. tolerance affects the amount of\r
- // simplification (lesser value means higher quality but slower and with more points).\r
- // Also released as a separated micro-library [Simplify.js](http://mourner.github.com/simplify-js/).\r
- function simplify(points, tolerance) {\r
- if (!tolerance || !points.length) {\r
- return points.slice();\r
- }\r
-\r
- var sqTolerance = tolerance * tolerance;\r
-\r
- // stage 1: vertex reduction\r
- points = _reducePoints(points, sqTolerance);\r
-\r
- // stage 2: Douglas-Peucker simplification\r
- points = _simplifyDP(points, sqTolerance);\r
-\r
- return points;\r
- }\r
-\r
- // @function pointToSegmentDistance(p: Point, p1: Point, p2: Point): Number\r
- // Returns the distance between point `p` and segment `p1` to `p2`.\r
- function pointToSegmentDistance(p, p1, p2) {\r
- return Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, true));\r
- }\r
-\r
- // @function closestPointOnSegment(p: Point, p1: Point, p2: Point): Number\r
- // Returns the closest point from a point `p` on a segment `p1` to `p2`.\r
- function closestPointOnSegment(p, p1, p2) {\r
- return _sqClosestPointOnSegment(p, p1, p2);\r
- }\r
-\r
- // Douglas-Peucker simplification, see http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm\r
- function _simplifyDP(points, sqTolerance) {\r
-\r
- var len = points.length,\r
- ArrayConstructor = typeof Uint8Array !== undefined + '' ? Uint8Array : Array,\r
- markers = new ArrayConstructor(len);\r
-\r
- markers[0] = markers[len - 1] = 1;\r
-\r
- _simplifyDPStep(points, markers, sqTolerance, 0, len - 1);\r
-\r
- var i,\r
- newPoints = [];\r
-\r
- for (i = 0; i < len; i++) {\r
- if (markers[i]) {\r
- newPoints.push(points[i]);\r
- }\r
- }\r
-\r
- return newPoints;\r
- }\r
-\r
- function _simplifyDPStep(points, markers, sqTolerance, first, last) {\r
-\r
- var maxSqDist = 0,\r
- index, i, sqDist;\r
-\r
- for (i = first + 1; i <= last - 1; i++) {\r
- sqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], true);\r
-\r
- if (sqDist > maxSqDist) {\r
- index = i;\r
- maxSqDist = sqDist;\r
- }\r
- }\r
-\r
- if (maxSqDist > sqTolerance) {\r
- markers[index] = 1;\r
-\r
- _simplifyDPStep(points, markers, sqTolerance, first, index);\r
- _simplifyDPStep(points, markers, sqTolerance, index, last);\r
- }\r
- }\r
-\r
- // reduce points that are too close to each other to a single point\r
- function _reducePoints(points, sqTolerance) {\r
- var reducedPoints = [points[0]];\r
-\r
- for (var i = 1, prev = 0, len = points.length; i < len; i++) {\r
- if (_sqDist(points[i], points[prev]) > sqTolerance) {\r
- reducedPoints.push(points[i]);\r
- prev = i;\r
- }\r
- }\r
- if (prev < len - 1) {\r
- reducedPoints.push(points[len - 1]);\r
- }\r
- return reducedPoints;\r
- }\r
-\r
- var _lastCode;\r
-\r
- // @function clipSegment(a: Point, b: Point, bounds: Bounds, useLastCode?: Boolean, round?: Boolean): Point[]|Boolean\r
- // Clips the segment a to b by rectangular bounds with the\r
- // [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm)\r
- // (modifying the segment points directly!). Used by Leaflet to only show polyline\r
- // points that are on the screen or near, increasing performance.\r
- function clipSegment(a, b, bounds, useLastCode, round) {\r
- var codeA = useLastCode ? _lastCode : _getBitCode(a, bounds),\r
- codeB = _getBitCode(b, bounds),\r
-\r
- codeOut, p, newCode;\r
-\r
- // save 2nd code to avoid calculating it on the next segment\r
- _lastCode = codeB;\r
-\r
- while (true) {\r
- // if a,b is inside the clip window (trivial accept)\r
- if (!(codeA | codeB)) {\r
- return [a, b];\r
- }\r
-\r
- // if a,b is outside the clip window (trivial reject)\r
- if (codeA & codeB) {\r
- return false;\r
- }\r
-\r
- // other cases\r
- codeOut = codeA || codeB;\r
- p = _getEdgeIntersection(a, b, codeOut, bounds, round);\r
- newCode = _getBitCode(p, bounds);\r
-\r
- if (codeOut === codeA) {\r
- a = p;\r
- codeA = newCode;\r
- } else {\r
- b = p;\r
- codeB = newCode;\r
- }\r
- }\r
- }\r
-\r
- function _getEdgeIntersection(a, b, code, bounds, round) {\r
- var dx = b.x - a.x,\r
- dy = b.y - a.y,\r
- min = bounds.min,\r
- max = bounds.max,\r
- x, y;\r
-\r
- if (code & 8) { // top\r
- x = a.x + dx * (max.y - a.y) / dy;\r
- y = max.y;\r
-\r
- } else if (code & 4) { // bottom\r
- x = a.x + dx * (min.y - a.y) / dy;\r
- y = min.y;\r
-\r
- } else if (code & 2) { // right\r
- x = max.x;\r
- y = a.y + dy * (max.x - a.x) / dx;\r
-\r
- } else if (code & 1) { // left\r
- x = min.x;\r
- y = a.y + dy * (min.x - a.x) / dx;\r
- }\r
-\r
- return new Point(x, y, round);\r
- }\r
-\r
- function _getBitCode(p, bounds) {\r
- var code = 0;\r
-\r
- if (p.x < bounds.min.x) { // left\r
- code |= 1;\r
- } else if (p.x > bounds.max.x) { // right\r
- code |= 2;\r
- }\r
-\r
- if (p.y < bounds.min.y) { // bottom\r
- code |= 4;\r
- } else if (p.y > bounds.max.y) { // top\r
- code |= 8;\r
- }\r
-\r
- return code;\r
- }\r
-\r
- // square distance (to avoid unnecessary Math.sqrt calls)\r
- function _sqDist(p1, p2) {\r
- var dx = p2.x - p1.x,\r
- dy = p2.y - p1.y;\r
- return dx * dx + dy * dy;\r
- }\r
-\r
- // return closest point on segment or distance to that point\r
- function _sqClosestPointOnSegment(p, p1, p2, sqDist) {\r
- var x = p1.x,\r
- y = p1.y,\r
- dx = p2.x - x,\r
- dy = p2.y - y,\r
- dot = dx * dx + dy * dy,\r
- t;\r
-\r
- if (dot > 0) {\r
- t = ((p.x - x) * dx + (p.y - y) * dy) / dot;\r
-\r
- if (t > 1) {\r
- x = p2.x;\r
- y = p2.y;\r
- } else if (t > 0) {\r
- x += dx * t;\r
- y += dy * t;\r
- }\r
- }\r
-\r
- dx = p.x - x;\r
- dy = p.y - y;\r
-\r
- return sqDist ? dx * dx + dy * dy : new Point(x, y);\r
- }\r
-\r
-\r
- // @function isFlat(latlngs: LatLng[]): Boolean\r
- // Returns true if `latlngs` is a flat array, false is nested.\r
- function isFlat(latlngs) {\r
- return !isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');\r
- }\r
-\r
- function _flat(latlngs) {\r
- console.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');\r
- return isFlat(latlngs);\r
- }
-
- var LineUtil = ({
- simplify: simplify,
- pointToSegmentDistance: pointToSegmentDistance,
- closestPointOnSegment: closestPointOnSegment,
- clipSegment: clipSegment,
- _getEdgeIntersection: _getEdgeIntersection,
- _getBitCode: _getBitCode,
- _sqClosestPointOnSegment: _sqClosestPointOnSegment,
- isFlat: isFlat,
- _flat: _flat
- });
-
- /*\r
- * @namespace PolyUtil\r
- * Various utility functions for polygon geometries.\r
- */\r
-\r
- /* @function clipPolygon(points: Point[], bounds: Bounds, round?: Boolean): Point[]\r
- * Clips the polygon geometry defined by the given `points` by the given bounds (using the [Sutherland-Hodgman algorithm](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm)).\r
- * Used by Leaflet to only show polygon points that are on the screen or near, increasing\r
- * performance. Note that polygon points needs different algorithm for clipping\r
- * than polyline, so there's a separate method for it.\r
- */\r
- function clipPolygon(points, bounds, round) {\r
- var clippedPoints,\r
- edges = [1, 4, 2, 8],\r
- i, j, k,\r
- a, b,\r
- len, edge, p;\r
-\r
- for (i = 0, len = points.length; i < len; i++) {\r
- points[i]._code = _getBitCode(points[i], bounds);\r
- }\r
-\r
- // for each edge (left, bottom, right, top)\r
- for (k = 0; k < 4; k++) {\r
- edge = edges[k];\r
- clippedPoints = [];\r
-\r
- for (i = 0, len = points.length, j = len - 1; i < len; j = i++) {\r
- a = points[i];\r
- b = points[j];\r
-\r
- // if a is inside the clip window\r
- if (!(a._code & edge)) {\r
- // if b is outside the clip window (a->b goes out of screen)\r
- if (b._code & edge) {\r
- p = _getEdgeIntersection(b, a, edge, bounds, round);\r
- p._code = _getBitCode(p, bounds);\r
- clippedPoints.push(p);\r
- }\r
- clippedPoints.push(a);\r
-\r
- // else if b is inside the clip window (a->b enters the screen)\r
- } else if (!(b._code & edge)) {\r
- p = _getEdgeIntersection(b, a, edge, bounds, round);\r
- p._code = _getBitCode(p, bounds);\r
- clippedPoints.push(p);\r
- }\r
- }\r
- points = clippedPoints;\r
- }\r
-\r
- return points;\r
- }
-
- var PolyUtil = ({
- clipPolygon: clipPolygon
- });
-
- /*\r
- * @namespace Projection\r
- * @section\r
- * Leaflet comes with a set of already defined Projections out of the box:\r
- *\r
- * @projection L.Projection.LonLat\r
- *\r
- * Equirectangular, or Plate Carree projection — the most simple projection,\r
- * mostly used by GIS enthusiasts. Directly maps `x` as longitude, and `y` as\r
- * latitude. Also suitable for flat worlds, e.g. game maps. Used by the\r
- * `EPSG:4326` and `Simple` CRS.\r
- */\r
-\r
- var LonLat = {\r
- project: function (latlng) {\r
- return new Point(latlng.lng, latlng.lat);\r
- },\r
-\r
- unproject: function (point) {\r
- return new LatLng(point.y, point.x);\r
- },\r
-\r
- bounds: new Bounds([-180, -90], [180, 90])\r
- };
-
- /*\r
- * @namespace Projection\r
- * @projection L.Projection.Mercator\r
- *\r
- * Elliptical Mercator projection — more complex than Spherical Mercator. Assumes that Earth is an ellipsoid. Used by the EPSG:3395 CRS.\r
- */\r
-\r
- var Mercator = {\r
- R: 6378137,\r
- R_MINOR: 6356752.314245179,\r
-\r
- bounds: new Bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),\r
-\r
- project: function (latlng) {\r
- var d = Math.PI / 180,\r
- r = this.R,\r
- y = latlng.lat * d,\r
- tmp = this.R_MINOR / r,\r
- e = Math.sqrt(1 - tmp * tmp),\r
- con = e * Math.sin(y);\r
-\r
- var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\r
- y = -r * Math.log(Math.max(ts, 1E-10));\r
-\r
- return new Point(latlng.lng * d * r, y);\r
- },\r
-\r
- unproject: function (point) {\r
- var d = 180 / Math.PI,\r
- r = this.R,\r
- tmp = this.R_MINOR / r,\r
- e = Math.sqrt(1 - tmp * tmp),\r
- ts = Math.exp(-point.y / r),\r
- phi = Math.PI / 2 - 2 * Math.atan(ts);\r
-\r
- for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\r
- con = e * Math.sin(phi);\r
- con = Math.pow((1 - con) / (1 + con), e / 2);\r
- dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\r
- phi += dphi;\r
- }\r
-\r
- return new LatLng(phi * d, point.x * d / r);\r
- }\r
- };
-
- /*
- * @class Projection
-
- * An object with methods for projecting geographical coordinates of the world onto
- * a flat surface (and back). See [Map projection](http://en.wikipedia.org/wiki/Map_projection).
-
- * @property bounds: Bounds
- * The bounds (specified in CRS units) where the projection is valid
-
- * @method project(latlng: LatLng): Point
- * Projects geographical coordinates into a 2D point.
- * Only accepts actual `L.LatLng` instances, not arrays.
-
- * @method unproject(point: Point): LatLng
- * The inverse of `project`. Projects a 2D point into a geographical location.
- * Only accepts actual `L.Point` instances, not arrays.
-
- * Note that the projection instances do not inherit from Leaflet's `Class` object,
- * and can't be instantiated. Also, new classes can't inherit from them,
- * and methods can't be added to them with the `include` function.
-
- */
-
- var index = ({
- LonLat: LonLat,
- Mercator: Mercator,
- SphericalMercator: SphericalMercator
- });
-
- /*\r
- * @namespace CRS\r
- * @crs L.CRS.EPSG3395\r
- *\r
- * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.\r
- */\r
- var EPSG3395 = extend({}, Earth, {\r
- code: 'EPSG:3395',\r
- projection: Mercator,\r
-\r
- transformation: (function () {\r
- var scale = 0.5 / (Math.PI * Mercator.R);\r
- return toTransformation(scale, 0.5, -scale, 0.5);\r
- }())\r
- });
-
- /*\r
- * @namespace CRS\r
- * @crs L.CRS.EPSG4326\r
- *\r
- * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.\r
- *\r
- * Leaflet 1.0.x complies with the [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic),\r
- * which is a breaking change from 0.7.x behaviour. If you are using a `TileLayer`\r
- * with this CRS, ensure that there are two 256x256 pixel tiles covering the\r
- * whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),\r
- * or (-180,-90) for `TileLayer`s with [the `tms` option](#tilelayer-tms) set.\r
- */\r
-\r
- var EPSG4326 = extend({}, Earth, {\r
- code: 'EPSG:4326',\r
- projection: LonLat,\r
- transformation: toTransformation(1 / 180, 1, -1 / 180, 0.5)\r
- });
-
- /*
- * @namespace CRS
- * @crs L.CRS.Simple
- *
- * A simple CRS that maps longitude and latitude into `x` and `y` directly.
- * May be used for maps of flat surfaces (e.g. game maps). Note that the `y`
- * axis should still be inverted (going from bottom to top). `distance()` returns
- * simple euclidean distance.
- */
-
- var Simple = extend({}, CRS, {
- projection: LonLat,
- transformation: toTransformation(1, 0, -1, 0),
-
- scale: function (zoom) {
- return Math.pow(2, zoom);
- },
-
- zoom: function (scale) {
- return Math.log(scale) / Math.LN2;
- },
-
- distance: function (latlng1, latlng2) {
- var dx = latlng2.lng - latlng1.lng,
- dy = latlng2.lat - latlng1.lat;
-
- return Math.sqrt(dx * dx + dy * dy);
- },
-
- infinite: true
- });
-
- CRS.Earth = Earth;
- CRS.EPSG3395 = EPSG3395;
- CRS.EPSG3857 = EPSG3857;
- CRS.EPSG900913 = EPSG900913;
- CRS.EPSG4326 = EPSG4326;
- CRS.Simple = Simple;
-
- /*
- * @class Layer
- * @inherits Evented
- * @aka L.Layer
- * @aka ILayer
- *
- * A set of methods from the Layer base class that all Leaflet layers use.
- * Inherits all methods, options and events from `L.Evented`.
- *
- * @example
- *
- * ```js
- * var layer = L.marker(latlng).addTo(map);
- * layer.addTo(map);
- * layer.remove();
- * ```
- *
- * @event add: Event
- * Fired after the layer is added to a map
- *
- * @event remove: Event
- * Fired after the layer is removed from a map
- */
-
-
- var Layer = Evented.extend({
-
- // Classes extending `L.Layer` will inherit the following options:
- options: {
- // @option pane: String = 'overlayPane'
- // By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default.
- pane: 'overlayPane',
-
- // @option attribution: String = null
- // String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
- attribution: null,
-
- bubblingMouseEvents: true
- },
-
- /* @section
- * Classes extending `L.Layer` will inherit the following methods:
- *
- * @method addTo(map: Map|LayerGroup): this
- * Adds the layer to the given map or layer group.
- */
- addTo: function (map) {
- map.addLayer(this);
- return this;
- },
-
- // @method remove: this
- // Removes the layer from the map it is currently active on.
- remove: function () {
- return this.removeFrom(this._map || this._mapToAdd);
- },
-
- // @method removeFrom(map: Map): this
- // Removes the layer from the given map
- //
- // @alternative
- // @method removeFrom(group: LayerGroup): this
- // Removes the layer from the given `LayerGroup`
- removeFrom: function (obj) {
- if (obj) {
- obj.removeLayer(this);
- }
- return this;
- },
-
- // @method getPane(name? : String): HTMLElement
- // Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer.
- getPane: function (name) {
- return this._map.getPane(name ? (this.options[name] || name) : this.options.pane);
- },
-
- addInteractiveTarget: function (targetEl) {
- this._map._targets[stamp(targetEl)] = this;
- return this;
- },
-
- removeInteractiveTarget: function (targetEl) {
- delete this._map._targets[stamp(targetEl)];
- return this;
- },
-
- // @method getAttribution: String
- // Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).
- getAttribution: function () {
- return this.options.attribution;
- },
-
- _layerAdd: function (e) {
- var map = e.target;
-
- // check in case layer gets added and then removed before the map is ready
- if (!map.hasLayer(this)) { return; }
-
- this._map = map;
- this._zoomAnimated = map._zoomAnimated;
-
- if (this.getEvents) {
- var events = this.getEvents();
- map.on(events, this);
- this.once('remove', function () {
- map.off(events, this);
- }, this);
- }
-
- this.onAdd(map);
-
- if (this.getAttribution && map.attributionControl) {
- map.attributionControl.addAttribution(this.getAttribution());
- }
-
- this.fire('add');
- map.fire('layeradd', {layer: this});
- }
- });
-
- /* @section Extension methods
- * @uninheritable
- *
- * Every layer should extend from `L.Layer` and (re-)implement the following methods.
- *
- * @method onAdd(map: Map): this
- * Should contain code that creates DOM elements for the layer, adds them to `map panes` where they should belong and puts listeners on relevant map events. Called on [`map.addLayer(layer)`](#map-addlayer).
- *
- * @method onRemove(map: Map): this
- * Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in [`onAdd`](#layer-onadd). Called on [`map.removeLayer(layer)`](#map-removelayer).
- *
- * @method getEvents(): Object
- * This optional method should return an object like `{ viewreset: this._reset }` for [`addEventListener`](#evented-addeventlistener). The event handlers in this object will be automatically added and removed from the map with your layer.
- *
- * @method getAttribution(): String
- * This optional method should return a string containing HTML to be shown on the `Attribution control` whenever the layer is visible.
- *
- * @method beforeAdd(map: Map): this
- * Optional method. Called on [`map.addLayer(layer)`](#map-addlayer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
- */
-
-
- /* @namespace Map
- * @section Layer events
- *
- * @event layeradd: LayerEvent
- * Fired when a new layer is added to the map.
- *
- * @event layerremove: LayerEvent
- * Fired when some layer is removed from the map
- *
- * @section Methods for Layers and Controls
- */
- Map.include({
- // @method addLayer(layer: Layer): this
- // Adds the given layer to the map
- addLayer: function (layer) {
- if (!layer._layerAdd) {
- throw new Error('The provided object is not a Layer.');
- }
-
- var id = stamp(layer);
- if (this._layers[id]) { return this; }
- this._layers[id] = layer;
-
- layer._mapToAdd = this;
-
- if (layer.beforeAdd) {
- layer.beforeAdd(this);
- }
-
- this.whenReady(layer._layerAdd, layer);
-
- return this;
- },
-
- // @method removeLayer(layer: Layer): this
- // Removes the given layer from the map.
- removeLayer: function (layer) {
- var id = stamp(layer);
-
- if (!this._layers[id]) { return this; }
-
- if (this._loaded) {
- layer.onRemove(this);
- }
-
- if (layer.getAttribution && this.attributionControl) {
- this.attributionControl.removeAttribution(layer.getAttribution());
- }
-
- delete this._layers[id];
-
- if (this._loaded) {
- this.fire('layerremove', {layer: layer});
- layer.fire('remove');
- }
-
- layer._map = layer._mapToAdd = null;
-
- return this;
- },
-
- // @method hasLayer(layer: Layer): Boolean
- // Returns `true` if the given layer is currently added to the map
- hasLayer: function (layer) {
- return !!layer && (stamp(layer) in this._layers);
- },
-
- /* @method eachLayer(fn: Function, context?: Object): this
- * Iterates over the layers of the map, optionally specifying context of the iterator function.
- * ```
- * map.eachLayer(function(layer){
- * layer.bindPopup('Hello');
- * });
- * ```
- */
- eachLayer: function (method, context) {
- for (var i in this._layers) {
- method.call(context, this._layers[i]);
- }
- return this;
- },
-
- _addLayers: function (layers) {
- layers = layers ? (isArray(layers) ? layers : [layers]) : [];
-
- for (var i = 0, len = layers.length; i < len; i++) {
- this.addLayer(layers[i]);
- }
- },
-
- _addZoomLimit: function (layer) {
- if (isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {
- this._zoomBoundLayers[stamp(layer)] = layer;
- this._updateZoomLevels();
- }
- },
-
- _removeZoomLimit: function (layer) {
- var id = stamp(layer);
-
- if (this._zoomBoundLayers[id]) {
- delete this._zoomBoundLayers[id];
- this._updateZoomLevels();
- }
- },
-
- _updateZoomLevels: function () {
- var minZoom = Infinity,
- maxZoom = -Infinity,
- oldZoomSpan = this._getZoomSpan();
-
- for (var i in this._zoomBoundLayers) {
- var options = this._zoomBoundLayers[i].options;
-
- minZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom);
- maxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom);
- }
-
- this._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom;
- this._layersMinZoom = minZoom === Infinity ? undefined : minZoom;
-
- // @section Map state change events
- // @event zoomlevelschange: Event
- // Fired when the number of zoomlevels on the map is changed due
- // to adding or removing a layer.
- if (oldZoomSpan !== this._getZoomSpan()) {
- this.fire('zoomlevelschange');
- }
-
- if (this.options.maxZoom === undefined && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) {
- this.setZoom(this._layersMaxZoom);
- }
- if (this.options.minZoom === undefined && this._layersMinZoom && this.getZoom() < this._layersMinZoom) {
- this.setZoom(this._layersMinZoom);
- }
- }
- });
-
- /*\r
- * @class LayerGroup\r
- * @aka L.LayerGroup\r
- * @inherits Layer\r
- *\r
- * Used to group several layers and handle them as one. If you add it to the map,\r
- * any layers added or removed from the group will be added/removed on the map as\r
- * well. Extends `Layer`.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * L.layerGroup([marker1, marker2])\r
- * .addLayer(polyline)\r
- * .addTo(map);\r
- * ```\r
- */\r
-\r
- var LayerGroup = Layer.extend({\r
-\r
- initialize: function (layers, options) {\r
- setOptions(this, options);\r
-\r
- this._layers = {};\r
-\r
- var i, len;\r
-\r
- if (layers) {\r
- for (i = 0, len = layers.length; i < len; i++) {\r
- this.addLayer(layers[i]);\r
- }\r
- }\r
- },\r
-\r
- // @method addLayer(layer: Layer): this\r
- // Adds the given layer to the group.\r
- addLayer: function (layer) {\r
- var id = this.getLayerId(layer);\r
-\r
- this._layers[id] = layer;\r
-\r
- if (this._map) {\r
- this._map.addLayer(layer);\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method removeLayer(layer: Layer): this\r
- // Removes the given layer from the group.\r
- // @alternative\r
- // @method removeLayer(id: Number): this\r
- // Removes the layer with the given internal ID from the group.\r
- removeLayer: function (layer) {\r
- var id = layer in this._layers ? layer : this.getLayerId(layer);\r
-\r
- if (this._map && this._layers[id]) {\r
- this._map.removeLayer(this._layers[id]);\r
- }\r
-\r
- delete this._layers[id];\r
-\r
- return this;\r
- },\r
-\r
- // @method hasLayer(layer: Layer): Boolean\r
- // Returns `true` if the given layer is currently added to the group.\r
- // @alternative\r
- // @method hasLayer(id: Number): Boolean\r
- // Returns `true` if the given internal ID is currently added to the group.\r
- hasLayer: function (layer) {\r
- if (!layer) { return false; }\r
- var layerId = typeof layer === 'number' ? layer : this.getLayerId(layer);\r
- return layerId in this._layers;\r
- },\r
-\r
- // @method clearLayers(): this\r
- // Removes all the layers from the group.\r
- clearLayers: function () {\r
- return this.eachLayer(this.removeLayer, this);\r
- },\r
-\r
- // @method invoke(methodName: String, …): this\r
- // Calls `methodName` on every layer contained in this group, passing any\r
- // additional parameters. Has no effect if the layers contained do not\r
- // implement `methodName`.\r
- invoke: function (methodName) {\r
- var args = Array.prototype.slice.call(arguments, 1),\r
- i, layer;\r
-\r
- for (i in this._layers) {\r
- layer = this._layers[i];\r
-\r
- if (layer[methodName]) {\r
- layer[methodName].apply(layer, args);\r
- }\r
- }\r
-\r
- return this;\r
- },\r
-\r
- onAdd: function (map) {\r
- this.eachLayer(map.addLayer, map);\r
- },\r
-\r
- onRemove: function (map) {\r
- this.eachLayer(map.removeLayer, map);\r
- },\r
-\r
- // @method eachLayer(fn: Function, context?: Object): this\r
- // Iterates over the layers of the group, optionally specifying context of the iterator function.\r
- // ```js\r
- // group.eachLayer(function (layer) {\r
- // layer.bindPopup('Hello');\r
- // });\r
- // ```\r
- eachLayer: function (method, context) {\r
- for (var i in this._layers) {\r
- method.call(context, this._layers[i]);\r
- }\r
- return this;\r
- },\r
-\r
- // @method getLayer(id: Number): Layer\r
- // Returns the layer with the given internal ID.\r
- getLayer: function (id) {\r
- return this._layers[id];\r
- },\r
-\r
- // @method getLayers(): Layer[]\r
- // Returns an array of all the layers added to the group.\r
- getLayers: function () {\r
- var layers = [];\r
- this.eachLayer(layers.push, layers);\r
- return layers;\r
- },\r
-\r
- // @method setZIndex(zIndex: Number): this\r
- // Calls `setZIndex` on every layer contained in this group, passing the z-index.\r
- setZIndex: function (zIndex) {\r
- return this.invoke('setZIndex', zIndex);\r
- },\r
-\r
- // @method getLayerId(layer: Layer): Number\r
- // Returns the internal ID for a layer\r
- getLayerId: function (layer) {\r
- return stamp(layer);\r
- }\r
- });\r
-\r
-\r
- // @factory L.layerGroup(layers?: Layer[], options?: Object)\r
- // Create a layer group, optionally given an initial set of layers and an `options` object.\r
- var layerGroup = function (layers, options) {\r
- return new LayerGroup(layers, options);\r
- };
-
- /*\r
- * @class FeatureGroup\r
- * @aka L.FeatureGroup\r
- * @inherits LayerGroup\r
- *\r
- * Extended `LayerGroup` that makes it easier to do the same thing to all its member layers:\r
- * * [`bindPopup`](#layer-bindpopup) binds a popup to all of the layers at once (likewise with [`bindTooltip`](#layer-bindtooltip))\r
- * * Events are propagated to the `FeatureGroup`, so if the group has an event\r
- * handler, it will handle events from any of the layers. This includes mouse events\r
- * and custom events.\r
- * * Has `layeradd` and `layerremove` events\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * L.featureGroup([marker1, marker2, polyline])\r
- * .bindPopup('Hello world!')\r
- * .on('click', function() { alert('Clicked on a member of the group!'); })\r
- * .addTo(map);\r
- * ```\r
- */\r
-\r
- var FeatureGroup = LayerGroup.extend({\r
-\r
- addLayer: function (layer) {\r
- if (this.hasLayer(layer)) {\r
- return this;\r
- }\r
-\r
- layer.addEventParent(this);\r
-\r
- LayerGroup.prototype.addLayer.call(this, layer);\r
-\r
- // @event layeradd: LayerEvent\r
- // Fired when a layer is added to this `FeatureGroup`\r
- return this.fire('layeradd', {layer: layer});\r
- },\r
-\r
- removeLayer: function (layer) {\r
- if (!this.hasLayer(layer)) {\r
- return this;\r
- }\r
- if (layer in this._layers) {\r
- layer = this._layers[layer];\r
- }\r
-\r
- layer.removeEventParent(this);\r
-\r
- LayerGroup.prototype.removeLayer.call(this, layer);\r
-\r
- // @event layerremove: LayerEvent\r
- // Fired when a layer is removed from this `FeatureGroup`\r
- return this.fire('layerremove', {layer: layer});\r
- },\r
-\r
- // @method setStyle(style: Path options): this\r
- // Sets the given path options to each layer of the group that has a `setStyle` method.\r
- setStyle: function (style) {\r
- return this.invoke('setStyle', style);\r
- },\r
-\r
- // @method bringToFront(): this\r
- // Brings the layer group to the top of all other layers\r
- bringToFront: function () {\r
- return this.invoke('bringToFront');\r
- },\r
-\r
- // @method bringToBack(): this\r
- // Brings the layer group to the back of all other layers\r
- bringToBack: function () {\r
- return this.invoke('bringToBack');\r
- },\r
-\r
- // @method getBounds(): LatLngBounds\r
- // Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).\r
- getBounds: function () {\r
- var bounds = new LatLngBounds();\r
-\r
- for (var id in this._layers) {\r
- var layer = this._layers[id];\r
- bounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng());\r
- }\r
- return bounds;\r
- }\r
- });\r
-\r
- // @factory L.featureGroup(layers?: Layer[], options?: Object)\r
- // Create a feature group, optionally given an initial set of layers and an `options` object.\r
- var featureGroup = function (layers, options) {\r
- return new FeatureGroup(layers, options);\r
- };
-
- /*\r
- * @class Icon\r
- * @aka L.Icon\r
- *\r
- * Represents an icon to provide when creating a marker.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var myIcon = L.icon({\r
- * iconUrl: 'my-icon.png',\r
- * iconRetinaUrl: 'my-icon@2x.png',\r
- * iconSize: [38, 95],\r
- * iconAnchor: [22, 94],\r
- * popupAnchor: [-3, -76],\r
- * shadowUrl: 'my-icon-shadow.png',\r
- * shadowRetinaUrl: 'my-icon-shadow@2x.png',\r
- * shadowSize: [68, 95],\r
- * shadowAnchor: [22, 94]\r
- * });\r
- *\r
- * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);\r
- * ```\r
- *\r
- * `L.Icon.Default` extends `L.Icon` and is the blue icon Leaflet uses for markers by default.\r
- *\r
- */\r
-\r
- var Icon = Class.extend({\r
-\r
- /* @section\r
- * @aka Icon options\r
- *\r
- * @option iconUrl: String = null\r
- * **(required)** The URL to the icon image (absolute or relative to your script path).\r
- *\r
- * @option iconRetinaUrl: String = null\r
- * The URL to a retina sized version of the icon image (absolute or relative to your\r
- * script path). Used for Retina screen devices.\r
- *\r
- * @option iconSize: Point = null\r
- * Size of the icon image in pixels.\r
- *\r
- * @option iconAnchor: Point = null\r
- * The coordinates of the "tip" of the icon (relative to its top left corner). The icon\r
- * will be aligned so that this point is at the marker's geographical location. Centered\r
- * by default if size is specified, also can be set in CSS with negative margins.\r
- *\r
- * @option popupAnchor: Point = [0, 0]\r
- * The coordinates of the point from which popups will "open", relative to the icon anchor.\r
- *\r
- * @option tooltipAnchor: Point = [0, 0]\r
- * The coordinates of the point from which tooltips will "open", relative to the icon anchor.\r
- *\r
- * @option shadowUrl: String = null\r
- * The URL to the icon shadow image. If not specified, no shadow image will be created.\r
- *\r
- * @option shadowRetinaUrl: String = null\r
- *\r
- * @option shadowSize: Point = null\r
- * Size of the shadow image in pixels.\r
- *\r
- * @option shadowAnchor: Point = null\r
- * The coordinates of the "tip" of the shadow (relative to its top left corner) (the same\r
- * as iconAnchor if not specified).\r
- *\r
- * @option className: String = ''\r
- * A custom class name to assign to both icon and shadow images. Empty by default.\r
- */\r
-\r
- options: {\r
- popupAnchor: [0, 0],\r
- tooltipAnchor: [0, 0]\r
- },\r
-\r
- initialize: function (options) {\r
- setOptions(this, options);\r
- },\r
-\r
- // @method createIcon(oldIcon?: HTMLElement): HTMLElement\r
- // Called internally when the icon has to be shown, returns a `<img>` HTML element\r
- // styled according to the options.\r
- createIcon: function (oldIcon) {\r
- return this._createIcon('icon', oldIcon);\r
- },\r
-\r
- // @method createShadow(oldIcon?: HTMLElement): HTMLElement\r
- // As `createIcon`, but for the shadow beneath it.\r
- createShadow: function (oldIcon) {\r
- return this._createIcon('shadow', oldIcon);\r
- },\r
-\r
- _createIcon: function (name, oldIcon) {\r
- var src = this._getIconUrl(name);\r
-\r
- if (!src) {\r
- if (name === 'icon') {\r
- throw new Error('iconUrl not set in Icon options (see the docs).');\r
- }\r
- return null;\r
- }\r
-\r
- var img = this._createImg(src, oldIcon && oldIcon.tagName === 'IMG' ? oldIcon : null);\r
- this._setIconStyles(img, name);\r
-\r
- return img;\r
- },\r
-\r
- _setIconStyles: function (img, name) {\r
- var options = this.options;\r
- var sizeOption = options[name + 'Size'];\r
-\r
- if (typeof sizeOption === 'number') {\r
- sizeOption = [sizeOption, sizeOption];\r
- }\r
-\r
- var size = toPoint(sizeOption),\r
- anchor = toPoint(name === 'shadow' && options.shadowAnchor || options.iconAnchor ||\r
- size && size.divideBy(2, true));\r
-\r
- img.className = 'leaflet-marker-' + name + ' ' + (options.className || '');\r
-\r
- if (anchor) {\r
- img.style.marginLeft = (-anchor.x) + 'px';\r
- img.style.marginTop = (-anchor.y) + 'px';\r
- }\r
-\r
- if (size) {\r
- img.style.width = size.x + 'px';\r
- img.style.height = size.y + 'px';\r
- }\r
- },\r
-\r
- _createImg: function (src, el) {\r
- el = el || document.createElement('img');\r
- el.src = src;\r
- return el;\r
- },\r
-\r
- _getIconUrl: function (name) {\r
- return retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];\r
- }\r
- });\r
-\r
-\r
- // @factory L.icon(options: Icon options)\r
- // Creates an icon instance with the given options.\r
- function icon(options) {\r
- return new Icon(options);\r
- }
-
- /*
- * @miniclass Icon.Default (Icon)
- * @aka L.Icon.Default
- * @section
- *
- * A trivial subclass of `Icon`, represents the icon to use in `Marker`s when
- * no icon is specified. Points to the blue marker image distributed with Leaflet
- * releases.
- *
- * In order to customize the default icon, just change the properties of `L.Icon.Default.prototype.options`
- * (which is a set of `Icon options`).
- *
- * If you want to _completely_ replace the default icon, override the
- * `L.Marker.prototype.options.icon` with your own icon instead.
- */
-
- var IconDefault = Icon.extend({
-
- options: {
- iconUrl: 'marker-icon.png',
- iconRetinaUrl: 'marker-icon-2x.png',
- shadowUrl: 'marker-shadow.png',
- iconSize: [25, 41],
- iconAnchor: [12, 41],
- popupAnchor: [1, -34],
- tooltipAnchor: [16, -28],
- shadowSize: [41, 41]
- },
-
- _getIconUrl: function (name) {
- if (!IconDefault.imagePath) { // Deprecated, backwards-compatibility only
- IconDefault.imagePath = this._detectIconPath();
- }
-
- // @option imagePath: String
- // `Icon.Default` will try to auto-detect the location of the
- // blue icon images. If you are placing these images in a non-standard
- // way, set this option to point to the right path.
- return (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name);
- },
-
- _detectIconPath: function () {
- var el = create$1('div', 'leaflet-default-icon-path', document.body);
- var path = getStyle(el, 'background-image') ||
- getStyle(el, 'backgroundImage'); // IE8
-
- document.body.removeChild(el);
-
- if (path === null || path.indexOf('url') !== 0) {
- path = '';
- } else {
- path = path.replace(/^url\(["']?/, '').replace(/marker-icon\.png["']?\)$/, '');
- }
-
- return path;
- }
- });
-
- /*
- * L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable.
- */
-
-
- /* @namespace Marker
- * @section Interaction handlers
- *
- * Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see `Handler` methods). Example:
- *
- * ```js
- * marker.dragging.disable();
- * ```
- *
- * @property dragging: Handler
- * Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set [`marker.options.draggable`](#marker-draggable)).
- */
-
- var MarkerDrag = Handler.extend({
- initialize: function (marker) {
- this._marker = marker;
- },
-
- addHooks: function () {
- var icon = this._marker._icon;
-
- if (!this._draggable) {
- this._draggable = new Draggable(icon, icon, true);
- }
-
- this._draggable.on({
- dragstart: this._onDragStart,
- predrag: this._onPreDrag,
- drag: this._onDrag,
- dragend: this._onDragEnd
- }, this).enable();
-
- addClass(icon, 'leaflet-marker-draggable');
- },
-
- removeHooks: function () {
- this._draggable.off({
- dragstart: this._onDragStart,
- predrag: this._onPreDrag,
- drag: this._onDrag,
- dragend: this._onDragEnd
- }, this).disable();
-
- if (this._marker._icon) {
- removeClass(this._marker._icon, 'leaflet-marker-draggable');
- }
- },
-
- moved: function () {
- return this._draggable && this._draggable._moved;
- },
-
- _adjustPan: function (e) {
- var marker = this._marker,
- map = marker._map,
- speed = this._marker.options.autoPanSpeed,
- padding = this._marker.options.autoPanPadding,
- iconPos = getPosition(marker._icon),
- bounds = map.getPixelBounds(),
- origin = map.getPixelOrigin();
-
- var panBounds = toBounds(
- bounds.min._subtract(origin).add(padding),
- bounds.max._subtract(origin).subtract(padding)
- );
-
- if (!panBounds.contains(iconPos)) {
- // Compute incremental movement
- var movement = toPoint(
- (Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -
- (Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),
-
- (Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -
- (Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)
- ).multiplyBy(speed);
-
- map.panBy(movement, {animate: false});
-
- this._draggable._newPos._add(movement);
- this._draggable._startPos._add(movement);
-
- setPosition(marker._icon, this._draggable._newPos);
- this._onDrag(e);
-
- this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));
- }
- },
-
- _onDragStart: function () {
- // @section Dragging events
- // @event dragstart: Event
- // Fired when the user starts dragging the marker.
-
- // @event movestart: Event
- // Fired when the marker starts moving (because of dragging).
-
- this._oldLatLng = this._marker.getLatLng();
-
- // When using ES6 imports it could not be set when `Popup` was not imported as well
- this._marker.closePopup && this._marker.closePopup();
-
- this._marker
- .fire('movestart')
- .fire('dragstart');
- },
-
- _onPreDrag: function (e) {
- if (this._marker.options.autoPan) {
- cancelAnimFrame(this._panRequest);
- this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));
- }
- },
-
- _onDrag: function (e) {
- var marker = this._marker,
- shadow = marker._shadow,
- iconPos = getPosition(marker._icon),
- latlng = marker._map.layerPointToLatLng(iconPos);
-
- // update shadow position
- if (shadow) {
- setPosition(shadow, iconPos);
- }
-
- marker._latlng = latlng;
- e.latlng = latlng;
- e.oldLatLng = this._oldLatLng;
-
- // @event drag: Event
- // Fired repeatedly while the user drags the marker.
- marker
- .fire('move', e)
- .fire('drag', e);
- },
-
- _onDragEnd: function (e) {
- // @event dragend: DragEndEvent
- // Fired when the user stops dragging the marker.
-
- cancelAnimFrame(this._panRequest);
-
- // @event moveend: Event
- // Fired when the marker stops moving (because of dragging).
- delete this._oldLatLng;
- this._marker
- .fire('moveend')
- .fire('dragend', e);
- }
- });
-
- /*\r
- * @class Marker\r
- * @inherits Interactive layer\r
- * @aka L.Marker\r
- * L.Marker is used to display clickable/draggable icons on the map. Extends `Layer`.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * L.marker([50.5, 30.5]).addTo(map);\r
- * ```\r
- */\r
-\r
- var Marker = Layer.extend({\r
-\r
- // @section\r
- // @aka Marker options\r
- options: {\r
- // @option icon: Icon = *\r
- // Icon instance to use for rendering the marker.\r
- // See [Icon documentation](#L.Icon) for details on how to customize the marker icon.\r
- // If not specified, a common instance of `L.Icon.Default` is used.\r
- icon: new IconDefault(),\r
-\r
- // Option inherited from "Interactive layer" abstract class\r
- interactive: true,\r
-\r
- // @option keyboard: Boolean = true\r
- // Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.\r
- keyboard: true,\r
-\r
- // @option title: String = ''\r
- // Text for the browser tooltip that appear on marker hover (no tooltip by default).\r
- title: '',\r
-\r
- // @option alt: String = ''\r
- // Text for the `alt` attribute of the icon image (useful for accessibility).\r
- alt: '',\r
-\r
- // @option zIndexOffset: Number = 0\r
- // By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively).\r
- zIndexOffset: 0,\r
-\r
- // @option opacity: Number = 1.0\r
- // The opacity of the marker.\r
- opacity: 1,\r
-\r
- // @option riseOnHover: Boolean = false\r
- // If `true`, the marker will get on top of others when you hover the mouse over it.\r
- riseOnHover: false,\r
-\r
- // @option riseOffset: Number = 250\r
- // The z-index offset used for the `riseOnHover` feature.\r
- riseOffset: 250,\r
-\r
- // @option pane: String = 'markerPane'\r
- // `Map pane` where the markers icon will be added.\r
- pane: 'markerPane',\r
-\r
- // @option shadowPane: String = 'shadowPane'\r
- // `Map pane` where the markers shadow will be added.\r
- shadowPane: 'shadowPane',\r
-\r
- // @option bubblingMouseEvents: Boolean = false\r
- // When `true`, a mouse event on this marker will trigger the same event on the map\r
- // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).\r
- bubblingMouseEvents: false,\r
-\r
- // @section Draggable marker options\r
- // @option draggable: Boolean = false\r
- // Whether the marker is draggable with mouse/touch or not.\r
- draggable: false,\r
-\r
- // @option autoPan: Boolean = false\r
- // Whether to pan the map when dragging this marker near its edge or not.\r
- autoPan: false,\r
-\r
- // @option autoPanPadding: Point = Point(50, 50)\r
- // Distance (in pixels to the left/right and to the top/bottom) of the\r
- // map edge to start panning the map.\r
- autoPanPadding: [50, 50],\r
-\r
- // @option autoPanSpeed: Number = 10\r
- // Number of pixels the map should pan by.\r
- autoPanSpeed: 10\r
- },\r
-\r
- /* @section\r
- *\r
- * In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:\r
- */\r
-\r
- initialize: function (latlng, options) {\r
- setOptions(this, options);\r
- this._latlng = toLatLng(latlng);\r
- },\r
-\r
- onAdd: function (map) {\r
- this._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation;\r
-\r
- if (this._zoomAnimated) {\r
- map.on('zoomanim', this._animateZoom, this);\r
- }\r
-\r
- this._initIcon();\r
- this.update();\r
- },\r
-\r
- onRemove: function (map) {\r
- if (this.dragging && this.dragging.enabled()) {\r
- this.options.draggable = true;\r
- this.dragging.removeHooks();\r
- }\r
- delete this.dragging;\r
-\r
- if (this._zoomAnimated) {\r
- map.off('zoomanim', this._animateZoom, this);\r
- }\r
-\r
- this._removeIcon();\r
- this._removeShadow();\r
- },\r
-\r
- getEvents: function () {\r
- return {\r
- zoom: this.update,\r
- viewreset: this.update\r
- };\r
- },\r
-\r
- // @method getLatLng: LatLng\r
- // Returns the current geographical position of the marker.\r
- getLatLng: function () {\r
- return this._latlng;\r
- },\r
-\r
- // @method setLatLng(latlng: LatLng): this\r
- // Changes the marker position to the given point.\r
- setLatLng: function (latlng) {\r
- var oldLatLng = this._latlng;\r
- this._latlng = toLatLng(latlng);\r
- this.update();\r
-\r
- // @event move: Event\r
- // Fired when the marker is moved via [`setLatLng`](#marker-setlatlng) or by [dragging](#marker-dragging). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.\r
- return this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});\r
- },\r
-\r
- // @method setZIndexOffset(offset: Number): this\r
- // Changes the [zIndex offset](#marker-zindexoffset) of the marker.\r
- setZIndexOffset: function (offset) {\r
- this.options.zIndexOffset = offset;\r
- return this.update();\r
- },\r
-\r
- // @method getIcon: Icon\r
- // Returns the current icon used by the marker\r
- getIcon: function () {\r
- return this.options.icon;\r
- },\r
-\r
- // @method setIcon(icon: Icon): this\r
- // Changes the marker icon.\r
- setIcon: function (icon) {\r
-\r
- this.options.icon = icon;\r
-\r
- if (this._map) {\r
- this._initIcon();\r
- this.update();\r
- }\r
-\r
- if (this._popup) {\r
- this.bindPopup(this._popup, this._popup.options);\r
- }\r
-\r
- return this;\r
- },\r
-\r
- getElement: function () {\r
- return this._icon;\r
- },\r
-\r
- update: function () {\r
-\r
- if (this._icon && this._map) {\r
- var pos = this._map.latLngToLayerPoint(this._latlng).round();\r
- this._setPos(pos);\r
- }\r
-\r
- return this;\r
- },\r
-\r
- _initIcon: function () {\r
- var options = this.options,\r
- classToAdd = 'leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');\r
-\r
- var icon = options.icon.createIcon(this._icon),\r
- addIcon = false;\r
-\r
- // if we're not reusing the icon, remove the old one and init new one\r
- if (icon !== this._icon) {\r
- if (this._icon) {\r
- this._removeIcon();\r
- }\r
- addIcon = true;\r
-\r
- if (options.title) {\r
- icon.title = options.title;\r
- }\r
-\r
- if (icon.tagName === 'IMG') {\r
- icon.alt = options.alt || '';\r
- }\r
- }\r
-\r
- addClass(icon, classToAdd);\r
-\r
- if (options.keyboard) {\r
- icon.tabIndex = '0';\r
- }\r
-\r
- this._icon = icon;\r
-\r
- if (options.riseOnHover) {\r
- this.on({\r
- mouseover: this._bringToFront,\r
- mouseout: this._resetZIndex\r
- });\r
- }\r
-\r
- var newShadow = options.icon.createShadow(this._shadow),\r
- addShadow = false;\r
-\r
- if (newShadow !== this._shadow) {\r
- this._removeShadow();\r
- addShadow = true;\r
- }\r
-\r
- if (newShadow) {\r
- addClass(newShadow, classToAdd);\r
- newShadow.alt = '';\r
- }\r
- this._shadow = newShadow;\r
-\r
-\r
- if (options.opacity < 1) {\r
- this._updateOpacity();\r
- }\r
-\r
-\r
- if (addIcon) {\r
- this.getPane().appendChild(this._icon);\r
- }\r
- this._initInteraction();\r
- if (newShadow && addShadow) {\r
- this.getPane(options.shadowPane).appendChild(this._shadow);\r
- }\r
- },\r
-\r
- _removeIcon: function () {\r
- if (this.options.riseOnHover) {\r
- this.off({\r
- mouseover: this._bringToFront,\r
- mouseout: this._resetZIndex\r
- });\r
- }\r
-\r
- remove(this._icon);\r
- this.removeInteractiveTarget(this._icon);\r
-\r
- this._icon = null;\r
- },\r
-\r
- _removeShadow: function () {\r
- if (this._shadow) {\r
- remove(this._shadow);\r
- }\r
- this._shadow = null;\r
- },\r
-\r
- _setPos: function (pos) {\r
-\r
- if (this._icon) {\r
- setPosition(this._icon, pos);\r
- }\r
-\r
- if (this._shadow) {\r
- setPosition(this._shadow, pos);\r
- }\r
-\r
- this._zIndex = pos.y + this.options.zIndexOffset;\r
-\r
- this._resetZIndex();\r
- },\r
-\r
- _updateZIndex: function (offset) {\r
- if (this._icon) {\r
- this._icon.style.zIndex = this._zIndex + offset;\r
- }\r
- },\r
-\r
- _animateZoom: function (opt) {\r
- var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round();\r
-\r
- this._setPos(pos);\r
- },\r
-\r
- _initInteraction: function () {\r
-\r
- if (!this.options.interactive) { return; }\r
-\r
- addClass(this._icon, 'leaflet-interactive');\r
-\r
- this.addInteractiveTarget(this._icon);\r
-\r
- if (MarkerDrag) {\r
- var draggable = this.options.draggable;\r
- if (this.dragging) {\r
- draggable = this.dragging.enabled();\r
- this.dragging.disable();\r
- }\r
-\r
- this.dragging = new MarkerDrag(this);\r
-\r
- if (draggable) {\r
- this.dragging.enable();\r
- }\r
- }\r
- },\r
-\r
- // @method setOpacity(opacity: Number): this\r
- // Changes the opacity of the marker.\r
- setOpacity: function (opacity) {\r
- this.options.opacity = opacity;\r
- if (this._map) {\r
- this._updateOpacity();\r
- }\r
-\r
- return this;\r
- },\r
-\r
- _updateOpacity: function () {\r
- var opacity = this.options.opacity;\r
-\r
- if (this._icon) {\r
- setOpacity(this._icon, opacity);\r
- }\r
-\r
- if (this._shadow) {\r
- setOpacity(this._shadow, opacity);\r
- }\r
- },\r
-\r
- _bringToFront: function () {\r
- this._updateZIndex(this.options.riseOffset);\r
- },\r
-\r
- _resetZIndex: function () {\r
- this._updateZIndex(0);\r
- },\r
-\r
- _getPopupAnchor: function () {\r
- return this.options.icon.options.popupAnchor;\r
- },\r
-\r
- _getTooltipAnchor: function () {\r
- return this.options.icon.options.tooltipAnchor;\r
- }\r
- });\r
-\r
-\r
- // factory L.marker(latlng: LatLng, options? : Marker options)\r
-\r
- // @factory L.marker(latlng: LatLng, options? : Marker options)\r
- // Instantiates a Marker object given a geographical point and optionally an options object.\r
- function marker(latlng, options) {\r
- return new Marker(latlng, options);\r
- }
-
- /*
- * @class Path
- * @aka L.Path
- * @inherits Interactive layer
- *
- * An abstract class that contains options and constants shared between vector
- * overlays (Polygon, Polyline, Circle). Do not use it directly. Extends `Layer`.
- */
-
- var Path = Layer.extend({
-
- // @section
- // @aka Path options
- options: {
- // @option stroke: Boolean = true
- // Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.
- stroke: true,
-
- // @option color: String = '#3388ff'
- // Stroke color
- color: '#3388ff',
-
- // @option weight: Number = 3
- // Stroke width in pixels
- weight: 3,
-
- // @option opacity: Number = 1.0
- // Stroke opacity
- opacity: 1,
-
- // @option lineCap: String= 'round'
- // A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.
- lineCap: 'round',
-
- // @option lineJoin: String = 'round'
- // A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.
- lineJoin: 'round',
-
- // @option dashArray: String = null
- // A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
- dashArray: null,
-
- // @option dashOffset: String = null
- // A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
- dashOffset: null,
-
- // @option fill: Boolean = depends
- // Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.
- fill: false,
-
- // @option fillColor: String = *
- // Fill color. Defaults to the value of the [`color`](#path-color) option
- fillColor: null,
-
- // @option fillOpacity: Number = 0.2
- // Fill opacity.
- fillOpacity: 0.2,
-
- // @option fillRule: String = 'evenodd'
- // A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.
- fillRule: 'evenodd',
-
- // className: '',
-
- // Option inherited from "Interactive layer" abstract class
- interactive: true,
-
- // @option bubblingMouseEvents: Boolean = true
- // When `true`, a mouse event on this path will trigger the same event on the map
- // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
- bubblingMouseEvents: true
- },
-
- beforeAdd: function (map) {
- // Renderer is set here because we need to call renderer.getEvents
- // before this.getEvents.
- this._renderer = map.getRenderer(this);
- },
-
- onAdd: function () {
- this._renderer._initPath(this);
- this._reset();
- this._renderer._addPath(this);
- },
-
- onRemove: function () {
- this._renderer._removePath(this);
- },
-
- // @method redraw(): this
- // Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
- redraw: function () {
- if (this._map) {
- this._renderer._updatePath(this);
- }
- return this;
- },
-
- // @method setStyle(style: Path options): this
- // Changes the appearance of a Path based on the options in the `Path options` object.
- setStyle: function (style) {
- setOptions(this, style);
- if (this._renderer) {
- this._renderer._updateStyle(this);
- if (this.options.stroke && style && Object.prototype.hasOwnProperty.call(style, 'weight')) {
- this._updateBounds();
- }
- }
- return this;
- },
-
- // @method bringToFront(): this
- // Brings the layer to the top of all path layers.
- bringToFront: function () {
- if (this._renderer) {
- this._renderer._bringToFront(this);
- }
- return this;
- },
-
- // @method bringToBack(): this
- // Brings the layer to the bottom of all path layers.
- bringToBack: function () {
- if (this._renderer) {
- this._renderer._bringToBack(this);
- }
- return this;
- },
-
- getElement: function () {
- return this._path;
- },
-
- _reset: function () {
- // defined in child classes
- this._project();
- this._update();
- },
-
- _clickTolerance: function () {
- // used when doing hit detection for Canvas layers
- return (this.options.stroke ? this.options.weight / 2 : 0) + this._renderer.options.tolerance;
- }
- });
-
- /*
- * @class CircleMarker
- * @aka L.CircleMarker
- * @inherits Path
- *
- * A circle of a fixed size with radius specified in pixels. Extends `Path`.
- */
-
- var CircleMarker = Path.extend({
-
- // @section
- // @aka CircleMarker options
- options: {
- fill: true,
-
- // @option radius: Number = 10
- // Radius of the circle marker, in pixels
- radius: 10
- },
-
- initialize: function (latlng, options) {
- setOptions(this, options);
- this._latlng = toLatLng(latlng);
- this._radius = this.options.radius;
- },
-
- // @method setLatLng(latLng: LatLng): this
- // Sets the position of a circle marker to a new location.
- setLatLng: function (latlng) {
- var oldLatLng = this._latlng;
- this._latlng = toLatLng(latlng);
- this.redraw();
-
- // @event move: Event
- // Fired when the marker is moved via [`setLatLng`](#circlemarker-setlatlng). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.
- return this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});
- },
-
- // @method getLatLng(): LatLng
- // Returns the current geographical position of the circle marker
- getLatLng: function () {
- return this._latlng;
- },
-
- // @method setRadius(radius: Number): this
- // Sets the radius of a circle marker. Units are in pixels.
- setRadius: function (radius) {
- this.options.radius = this._radius = radius;
- return this.redraw();
- },
-
- // @method getRadius(): Number
- // Returns the current radius of the circle
- getRadius: function () {
- return this._radius;
- },
-
- setStyle : function (options) {
- var radius = options && options.radius || this._radius;
- Path.prototype.setStyle.call(this, options);
- this.setRadius(radius);
- return this;
- },
-
- _project: function () {
- this._point = this._map.latLngToLayerPoint(this._latlng);
- this._updateBounds();
- },
-
- _updateBounds: function () {
- var r = this._radius,
- r2 = this._radiusY || r,
- w = this._clickTolerance(),
- p = [r + w, r2 + w];
- this._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p));
- },
-
- _update: function () {
- if (this._map) {
- this._updatePath();
- }
- },
-
- _updatePath: function () {
- this._renderer._updateCircle(this);
- },
-
- _empty: function () {
- return this._radius && !this._renderer._bounds.intersects(this._pxBounds);
- },
-
- // Needed by the `Canvas` renderer for interactivity
- _containsPoint: function (p) {
- return p.distanceTo(this._point) <= this._radius + this._clickTolerance();
- }
- });
-
-
- // @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options)
- // Instantiates a circle marker object given a geographical point, and an optional options object.
- function circleMarker(latlng, options) {
- return new CircleMarker(latlng, options);
- }
-
- /*
- * @class Circle
- * @aka L.Circle
- * @inherits CircleMarker
- *
- * A class for drawing circle overlays on a map. Extends `CircleMarker`.
- *
- * It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
- *
- * @example
- *
- * ```js
- * L.circle([50.5, 30.5], {radius: 200}).addTo(map);
- * ```
- */
-
- var Circle = CircleMarker.extend({
-
- initialize: function (latlng, options, legacyOptions) {
- if (typeof options === 'number') {
- // Backwards compatibility with 0.7.x factory (latlng, radius, options?)
- options = extend({}, legacyOptions, {radius: options});
- }
- setOptions(this, options);
- this._latlng = toLatLng(latlng);
-
- if (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); }
-
- // @section
- // @aka Circle options
- // @option radius: Number; Radius of the circle, in meters.
- this._mRadius = this.options.radius;
- },
-
- // @method setRadius(radius: Number): this
- // Sets the radius of a circle. Units are in meters.
- setRadius: function (radius) {
- this._mRadius = radius;
- return this.redraw();
- },
-
- // @method getRadius(): Number
- // Returns the current radius of a circle. Units are in meters.
- getRadius: function () {
- return this._mRadius;
- },
-
- // @method getBounds(): LatLngBounds
- // Returns the `LatLngBounds` of the path.
- getBounds: function () {
- var half = [this._radius, this._radiusY || this._radius];
-
- return new LatLngBounds(
- this._map.layerPointToLatLng(this._point.subtract(half)),
- this._map.layerPointToLatLng(this._point.add(half)));
- },
-
- setStyle: Path.prototype.setStyle,
-
- _project: function () {
-
- var lng = this._latlng.lng,
- lat = this._latlng.lat,
- map = this._map,
- crs = map.options.crs;
-
- if (crs.distance === Earth.distance) {
- var d = Math.PI / 180,
- latR = (this._mRadius / Earth.R) / d,
- top = map.project([lat + latR, lng]),
- bottom = map.project([lat - latR, lng]),
- p = top.add(bottom).divideBy(2),
- lat2 = map.unproject(p).lat,
- lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) /
- (Math.cos(lat * d) * Math.cos(lat2 * d))) / d;
-
- if (isNaN(lngR) || lngR === 0) {
- lngR = latR / Math.cos(Math.PI / 180 * lat); // Fallback for edge case, #2425
- }
-
- this._point = p.subtract(map.getPixelOrigin());
- this._radius = isNaN(lngR) ? 0 : p.x - map.project([lat2, lng - lngR]).x;
- this._radiusY = p.y - top.y;
-
- } else {
- var latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0]));
-
- this._point = map.latLngToLayerPoint(this._latlng);
- this._radius = this._point.x - map.latLngToLayerPoint(latlng2).x;
- }
-
- this._updateBounds();
- }
- });
-
- // @factory L.circle(latlng: LatLng, options?: Circle options)
- // Instantiates a circle object given a geographical point, and an options object
- // which contains the circle radius.
- // @alternative
- // @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options)
- // Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
- // Do not use in new applications or plugins.
- function circle(latlng, options, legacyOptions) {
- return new Circle(latlng, options, legacyOptions);
- }
-
- /*
- * @class Polyline
- * @aka L.Polyline
- * @inherits Path
- *
- * A class for drawing polyline overlays on a map. Extends `Path`.
- *
- * @example
- *
- * ```js
- * // create a red polyline from an array of LatLng points
- * var latlngs = [
- * [45.51, -122.68],
- * [37.77, -122.43],
- * [34.04, -118.2]
- * ];
- *
- * var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
- *
- * // zoom the map to the polyline
- * map.fitBounds(polyline.getBounds());
- * ```
- *
- * You can also pass a multi-dimensional array to represent a `MultiPolyline` shape:
- *
- * ```js
- * // create a red polyline from an array of arrays of LatLng points
- * var latlngs = [
- * [[45.51, -122.68],
- * [37.77, -122.43],
- * [34.04, -118.2]],
- * [[40.78, -73.91],
- * [41.83, -87.62],
- * [32.76, -96.72]]
- * ];
- * ```
- */
-
-
- var Polyline = Path.extend({
-
- // @section
- // @aka Polyline options
- options: {
- // @option smoothFactor: Number = 1.0
- // How much to simplify the polyline on each zoom level. More means
- // better performance and smoother look, and less means more accurate representation.
- smoothFactor: 1.0,
-
- // @option noClip: Boolean = false
- // Disable polyline clipping.
- noClip: false
- },
-
- initialize: function (latlngs, options) {
- setOptions(this, options);
- this._setLatLngs(latlngs);
- },
-
- // @method getLatLngs(): LatLng[]
- // Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
- getLatLngs: function () {
- return this._latlngs;
- },
-
- // @method setLatLngs(latlngs: LatLng[]): this
- // Replaces all the points in the polyline with the given array of geographical points.
- setLatLngs: function (latlngs) {
- this._setLatLngs(latlngs);
- return this.redraw();
- },
-
- // @method isEmpty(): Boolean
- // Returns `true` if the Polyline has no LatLngs.
- isEmpty: function () {
- return !this._latlngs.length;
- },
-
- // @method closestLayerPoint(p: Point): Point
- // Returns the point closest to `p` on the Polyline.
- closestLayerPoint: function (p) {
- var minDistance = Infinity,
- minPoint = null,
- closest = _sqClosestPointOnSegment,
- p1, p2;
-
- for (var j = 0, jLen = this._parts.length; j < jLen; j++) {
- var points = this._parts[j];
-
- for (var i = 1, len = points.length; i < len; i++) {
- p1 = points[i - 1];
- p2 = points[i];
-
- var sqDist = closest(p, p1, p2, true);
-
- if (sqDist < minDistance) {
- minDistance = sqDist;
- minPoint = closest(p, p1, p2);
- }
- }
- }
- if (minPoint) {
- minPoint.distance = Math.sqrt(minDistance);
- }
- return minPoint;
- },
-
- // @method getCenter(): LatLng
- // Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the polyline.
- getCenter: function () {
- // throws error when not yet added to map as this center calculation requires projected coordinates
- if (!this._map) {
- throw new Error('Must add layer to map before using getCenter()');
- }
-
- var i, halfDist, segDist, dist, p1, p2, ratio,
- points = this._rings[0],
- len = points.length;
-
- if (!len) { return null; }
-
- // polyline centroid algorithm; only uses the first ring if there are multiple
-
- for (i = 0, halfDist = 0; i < len - 1; i++) {
- halfDist += points[i].distanceTo(points[i + 1]) / 2;
- }
-
- // The line is so small in the current view that all points are on the same pixel.
- if (halfDist === 0) {
- return this._map.layerPointToLatLng(points[0]);
- }
-
- for (i = 0, dist = 0; i < len - 1; i++) {
- p1 = points[i];
- p2 = points[i + 1];
- segDist = p1.distanceTo(p2);
- dist += segDist;
-
- if (dist > halfDist) {
- ratio = (dist - halfDist) / segDist;
- return this._map.layerPointToLatLng([
- p2.x - ratio * (p2.x - p1.x),
- p2.y - ratio * (p2.y - p1.y)
- ]);
- }
- }
- },
-
- // @method getBounds(): LatLngBounds
- // Returns the `LatLngBounds` of the path.
- getBounds: function () {
- return this._bounds;
- },
-
- // @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this
- // Adds a given point to the polyline. By default, adds to the first ring of
- // the polyline in case of a multi-polyline, but can be overridden by passing
- // a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)).
- addLatLng: function (latlng, latlngs) {
- latlngs = latlngs || this._defaultShape();
- latlng = toLatLng(latlng);
- latlngs.push(latlng);
- this._bounds.extend(latlng);
- return this.redraw();
- },
-
- _setLatLngs: function (latlngs) {
- this._bounds = new LatLngBounds();
- this._latlngs = this._convertLatLngs(latlngs);
- },
-
- _defaultShape: function () {
- return isFlat(this._latlngs) ? this._latlngs : this._latlngs[0];
- },
-
- // recursively convert latlngs input into actual LatLng instances; calculate bounds along the way
- _convertLatLngs: function (latlngs) {
- var result = [],
- flat = isFlat(latlngs);
-
- for (var i = 0, len = latlngs.length; i < len; i++) {
- if (flat) {
- result[i] = toLatLng(latlngs[i]);
- this._bounds.extend(result[i]);
- } else {
- result[i] = this._convertLatLngs(latlngs[i]);
- }
- }
-
- return result;
- },
-
- _project: function () {
- var pxBounds = new Bounds();
- this._rings = [];
- this._projectLatlngs(this._latlngs, this._rings, pxBounds);
-
- if (this._bounds.isValid() && pxBounds.isValid()) {
- this._rawPxBounds = pxBounds;
- this._updateBounds();
- }
- },
-
- _updateBounds: function () {
- var w = this._clickTolerance(),
- p = new Point(w, w);
- this._pxBounds = new Bounds([
- this._rawPxBounds.min.subtract(p),
- this._rawPxBounds.max.add(p)
- ]);
- },
-
- // recursively turns latlngs into a set of rings with projected coordinates
- _projectLatlngs: function (latlngs, result, projectedBounds) {
- var flat = latlngs[0] instanceof LatLng,
- len = latlngs.length,
- i, ring;
-
- if (flat) {
- ring = [];
- for (i = 0; i < len; i++) {
- ring[i] = this._map.latLngToLayerPoint(latlngs[i]);
- projectedBounds.extend(ring[i]);
- }
- result.push(ring);
- } else {
- for (i = 0; i < len; i++) {
- this._projectLatlngs(latlngs[i], result, projectedBounds);
- }
- }
- },
-
- // clip polyline by renderer bounds so that we have less to render for performance
- _clipPoints: function () {
- var bounds = this._renderer._bounds;
-
- this._parts = [];
- if (!this._pxBounds || !this._pxBounds.intersects(bounds)) {
- return;
- }
-
- if (this.options.noClip) {
- this._parts = this._rings;
- return;
- }
-
- var parts = this._parts,
- i, j, k, len, len2, segment, points;
-
- for (i = 0, k = 0, len = this._rings.length; i < len; i++) {
- points = this._rings[i];
-
- for (j = 0, len2 = points.length; j < len2 - 1; j++) {
- segment = clipSegment(points[j], points[j + 1], bounds, j, true);
-
- if (!segment) { continue; }
-
- parts[k] = parts[k] || [];
- parts[k].push(segment[0]);
-
- // if segment goes out of screen, or it's the last one, it's the end of the line part
- if ((segment[1] !== points[j + 1]) || (j === len2 - 2)) {
- parts[k].push(segment[1]);
- k++;
- }
- }
- }
- },
-
- // simplify each clipped part of the polyline for performance
- _simplifyPoints: function () {
- var parts = this._parts,
- tolerance = this.options.smoothFactor;
-
- for (var i = 0, len = parts.length; i < len; i++) {
- parts[i] = simplify(parts[i], tolerance);
- }
- },
-
- _update: function () {
- if (!this._map) { return; }
-
- this._clipPoints();
- this._simplifyPoints();
- this._updatePath();
- },
-
- _updatePath: function () {
- this._renderer._updatePoly(this);
- },
-
- // Needed by the `Canvas` renderer for interactivity
- _containsPoint: function (p, closed) {
- var i, j, k, len, len2, part,
- w = this._clickTolerance();
-
- if (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }
-
- // hit detection for polylines
- for (i = 0, len = this._parts.length; i < len; i++) {
- part = this._parts[i];
-
- for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {
- if (!closed && (j === 0)) { continue; }
-
- if (pointToSegmentDistance(p, part[k], part[j]) <= w) {
- return true;
- }
- }
- }
- return false;
- }
- });
-
- // @factory L.polyline(latlngs: LatLng[], options?: Polyline options)
- // Instantiates a polyline object given an array of geographical points and
- // optionally an options object. You can create a `Polyline` object with
- // multiple separate lines (`MultiPolyline`) by passing an array of arrays
- // of geographic points.
- function polyline(latlngs, options) {
- return new Polyline(latlngs, options);
- }
-
- // Retrocompat. Allow plugins to support Leaflet versions before and after 1.1.
- Polyline._flat = _flat;
-
- /*
- * @class Polygon
- * @aka L.Polygon
- * @inherits Polyline
- *
- * A class for drawing polygon overlays on a map. Extends `Polyline`.
- *
- * Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
- *
- *
- * @example
- *
- * ```js
- * // create a red polygon from an array of LatLng points
- * var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
- *
- * var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
- *
- * // zoom the map to the polygon
- * map.fitBounds(polygon.getBounds());
- * ```
- *
- * You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:
- *
- * ```js
- * var latlngs = [
- * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
- * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
- * ];
- * ```
- *
- * Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.
- *
- * ```js
- * var latlngs = [
- * [ // first polygon
- * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
- * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
- * ],
- * [ // second polygon
- * [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
- * ]
- * ];
- * ```
- */
-
- var Polygon = Polyline.extend({
-
- options: {
- fill: true
- },
-
- isEmpty: function () {
- return !this._latlngs.length || !this._latlngs[0].length;
- },
-
- getCenter: function () {
- // throws error when not yet added to map as this center calculation requires projected coordinates
- if (!this._map) {
- throw new Error('Must add layer to map before using getCenter()');
- }
-
- var i, j, p1, p2, f, area, x, y, center,
- points = this._rings[0],
- len = points.length;
-
- if (!len) { return null; }
-
- // polygon centroid algorithm; only uses the first ring if there are multiple
-
- area = x = y = 0;
-
- for (i = 0, j = len - 1; i < len; j = i++) {
- p1 = points[i];
- p2 = points[j];
-
- f = p1.y * p2.x - p2.y * p1.x;
- x += (p1.x + p2.x) * f;
- y += (p1.y + p2.y) * f;
- area += f * 3;
- }
-
- if (area === 0) {
- // Polygon is so small that all points are on same pixel.
- center = points[0];
- } else {
- center = [x / area, y / area];
- }
- return this._map.layerPointToLatLng(center);
- },
-
- _convertLatLngs: function (latlngs) {
- var result = Polyline.prototype._convertLatLngs.call(this, latlngs),
- len = result.length;
-
- // remove last point if it equals first one
- if (len >= 2 && result[0] instanceof LatLng && result[0].equals(result[len - 1])) {
- result.pop();
- }
- return result;
- },
-
- _setLatLngs: function (latlngs) {
- Polyline.prototype._setLatLngs.call(this, latlngs);
- if (isFlat(this._latlngs)) {
- this._latlngs = [this._latlngs];
- }
- },
-
- _defaultShape: function () {
- return isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];
- },
-
- _clipPoints: function () {
- // polygons need a different clipping algorithm so we redefine that
-
- var bounds = this._renderer._bounds,
- w = this.options.weight,
- p = new Point(w, w);
-
- // increase clip padding by stroke width to avoid stroke on clip edges
- bounds = new Bounds(bounds.min.subtract(p), bounds.max.add(p));
-
- this._parts = [];
- if (!this._pxBounds || !this._pxBounds.intersects(bounds)) {
- return;
- }
-
- if (this.options.noClip) {
- this._parts = this._rings;
- return;
- }
-
- for (var i = 0, len = this._rings.length, clipped; i < len; i++) {
- clipped = clipPolygon(this._rings[i], bounds, true);
- if (clipped.length) {
- this._parts.push(clipped);
- }
- }
- },
-
- _updatePath: function () {
- this._renderer._updatePoly(this, true);
- },
-
- // Needed by the `Canvas` renderer for interactivity
- _containsPoint: function (p) {
- var inside = false,
- part, p1, p2, i, j, k, len, len2;
-
- if (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }
-
- // ray casting algorithm for detecting if point is in polygon
- for (i = 0, len = this._parts.length; i < len; i++) {
- part = this._parts[i];
-
- for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {
- p1 = part[j];
- p2 = part[k];
-
- if (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {
- inside = !inside;
- }
- }
- }
-
- // also check if it's on polygon stroke
- return inside || Polyline.prototype._containsPoint.call(this, p, true);
- }
-
- });
-
-
- // @factory L.polygon(latlngs: LatLng[], options?: Polyline options)
- function polygon(latlngs, options) {
- return new Polygon(latlngs, options);
- }
-
- /*\r
- * @class GeoJSON\r
- * @aka L.GeoJSON\r
- * @inherits FeatureGroup\r
- *\r
- * Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse\r
- * GeoJSON data and display it on the map. Extends `FeatureGroup`.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * L.geoJSON(data, {\r
- * style: function (feature) {\r
- * return {color: feature.properties.color};\r
- * }\r
- * }).bindPopup(function (layer) {\r
- * return layer.feature.properties.description;\r
- * }).addTo(map);\r
- * ```\r
- */\r
-\r
- var GeoJSON = FeatureGroup.extend({\r
-\r
- /* @section\r
- * @aka GeoJSON options\r
- *\r
- * @option pointToLayer: Function = *\r
- * A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally\r
- * called when data is added, passing the GeoJSON point feature and its `LatLng`.\r
- * The default is to spawn a default `Marker`:\r
- * ```js\r
- * function(geoJsonPoint, latlng) {\r
- * return L.marker(latlng);\r
- * }\r
- * ```\r
- *\r
- * @option style: Function = *\r
- * A `Function` defining the `Path options` for styling GeoJSON lines and polygons,\r
- * called internally when data is added.\r
- * The default value is to not override any defaults:\r
- * ```js\r
- * function (geoJsonFeature) {\r
- * return {}\r
- * }\r
- * ```\r
- *\r
- * @option onEachFeature: Function = *\r
- * A `Function` that will be called once for each created `Feature`, after it has\r
- * been created and styled. Useful for attaching events and popups to features.\r
- * The default is to do nothing with the newly created layers:\r
- * ```js\r
- * function (feature, layer) {}\r
- * ```\r
- *\r
- * @option filter: Function = *\r
- * A `Function` that will be used to decide whether to include a feature or not.\r
- * The default is to include all features:\r
- * ```js\r
- * function (geoJsonFeature) {\r
- * return true;\r
- * }\r
- * ```\r
- * Note: dynamically changing the `filter` option will have effect only on newly\r
- * added data. It will _not_ re-evaluate already included features.\r
- *\r
- * @option coordsToLatLng: Function = *\r
- * A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.\r
- * The default is the `coordsToLatLng` static method.\r
- *\r
- * @option markersInheritOptions: Boolean = false\r
- * Whether default Markers for "Point" type Features inherit from group options.\r
- */\r
-\r
- initialize: function (geojson, options) {\r
- setOptions(this, options);\r
-\r
- this._layers = {};\r
-\r
- if (geojson) {\r
- this.addData(geojson);\r
- }\r
- },\r
-\r
- // @method addData( <GeoJSON> data ): this\r
- // Adds a GeoJSON object to the layer.\r
- addData: function (geojson) {\r
- var features = isArray(geojson) ? geojson : geojson.features,\r
- i, len, feature;\r
-\r
- if (features) {\r
- for (i = 0, len = features.length; i < len; i++) {\r
- // only add this if geometry or geometries are set and not null\r
- feature = features[i];\r
- if (feature.geometries || feature.geometry || feature.features || feature.coordinates) {\r
- this.addData(feature);\r
- }\r
- }\r
- return this;\r
- }\r
-\r
- var options = this.options;\r
-\r
- if (options.filter && !options.filter(geojson)) { return this; }\r
-\r
- var layer = geometryToLayer(geojson, options);\r
- if (!layer) {\r
- return this;\r
- }\r
- layer.feature = asFeature(geojson);\r
-\r
- layer.defaultOptions = layer.options;\r
- this.resetStyle(layer);\r
-\r
- if (options.onEachFeature) {\r
- options.onEachFeature(geojson, layer);\r
- }\r
-\r
- return this.addLayer(layer);\r
- },\r
-\r
- // @method resetStyle( <Path> layer? ): this\r
- // Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.\r
- // If `layer` is omitted, the style of all features in the current layer is reset.\r
- resetStyle: function (layer) {\r
- if (layer === undefined) {\r
- return this.eachLayer(this.resetStyle, this);\r
- }\r
- // reset any custom styles\r
- layer.options = extend({}, layer.defaultOptions);\r
- this._setLayerStyle(layer, this.options.style);\r
- return this;\r
- },\r
-\r
- // @method setStyle( <Function> style ): this\r
- // Changes styles of GeoJSON vector layers with the given style function.\r
- setStyle: function (style) {\r
- return this.eachLayer(function (layer) {\r
- this._setLayerStyle(layer, style);\r
- }, this);\r
- },\r
-\r
- _setLayerStyle: function (layer, style) {\r
- if (layer.setStyle) {\r
- if (typeof style === 'function') {\r
- style = style(layer.feature);\r
- }\r
- layer.setStyle(style);\r
- }\r
- }\r
- });\r
-\r
- // @section\r
- // There are several static functions which can be called without instantiating L.GeoJSON:\r
-\r
- // @function geometryToLayer(featureData: Object, options?: GeoJSON options): Layer\r
- // Creates a `Layer` from a given GeoJSON feature. Can use a custom\r
- // [`pointToLayer`](#geojson-pointtolayer) and/or [`coordsToLatLng`](#geojson-coordstolatlng)\r
- // functions if provided as options.\r
- function geometryToLayer(geojson, options) {\r
-\r
- var geometry = geojson.type === 'Feature' ? geojson.geometry : geojson,\r
- coords = geometry ? geometry.coordinates : null,\r
- layers = [],\r
- pointToLayer = options && options.pointToLayer,\r
- _coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng,\r
- latlng, latlngs, i, len;\r
-\r
- if (!coords && !geometry) {\r
- return null;\r
- }\r
-\r
- switch (geometry.type) {\r
- case 'Point':\r
- latlng = _coordsToLatLng(coords);\r
- return _pointToLayer(pointToLayer, geojson, latlng, options);\r
-\r
- case 'MultiPoint':\r
- for (i = 0, len = coords.length; i < len; i++) {\r
- latlng = _coordsToLatLng(coords[i]);\r
- layers.push(_pointToLayer(pointToLayer, geojson, latlng, options));\r
- }\r
- return new FeatureGroup(layers);\r
-\r
- case 'LineString':\r
- case 'MultiLineString':\r
- latlngs = coordsToLatLngs(coords, geometry.type === 'LineString' ? 0 : 1, _coordsToLatLng);\r
- return new Polyline(latlngs, options);\r
-\r
- case 'Polygon':\r
- case 'MultiPolygon':\r
- latlngs = coordsToLatLngs(coords, geometry.type === 'Polygon' ? 1 : 2, _coordsToLatLng);\r
- return new Polygon(latlngs, options);\r
-\r
- case 'GeometryCollection':\r
- for (i = 0, len = geometry.geometries.length; i < len; i++) {\r
- var layer = geometryToLayer({\r
- geometry: geometry.geometries[i],\r
- type: 'Feature',\r
- properties: geojson.properties\r
- }, options);\r
-\r
- if (layer) {\r
- layers.push(layer);\r
- }\r
- }\r
- return new FeatureGroup(layers);\r
-\r
- default:\r
- throw new Error('Invalid GeoJSON object.');\r
- }\r
- }\r
-\r
- function _pointToLayer(pointToLayerFn, geojson, latlng, options) {\r
- return pointToLayerFn ?\r
- pointToLayerFn(geojson, latlng) :\r
- new Marker(latlng, options && options.markersInheritOptions && options);\r
- }\r
-\r
- // @function coordsToLatLng(coords: Array): LatLng\r
- // Creates a `LatLng` object from an array of 2 numbers (longitude, latitude)\r
- // or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.\r
- function coordsToLatLng(coords) {\r
- return new LatLng(coords[1], coords[0], coords[2]);\r
- }\r
-\r
- // @function coordsToLatLngs(coords: Array, levelsDeep?: Number, coordsToLatLng?: Function): Array\r
- // Creates a multidimensional array of `LatLng`s from a GeoJSON coordinates array.\r
- // `levelsDeep` specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).\r
- // Can use a custom [`coordsToLatLng`](#geojson-coordstolatlng) function.\r
- function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {\r
- var latlngs = [];\r
-\r
- for (var i = 0, len = coords.length, latlng; i < len; i++) {\r
- latlng = levelsDeep ?\r
- coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :\r
- (_coordsToLatLng || coordsToLatLng)(coords[i]);\r
-\r
- latlngs.push(latlng);\r
- }\r
-\r
- return latlngs;\r
- }\r
-\r
- // @function latLngToCoords(latlng: LatLng, precision?: Number): Array\r
- // Reverse of [`coordsToLatLng`](#geojson-coordstolatlng)\r
- function latLngToCoords(latlng, precision) {\r
- precision = typeof precision === 'number' ? precision : 6;\r
- return latlng.alt !== undefined ?\r
- [formatNum(latlng.lng, precision), formatNum(latlng.lat, precision), formatNum(latlng.alt, precision)] :\r
- [formatNum(latlng.lng, precision), formatNum(latlng.lat, precision)];\r
- }\r
-\r
- // @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean): Array\r
- // Reverse of [`coordsToLatLngs`](#geojson-coordstolatlngs)\r
- // `closed` determines whether the first point should be appended to the end of the array to close the feature, only used when `levelsDeep` is 0. False by default.\r
- function latLngsToCoords(latlngs, levelsDeep, closed, precision) {\r
- var coords = [];\r
-\r
- for (var i = 0, len = latlngs.length; i < len; i++) {\r
- coords.push(levelsDeep ?\r
- latLngsToCoords(latlngs[i], levelsDeep - 1, closed, precision) :\r
- latLngToCoords(latlngs[i], precision));\r
- }\r
-\r
- if (!levelsDeep && closed) {\r
- coords.push(coords[0]);\r
- }\r
-\r
- return coords;\r
- }\r
-\r
- function getFeature(layer, newGeometry) {\r
- return layer.feature ?\r
- extend({}, layer.feature, {geometry: newGeometry}) :\r
- asFeature(newGeometry);\r
- }\r
-\r
- // @function asFeature(geojson: Object): Object\r
- // Normalize GeoJSON geometries/features into GeoJSON features.\r
- function asFeature(geojson) {\r
- if (geojson.type === 'Feature' || geojson.type === 'FeatureCollection') {\r
- return geojson;\r
- }\r
-\r
- return {\r
- type: 'Feature',\r
- properties: {},\r
- geometry: geojson\r
- };\r
- }\r
-\r
- var PointToGeoJSON = {\r
- toGeoJSON: function (precision) {\r
- return getFeature(this, {\r
- type: 'Point',\r
- coordinates: latLngToCoords(this.getLatLng(), precision)\r
- });\r
- }\r
- };\r
-\r
- // @namespace Marker\r
- // @section Other methods\r
- // @method toGeoJSON(precision?: Number): Object\r
- // `precision` is the number of decimal places for coordinates.\r
- // The default value is 6 places.\r
- // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature).\r
- Marker.include(PointToGeoJSON);\r
-\r
- // @namespace CircleMarker\r
- // @method toGeoJSON(precision?: Number): Object\r
- // `precision` is the number of decimal places for coordinates.\r
- // The default value is 6 places.\r
- // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature).\r
- Circle.include(PointToGeoJSON);\r
- CircleMarker.include(PointToGeoJSON);\r
-\r
-\r
- // @namespace Polyline\r
- // @method toGeoJSON(precision?: Number): Object\r
- // `precision` is the number of decimal places for coordinates.\r
- // The default value is 6 places.\r
- // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).\r
- Polyline.include({\r
- toGeoJSON: function (precision) {\r
- var multi = !isFlat(this._latlngs);\r
-\r
- var coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision);\r
-\r
- return getFeature(this, {\r
- type: (multi ? 'Multi' : '') + 'LineString',\r
- coordinates: coords\r
- });\r
- }\r
- });\r
-\r
- // @namespace Polygon\r
- // @method toGeoJSON(precision?: Number): Object\r
- // `precision` is the number of decimal places for coordinates.\r
- // The default value is 6 places.\r
- // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).\r
- Polygon.include({\r
- toGeoJSON: function (precision) {\r
- var holes = !isFlat(this._latlngs),\r
- multi = holes && !isFlat(this._latlngs[0]);\r
-\r
- var coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision);\r
-\r
- if (!holes) {\r
- coords = [coords];\r
- }\r
-\r
- return getFeature(this, {\r
- type: (multi ? 'Multi' : '') + 'Polygon',\r
- coordinates: coords\r
- });\r
- }\r
- });\r
-\r
-\r
- // @namespace LayerGroup\r
- LayerGroup.include({\r
- toMultiPoint: function (precision) {\r
- var coords = [];\r
-\r
- this.eachLayer(function (layer) {\r
- coords.push(layer.toGeoJSON(precision).geometry.coordinates);\r
- });\r
-\r
- return getFeature(this, {\r
- type: 'MultiPoint',\r
- coordinates: coords\r
- });\r
- },\r
-\r
- // @method toGeoJSON(precision?: Number): Object\r
- // `precision` is the number of decimal places for coordinates.\r
- // The default value is 6 places.\r
- // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).\r
- toGeoJSON: function (precision) {\r
-\r
- var type = this.feature && this.feature.geometry && this.feature.geometry.type;\r
-\r
- if (type === 'MultiPoint') {\r
- return this.toMultiPoint(precision);\r
- }\r
-\r
- var isGeometryCollection = type === 'GeometryCollection',\r
- jsons = [];\r
-\r
- this.eachLayer(function (layer) {\r
- if (layer.toGeoJSON) {\r
- var json = layer.toGeoJSON(precision);\r
- if (isGeometryCollection) {\r
- jsons.push(json.geometry);\r
- } else {\r
- var feature = asFeature(json);\r
- // Squash nested feature collections\r
- if (feature.type === 'FeatureCollection') {\r
- jsons.push.apply(jsons, feature.features);\r
- } else {\r
- jsons.push(feature);\r
- }\r
- }\r
- }\r
- });\r
-\r
- if (isGeometryCollection) {\r
- return getFeature(this, {\r
- geometries: jsons,\r
- type: 'GeometryCollection'\r
- });\r
- }\r
-\r
- return {\r
- type: 'FeatureCollection',\r
- features: jsons\r
- };\r
- }\r
- });\r
-\r
- // @namespace GeoJSON\r
- // @factory L.geoJSON(geojson?: Object, options?: GeoJSON options)\r
- // Creates a GeoJSON layer. Optionally accepts an object in\r
- // [GeoJSON format](https://tools.ietf.org/html/rfc7946) to display on the map\r
- // (you can alternatively add it later with `addData` method) and an `options` object.\r
- function geoJSON(geojson, options) {\r
- return new GeoJSON(geojson, options);\r
- }\r
-\r
- // Backward compatibility.\r
- var geoJson = geoJSON;
-
- /*\r
- * @class ImageOverlay\r
- * @aka L.ImageOverlay\r
- * @inherits Interactive layer\r
- *\r
- * Used to load and display a single image over specific bounds of the map. Extends `Layer`.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',\r
- * imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];\r
- * L.imageOverlay(imageUrl, imageBounds).addTo(map);\r
- * ```\r
- */\r
-\r
- var ImageOverlay = Layer.extend({\r
-\r
- // @section\r
- // @aka ImageOverlay options\r
- options: {\r
- // @option opacity: Number = 1.0\r
- // The opacity of the image overlay.\r
- opacity: 1,\r
-\r
- // @option alt: String = ''\r
- // Text for the `alt` attribute of the image (useful for accessibility).\r
- alt: '',\r
-\r
- // @option interactive: Boolean = false\r
- // If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered.\r
- interactive: false,\r
-\r
- // @option crossOrigin: Boolean|String = false\r
- // Whether the crossOrigin attribute will be added to the image.\r
- // If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.\r
- // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r
- crossOrigin: false,\r
-\r
- // @option errorOverlayUrl: String = ''\r
- // URL to the overlay image to show in place of the overlay that failed to load.\r
- errorOverlayUrl: '',\r
-\r
- // @option zIndex: Number = 1\r
- // The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer.\r
- zIndex: 1,\r
-\r
- // @option className: String = ''\r
- // A custom class name to assign to the image. Empty by default.\r
- className: ''\r
- },\r
-\r
- initialize: function (url, bounds, options) { // (String, LatLngBounds, Object)\r
- this._url = url;\r
- this._bounds = toLatLngBounds(bounds);\r
-\r
- setOptions(this, options);\r
- },\r
-\r
- onAdd: function () {\r
- if (!this._image) {\r
- this._initImage();\r
-\r
- if (this.options.opacity < 1) {\r
- this._updateOpacity();\r
- }\r
- }\r
-\r
- if (this.options.interactive) {\r
- addClass(this._image, 'leaflet-interactive');\r
- this.addInteractiveTarget(this._image);\r
- }\r
-\r
- this.getPane().appendChild(this._image);\r
- this._reset();\r
- },\r
-\r
- onRemove: function () {\r
- remove(this._image);\r
- if (this.options.interactive) {\r
- this.removeInteractiveTarget(this._image);\r
- }\r
- },\r
-\r
- // @method setOpacity(opacity: Number): this\r
- // Sets the opacity of the overlay.\r
- setOpacity: function (opacity) {\r
- this.options.opacity = opacity;\r
-\r
- if (this._image) {\r
- this._updateOpacity();\r
- }\r
- return this;\r
- },\r
-\r
- setStyle: function (styleOpts) {\r
- if (styleOpts.opacity) {\r
- this.setOpacity(styleOpts.opacity);\r
- }\r
- return this;\r
- },\r
-\r
- // @method bringToFront(): this\r
- // Brings the layer to the top of all overlays.\r
- bringToFront: function () {\r
- if (this._map) {\r
- toFront(this._image);\r
- }\r
- return this;\r
- },\r
-\r
- // @method bringToBack(): this\r
- // Brings the layer to the bottom of all overlays.\r
- bringToBack: function () {\r
- if (this._map) {\r
- toBack(this._image);\r
- }\r
- return this;\r
- },\r
-\r
- // @method setUrl(url: String): this\r
- // Changes the URL of the image.\r
- setUrl: function (url) {\r
- this._url = url;\r
-\r
- if (this._image) {\r
- this._image.src = url;\r
- }\r
- return this;\r
- },\r
-\r
- // @method setBounds(bounds: LatLngBounds): this\r
- // Update the bounds that this ImageOverlay covers\r
- setBounds: function (bounds) {\r
- this._bounds = toLatLngBounds(bounds);\r
-\r
- if (this._map) {\r
- this._reset();\r
- }\r
- return this;\r
- },\r
-\r
- getEvents: function () {\r
- var events = {\r
- zoom: this._reset,\r
- viewreset: this._reset\r
- };\r
-\r
- if (this._zoomAnimated) {\r
- events.zoomanim = this._animateZoom;\r
- }\r
-\r
- return events;\r
- },\r
-\r
- // @method setZIndex(value: Number): this\r
- // Changes the [zIndex](#imageoverlay-zindex) of the image overlay.\r
- setZIndex: function (value) {\r
- this.options.zIndex = value;\r
- this._updateZIndex();\r
- return this;\r
- },\r
-\r
- // @method getBounds(): LatLngBounds\r
- // Get the bounds that this ImageOverlay covers\r
- getBounds: function () {\r
- return this._bounds;\r
- },\r
-\r
- // @method getElement(): HTMLElement\r
- // Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement)\r
- // used by this overlay.\r
- getElement: function () {\r
- return this._image;\r
- },\r
-\r
- _initImage: function () {\r
- var wasElementSupplied = this._url.tagName === 'IMG';\r
- var img = this._image = wasElementSupplied ? this._url : create$1('img');\r
-\r
- addClass(img, 'leaflet-image-layer');\r
- if (this._zoomAnimated) { addClass(img, 'leaflet-zoom-animated'); }\r
- if (this.options.className) { addClass(img, this.options.className); }\r
-\r
- img.onselectstart = falseFn;\r
- img.onmousemove = falseFn;\r
-\r
- // @event load: Event\r
- // Fired when the ImageOverlay layer has loaded its image\r
- img.onload = bind(this.fire, this, 'load');\r
- img.onerror = bind(this._overlayOnError, this, 'error');\r
-\r
- if (this.options.crossOrigin || this.options.crossOrigin === '') {\r
- img.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r
- }\r
-\r
- if (this.options.zIndex) {\r
- this._updateZIndex();\r
- }\r
-\r
- if (wasElementSupplied) {\r
- this._url = img.src;\r
- return;\r
- }\r
-\r
- img.src = this._url;\r
- img.alt = this.options.alt;\r
- },\r
-\r
- _animateZoom: function (e) {\r
- var scale = this._map.getZoomScale(e.zoom),\r
- offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min;\r
-\r
- setTransform(this._image, offset, scale);\r
- },\r
-\r
- _reset: function () {\r
- var image = this._image,\r
- bounds = new Bounds(\r
- this._map.latLngToLayerPoint(this._bounds.getNorthWest()),\r
- this._map.latLngToLayerPoint(this._bounds.getSouthEast())),\r
- size = bounds.getSize();\r
-\r
- setPosition(image, bounds.min);\r
-\r
- image.style.width = size.x + 'px';\r
- image.style.height = size.y + 'px';\r
- },\r
-\r
- _updateOpacity: function () {\r
- setOpacity(this._image, this.options.opacity);\r
- },\r
-\r
- _updateZIndex: function () {\r
- if (this._image && this.options.zIndex !== undefined && this.options.zIndex !== null) {\r
- this._image.style.zIndex = this.options.zIndex;\r
- }\r
- },\r
-\r
- _overlayOnError: function () {\r
- // @event error: Event\r
- // Fired when the ImageOverlay layer fails to load its image\r
- this.fire('error');\r
-\r
- var errorUrl = this.options.errorOverlayUrl;\r
- if (errorUrl && this._url !== errorUrl) {\r
- this._url = errorUrl;\r
- this._image.src = errorUrl;\r
- }\r
- }\r
- });\r
-\r
- // @factory L.imageOverlay(imageUrl: String, bounds: LatLngBounds, options?: ImageOverlay options)\r
- // Instantiates an image overlay object given the URL of the image and the\r
- // geographical bounds it is tied to.\r
- var imageOverlay = function (url, bounds, options) {\r
- return new ImageOverlay(url, bounds, options);\r
- };
-
- /*\r
- * @class VideoOverlay\r
- * @aka L.VideoOverlay\r
- * @inherits ImageOverlay\r
- *\r
- * Used to load and display a video player over specific bounds of the map. Extends `ImageOverlay`.\r
- *\r
- * A video overlay uses the [`<video>`](https://developer.mozilla.org/docs/Web/HTML/Element/video)\r
- * HTML5 element.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',\r
- * videoBounds = [[ 32, -130], [ 13, -100]];\r
- * L.videoOverlay(videoUrl, videoBounds ).addTo(map);\r
- * ```\r
- */\r
-\r
- var VideoOverlay = ImageOverlay.extend({\r
-\r
- // @section\r
- // @aka VideoOverlay options\r
- options: {\r
- // @option autoplay: Boolean = true\r
- // Whether the video starts playing automatically when loaded.\r
- autoplay: true,\r
-\r
- // @option loop: Boolean = true\r
- // Whether the video will loop back to the beginning when played.\r
- loop: true,\r
-\r
- // @option keepAspectRatio: Boolean = true\r
- // Whether the video will save aspect ratio after the projection.\r
- // Relevant for supported browsers. Browser compatibility- https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit\r
- keepAspectRatio: true,\r
-\r
- // @option muted: Boolean = false\r
- // Whether the video starts on mute when loaded.\r
- muted: false\r
- },\r
-\r
- _initImage: function () {\r
- var wasElementSupplied = this._url.tagName === 'VIDEO';\r
- var vid = this._image = wasElementSupplied ? this._url : create$1('video');\r
-\r
- addClass(vid, 'leaflet-image-layer');\r
- if (this._zoomAnimated) { addClass(vid, 'leaflet-zoom-animated'); }\r
- if (this.options.className) { addClass(vid, this.options.className); }\r
-\r
- vid.onselectstart = falseFn;\r
- vid.onmousemove = falseFn;\r
-\r
- // @event load: Event\r
- // Fired when the video has finished loading the first frame\r
- vid.onloadeddata = bind(this.fire, this, 'load');\r
-\r
- if (wasElementSupplied) {\r
- var sourceElements = vid.getElementsByTagName('source');\r
- var sources = [];\r
- for (var j = 0; j < sourceElements.length; j++) {\r
- sources.push(sourceElements[j].src);\r
- }\r
-\r
- this._url = (sourceElements.length > 0) ? sources : [vid.src];\r
- return;\r
- }\r
-\r
- if (!isArray(this._url)) { this._url = [this._url]; }\r
-\r
- if (!this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(vid.style, 'objectFit')) {\r
- vid.style['objectFit'] = 'fill';\r
- }\r
- vid.autoplay = !!this.options.autoplay;\r
- vid.loop = !!this.options.loop;\r
- vid.muted = !!this.options.muted;\r
- for (var i = 0; i < this._url.length; i++) {\r
- var source = create$1('source');\r
- source.src = this._url[i];\r
- vid.appendChild(source);\r
- }\r
- }\r
-\r
- // @method getElement(): HTMLVideoElement\r
- // Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement)\r
- // used by this overlay.\r
- });\r
-\r
-\r
- // @factory L.videoOverlay(video: String|Array|HTMLVideoElement, bounds: LatLngBounds, options?: VideoOverlay options)\r
- // Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the\r
- // geographical bounds it is tied to.\r
-\r
- function videoOverlay(video, bounds, options) {\r
- return new VideoOverlay(video, bounds, options);\r
- }
-
- /*
- * @class SVGOverlay
- * @aka L.SVGOverlay
- * @inherits ImageOverlay
- *
- * Used to load, display and provide DOM access to an SVG file over specific bounds of the map. Extends `ImageOverlay`.
- *
- * An SVG overlay uses the [`<svg>`](https://developer.mozilla.org/docs/Web/SVG/Element/svg) element.
- *
- * @example
- *
- * ```js
- * var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
- * svgElement.setAttribute('xmlns', "http://www.w3.org/2000/svg");
- * svgElement.setAttribute('viewBox', "0 0 200 200");
- * svgElement.innerHTML = '<rect width="200" height="200"/><rect x="75" y="23" width="50" height="50" style="fill:red"/><rect x="75" y="123" width="50" height="50" style="fill:#0013ff"/>';
- * var svgElementBounds = [ [ 32, -130 ], [ 13, -100 ] ];
- * L.svgOverlay(svgElement, svgElementBounds).addTo(map);
- * ```
- */
-
- var SVGOverlay = ImageOverlay.extend({
- _initImage: function () {
- var el = this._image = this._url;
-
- addClass(el, 'leaflet-image-layer');
- if (this._zoomAnimated) { addClass(el, 'leaflet-zoom-animated'); }
- if (this.options.className) { addClass(el, this.options.className); }
-
- el.onselectstart = falseFn;
- el.onmousemove = falseFn;
- }
-
- // @method getElement(): SVGElement
- // Returns the instance of [`SVGElement`](https://developer.mozilla.org/docs/Web/API/SVGElement)
- // used by this overlay.
- });
-
-
- // @factory L.svgOverlay(svg: String|SVGElement, bounds: LatLngBounds, options?: SVGOverlay options)
- // Instantiates an image overlay object given an SVG element and the geographical bounds it is tied to.
- // A viewBox attribute is required on the SVG element to zoom in and out properly.
-
- function svgOverlay(el, bounds, options) {
- return new SVGOverlay(el, bounds, options);
- }
-
- /*\r
- * @class DivOverlay\r
- * @inherits Layer\r
- * @aka L.DivOverlay\r
- * Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.\r
- */\r
-\r
- // @namespace DivOverlay\r
- var DivOverlay = Layer.extend({\r
-\r
- // @section\r
- // @aka DivOverlay options\r
- options: {\r
- // @option offset: Point = Point(0, 7)\r
- // The offset of the popup position. Useful to control the anchor\r
- // of the popup when opening it on some overlays.\r
- offset: [0, 7],\r
-\r
- // @option className: String = ''\r
- // A custom CSS class name to assign to the popup.\r
- className: '',\r
-\r
- // @option pane: String = 'popupPane'\r
- // `Map pane` where the popup will be added.\r
- pane: 'popupPane'\r
- },\r
-\r
- initialize: function (options, source) {\r
- setOptions(this, options);\r
-\r
- this._source = source;\r
- },\r
-\r
- onAdd: function (map) {\r
- this._zoomAnimated = map._zoomAnimated;\r
-\r
- if (!this._container) {\r
- this._initLayout();\r
- }\r
-\r
- if (map._fadeAnimated) {\r
- setOpacity(this._container, 0);\r
- }\r
-\r
- clearTimeout(this._removeTimeout);\r
- this.getPane().appendChild(this._container);\r
- this.update();\r
-\r
- if (map._fadeAnimated) {\r
- setOpacity(this._container, 1);\r
- }\r
-\r
- this.bringToFront();\r
- },\r
-\r
- onRemove: function (map) {\r
- if (map._fadeAnimated) {\r
- setOpacity(this._container, 0);\r
- this._removeTimeout = setTimeout(bind(remove, undefined, this._container), 200);\r
- } else {\r
- remove(this._container);\r
- }\r
- },\r
-\r
- // @namespace Popup\r
- // @method getLatLng: LatLng\r
- // Returns the geographical point of popup.\r
- getLatLng: function () {\r
- return this._latlng;\r
- },\r
-\r
- // @method setLatLng(latlng: LatLng): this\r
- // Sets the geographical point where the popup will open.\r
- setLatLng: function (latlng) {\r
- this._latlng = toLatLng(latlng);\r
- if (this._map) {\r
- this._updatePosition();\r
- this._adjustPan();\r
- }\r
- return this;\r
- },\r
-\r
- // @method getContent: String|HTMLElement\r
- // Returns the content of the popup.\r
- getContent: function () {\r
- return this._content;\r
- },\r
-\r
- // @method setContent(htmlContent: String|HTMLElement|Function): this\r
- // Sets the HTML content of the popup. If a function is passed the source layer will be passed to the function. The function should return a `String` or `HTMLElement` to be used in the popup.\r
- setContent: function (content) {\r
- this._content = content;\r
- this.update();\r
- return this;\r
- },\r
-\r
- // @method getElement: String|HTMLElement\r
- // Returns the HTML container of the popup.\r
- getElement: function () {\r
- return this._container;\r
- },\r
-\r
- // @method update: null\r
- // Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded.\r
- update: function () {\r
- if (!this._map) { return; }\r
-\r
- this._container.style.visibility = 'hidden';\r
-\r
- this._updateContent();\r
- this._updateLayout();\r
- this._updatePosition();\r
-\r
- this._container.style.visibility = '';\r
-\r
- this._adjustPan();\r
- },\r
-\r
- getEvents: function () {\r
- var events = {\r
- zoom: this._updatePosition,\r
- viewreset: this._updatePosition\r
- };\r
-\r
- if (this._zoomAnimated) {\r
- events.zoomanim = this._animateZoom;\r
- }\r
- return events;\r
- },\r
-\r
- // @method isOpen: Boolean\r
- // Returns `true` when the popup is visible on the map.\r
- isOpen: function () {\r
- return !!this._map && this._map.hasLayer(this);\r
- },\r
-\r
- // @method bringToFront: this\r
- // Brings this popup in front of other popups (in the same map pane).\r
- bringToFront: function () {\r
- if (this._map) {\r
- toFront(this._container);\r
- }\r
- return this;\r
- },\r
-\r
- // @method bringToBack: this\r
- // Brings this popup to the back of other popups (in the same map pane).\r
- bringToBack: function () {\r
- if (this._map) {\r
- toBack(this._container);\r
- }\r
- return this;\r
- },\r
-\r
- _prepareOpen: function (parent, layer, latlng) {\r
- if (!(layer instanceof Layer)) {\r
- latlng = layer;\r
- layer = parent;\r
- }\r
-\r
- if (layer instanceof FeatureGroup) {\r
- for (var id in parent._layers) {\r
- layer = parent._layers[id];\r
- break;\r
- }\r
- }\r
-\r
- if (!latlng) {\r
- if (layer.getCenter) {\r
- latlng = layer.getCenter();\r
- } else if (layer.getLatLng) {\r
- latlng = layer.getLatLng();\r
- } else {\r
- throw new Error('Unable to get source layer LatLng.');\r
- }\r
- }\r
-\r
- // set overlay source to this layer\r
- this._source = layer;\r
-\r
- // update the overlay (content, layout, ect...)\r
- this.update();\r
-\r
- return latlng;\r
- },\r
-\r
- _updateContent: function () {\r
- if (!this._content) { return; }\r
-\r
- var node = this._contentNode;\r
- var content = (typeof this._content === 'function') ? this._content(this._source || this) : this._content;\r
-\r
- if (typeof content === 'string') {\r
- node.innerHTML = content;\r
- } else {\r
- while (node.hasChildNodes()) {\r
- node.removeChild(node.firstChild);\r
- }\r
- node.appendChild(content);\r
- }\r
- this.fire('contentupdate');\r
- },\r
-\r
- _updatePosition: function () {\r
- if (!this._map) { return; }\r
-\r
- var pos = this._map.latLngToLayerPoint(this._latlng),\r
- offset = toPoint(this.options.offset),\r
- anchor = this._getAnchor();\r
-\r
- if (this._zoomAnimated) {\r
- setPosition(this._container, pos.add(anchor));\r
- } else {\r
- offset = offset.add(pos).add(anchor);\r
- }\r
-\r
- var bottom = this._containerBottom = -offset.y,\r
- left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;\r
-\r
- // bottom position the popup in case the height of the popup changes (images loading etc)\r
- this._container.style.bottom = bottom + 'px';\r
- this._container.style.left = left + 'px';\r
- },\r
-\r
- _getAnchor: function () {\r
- return [0, 0];\r
- }\r
-\r
- });
-
- /*\r
- * @class Popup\r
- * @inherits DivOverlay\r
- * @aka L.Popup\r
- * Used to open popups in certain places of the map. Use [Map.openPopup](#map-openpopup) to\r
- * open popups while making sure that only one popup is open at one time\r
- * (recommended for usability), or use [Map.addLayer](#map-addlayer) to open as many as you want.\r
- *\r
- * @example\r
- *\r
- * If you want to just bind a popup to marker click and then open it, it's really easy:\r
- *\r
- * ```js\r
- * marker.bindPopup(popupContent).openPopup();\r
- * ```\r
- * Path overlays like polylines also have a `bindPopup` method.\r
- * Here's a more complicated way to open a popup on a map:\r
- *\r
- * ```js\r
- * var popup = L.popup()\r
- * .setLatLng(latlng)\r
- * .setContent('<p>Hello world!<br />This is a nice popup.</p>')\r
- * .openOn(map);\r
- * ```\r
- */\r
-\r
-\r
- // @namespace Popup\r
- var Popup = DivOverlay.extend({\r
-\r
- // @section\r
- // @aka Popup options\r
- options: {\r
- // @option maxWidth: Number = 300\r
- // Max width of the popup, in pixels.\r
- maxWidth: 300,\r
-\r
- // @option minWidth: Number = 50\r
- // Min width of the popup, in pixels.\r
- minWidth: 50,\r
-\r
- // @option maxHeight: Number = null\r
- // If set, creates a scrollable container of the given height\r
- // inside a popup if its content exceeds it.\r
- maxHeight: null,\r
-\r
- // @option autoPan: Boolean = true\r
- // Set it to `false` if you don't want the map to do panning animation\r
- // to fit the opened popup.\r
- autoPan: true,\r
-\r
- // @option autoPanPaddingTopLeft: Point = null\r
- // The margin between the popup and the top left corner of the map\r
- // view after autopanning was performed.\r
- autoPanPaddingTopLeft: null,\r
-\r
- // @option autoPanPaddingBottomRight: Point = null\r
- // The margin between the popup and the bottom right corner of the map\r
- // view after autopanning was performed.\r
- autoPanPaddingBottomRight: null,\r
-\r
- // @option autoPanPadding: Point = Point(5, 5)\r
- // Equivalent of setting both top left and bottom right autopan padding to the same value.\r
- autoPanPadding: [5, 5],\r
-\r
- // @option keepInView: Boolean = false\r
- // Set it to `true` if you want to prevent users from panning the popup\r
- // off of the screen while it is open.\r
- keepInView: false,\r
-\r
- // @option closeButton: Boolean = true\r
- // Controls the presence of a close button in the popup.\r
- closeButton: true,\r
-\r
- // @option autoClose: Boolean = true\r
- // Set it to `false` if you want to override the default behavior of\r
- // the popup closing when another popup is opened.\r
- autoClose: true,\r
-\r
- // @option closeOnEscapeKey: Boolean = true\r
- // Set it to `false` if you want to override the default behavior of\r
- // the ESC key for closing of the popup.\r
- closeOnEscapeKey: true,\r
-\r
- // @option closeOnClick: Boolean = *\r
- // Set it if you want to override the default behavior of the popup closing when user clicks\r
- // on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option.\r
-\r
- // @option className: String = ''\r
- // A custom CSS class name to assign to the popup.\r
- className: ''\r
- },\r
-\r
- // @namespace Popup\r
- // @method openOn(map: Map): this\r
- // Adds the popup to the map and closes the previous one. The same as `map.openPopup(popup)`.\r
- openOn: function (map) {\r
- map.openPopup(this);\r
- return this;\r
- },\r
-\r
- onAdd: function (map) {\r
- DivOverlay.prototype.onAdd.call(this, map);\r
-\r
- // @namespace Map\r
- // @section Popup events\r
- // @event popupopen: PopupEvent\r
- // Fired when a popup is opened in the map\r
- map.fire('popupopen', {popup: this});\r
-\r
- if (this._source) {\r
- // @namespace Layer\r
- // @section Popup events\r
- // @event popupopen: PopupEvent\r
- // Fired when a popup bound to this layer is opened\r
- this._source.fire('popupopen', {popup: this}, true);\r
- // For non-path layers, we toggle the popup when clicking\r
- // again the layer, so prevent the map to reopen it.\r
- if (!(this._source instanceof Path)) {\r
- this._source.on('preclick', stopPropagation);\r
- }\r
- }\r
- },\r
-\r
- onRemove: function (map) {\r
- DivOverlay.prototype.onRemove.call(this, map);\r
-\r
- // @namespace Map\r
- // @section Popup events\r
- // @event popupclose: PopupEvent\r
- // Fired when a popup in the map is closed\r
- map.fire('popupclose', {popup: this});\r
-\r
- if (this._source) {\r
- // @namespace Layer\r
- // @section Popup events\r
- // @event popupclose: PopupEvent\r
- // Fired when a popup bound to this layer is closed\r
- this._source.fire('popupclose', {popup: this}, true);\r
- if (!(this._source instanceof Path)) {\r
- this._source.off('preclick', stopPropagation);\r
- }\r
- }\r
- },\r
-\r
- getEvents: function () {\r
- var events = DivOverlay.prototype.getEvents.call(this);\r
-\r
- if (this.options.closeOnClick !== undefined ? this.options.closeOnClick : this._map.options.closePopupOnClick) {\r
- events.preclick = this._close;\r
- }\r
-\r
- if (this.options.keepInView) {\r
- events.moveend = this._adjustPan;\r
- }\r
-\r
- return events;\r
- },\r
-\r
- _close: function () {\r
- if (this._map) {\r
- this._map.closePopup(this);\r
- }\r
- },\r
-\r
- _initLayout: function () {\r
- var prefix = 'leaflet-popup',\r
- container = this._container = create$1('div',\r
- prefix + ' ' + (this.options.className || '') +\r
- ' leaflet-zoom-animated');\r
-\r
- var wrapper = this._wrapper = create$1('div', prefix + '-content-wrapper', container);\r
- this._contentNode = create$1('div', prefix + '-content', wrapper);\r
-\r
- disableClickPropagation(container);\r
- disableScrollPropagation(this._contentNode);\r
- on(container, 'contextmenu', stopPropagation);\r
-\r
- this._tipContainer = create$1('div', prefix + '-tip-container', container);\r
- this._tip = create$1('div', prefix + '-tip', this._tipContainer);\r
-\r
- if (this.options.closeButton) {\r
- var closeButton = this._closeButton = create$1('a', prefix + '-close-button', container);\r
- closeButton.href = '#close';\r
- closeButton.innerHTML = '×';\r
-\r
- on(closeButton, 'click', this._onCloseButtonClick, this);\r
- }\r
- },\r
-\r
- _updateLayout: function () {\r
- var container = this._contentNode,\r
- style = container.style;\r
-\r
- style.width = '';\r
- style.whiteSpace = 'nowrap';\r
-\r
- var width = container.offsetWidth;\r
- width = Math.min(width, this.options.maxWidth);\r
- width = Math.max(width, this.options.minWidth);\r
-\r
- style.width = (width + 1) + 'px';\r
- style.whiteSpace = '';\r
-\r
- style.height = '';\r
-\r
- var height = container.offsetHeight,\r
- maxHeight = this.options.maxHeight,\r
- scrolledClass = 'leaflet-popup-scrolled';\r
-\r
- if (maxHeight && height > maxHeight) {\r
- style.height = maxHeight + 'px';\r
- addClass(container, scrolledClass);\r
- } else {\r
- removeClass(container, scrolledClass);\r
- }\r
-\r
- this._containerWidth = this._container.offsetWidth;\r
- },\r
-\r
- _animateZoom: function (e) {\r
- var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),\r
- anchor = this._getAnchor();\r
- setPosition(this._container, pos.add(anchor));\r
- },\r
-\r
- _adjustPan: function () {\r
- if (!this.options.autoPan) { return; }\r
- if (this._map._panAnim) { this._map._panAnim.stop(); }\r
-\r
- var map = this._map,\r
- marginBottom = parseInt(getStyle(this._container, 'marginBottom'), 10) || 0,\r
- containerHeight = this._container.offsetHeight + marginBottom,\r
- containerWidth = this._containerWidth,\r
- layerPos = new Point(this._containerLeft, -containerHeight - this._containerBottom);\r
-\r
- layerPos._add(getPosition(this._container));\r
-\r
- var containerPos = map.layerPointToContainerPoint(layerPos),\r
- padding = toPoint(this.options.autoPanPadding),\r
- paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding),\r
- paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding),\r
- size = map.getSize(),\r
- dx = 0,\r
- dy = 0;\r
-\r
- if (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\r
- dx = containerPos.x + containerWidth - size.x + paddingBR.x;\r
- }\r
- if (containerPos.x - dx - paddingTL.x < 0) { // left\r
- dx = containerPos.x - paddingTL.x;\r
- }\r
- if (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\r
- dy = containerPos.y + containerHeight - size.y + paddingBR.y;\r
- }\r
- if (containerPos.y - dy - paddingTL.y < 0) { // top\r
- dy = containerPos.y - paddingTL.y;\r
- }\r
-\r
- // @namespace Map\r
- // @section Popup events\r
- // @event autopanstart: Event\r
- // Fired when the map starts autopanning when opening a popup.\r
- if (dx || dy) {\r
- map\r
- .fire('autopanstart')\r
- .panBy([dx, dy]);\r
- }\r
- },\r
-\r
- _onCloseButtonClick: function (e) {\r
- this._close();\r
- stop(e);\r
- },\r
-\r
- _getAnchor: function () {\r
- // Where should we anchor the popup on the source layer?\r
- return toPoint(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]);\r
- }\r
-\r
- });\r
-\r
- // @namespace Popup\r
- // @factory L.popup(options?: Popup options, source?: Layer)\r
- // Instantiates a `Popup` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the popup with a reference to the Layer to which it refers.\r
- var popup = function (options, source) {\r
- return new Popup(options, source);\r
- };\r
-\r
-\r
- /* @namespace Map\r
- * @section Interaction Options\r
- * @option closePopupOnClick: Boolean = true\r
- * Set it to `false` if you don't want popups to close when user clicks the map.\r
- */\r
- Map.mergeOptions({\r
- closePopupOnClick: true\r
- });\r
-\r
-\r
- // @namespace Map\r
- // @section Methods for Layers and Controls\r
- Map.include({\r
- // @method openPopup(popup: Popup): this\r
- // Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).\r
- // @alternative\r
- // @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this\r
- // Creates a popup with the specified content and options and opens it in the given point on a map.\r
- openPopup: function (popup, latlng, options) {\r
- if (!(popup instanceof Popup)) {\r
- popup = new Popup(options).setContent(popup);\r
- }\r
-\r
- if (latlng) {\r
- popup.setLatLng(latlng);\r
- }\r
-\r
- if (this.hasLayer(popup)) {\r
- return this;\r
- }\r
-\r
- if (this._popup && this._popup.options.autoClose) {\r
- this.closePopup();\r
- }\r
-\r
- this._popup = popup;\r
- return this.addLayer(popup);\r
- },\r
-\r
- // @method closePopup(popup?: Popup): this\r
- // Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one).\r
- closePopup: function (popup) {\r
- if (!popup || popup === this._popup) {\r
- popup = this._popup;\r
- this._popup = null;\r
- }\r
- if (popup) {\r
- this.removeLayer(popup);\r
- }\r
- return this;\r
- }\r
- });\r
-\r
- /*\r
- * @namespace Layer\r
- * @section Popup methods example\r
- *\r
- * All layers share a set of methods convenient for binding popups to it.\r
- *\r
- * ```js\r
- * var layer = L.Polygon(latlngs).bindPopup('Hi There!').addTo(map);\r
- * layer.openPopup();\r
- * layer.closePopup();\r
- * ```\r
- *\r
- * Popups will also be automatically opened when the layer is clicked on and closed when the layer is removed from the map or another popup is opened.\r
- */\r
-\r
- // @section Popup methods\r
- Layer.include({\r
-\r
- // @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this\r
- // Binds a popup to the layer with the passed `content` and sets up the\r
- // necessary event listeners. If a `Function` is passed it will receive\r
- // the layer as the first argument and should return a `String` or `HTMLElement`.\r
- bindPopup: function (content, options) {\r
-\r
- if (content instanceof Popup) {\r
- setOptions(content, options);\r
- this._popup = content;\r
- content._source = this;\r
- } else {\r
- if (!this._popup || options) {\r
- this._popup = new Popup(options, this);\r
- }\r
- this._popup.setContent(content);\r
- }\r
-\r
- if (!this._popupHandlersAdded) {\r
- this.on({\r
- click: this._openPopup,\r
- keypress: this._onKeyPress,\r
- remove: this.closePopup,\r
- move: this._movePopup\r
- });\r
- this._popupHandlersAdded = true;\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method unbindPopup(): this\r
- // Removes the popup previously bound with `bindPopup`.\r
- unbindPopup: function () {\r
- if (this._popup) {\r
- this.off({\r
- click: this._openPopup,\r
- keypress: this._onKeyPress,\r
- remove: this.closePopup,\r
- move: this._movePopup\r
- });\r
- this._popupHandlersAdded = false;\r
- this._popup = null;\r
- }\r
- return this;\r
- },\r
-\r
- // @method openPopup(latlng?: LatLng): this\r
- // Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.\r
- openPopup: function (layer, latlng) {\r
- if (this._popup && this._map) {\r
- latlng = this._popup._prepareOpen(this, layer, latlng);\r
-\r
- // open the popup on the map\r
- this._map.openPopup(this._popup, latlng);\r
- }\r
-\r
- return this;\r
- },\r
-\r
- // @method closePopup(): this\r
- // Closes the popup bound to this layer if it is open.\r
- closePopup: function () {\r
- if (this._popup) {\r
- this._popup._close();\r
- }\r
- return this;\r
- },\r
-\r
- // @method togglePopup(): this\r
- // Opens or closes the popup bound to this layer depending on its current state.\r
- togglePopup: function (target) {\r
- if (this._popup) {\r
- if (this._popup._map) {\r
- this.closePopup();\r
- } else {\r
- this.openPopup(target);\r
- }\r
- }\r
- return this;\r
- },\r
-\r
- // @method isPopupOpen(): boolean\r
- // Returns `true` if the popup bound to this layer is currently open.\r
- isPopupOpen: function () {\r
- return (this._popup ? this._popup.isOpen() : false);\r
- },\r
-\r
- // @method setPopupContent(content: String|HTMLElement|Popup): this\r
- // Sets the content of the popup bound to this layer.\r
- setPopupContent: function (content) {\r
- if (this._popup) {\r
- this._popup.setContent(content);\r
- }\r
- return this;\r
- },\r
-\r
- // @method getPopup(): Popup\r
- // Returns the popup bound to this layer.\r
- getPopup: function () {\r
- return this._popup;\r
- },\r
-\r
- _openPopup: function (e) {\r
- var layer = e.layer || e.target;\r
-\r
- if (!this._popup) {\r
- return;\r
- }\r
-\r
- if (!this._map) {\r
- return;\r
- }\r
-\r
- // prevent map click\r
- stop(e);\r
-\r
- // if this inherits from Path its a vector and we can just\r
- // open the popup at the new location\r
- if (layer instanceof Path) {\r
- this.openPopup(e.layer || e.target, e.latlng);\r
- return;\r
- }\r
-\r
- // otherwise treat it like a marker and figure out\r
- // if we should toggle it open/closed\r
- if (this._map.hasLayer(this._popup) && this._popup._source === layer) {\r
- this.closePopup();\r
- } else {\r
- this.openPopup(layer, e.latlng);\r
- }\r
- },\r
-\r
- _movePopup: function (e) {\r
- this._popup.setLatLng(e.latlng);\r
- },\r
-\r
- _onKeyPress: function (e) {\r
- if (e.originalEvent.keyCode === 13) {\r
- this._openPopup(e);\r
- }\r
- }\r
- });
-
- /*
- * @class Tooltip
- * @inherits DivOverlay
- * @aka L.Tooltip
- * Used to display small texts on top of map layers.
- *
- * @example
- *
- * ```js
- * marker.bindTooltip("my tooltip text").openTooltip();
- * ```
- * Note about tooltip offset. Leaflet takes two options in consideration
- * for computing tooltip offsetting:
- * - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
- * Add a positive x offset to move the tooltip to the right, and a positive y offset to
- * move it to the bottom. Negatives will move to the left and top.
- * - the `tooltipAnchor` Icon option: this will only be considered for Marker. You
- * should adapt this value if you use a custom icon.
- */
-
-
- // @namespace Tooltip
- var Tooltip = DivOverlay.extend({
-
- // @section
- // @aka Tooltip options
- options: {
- // @option pane: String = 'tooltipPane'
- // `Map pane` where the tooltip will be added.
- pane: 'tooltipPane',
-
- // @option offset: Point = Point(0, 0)
- // Optional offset of the tooltip position.
- offset: [0, 0],
-
- // @option direction: String = 'auto'
- // Direction where to open the tooltip. Possible values are: `right`, `left`,
- // `top`, `bottom`, `center`, `auto`.
- // `auto` will dynamically switch between `right` and `left` according to the tooltip
- // position on the map.
- direction: 'auto',
-
- // @option permanent: Boolean = false
- // Whether to open the tooltip permanently or only on mouseover.
- permanent: false,
-
- // @option sticky: Boolean = false
- // If true, the tooltip will follow the mouse instead of being fixed at the feature center.
- sticky: false,
-
- // @option interactive: Boolean = false
- // If true, the tooltip will listen to the feature events.
- interactive: false,
-
- // @option opacity: Number = 0.9
- // Tooltip container opacity.
- opacity: 0.9
- },
-
- onAdd: function (map) {
- DivOverlay.prototype.onAdd.call(this, map);
- this.setOpacity(this.options.opacity);
-
- // @namespace Map
- // @section Tooltip events
- // @event tooltipopen: TooltipEvent
- // Fired when a tooltip is opened in the map.
- map.fire('tooltipopen', {tooltip: this});
-
- if (this._source) {
- // @namespace Layer
- // @section Tooltip events
- // @event tooltipopen: TooltipEvent
- // Fired when a tooltip bound to this layer is opened.
- this._source.fire('tooltipopen', {tooltip: this}, true);
- }
- },
-
- onRemove: function (map) {
- DivOverlay.prototype.onRemove.call(this, map);
-
- // @namespace Map
- // @section Tooltip events
- // @event tooltipclose: TooltipEvent
- // Fired when a tooltip in the map is closed.
- map.fire('tooltipclose', {tooltip: this});
-
- if (this._source) {
- // @namespace Layer
- // @section Tooltip events
- // @event tooltipclose: TooltipEvent
- // Fired when a tooltip bound to this layer is closed.
- this._source.fire('tooltipclose', {tooltip: this}, true);
- }
- },
-
- getEvents: function () {
- var events = DivOverlay.prototype.getEvents.call(this);
-
- if (touch && !this.options.permanent) {
- events.preclick = this._close;
- }
-
- return events;
- },
-
- _close: function () {
- if (this._map) {
- this._map.closeTooltip(this);
- }
- },
-
- _initLayout: function () {
- var prefix = 'leaflet-tooltip',
- className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');
-
- this._contentNode = this._container = create$1('div', className);
- },
-
- _updateLayout: function () {},
-
- _adjustPan: function () {},
-
- _setPosition: function (pos) {
- var subX, subY,
- map = this._map,
- container = this._container,
- centerPoint = map.latLngToContainerPoint(map.getCenter()),
- tooltipPoint = map.layerPointToContainerPoint(pos),
- direction = this.options.direction,
- tooltipWidth = container.offsetWidth,
- tooltipHeight = container.offsetHeight,
- offset = toPoint(this.options.offset),
- anchor = this._getAnchor();
-
- if (direction === 'top') {
- subX = tooltipWidth / 2;
- subY = tooltipHeight;
- } else if (direction === 'bottom') {
- subX = tooltipWidth / 2;
- subY = 0;
- } else if (direction === 'center') {
- subX = tooltipWidth / 2;
- subY = tooltipHeight / 2;
- } else if (direction === 'right') {
- subX = 0;
- subY = tooltipHeight / 2;
- } else if (direction === 'left') {
- subX = tooltipWidth;
- subY = tooltipHeight / 2;
- } else if (tooltipPoint.x < centerPoint.x) {
- direction = 'right';
- subX = 0;
- subY = tooltipHeight / 2;
- } else {
- direction = 'left';
- subX = tooltipWidth + (offset.x + anchor.x) * 2;
- subY = tooltipHeight / 2;
- }
-
- pos = pos.subtract(toPoint(subX, subY, true)).add(offset).add(anchor);
-
- removeClass(container, 'leaflet-tooltip-right');
- removeClass(container, 'leaflet-tooltip-left');
- removeClass(container, 'leaflet-tooltip-top');
- removeClass(container, 'leaflet-tooltip-bottom');
- addClass(container, 'leaflet-tooltip-' + direction);
- setPosition(container, pos);
- },
-
- _updatePosition: function () {
- var pos = this._map.latLngToLayerPoint(this._latlng);
- this._setPosition(pos);
- },
-
- setOpacity: function (opacity) {
- this.options.opacity = opacity;
-
- if (this._container) {
- setOpacity(this._container, opacity);
- }
- },
-
- _animateZoom: function (e) {
- var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);
- this._setPosition(pos);
- },
-
- _getAnchor: function () {
- // Where should we anchor the tooltip on the source layer?
- return toPoint(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]);
- }
-
- });
-
- // @namespace Tooltip
- // @factory L.tooltip(options?: Tooltip options, source?: Layer)
- // Instantiates a Tooltip object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the tooltip with a reference to the Layer to which it refers.
- var tooltip = function (options, source) {
- return new Tooltip(options, source);
- };
-
- // @namespace Map
- // @section Methods for Layers and Controls
- Map.include({
-
- // @method openTooltip(tooltip: Tooltip): this
- // Opens the specified tooltip.
- // @alternative
- // @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this
- // Creates a tooltip with the specified content and options and open it.
- openTooltip: function (tooltip, latlng, options) {
- if (!(tooltip instanceof Tooltip)) {
- tooltip = new Tooltip(options).setContent(tooltip);
- }
-
- if (latlng) {
- tooltip.setLatLng(latlng);
- }
-
- if (this.hasLayer(tooltip)) {
- return this;
- }
-
- return this.addLayer(tooltip);
- },
-
- // @method closeTooltip(tooltip?: Tooltip): this
- // Closes the tooltip given as parameter.
- closeTooltip: function (tooltip) {
- if (tooltip) {
- this.removeLayer(tooltip);
- }
- return this;
- }
-
- });
-
- /*
- * @namespace Layer
- * @section Tooltip methods example
- *
- * All layers share a set of methods convenient for binding tooltips to it.
- *
- * ```js
- * var layer = L.Polygon(latlngs).bindTooltip('Hi There!').addTo(map);
- * layer.openTooltip();
- * layer.closeTooltip();
- * ```
- */
-
- // @section Tooltip methods
- Layer.include({
-
- // @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this
- // Binds a tooltip to the layer with the passed `content` and sets up the
- // necessary event listeners. If a `Function` is passed it will receive
- // the layer as the first argument and should return a `String` or `HTMLElement`.
- bindTooltip: function (content, options) {
-
- if (content instanceof Tooltip) {
- setOptions(content, options);
- this._tooltip = content;
- content._source = this;
- } else {
- if (!this._tooltip || options) {
- this._tooltip = new Tooltip(options, this);
- }
- this._tooltip.setContent(content);
-
- }
-
- this._initTooltipInteractions();
-
- if (this._tooltip.options.permanent && this._map && this._map.hasLayer(this)) {
- this.openTooltip();
- }
-
- return this;
- },
-
- // @method unbindTooltip(): this
- // Removes the tooltip previously bound with `bindTooltip`.
- unbindTooltip: function () {
- if (this._tooltip) {
- this._initTooltipInteractions(true);
- this.closeTooltip();
- this._tooltip = null;
- }
- return this;
- },
-
- _initTooltipInteractions: function (remove$$1) {
- if (!remove$$1 && this._tooltipHandlersAdded) { return; }
- var onOff = remove$$1 ? 'off' : 'on',
- events = {
- remove: this.closeTooltip,
- move: this._moveTooltip
- };
- if (!this._tooltip.options.permanent) {
- events.mouseover = this._openTooltip;
- events.mouseout = this.closeTooltip;
- if (this._tooltip.options.sticky) {
- events.mousemove = this._moveTooltip;
- }
- if (touch) {
- events.click = this._openTooltip;
- }
- } else {
- events.add = this._openTooltip;
- }
- this[onOff](events);
- this._tooltipHandlersAdded = !remove$$1;
- },
-
- // @method openTooltip(latlng?: LatLng): this
- // Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed.
- openTooltip: function (layer, latlng) {
- if (this._tooltip && this._map) {
- latlng = this._tooltip._prepareOpen(this, layer, latlng);
-
- // open the tooltip on the map
- this._map.openTooltip(this._tooltip, latlng);
-
- // Tooltip container may not be defined if not permanent and never
- // opened.
- if (this._tooltip.options.interactive && this._tooltip._container) {
- addClass(this._tooltip._container, 'leaflet-clickable');
- this.addInteractiveTarget(this._tooltip._container);
- }
- }
-
- return this;
- },
-
- // @method closeTooltip(): this
- // Closes the tooltip bound to this layer if it is open.
- closeTooltip: function () {
- if (this._tooltip) {
- this._tooltip._close();
- if (this._tooltip.options.interactive && this._tooltip._container) {
- removeClass(this._tooltip._container, 'leaflet-clickable');
- this.removeInteractiveTarget(this._tooltip._container);
- }
- }
- return this;
- },
-
- // @method toggleTooltip(): this
- // Opens or closes the tooltip bound to this layer depending on its current state.
- toggleTooltip: function (target) {
- if (this._tooltip) {
- if (this._tooltip._map) {
- this.closeTooltip();
- } else {
- this.openTooltip(target);
- }
- }
- return this;
- },
-
- // @method isTooltipOpen(): boolean
- // Returns `true` if the tooltip bound to this layer is currently open.
- isTooltipOpen: function () {
- return this._tooltip.isOpen();
- },
-
- // @method setTooltipContent(content: String|HTMLElement|Tooltip): this
- // Sets the content of the tooltip bound to this layer.
- setTooltipContent: function (content) {
- if (this._tooltip) {
- this._tooltip.setContent(content);
- }
- return this;
- },
-
- // @method getTooltip(): Tooltip
- // Returns the tooltip bound to this layer.
- getTooltip: function () {
- return this._tooltip;
- },
-
- _openTooltip: function (e) {
- var layer = e.layer || e.target;
-
- if (!this._tooltip || !this._map) {
- return;
- }
- this.openTooltip(layer, this._tooltip.options.sticky ? e.latlng : undefined);
- },
-
- _moveTooltip: function (e) {
- var latlng = e.latlng, containerPoint, layerPoint;
- if (this._tooltip.options.sticky && e.originalEvent) {
- containerPoint = this._map.mouseEventToContainerPoint(e.originalEvent);
- layerPoint = this._map.containerPointToLayerPoint(containerPoint);
- latlng = this._map.layerPointToLatLng(layerPoint);
- }
- this._tooltip.setLatLng(latlng);
- }
- });
-
- /*
- * @class DivIcon
- * @aka L.DivIcon
- * @inherits Icon
- *
- * Represents a lightweight icon for markers that uses a simple `<div>`
- * element instead of an image. Inherits from `Icon` but ignores the `iconUrl` and shadow options.
- *
- * @example
- * ```js
- * var myIcon = L.divIcon({className: 'my-div-icon'});
- * // you can set .my-div-icon styles in CSS
- *
- * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
- * ```
- *
- * By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
- */
-
- var DivIcon = Icon.extend({
- options: {
- // @section
- // @aka DivIcon options
- iconSize: [12, 12], // also can be set through CSS
-
- // iconAnchor: (Point),
- // popupAnchor: (Point),
-
- // @option html: String|HTMLElement = ''
- // Custom HTML code to put inside the div element, empty by default. Alternatively,
- // an instance of `HTMLElement`.
- html: false,
-
- // @option bgPos: Point = [0, 0]
- // Optional relative position of the background, in pixels
- bgPos: null,
-
- className: 'leaflet-div-icon'
- },
-
- createIcon: function (oldIcon) {
- var div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'),
- options = this.options;
-
- if (options.html instanceof Element) {
- empty(div);
- div.appendChild(options.html);
- } else {
- div.innerHTML = options.html !== false ? options.html : '';
- }
-
- if (options.bgPos) {
- var bgPos = toPoint(options.bgPos);
- div.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px';
- }
- this._setIconStyles(div, 'icon');
-
- return div;
- },
-
- createShadow: function () {
- return null;
- }
- });
-
- // @factory L.divIcon(options: DivIcon options)
- // Creates a `DivIcon` instance with the given options.
- function divIcon(options) {
- return new DivIcon(options);
- }
-
- Icon.Default = IconDefault;
-
- /*
- * @class GridLayer
- * @inherits Layer
- * @aka L.GridLayer
- *
- * Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces `TileLayer.Canvas`.
- * GridLayer can be extended to create a tiled grid of HTML elements like `<canvas>`, `<img>` or `<div>`. GridLayer will handle creating and animating these DOM elements for you.
- *
- *
- * @section Synchronous usage
- * @example
- *
- * To create a custom layer, extend GridLayer and implement the `createTile()` method, which will be passed a `Point` object with the `x`, `y`, and `z` (zoom level) coordinates to draw your tile.
- *
- * ```js
- * var CanvasLayer = L.GridLayer.extend({
- * createTile: function(coords){
- * // create a <canvas> element for drawing
- * var tile = L.DomUtil.create('canvas', 'leaflet-tile');
- *
- * // setup tile width and height according to the options
- * var size = this.getTileSize();
- * tile.width = size.x;
- * tile.height = size.y;
- *
- * // get a canvas context and draw something on it using coords.x, coords.y and coords.z
- * var ctx = tile.getContext('2d');
- *
- * // return the tile so it can be rendered on screen
- * return tile;
- * }
- * });
- * ```
- *
- * @section Asynchronous usage
- * @example
- *
- * Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the `done()` callback.
- *
- * ```js
- * var CanvasLayer = L.GridLayer.extend({
- * createTile: function(coords, done){
- * var error;
- *
- * // create a <canvas> element for drawing
- * var tile = L.DomUtil.create('canvas', 'leaflet-tile');
- *
- * // setup tile width and height according to the options
- * var size = this.getTileSize();
- * tile.width = size.x;
- * tile.height = size.y;
- *
- * // draw something asynchronously and pass the tile to the done() callback
- * setTimeout(function() {
- * done(error, tile);
- * }, 1000);
- *
- * return tile;
- * }
- * });
- * ```
- *
- * @section
- */
-
-
- var GridLayer = Layer.extend({
-
- // @section
- // @aka GridLayer options
- options: {
- // @option tileSize: Number|Point = 256
- // Width and height of tiles in the grid. Use a number if width and height are equal, or `L.point(width, height)` otherwise.
- tileSize: 256,
-
- // @option opacity: Number = 1.0
- // Opacity of the tiles. Can be used in the `createTile()` function.
- opacity: 1,
-
- // @option updateWhenIdle: Boolean = (depends)
- // Load new tiles only when panning ends.
- // `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
- // `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the
- // [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers.
- updateWhenIdle: mobile,
-
- // @option updateWhenZooming: Boolean = true
- // By default, a smooth zoom animation (during a [touch zoom](#map-touchzoom) or a [`flyTo()`](#map-flyto)) will update grid layers every integer zoom level. Setting this option to `false` will update the grid layer only when the smooth animation ends.
- updateWhenZooming: true,
-
- // @option updateInterval: Number = 200
- // Tiles will not update more than once every `updateInterval` milliseconds when panning.
- updateInterval: 200,
-
- // @option zIndex: Number = 1
- // The explicit zIndex of the tile layer.
- zIndex: 1,
-
- // @option bounds: LatLngBounds = undefined
- // If set, tiles will only be loaded inside the set `LatLngBounds`.
- bounds: null,
-
- // @option minZoom: Number = 0
- // The minimum zoom level down to which this layer will be displayed (inclusive).
- minZoom: 0,
-
- // @option maxZoom: Number = undefined
- // The maximum zoom level up to which this layer will be displayed (inclusive).
- maxZoom: undefined,
-
- // @option maxNativeZoom: Number = undefined
- // Maximum zoom number the tile source has available. If it is specified,
- // the tiles on all zoom levels higher than `maxNativeZoom` will be loaded
- // from `maxNativeZoom` level and auto-scaled.
- maxNativeZoom: undefined,
-
- // @option minNativeZoom: Number = undefined
- // Minimum zoom number the tile source has available. If it is specified,
- // the tiles on all zoom levels lower than `minNativeZoom` will be loaded
- // from `minNativeZoom` level and auto-scaled.
- minNativeZoom: undefined,
-
- // @option noWrap: Boolean = false
- // Whether the layer is wrapped around the antimeridian. If `true`, the
- // GridLayer will only be displayed once at low zoom levels. Has no
- // effect when the [map CRS](#map-crs) doesn't wrap around. Can be used
- // in combination with [`bounds`](#gridlayer-bounds) to prevent requesting
- // tiles outside the CRS limits.
- noWrap: false,
-
- // @option pane: String = 'tilePane'
- // `Map pane` where the grid layer will be added.
- pane: 'tilePane',
-
- // @option className: String = ''
- // A custom class name to assign to the tile layer. Empty by default.
- className: '',
-
- // @option keepBuffer: Number = 2
- // When panning the map, keep this many rows and columns of tiles before unloading them.
- keepBuffer: 2
- },
-
- initialize: function (options) {
- setOptions(this, options);
- },
-
- onAdd: function () {
- this._initContainer();
-
- this._levels = {};
- this._tiles = {};
-
- this._resetView();
- this._update();
- },
-
- beforeAdd: function (map) {
- map._addZoomLimit(this);
- },
-
- onRemove: function (map) {
- this._removeAllTiles();
- remove(this._container);
- map._removeZoomLimit(this);
- this._container = null;
- this._tileZoom = undefined;
- },
-
- // @method bringToFront: this
- // Brings the tile layer to the top of all tile layers.
- bringToFront: function () {
- if (this._map) {
- toFront(this._container);
- this._setAutoZIndex(Math.max);
- }
- return this;
- },
-
- // @method bringToBack: this
- // Brings the tile layer to the bottom of all tile layers.
- bringToBack: function () {
- if (this._map) {
- toBack(this._container);
- this._setAutoZIndex(Math.min);
- }
- return this;
- },
-
- // @method getContainer: HTMLElement
- // Returns the HTML element that contains the tiles for this layer.
- getContainer: function () {
- return this._container;
- },
-
- // @method setOpacity(opacity: Number): this
- // Changes the [opacity](#gridlayer-opacity) of the grid layer.
- setOpacity: function (opacity) {
- this.options.opacity = opacity;
- this._updateOpacity();
- return this;
- },
-
- // @method setZIndex(zIndex: Number): this
- // Changes the [zIndex](#gridlayer-zindex) of the grid layer.
- setZIndex: function (zIndex) {
- this.options.zIndex = zIndex;
- this._updateZIndex();
-
- return this;
- },
-
- // @method isLoading: Boolean
- // Returns `true` if any tile in the grid layer has not finished loading.
- isLoading: function () {
- return this._loading;
- },
-
- // @method redraw: this
- // Causes the layer to clear all the tiles and request them again.
- redraw: function () {
- if (this._map) {
- this._removeAllTiles();
- this._update();
- }
- return this;
- },
-
- getEvents: function () {
- var events = {
- viewprereset: this._invalidateAll,
- viewreset: this._resetView,
- zoom: this._resetView,
- moveend: this._onMoveEnd
- };
-
- if (!this.options.updateWhenIdle) {
- // update tiles on move, but not more often than once per given interval
- if (!this._onMove) {
- this._onMove = throttle(this._onMoveEnd, this.options.updateInterval, this);
- }
-
- events.move = this._onMove;
- }
-
- if (this._zoomAnimated) {
- events.zoomanim = this._animateZoom;
- }
-
- return events;
- },
-
- // @section Extension methods
- // Layers extending `GridLayer` shall reimplement the following method.
- // @method createTile(coords: Object, done?: Function): HTMLElement
- // Called only internally, must be overridden by classes extending `GridLayer`.
- // Returns the `HTMLElement` corresponding to the given `coords`. If the `done` callback
- // is specified, it must be called when the tile has finished loading and drawing.
- createTile: function () {
- return document.createElement('div');
- },
-
- // @section
- // @method getTileSize: Point
- // Normalizes the [tileSize option](#gridlayer-tilesize) into a point. Used by the `createTile()` method.
- getTileSize: function () {
- var s = this.options.tileSize;
- return s instanceof Point ? s : new Point(s, s);
- },
-
- _updateZIndex: function () {
- if (this._container && this.options.zIndex !== undefined && this.options.zIndex !== null) {
- this._container.style.zIndex = this.options.zIndex;
- }
- },
-
- _setAutoZIndex: function (compare) {
- // go through all other layers of the same pane, set zIndex to max + 1 (front) or min - 1 (back)
-
- var layers = this.getPane().children,
- edgeZIndex = -compare(-Infinity, Infinity); // -Infinity for max, Infinity for min
-
- for (var i = 0, len = layers.length, zIndex; i < len; i++) {
-
- zIndex = layers[i].style.zIndex;
-
- if (layers[i] !== this._container && zIndex) {
- edgeZIndex = compare(edgeZIndex, +zIndex);
- }
- }
-
- if (isFinite(edgeZIndex)) {
- this.options.zIndex = edgeZIndex + compare(-1, 1);
- this._updateZIndex();
- }
- },
-
- _updateOpacity: function () {
- if (!this._map) { return; }
-
- // IE doesn't inherit filter opacity properly, so we're forced to set it on tiles
- if (ielt9) { return; }
-
- setOpacity(this._container, this.options.opacity);
-
- var now = +new Date(),
- nextFrame = false,
- willPrune = false;
-
- for (var key in this._tiles) {
- var tile = this._tiles[key];
- if (!tile.current || !tile.loaded) { continue; }
-
- var fade = Math.min(1, (now - tile.loaded) / 200);
-
- setOpacity(tile.el, fade);
- if (fade < 1) {
- nextFrame = true;
- } else {
- if (tile.active) {
- willPrune = true;
- } else {
- this._onOpaqueTile(tile);
- }
- tile.active = true;
- }
- }
-
- if (willPrune && !this._noPrune) { this._pruneTiles(); }
-
- if (nextFrame) {
- cancelAnimFrame(this._fadeFrame);
- this._fadeFrame = requestAnimFrame(this._updateOpacity, this);
- }
- },
-
- _onOpaqueTile: falseFn,
-
- _initContainer: function () {
- if (this._container) { return; }
-
- this._container = create$1('div', 'leaflet-layer ' + (this.options.className || ''));
- this._updateZIndex();
-
- if (this.options.opacity < 1) {
- this._updateOpacity();
- }
-
- this.getPane().appendChild(this._container);
- },
-
- _updateLevels: function () {
-
- var zoom = this._tileZoom,
- maxZoom = this.options.maxZoom;
-
- if (zoom === undefined) { return undefined; }
-
- for (var z in this._levels) {
- z = Number(z);
- if (this._levels[z].el.children.length || z === zoom) {
- this._levels[z].el.style.zIndex = maxZoom - Math.abs(zoom - z);
- this._onUpdateLevel(z);
- } else {
- remove(this._levels[z].el);
- this._removeTilesAtZoom(z);
- this._onRemoveLevel(z);
- delete this._levels[z];
- }
- }
-
- var level = this._levels[zoom],
- map = this._map;
-
- if (!level) {
- level = this._levels[zoom] = {};
-
- level.el = create$1('div', 'leaflet-tile-container leaflet-zoom-animated', this._container);
- level.el.style.zIndex = maxZoom;
-
- level.origin = map.project(map.unproject(map.getPixelOrigin()), zoom).round();
- level.zoom = zoom;
-
- this._setZoomTransform(level, map.getCenter(), map.getZoom());
-
- // force the browser to consider the newly added element for transition
- falseFn(level.el.offsetWidth);
-
- this._onCreateLevel(level);
- }
-
- this._level = level;
-
- return level;
- },
-
- _onUpdateLevel: falseFn,
-
- _onRemoveLevel: falseFn,
-
- _onCreateLevel: falseFn,
-
- _pruneTiles: function () {
- if (!this._map) {
- return;
- }
-
- var key, tile;
-
- var zoom = this._map.getZoom();
- if (zoom > this.options.maxZoom ||
- zoom < this.options.minZoom) {
- this._removeAllTiles();
- return;
- }
-
- for (key in this._tiles) {
- tile = this._tiles[key];
- tile.retain = tile.current;
- }
-
- for (key in this._tiles) {
- tile = this._tiles[key];
- if (tile.current && !tile.active) {
- var coords = tile.coords;
- if (!this._retainParent(coords.x, coords.y, coords.z, coords.z - 5)) {
- this._retainChildren(coords.x, coords.y, coords.z, coords.z + 2);
- }
- }
- }
-
- for (key in this._tiles) {
- if (!this._tiles[key].retain) {
- this._removeTile(key);
- }
- }
- },
-
- _removeTilesAtZoom: function (zoom) {
- for (var key in this._tiles) {
- if (this._tiles[key].coords.z !== zoom) {
- continue;
- }
- this._removeTile(key);
- }
- },
-
- _removeAllTiles: function () {
- for (var key in this._tiles) {
- this._removeTile(key);
- }
- },
-
- _invalidateAll: function () {
- for (var z in this._levels) {
- remove(this._levels[z].el);
- this._onRemoveLevel(Number(z));
- delete this._levels[z];
- }
- this._removeAllTiles();
-
- this._tileZoom = undefined;
- },
-
- _retainParent: function (x, y, z, minZoom) {
- var x2 = Math.floor(x / 2),
- y2 = Math.floor(y / 2),
- z2 = z - 1,
- coords2 = new Point(+x2, +y2);
- coords2.z = +z2;
-
- var key = this._tileCoordsToKey(coords2),
- tile = this._tiles[key];
-
- if (tile && tile.active) {
- tile.retain = true;
- return true;
-
- } else if (tile && tile.loaded) {
- tile.retain = true;
- }
-
- if (z2 > minZoom) {
- return this._retainParent(x2, y2, z2, minZoom);
- }
-
- return false;
- },
-
- _retainChildren: function (x, y, z, maxZoom) {
-
- for (var i = 2 * x; i < 2 * x + 2; i++) {
- for (var j = 2 * y; j < 2 * y + 2; j++) {
-
- var coords = new Point(i, j);
- coords.z = z + 1;
-
- var key = this._tileCoordsToKey(coords),
- tile = this._tiles[key];
-
- if (tile && tile.active) {
- tile.retain = true;
- continue;
-
- } else if (tile && tile.loaded) {
- tile.retain = true;
- }
-
- if (z + 1 < maxZoom) {
- this._retainChildren(i, j, z + 1, maxZoom);
- }
- }
- }
- },
-
- _resetView: function (e) {
- var animating = e && (e.pinch || e.flyTo);
- this._setView(this._map.getCenter(), this._map.getZoom(), animating, animating);
- },
-
- _animateZoom: function (e) {
- this._setView(e.center, e.zoom, true, e.noUpdate);
- },
-
- _clampZoom: function (zoom) {
- var options = this.options;
-
- if (undefined !== options.minNativeZoom && zoom < options.minNativeZoom) {
- return options.minNativeZoom;
- }
-
- if (undefined !== options.maxNativeZoom && options.maxNativeZoom < zoom) {
- return options.maxNativeZoom;
- }
-
- return zoom;
- },
-
- _setView: function (center, zoom, noPrune, noUpdate) {
- var tileZoom = Math.round(zoom);
- if ((this.options.maxZoom !== undefined && tileZoom > this.options.maxZoom) ||
- (this.options.minZoom !== undefined && tileZoom < this.options.minZoom)) {
- tileZoom = undefined;
- } else {
- tileZoom = this._clampZoom(tileZoom);
- }
-
- var tileZoomChanged = this.options.updateWhenZooming && (tileZoom !== this._tileZoom);
-
- if (!noUpdate || tileZoomChanged) {
-
- this._tileZoom = tileZoom;
-
- if (this._abortLoading) {
- this._abortLoading();
- }
-
- this._updateLevels();
- this._resetGrid();
-
- if (tileZoom !== undefined) {
- this._update(center);
- }
-
- if (!noPrune) {
- this._pruneTiles();
- }
-
- // Flag to prevent _updateOpacity from pruning tiles during
- // a zoom anim or a pinch gesture
- this._noPrune = !!noPrune;
- }
-
- this._setZoomTransforms(center, zoom);
- },
-
- _setZoomTransforms: function (center, zoom) {
- for (var i in this._levels) {
- this._setZoomTransform(this._levels[i], center, zoom);
- }
- },
-
- _setZoomTransform: function (level, center, zoom) {
- var scale = this._map.getZoomScale(zoom, level.zoom),
- translate = level.origin.multiplyBy(scale)
- .subtract(this._map._getNewPixelOrigin(center, zoom)).round();
-
- if (any3d) {
- setTransform(level.el, translate, scale);
- } else {
- setPosition(level.el, translate);
- }
- },
-
- _resetGrid: function () {
- var map = this._map,
- crs = map.options.crs,
- tileSize = this._tileSize = this.getTileSize(),
- tileZoom = this._tileZoom;
-
- var bounds = this._map.getPixelWorldBounds(this._tileZoom);
- if (bounds) {
- this._globalTileRange = this._pxBoundsToTileRange(bounds);
- }
-
- this._wrapX = crs.wrapLng && !this.options.noWrap && [
- Math.floor(map.project([0, crs.wrapLng[0]], tileZoom).x / tileSize.x),
- Math.ceil(map.project([0, crs.wrapLng[1]], tileZoom).x / tileSize.y)
- ];
- this._wrapY = crs.wrapLat && !this.options.noWrap && [
- Math.floor(map.project([crs.wrapLat[0], 0], tileZoom).y / tileSize.x),
- Math.ceil(map.project([crs.wrapLat[1], 0], tileZoom).y / tileSize.y)
- ];
- },
-
- _onMoveEnd: function () {
- if (!this._map || this._map._animatingZoom) { return; }
-
- this._update();
- },
-
- _getTiledPixelBounds: function (center) {
- var map = this._map,
- mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(),
- scale = map.getZoomScale(mapZoom, this._tileZoom),
- pixelCenter = map.project(center, this._tileZoom).floor(),
- halfSize = map.getSize().divideBy(scale * 2);
-
- return new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));
- },
-
- // Private method to load tiles in the grid's active zoom level according to map bounds
- _update: function (center) {
- var map = this._map;
- if (!map) { return; }
- var zoom = this._clampZoom(map.getZoom());
-
- if (center === undefined) { center = map.getCenter(); }
- if (this._tileZoom === undefined) { return; } // if out of minzoom/maxzoom
-
- var pixelBounds = this._getTiledPixelBounds(center),
- tileRange = this._pxBoundsToTileRange(pixelBounds),
- tileCenter = tileRange.getCenter(),
- queue = [],
- margin = this.options.keepBuffer,
- noPruneRange = new Bounds(tileRange.getBottomLeft().subtract([margin, -margin]),
- tileRange.getTopRight().add([margin, -margin]));
-
- // Sanity check: panic if the tile range contains Infinity somewhere.
- if (!(isFinite(tileRange.min.x) &&
- isFinite(tileRange.min.y) &&
- isFinite(tileRange.max.x) &&
- isFinite(tileRange.max.y))) { throw new Error('Attempted to load an infinite number of tiles'); }
-
- for (var key in this._tiles) {
- var c = this._tiles[key].coords;
- if (c.z !== this._tileZoom || !noPruneRange.contains(new Point(c.x, c.y))) {
- this._tiles[key].current = false;
- }
- }
-
- // _update just loads more tiles. If the tile zoom level differs too much
- // from the map's, let _setView reset levels and prune old tiles.
- if (Math.abs(zoom - this._tileZoom) > 1) { this._setView(center, zoom); return; }
-
- // create a queue of coordinates to load tiles from
- for (var j = tileRange.min.y; j <= tileRange.max.y; j++) {
- for (var i = tileRange.min.x; i <= tileRange.max.x; i++) {
- var coords = new Point(i, j);
- coords.z = this._tileZoom;
-
- if (!this._isValidTile(coords)) { continue; }
-
- var tile = this._tiles[this._tileCoordsToKey(coords)];
- if (tile) {
- tile.current = true;
- } else {
- queue.push(coords);
- }
- }
- }
-
- // sort tile queue to load tiles in order of their distance to center
- queue.sort(function (a, b) {
- return a.distanceTo(tileCenter) - b.distanceTo(tileCenter);
- });
-
- if (queue.length !== 0) {
- // if it's the first batch of tiles to load
- if (!this._loading) {
- this._loading = true;
- // @event loading: Event
- // Fired when the grid layer starts loading tiles.
- this.fire('loading');
- }
-
- // create DOM fragment to append tiles in one batch
- var fragment = document.createDocumentFragment();
-
- for (i = 0; i < queue.length; i++) {
- this._addTile(queue[i], fragment);
- }
-
- this._level.el.appendChild(fragment);
- }
- },
-
- _isValidTile: function (coords) {
- var crs = this._map.options.crs;
-
- if (!crs.infinite) {
- // don't load tile if it's out of bounds and not wrapped
- var bounds = this._globalTileRange;
- if ((!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||
- (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))) { return false; }
- }
-
- if (!this.options.bounds) { return true; }
-
- // don't load tile if it doesn't intersect the bounds in options
- var tileBounds = this._tileCoordsToBounds(coords);
- return toLatLngBounds(this.options.bounds).overlaps(tileBounds);
- },
-
- _keyToBounds: function (key) {
- return this._tileCoordsToBounds(this._keyToTileCoords(key));
- },
-
- _tileCoordsToNwSe: function (coords) {
- var map = this._map,
- tileSize = this.getTileSize(),
- nwPoint = coords.scaleBy(tileSize),
- sePoint = nwPoint.add(tileSize),
- nw = map.unproject(nwPoint, coords.z),
- se = map.unproject(sePoint, coords.z);
- return [nw, se];
- },
-
- // converts tile coordinates to its geographical bounds
- _tileCoordsToBounds: function (coords) {
- var bp = this._tileCoordsToNwSe(coords),
- bounds = new LatLngBounds(bp[0], bp[1]);
-
- if (!this.options.noWrap) {
- bounds = this._map.wrapLatLngBounds(bounds);
- }
- return bounds;
- },
- // converts tile coordinates to key for the tile cache
- _tileCoordsToKey: function (coords) {
- return coords.x + ':' + coords.y + ':' + coords.z;
- },
-
- // converts tile cache key to coordinates
- _keyToTileCoords: function (key) {
- var k = key.split(':'),
- coords = new Point(+k[0], +k[1]);
- coords.z = +k[2];
- return coords;
- },
-
- _removeTile: function (key) {
- var tile = this._tiles[key];
- if (!tile) { return; }
-
- remove(tile.el);
-
- delete this._tiles[key];
-
- // @event tileunload: TileEvent
- // Fired when a tile is removed (e.g. when a tile goes off the screen).
- this.fire('tileunload', {
- tile: tile.el,
- coords: this._keyToTileCoords(key)
- });
- },
-
- _initTile: function (tile) {
- addClass(tile, 'leaflet-tile');
-
- var tileSize = this.getTileSize();
- tile.style.width = tileSize.x + 'px';
- tile.style.height = tileSize.y + 'px';
-
- tile.onselectstart = falseFn;
- tile.onmousemove = falseFn;
-
- // update opacity on tiles in IE7-8 because of filter inheritance problems
- if (ielt9 && this.options.opacity < 1) {
- setOpacity(tile, this.options.opacity);
- }
-
- // without this hack, tiles disappear after zoom on Chrome for Android
- // https://github.com/Leaflet/Leaflet/issues/2078
- if (android && !android23) {
- tile.style.WebkitBackfaceVisibility = 'hidden';
- }
- },
-
- _addTile: function (coords, container) {
- var tilePos = this._getTilePos(coords),
- key = this._tileCoordsToKey(coords);
-
- var tile = this.createTile(this._wrapCoords(coords), bind(this._tileReady, this, coords));
-
- this._initTile(tile);
-
- // if createTile is defined with a second argument ("done" callback),
- // we know that tile is async and will be ready later; otherwise
- if (this.createTile.length < 2) {
- // mark tile as ready, but delay one frame for opacity animation to happen
- requestAnimFrame(bind(this._tileReady, this, coords, null, tile));
- }
-
- setPosition(tile, tilePos);
-
- // save tile in cache
- this._tiles[key] = {
- el: tile,
- coords: coords,
- current: true
- };
-
- container.appendChild(tile);
- // @event tileloadstart: TileEvent
- // Fired when a tile is requested and starts loading.
- this.fire('tileloadstart', {
- tile: tile,
- coords: coords
- });
- },
-
- _tileReady: function (coords, err, tile) {
- if (err) {
- // @event tileerror: TileErrorEvent
- // Fired when there is an error loading a tile.
- this.fire('tileerror', {
- error: err,
- tile: tile,
- coords: coords
- });
- }
-
- var key = this._tileCoordsToKey(coords);
-
- tile = this._tiles[key];
- if (!tile) { return; }
-
- tile.loaded = +new Date();
- if (this._map._fadeAnimated) {
- setOpacity(tile.el, 0);
- cancelAnimFrame(this._fadeFrame);
- this._fadeFrame = requestAnimFrame(this._updateOpacity, this);
- } else {
- tile.active = true;
- this._pruneTiles();
- }
-
- if (!err) {
- addClass(tile.el, 'leaflet-tile-loaded');
-
- // @event tileload: TileEvent
- // Fired when a tile loads.
- this.fire('tileload', {
- tile: tile.el,
- coords: coords
- });
- }
-
- if (this._noTilesToLoad()) {
- this._loading = false;
- // @event load: Event
- // Fired when the grid layer loaded all visible tiles.
- this.fire('load');
-
- if (ielt9 || !this._map._fadeAnimated) {
- requestAnimFrame(this._pruneTiles, this);
- } else {
- // Wait a bit more than 0.2 secs (the duration of the tile fade-in)
- // to trigger a pruning.
- setTimeout(bind(this._pruneTiles, this), 250);
- }
- }
- },
-
- _getTilePos: function (coords) {
- return coords.scaleBy(this.getTileSize()).subtract(this._level.origin);
- },
-
- _wrapCoords: function (coords) {
- var newCoords = new Point(
- this._wrapX ? wrapNum(coords.x, this._wrapX) : coords.x,
- this._wrapY ? wrapNum(coords.y, this._wrapY) : coords.y);
- newCoords.z = coords.z;
- return newCoords;
- },
-
- _pxBoundsToTileRange: function (bounds) {
- var tileSize = this.getTileSize();
- return new Bounds(
- bounds.min.unscaleBy(tileSize).floor(),
- bounds.max.unscaleBy(tileSize).ceil().subtract([1, 1]));
- },
-
- _noTilesToLoad: function () {
- for (var key in this._tiles) {
- if (!this._tiles[key].loaded) { return false; }
- }
- return true;
- }
- });
-
- // @factory L.gridLayer(options?: GridLayer options)
- // Creates a new instance of GridLayer with the supplied options.
- function gridLayer(options) {
- return new GridLayer(options);
- }
-
- /*\r
- * @class TileLayer\r
- * @inherits GridLayer\r
- * @aka L.TileLayer\r
- * Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under `Layer`. Extends `GridLayer`.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(map);\r
- * ```\r
- *\r
- * @section URL template\r
- * @example\r
- *\r
- * A string of the following form:\r
- *\r
- * ```\r
- * 'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'\r
- * ```\r
- *\r
- * `{s}` means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; `a`, `b` or `c` by default, can be omitted), `{z}` — zoom level, `{x}` and `{y}` — tile coordinates. `{r}` can be used to add "@2x" to the URL to load retina tiles.\r
- *\r
- * You can use custom keys in the template, which will be [evaluated](#util-template) from TileLayer options, like this:\r
- *\r
- * ```\r
- * L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});\r
- * ```\r
- */\r
-\r
-\r
- var TileLayer = GridLayer.extend({\r
-\r
- // @section\r
- // @aka TileLayer options\r
- options: {\r
- // @option minZoom: Number = 0\r
- // The minimum zoom level down to which this layer will be displayed (inclusive).\r
- minZoom: 0,\r
-\r
- // @option maxZoom: Number = 18\r
- // The maximum zoom level up to which this layer will be displayed (inclusive).\r
- maxZoom: 18,\r
-\r
- // @option subdomains: String|String[] = 'abc'\r
- // Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.\r
- subdomains: 'abc',\r
-\r
- // @option errorTileUrl: String = ''\r
- // URL to the tile image to show in place of the tile that failed to load.\r
- errorTileUrl: '',\r
-\r
- // @option zoomOffset: Number = 0\r
- // The zoom number used in tile URLs will be offset with this value.\r
- zoomOffset: 0,\r
-\r
- // @option tms: Boolean = false\r
- // If `true`, inverses Y axis numbering for tiles (turn this on for [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) services).\r
- tms: false,\r
-\r
- // @option zoomReverse: Boolean = false\r
- // If set to true, the zoom number used in tile URLs will be reversed (`maxZoom - zoom` instead of `zoom`)\r
- zoomReverse: false,\r
-\r
- // @option detectRetina: Boolean = false\r
- // If `true` and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.\r
- detectRetina: false,\r
-\r
- // @option crossOrigin: Boolean|String = false\r
- // Whether the crossOrigin attribute will be added to the tiles.\r
- // If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.\r
- // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r
- crossOrigin: false\r
- },\r
-\r
- initialize: function (url, options) {\r
-\r
- this._url = url;\r
-\r
- options = setOptions(this, options);\r
-\r
- // detecting retina displays, adjusting tileSize and zoom levels\r
- if (options.detectRetina && retina && options.maxZoom > 0) {\r
-\r
- options.tileSize = Math.floor(options.tileSize / 2);\r
-\r
- if (!options.zoomReverse) {\r
- options.zoomOffset++;\r
- options.maxZoom--;\r
- } else {\r
- options.zoomOffset--;\r
- options.minZoom++;\r
- }\r
-\r
- options.minZoom = Math.max(0, options.minZoom);\r
- }\r
-\r
- if (typeof options.subdomains === 'string') {\r
- options.subdomains = options.subdomains.split('');\r
- }\r
-\r
- // for https://github.com/Leaflet/Leaflet/issues/137\r
- if (!android) {\r
- this.on('tileunload', this._onTileRemove);\r
- }\r
- },\r
-\r
- // @method setUrl(url: String, noRedraw?: Boolean): this\r
- // Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).\r
- // If the URL does not change, the layer will not be redrawn unless\r
- // the noRedraw parameter is set to false.\r
- setUrl: function (url, noRedraw) {\r
- if (this._url === url && noRedraw === undefined) {\r
- noRedraw = true;\r
- }\r
-\r
- this._url = url;\r
-\r
- if (!noRedraw) {\r
- this.redraw();\r
- }\r
- return this;\r
- },\r
-\r
- // @method createTile(coords: Object, done?: Function): HTMLElement\r
- // Called only internally, overrides GridLayer's [`createTile()`](#gridlayer-createtile)\r
- // to return an `<img>` HTML element with the appropriate image URL given `coords`. The `done`\r
- // callback is called when the tile has been loaded.\r
- createTile: function (coords, done) {\r
- var tile = document.createElement('img');\r
-\r
- on(tile, 'load', bind(this._tileOnLoad, this, done, tile));\r
- on(tile, 'error', bind(this._tileOnError, this, done, tile));\r
-\r
- if (this.options.crossOrigin || this.options.crossOrigin === '') {\r
- tile.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r
- }\r
-\r
- /*\r
- Alt tag is set to empty string to keep screen readers from reading URL and for compliance reasons\r
- http://www.w3.org/TR/WCAG20-TECHS/H67\r
- */\r
- tile.alt = '';\r
-\r
- /*\r
- Set role="presentation" to force screen readers to ignore this\r
- https://www.w3.org/TR/wai-aria/roles#textalternativecomputation\r
- */\r
- tile.setAttribute('role', 'presentation');\r
-\r
- tile.src = this.getTileUrl(coords);\r
-\r
- return tile;\r
- },\r
-\r
- // @section Extension methods\r
- // @uninheritable\r
- // Layers extending `TileLayer` might reimplement the following method.\r
- // @method getTileUrl(coords: Object): String\r
- // Called only internally, returns the URL for a tile given its coordinates.\r
- // Classes extending `TileLayer` can override this function to provide custom tile URL naming schemes.\r
- getTileUrl: function (coords) {\r
- var data = {\r
- r: retina ? '@2x' : '',\r
- s: this._getSubdomain(coords),\r
- x: coords.x,\r
- y: coords.y,\r
- z: this._getZoomForUrl()\r
- };\r
- if (this._map && !this._map.options.crs.infinite) {\r
- var invertedY = this._globalTileRange.max.y - coords.y;\r
- if (this.options.tms) {\r
- data['y'] = invertedY;\r
- }\r
- data['-y'] = invertedY;\r
- }\r
-\r
- return template(this._url, extend(data, this.options));\r
- },\r
-\r
- _tileOnLoad: function (done, tile) {\r
- // For https://github.com/Leaflet/Leaflet/issues/3332\r
- if (ielt9) {\r
- setTimeout(bind(done, this, null, tile), 0);\r
- } else {\r
- done(null, tile);\r
- }\r
- },\r
-\r
- _tileOnError: function (done, tile, e) {\r
- var errorUrl = this.options.errorTileUrl;\r
- if (errorUrl && tile.getAttribute('src') !== errorUrl) {\r
- tile.src = errorUrl;\r
- }\r
- done(e, tile);\r
- },\r
-\r
- _onTileRemove: function (e) {\r
- e.tile.onload = null;\r
- },\r
-\r
- _getZoomForUrl: function () {\r
- var zoom = this._tileZoom,\r
- maxZoom = this.options.maxZoom,\r
- zoomReverse = this.options.zoomReverse,\r
- zoomOffset = this.options.zoomOffset;\r
-\r
- if (zoomReverse) {\r
- zoom = maxZoom - zoom;\r
- }\r
-\r
- return zoom + zoomOffset;\r
- },\r
-\r
- _getSubdomain: function (tilePoint) {\r
- var index = Math.abs(tilePoint.x + tilePoint.y) % this.options.subdomains.length;\r
- return this.options.subdomains[index];\r
- },\r
-\r
- // stops loading all tiles in the background layer\r
- _abortLoading: function () {\r
- var i, tile;\r
- for (i in this._tiles) {\r
- if (this._tiles[i].coords.z !== this._tileZoom) {\r
- tile = this._tiles[i].el;\r
-\r
- tile.onload = falseFn;\r
- tile.onerror = falseFn;\r
-\r
- if (!tile.complete) {\r
- tile.src = emptyImageUrl;\r
- remove(tile);\r
- delete this._tiles[i];\r
- }\r
- }\r
- }\r
- },\r
-\r
- _removeTile: function (key) {\r
- var tile = this._tiles[key];\r
- if (!tile) { return; }\r
-\r
- // Cancels any pending http requests associated with the tile\r
- // unless we're on Android's stock browser,\r
- // see https://github.com/Leaflet/Leaflet/issues/137\r
- if (!androidStock) {\r
- tile.el.setAttribute('src', emptyImageUrl);\r
- }\r
-\r
- return GridLayer.prototype._removeTile.call(this, key);\r
- },\r
-\r
- _tileReady: function (coords, err, tile) {\r
- if (!this._map || (tile && tile.getAttribute('src') === emptyImageUrl)) {\r
- return;\r
- }\r
-\r
- return GridLayer.prototype._tileReady.call(this, coords, err, tile);\r
- }\r
- });\r
-\r
-\r
- // @factory L.tilelayer(urlTemplate: String, options?: TileLayer options)\r
- // Instantiates a tile layer object given a `URL template` and optionally an options object.\r
-\r
- function tileLayer(url, options) {\r
- return new TileLayer(url, options);\r
- }
-
- /*\r
- * @class TileLayer.WMS\r
- * @inherits TileLayer\r
- * @aka L.TileLayer.WMS\r
- * Used to display [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services as tile layers on the map. Extends `TileLayer`.\r
- *\r
- * @example\r
- *\r
- * ```js\r
- * var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {\r
- * layers: 'nexrad-n0r-900913',\r
- * format: 'image/png',\r
- * transparent: true,\r
- * attribution: "Weather data © 2012 IEM Nexrad"\r
- * });\r
- * ```\r
- */\r
-\r
- var TileLayerWMS = TileLayer.extend({\r
-\r
- // @section\r
- // @aka TileLayer.WMS options\r
- // If any custom options not documented here are used, they will be sent to the\r
- // WMS server as extra parameters in each request URL. This can be useful for\r
- // [non-standard vendor WMS parameters](http://docs.geoserver.org/stable/en/user/services/wms/vendor.html).\r
- defaultWmsParams: {\r
- service: 'WMS',\r
- request: 'GetMap',\r
-\r
- // @option layers: String = ''\r
- // **(required)** Comma-separated list of WMS layers to show.\r
- layers: '',\r
-\r
- // @option styles: String = ''\r
- // Comma-separated list of WMS styles.\r
- styles: '',\r
-\r
- // @option format: String = 'image/jpeg'\r
- // WMS image format (use `'image/png'` for layers with transparency).\r
- format: 'image/jpeg',\r
-\r
- // @option transparent: Boolean = false\r
- // If `true`, the WMS service will return images with transparency.\r
- transparent: false,\r
-\r
- // @option version: String = '1.1.1'\r
- // Version of the WMS service to use\r
- version: '1.1.1'\r
- },\r
-\r
- options: {\r
- // @option crs: CRS = null\r
- // Coordinate Reference System to use for the WMS requests, defaults to\r
- // map CRS. Don't change this if you're not sure what it means.\r
- crs: null,\r
-\r
- // @option uppercase: Boolean = false\r
- // If `true`, WMS request parameter keys will be uppercase.\r
- uppercase: false\r
- },\r
-\r
- initialize: function (url, options) {\r
-\r
- this._url = url;\r
-\r
- var wmsParams = extend({}, this.defaultWmsParams);\r
-\r
- // all keys that are not TileLayer options go to WMS params\r
- for (var i in options) {\r
- if (!(i in this.options)) {\r
- wmsParams[i] = options[i];\r
- }\r
- }\r
-\r
- options = setOptions(this, options);\r
-\r
- var realRetina = options.detectRetina && retina ? 2 : 1;\r
- var tileSize = this.getTileSize();\r
- wmsParams.width = tileSize.x * realRetina;\r
- wmsParams.height = tileSize.y * realRetina;\r
-\r
- this.wmsParams = wmsParams;\r
- },\r
-\r
- onAdd: function (map) {\r
-\r
- this._crs = this.options.crs || map.options.crs;\r
- this._wmsVersion = parseFloat(this.wmsParams.version);\r
-\r
- var projectionKey = this._wmsVersion >= 1.3 ? 'crs' : 'srs';\r
- this.wmsParams[projectionKey] = this._crs.code;\r
-\r
- TileLayer.prototype.onAdd.call(this, map);\r
- },\r
-\r
- getTileUrl: function (coords) {\r
-\r
- var tileBounds = this._tileCoordsToNwSe(coords),\r
- crs = this._crs,\r
- bounds = toBounds(crs.project(tileBounds[0]), crs.project(tileBounds[1])),\r
- min = bounds.min,\r
- max = bounds.max,\r
- bbox = (this._wmsVersion >= 1.3 && this._crs === EPSG4326 ?\r
- [min.y, min.x, max.y, max.x] :\r
- [min.x, min.y, max.x, max.y]).join(','),\r
- url = TileLayer.prototype.getTileUrl.call(this, coords);\r
- return url +\r
- getParamString(this.wmsParams, url, this.options.uppercase) +\r
- (this.options.uppercase ? '&BBOX=' : '&bbox=') + bbox;\r
- },\r
-\r
- // @method setParams(params: Object, noRedraw?: Boolean): this\r
- // Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true).\r
- setParams: function (params, noRedraw) {\r
-\r
- extend(this.wmsParams, params);\r
-\r
- if (!noRedraw) {\r
- this.redraw();\r
- }\r
-\r
- return this;\r
- }\r
- });\r
-\r
-\r
- // @factory L.tileLayer.wms(baseUrl: String, options: TileLayer.WMS options)\r
- // Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.\r
- function tileLayerWMS(url, options) {\r
- return new TileLayerWMS(url, options);\r
- }
-
- TileLayer.WMS = TileLayerWMS;
- tileLayer.wms = tileLayerWMS;
-
- /*
- * @class Renderer
- * @inherits Layer
- * @aka L.Renderer
- *
- * Base class for vector renderer implementations (`SVG`, `Canvas`). Handles the
- * DOM container of the renderer, its bounds, and its zoom animation.
- *
- * A `Renderer` works as an implicit layer group for all `Path`s - the renderer
- * itself can be added or removed to the map. All paths use a renderer, which can
- * be implicit (the map will decide the type of renderer and use it automatically)
- * or explicit (using the [`renderer`](#path-renderer) option of the path).
- *
- * Do not use this class directly, use `SVG` and `Canvas` instead.
- *
- * @event update: Event
- * Fired when the renderer updates its bounds, center and zoom, for example when
- * its map has moved
- */
-
- var Renderer = Layer.extend({
-
- // @section
- // @aka Renderer options
- options: {
- // @option padding: Number = 0.1
- // How much to extend the clip area around the map view (relative to its size)
- // e.g. 0.1 would be 10% of map view in each direction
- padding: 0.1,
-
- // @option tolerance: Number = 0
- // How much to extend click tolerance round a path/object on the map
- tolerance : 0
- },
-
- initialize: function (options) {
- setOptions(this, options);
- stamp(this);
- this._layers = this._layers || {};
- },
-
- onAdd: function () {
- if (!this._container) {
- this._initContainer(); // defined by renderer implementations
-
- if (this._zoomAnimated) {
- addClass(this._container, 'leaflet-zoom-animated');
- }
- }
-
- this.getPane().appendChild(this._container);
- this._update();
- this.on('update', this._updatePaths, this);
- },
-
- onRemove: function () {
- this.off('update', this._updatePaths, this);
- this._destroyContainer();
- },
-
- getEvents: function () {
- var events = {
- viewreset: this._reset,
- zoom: this._onZoom,
- moveend: this._update,
- zoomend: this._onZoomEnd
- };
- if (this._zoomAnimated) {
- events.zoomanim = this._onAnimZoom;
- }
- return events;
- },
-
- _onAnimZoom: function (ev) {
- this._updateTransform(ev.center, ev.zoom);
- },
-
- _onZoom: function () {
- this._updateTransform(this._map.getCenter(), this._map.getZoom());
- },
-
- _updateTransform: function (center, zoom) {
- var scale = this._map.getZoomScale(zoom, this._zoom),
- position = getPosition(this._container),
- viewHalf = this._map.getSize().multiplyBy(0.5 + this.options.padding),
- currentCenterPoint = this._map.project(this._center, zoom),
- destCenterPoint = this._map.project(center, zoom),
- centerOffset = destCenterPoint.subtract(currentCenterPoint),
-
- topLeftOffset = viewHalf.multiplyBy(-scale).add(position).add(viewHalf).subtract(centerOffset);
-
- if (any3d) {
- setTransform(this._container, topLeftOffset, scale);
- } else {
- setPosition(this._container, topLeftOffset);
- }
- },
-
- _reset: function () {
- this._update();
- this._updateTransform(this._center, this._zoom);
-
- for (var id in this._layers) {
- this._layers[id]._reset();
- }
- },
-
- _onZoomEnd: function () {
- for (var id in this._layers) {
- this._layers[id]._project();
- }
- },
-
- _updatePaths: function () {
- for (var id in this._layers) {
- this._layers[id]._update();
- }
- },
-
- _update: function () {
- // Update pixel bounds of renderer container (for positioning/sizing/clipping later)
- // Subclasses are responsible of firing the 'update' event.
- var p = this.options.padding,
- size = this._map.getSize(),
- min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round();
-
- this._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());
-
- this._center = this._map.getCenter();
- this._zoom = this._map.getZoom();
- }
- });
-
- /*
- * @class Canvas
- * @inherits Renderer
- * @aka L.Canvas
- *
- * Allows vector layers to be displayed with [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).
- * Inherits `Renderer`.
- *
- * Due to [technical limitations](http://caniuse.com/#search=canvas), Canvas is not
- * available in all web browsers, notably IE8, and overlapping geometries might
- * not display properly in some edge cases.
- *
- * @example
- *
- * Use Canvas by default for all paths in the map:
- *
- * ```js
- * var map = L.map('map', {
- * renderer: L.canvas()
- * });
- * ```
- *
- * Use a Canvas renderer with extra padding for specific vector geometries:
- *
- * ```js
- * var map = L.map('map');
- * var myRenderer = L.canvas({ padding: 0.5 });
- * var line = L.polyline( coordinates, { renderer: myRenderer } );
- * var circle = L.circle( center, { renderer: myRenderer } );
- * ```
- */
-
- var Canvas = Renderer.extend({
- getEvents: function () {
- var events = Renderer.prototype.getEvents.call(this);
- events.viewprereset = this._onViewPreReset;
- return events;
- },
-
- _onViewPreReset: function () {
- // Set a flag so that a viewprereset+moveend+viewreset only updates&redraws once
- this._postponeUpdatePaths = true;
- },
-
- onAdd: function () {
- Renderer.prototype.onAdd.call(this);
-
- // Redraw vectors since canvas is cleared upon removal,
- // in case of removing the renderer itself from the map.
- this._draw();
- },
-
- _initContainer: function () {
- var container = this._container = document.createElement('canvas');
-
- on(container, 'mousemove', this._onMouseMove, this);
- on(container, 'click dblclick mousedown mouseup contextmenu', this._onClick, this);
- on(container, 'mouseout', this._handleMouseOut, this);
-
- this._ctx = container.getContext('2d');
- },
-
- _destroyContainer: function () {
- cancelAnimFrame(this._redrawRequest);
- delete this._ctx;
- remove(this._container);
- off(this._container);
- delete this._container;
- },
-
- _updatePaths: function () {
- if (this._postponeUpdatePaths) { return; }
-
- var layer;
- this._redrawBounds = null;
- for (var id in this._layers) {
- layer = this._layers[id];
- layer._update();
- }
- this._redraw();
- },
-
- _update: function () {
- if (this._map._animatingZoom && this._bounds) { return; }
-
- Renderer.prototype._update.call(this);
-
- var b = this._bounds,
- container = this._container,
- size = b.getSize(),
- m = retina ? 2 : 1;
-
- setPosition(container, b.min);
-
- // set canvas size (also clearing it); use double size on retina
- container.width = m * size.x;
- container.height = m * size.y;
- container.style.width = size.x + 'px';
- container.style.height = size.y + 'px';
-
- if (retina) {
- this._ctx.scale(2, 2);
- }
-
- // translate so we use the same path coordinates after canvas element moves
- this._ctx.translate(-b.min.x, -b.min.y);
-
- // Tell paths to redraw themselves
- this.fire('update');
- },
-
- _reset: function () {
- Renderer.prototype._reset.call(this);
-
- if (this._postponeUpdatePaths) {
- this._postponeUpdatePaths = false;
- this._updatePaths();
- }
- },
-
- _initPath: function (layer) {
- this._updateDashArray(layer);
- this._layers[stamp(layer)] = layer;
-
- var order = layer._order = {
- layer: layer,
- prev: this._drawLast,
- next: null
- };
- if (this._drawLast) { this._drawLast.next = order; }
- this._drawLast = order;
- this._drawFirst = this._drawFirst || this._drawLast;
- },
-
- _addPath: function (layer) {
- this._requestRedraw(layer);
- },
-
- _removePath: function (layer) {
- var order = layer._order;
- var next = order.next;
- var prev = order.prev;
-
- if (next) {
- next.prev = prev;
- } else {
- this._drawLast = prev;
- }
- if (prev) {
- prev.next = next;
- } else {
- this._drawFirst = next;
- }
-
- delete layer._order;
-
- delete this._layers[stamp(layer)];
-
- this._requestRedraw(layer);
- },
-
- _updatePath: function (layer) {
- // Redraw the union of the layer's old pixel
- // bounds and the new pixel bounds.
- this._extendRedrawBounds(layer);
- layer._project();
- layer._update();
- // The redraw will extend the redraw bounds
- // with the new pixel bounds.
- this._requestRedraw(layer);
- },
-
- _updateStyle: function (layer) {
- this._updateDashArray(layer);
- this._requestRedraw(layer);
- },
-
- _updateDashArray: function (layer) {
- if (typeof layer.options.dashArray === 'string') {
- var parts = layer.options.dashArray.split(/[, ]+/),
- dashArray = [],
- dashValue,
- i;
- for (i = 0; i < parts.length; i++) {
- dashValue = Number(parts[i]);
- // Ignore dash array containing invalid lengths
- if (isNaN(dashValue)) { return; }
- dashArray.push(dashValue);
- }
- layer.options._dashArray = dashArray;
- } else {
- layer.options._dashArray = layer.options.dashArray;
- }
- },
-
- _requestRedraw: function (layer) {
- if (!this._map) { return; }
-
- this._extendRedrawBounds(layer);
- this._redrawRequest = this._redrawRequest || requestAnimFrame(this._redraw, this);
- },
-
- _extendRedrawBounds: function (layer) {
- if (layer._pxBounds) {
- var padding = (layer.options.weight || 0) + 1;
- this._redrawBounds = this._redrawBounds || new Bounds();
- this._redrawBounds.extend(layer._pxBounds.min.subtract([padding, padding]));
- this._redrawBounds.extend(layer._pxBounds.max.add([padding, padding]));
- }
- },
-
- _redraw: function () {
- this._redrawRequest = null;
-
- if (this._redrawBounds) {
- this._redrawBounds.min._floor();
- this._redrawBounds.max._ceil();
- }
-
- this._clear(); // clear layers in redraw bounds
- this._draw(); // draw layers
-
- this._redrawBounds = null;
- },
-
- _clear: function () {
- var bounds = this._redrawBounds;
- if (bounds) {
- var size = bounds.getSize();
- this._ctx.clearRect(bounds.min.x, bounds.min.y, size.x, size.y);
- } else {
- this._ctx.save();
- this._ctx.setTransform(1, 0, 0, 1, 0, 0);
- this._ctx.clearRect(0, 0, this._container.width, this._container.height);
- this._ctx.restore();
- }
- },
-
- _draw: function () {
- var layer, bounds = this._redrawBounds;
- this._ctx.save();
- if (bounds) {
- var size = bounds.getSize();
- this._ctx.beginPath();
- this._ctx.rect(bounds.min.x, bounds.min.y, size.x, size.y);
- this._ctx.clip();
- }
-
- this._drawing = true;
-
- for (var order = this._drawFirst; order; order = order.next) {
- layer = order.layer;
- if (!bounds || (layer._pxBounds && layer._pxBounds.intersects(bounds))) {
- layer._updatePath();
- }
- }
-
- this._drawing = false;
-
- this._ctx.restore(); // Restore state before clipping.
- },
-
- _updatePoly: function (layer, closed) {
- if (!this._drawing) { return; }
-
- var i, j, len2, p,
- parts = layer._parts,
- len = parts.length,
- ctx = this._ctx;
-
- if (!len) { return; }
-
- ctx.beginPath();
-
- for (i = 0; i < len; i++) {
- for (j = 0, len2 = parts[i].length; j < len2; j++) {
- p = parts[i][j];
- ctx[j ? 'lineTo' : 'moveTo'](p.x, p.y);
- }
- if (closed) {
- ctx.closePath();
- }
- }
-
- this._fillStroke(ctx, layer);
-
- // TODO optimization: 1 fill/stroke for all features with equal style instead of 1 for each feature
- },
-
- _updateCircle: function (layer) {
-
- if (!this._drawing || layer._empty()) { return; }
-
- var p = layer._point,
- ctx = this._ctx,
- r = Math.max(Math.round(layer._radius), 1),
- s = (Math.max(Math.round(layer._radiusY), 1) || r) / r;
-
- if (s !== 1) {
- ctx.save();
- ctx.scale(1, s);
- }
-
- ctx.beginPath();
- ctx.arc(p.x, p.y / s, r, 0, Math.PI * 2, false);
-
- if (s !== 1) {
- ctx.restore();
- }
-
- this._fillStroke(ctx, layer);
- },
-
- _fillStroke: function (ctx, layer) {
- var options = layer.options;
-
- if (options.fill) {
- ctx.globalAlpha = options.fillOpacity;
- ctx.fillStyle = options.fillColor || options.color;
- ctx.fill(options.fillRule || 'evenodd');
- }
-
- if (options.stroke && options.weight !== 0) {
- if (ctx.setLineDash) {
- ctx.setLineDash(layer.options && layer.options._dashArray || []);
- }
- ctx.globalAlpha = options.opacity;
- ctx.lineWidth = options.weight;
- ctx.strokeStyle = options.color;
- ctx.lineCap = options.lineCap;
- ctx.lineJoin = options.lineJoin;
- ctx.stroke();
- }
- },
-
- // Canvas obviously doesn't have mouse events for individual drawn objects,
- // so we emulate that by calculating what's under the mouse on mousemove/click manually
-
- _onClick: function (e) {
- var point = this._map.mouseEventToLayerPoint(e), layer, clickedLayer;
-
- for (var order = this._drawFirst; order; order = order.next) {
- layer = order.layer;
- if (layer.options.interactive && layer._containsPoint(point)) {
- if (!(e.type === 'click' || e.type !== 'preclick') || !this._map._draggableMoved(layer)) {
- clickedLayer = layer;
- }
- }
- }
- if (clickedLayer) {
- fakeStop(e);
- this._fireEvent([clickedLayer], e);
- }
- },
-
- _onMouseMove: function (e) {
- if (!this._map || this._map.dragging.moving() || this._map._animatingZoom) { return; }
-
- var point = this._map.mouseEventToLayerPoint(e);
- this._handleMouseHover(e, point);
- },
-
-
- _handleMouseOut: function (e) {
- var layer = this._hoveredLayer;
- if (layer) {
- // if we're leaving the layer, fire mouseout
- removeClass(this._container, 'leaflet-interactive');
- this._fireEvent([layer], e, 'mouseout');
- this._hoveredLayer = null;
- this._mouseHoverThrottled = false;
- }
- },
-
- _handleMouseHover: function (e, point) {
- if (this._mouseHoverThrottled) {
- return;
- }
-
- var layer, candidateHoveredLayer;
-
- for (var order = this._drawFirst; order; order = order.next) {
- layer = order.layer;
- if (layer.options.interactive && layer._containsPoint(point)) {
- candidateHoveredLayer = layer;
- }
- }
-
- if (candidateHoveredLayer !== this._hoveredLayer) {
- this._handleMouseOut(e);
-
- if (candidateHoveredLayer) {
- addClass(this._container, 'leaflet-interactive'); // change cursor
- this._fireEvent([candidateHoveredLayer], e, 'mouseover');
- this._hoveredLayer = candidateHoveredLayer;
- }
- }
-
- if (this._hoveredLayer) {
- this._fireEvent([this._hoveredLayer], e);
- }
-
- this._mouseHoverThrottled = true;
- setTimeout(bind(function () {
- this._mouseHoverThrottled = false;
- }, this), 32);
- },
-
- _fireEvent: function (layers, e, type) {
- this._map._fireDOMEvent(e, type || e.type, layers);
- },
-
- _bringToFront: function (layer) {
- var order = layer._order;
-
- if (!order) { return; }
-
- var next = order.next;
- var prev = order.prev;
-
- if (next) {
- next.prev = prev;
- } else {
- // Already last
- return;
- }
- if (prev) {
- prev.next = next;
- } else if (next) {
- // Update first entry unless this is the
- // single entry
- this._drawFirst = next;
- }
-
- order.prev = this._drawLast;
- this._drawLast.next = order;
-
- order.next = null;
- this._drawLast = order;
-
- this._requestRedraw(layer);
- },
-
- _bringToBack: function (layer) {
- var order = layer._order;
-
- if (!order) { return; }
-
- var next = order.next;
- var prev = order.prev;
-
- if (prev) {
- prev.next = next;
- } else {
- // Already first
- return;
- }
- if (next) {
- next.prev = prev;
- } else if (prev) {
- // Update last entry unless this is the
- // single entry
- this._drawLast = prev;
- }
-
- order.prev = null;
-
- order.next = this._drawFirst;
- this._drawFirst.prev = order;
- this._drawFirst = order;
-
- this._requestRedraw(layer);
- }
- });
-
- // @factory L.canvas(options?: Renderer options)
- // Creates a Canvas renderer with the given options.
- function canvas$1(options) {
- return canvas ? new Canvas(options) : null;
- }
-
- /*
- * Thanks to Dmitry Baranovsky and his Raphael library for inspiration!
- */
-
-
- var vmlCreate = (function () {
- try {
- document.namespaces.add('lvml', 'urn:schemas-microsoft-com:vml');
- return function (name) {
- return document.createElement('<lvml:' + name + ' class="lvml">');
- };
- } catch (e) {
- return function (name) {
- return document.createElement('<' + name + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">');
- };
- }
- })();
-
-
- /*
- * @class SVG
- *
- *
- * VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
- * with old versions of Internet Explorer.
- */
-
- // mixin to redefine some SVG methods to handle VML syntax which is similar but with some differences
- var vmlMixin = {
-
- _initContainer: function () {
- this._container = create$1('div', 'leaflet-vml-container');
- },
-
- _update: function () {
- if (this._map._animatingZoom) { return; }
- Renderer.prototype._update.call(this);
- this.fire('update');
- },
-
- _initPath: function (layer) {
- var container = layer._container = vmlCreate('shape');
-
- addClass(container, 'leaflet-vml-shape ' + (this.options.className || ''));
-
- container.coordsize = '1 1';
-
- layer._path = vmlCreate('path');
- container.appendChild(layer._path);
-
- this._updateStyle(layer);
- this._layers[stamp(layer)] = layer;
- },
-
- _addPath: function (layer) {
- var container = layer._container;
- this._container.appendChild(container);
-
- if (layer.options.interactive) {
- layer.addInteractiveTarget(container);
- }
- },
-
- _removePath: function (layer) {
- var container = layer._container;
- remove(container);
- layer.removeInteractiveTarget(container);
- delete this._layers[stamp(layer)];
- },
-
- _updateStyle: function (layer) {
- var stroke = layer._stroke,
- fill = layer._fill,
- options = layer.options,
- container = layer._container;
-
- container.stroked = !!options.stroke;
- container.filled = !!options.fill;
-
- if (options.stroke) {
- if (!stroke) {
- stroke = layer._stroke = vmlCreate('stroke');
- }
- container.appendChild(stroke);
- stroke.weight = options.weight + 'px';
- stroke.color = options.color;
- stroke.opacity = options.opacity;
-
- if (options.dashArray) {
- stroke.dashStyle = isArray(options.dashArray) ?
- options.dashArray.join(' ') :
- options.dashArray.replace(/( *, *)/g, ' ');
- } else {
- stroke.dashStyle = '';
- }
- stroke.endcap = options.lineCap.replace('butt', 'flat');
- stroke.joinstyle = options.lineJoin;
-
- } else if (stroke) {
- container.removeChild(stroke);
- layer._stroke = null;
- }
-
- if (options.fill) {
- if (!fill) {
- fill = layer._fill = vmlCreate('fill');
- }
- container.appendChild(fill);
- fill.color = options.fillColor || options.color;
- fill.opacity = options.fillOpacity;
-
- } else if (fill) {
- container.removeChild(fill);
- layer._fill = null;
- }
- },
-
- _updateCircle: function (layer) {
- var p = layer._point.round(),
- r = Math.round(layer._radius),
- r2 = Math.round(layer._radiusY || r);
-
- this._setPath(layer, layer._empty() ? 'M0 0' :
- 'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360));
- },
-
- _setPath: function (layer, path) {
- layer._path.v = path;
- },
-
- _bringToFront: function (layer) {
- toFront(layer._container);
- },
-
- _bringToBack: function (layer) {
- toBack(layer._container);
- }
- };
-
- var create$2 = vml ? vmlCreate : svgCreate;
-
- /*
- * @class SVG
- * @inherits Renderer
- * @aka L.SVG
- *
- * Allows vector layers to be displayed with [SVG](https://developer.mozilla.org/docs/Web/SVG).
- * Inherits `Renderer`.
- *
- * Due to [technical limitations](http://caniuse.com/#search=svg), SVG is not
- * available in all web browsers, notably Android 2.x and 3.x.
- *
- * Although SVG is not available on IE7 and IE8, these browsers support
- * [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language)
- * (a now deprecated technology), and the SVG renderer will fall back to VML in
- * this case.
- *
- * @example
- *
- * Use SVG by default for all paths in the map:
- *
- * ```js
- * var map = L.map('map', {
- * renderer: L.svg()
- * });
- * ```
- *
- * Use a SVG renderer with extra padding for specific vector geometries:
- *
- * ```js
- * var map = L.map('map');
- * var myRenderer = L.svg({ padding: 0.5 });
- * var line = L.polyline( coordinates, { renderer: myRenderer } );
- * var circle = L.circle( center, { renderer: myRenderer } );
- * ```
- */
-
- var SVG = Renderer.extend({
-
- getEvents: function () {
- var events = Renderer.prototype.getEvents.call(this);
- events.zoomstart = this._onZoomStart;
- return events;
- },
-
- _initContainer: function () {
- this._container = create$2('svg');
-
- // makes it possible to click through svg root; we'll reset it back in individual paths
- this._container.setAttribute('pointer-events', 'none');
-
- this._rootGroup = create$2('g');
- this._container.appendChild(this._rootGroup);
- },
-
- _destroyContainer: function () {
- remove(this._container);
- off(this._container);
- delete this._container;
- delete this._rootGroup;
- delete this._svgSize;
- },
-
- _onZoomStart: function () {
- // Drag-then-pinch interactions might mess up the center and zoom.
- // In this case, the easiest way to prevent this is re-do the renderer
- // bounds and padding when the zooming starts.
- this._update();
- },
-
- _update: function () {
- if (this._map._animatingZoom && this._bounds) { return; }
-
- Renderer.prototype._update.call(this);
-
- var b = this._bounds,
- size = b.getSize(),
- container = this._container;
-
- // set size of svg-container if changed
- if (!this._svgSize || !this._svgSize.equals(size)) {
- this._svgSize = size;
- container.setAttribute('width', size.x);
- container.setAttribute('height', size.y);
- }
-
- // movement: update container viewBox so that we don't have to change coordinates of individual layers
- setPosition(container, b.min);
- container.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));
-
- this.fire('update');
- },
-
- // methods below are called by vector layers implementations
-
- _initPath: function (layer) {
- var path = layer._path = create$2('path');
-
- // @namespace Path
- // @option className: String = null
- // Custom class name set on an element. Only for SVG renderer.
- if (layer.options.className) {
- addClass(path, layer.options.className);
- }
-
- if (layer.options.interactive) {
- addClass(path, 'leaflet-interactive');
- }
-
- this._updateStyle(layer);
- this._layers[stamp(layer)] = layer;
- },
-
- _addPath: function (layer) {
- if (!this._rootGroup) { this._initContainer(); }
- this._rootGroup.appendChild(layer._path);
- layer.addInteractiveTarget(layer._path);
- },
-
- _removePath: function (layer) {
- remove(layer._path);
- layer.removeInteractiveTarget(layer._path);
- delete this._layers[stamp(layer)];
- },
-
- _updatePath: function (layer) {
- layer._project();
- layer._update();
- },
-
- _updateStyle: function (layer) {
- var path = layer._path,
- options = layer.options;
-
- if (!path) { return; }
-
- if (options.stroke) {
- path.setAttribute('stroke', options.color);
- path.setAttribute('stroke-opacity', options.opacity);
- path.setAttribute('stroke-width', options.weight);
- path.setAttribute('stroke-linecap', options.lineCap);
- path.setAttribute('stroke-linejoin', options.lineJoin);
-
- if (options.dashArray) {
- path.setAttribute('stroke-dasharray', options.dashArray);
- } else {
- path.removeAttribute('stroke-dasharray');
- }
-
- if (options.dashOffset) {
- path.setAttribute('stroke-dashoffset', options.dashOffset);
- } else {
- path.removeAttribute('stroke-dashoffset');
- }
- } else {
- path.setAttribute('stroke', 'none');
- }
-
- if (options.fill) {
- path.setAttribute('fill', options.fillColor || options.color);
- path.setAttribute('fill-opacity', options.fillOpacity);
- path.setAttribute('fill-rule', options.fillRule || 'evenodd');
- } else {
- path.setAttribute('fill', 'none');
- }
- },
-
- _updatePoly: function (layer, closed) {
- this._setPath(layer, pointsToPath(layer._parts, closed));
- },
-
- _updateCircle: function (layer) {
- var p = layer._point,
- r = Math.max(Math.round(layer._radius), 1),
- r2 = Math.max(Math.round(layer._radiusY), 1) || r,
- arc = 'a' + r + ',' + r2 + ' 0 1,0 ';
-
- // drawing a circle with two half-arcs
- var d = layer._empty() ? 'M0 0' :
- 'M' + (p.x - r) + ',' + p.y +
- arc + (r * 2) + ',0 ' +
- arc + (-r * 2) + ',0 ';
-
- this._setPath(layer, d);
- },
-
- _setPath: function (layer, path) {
- layer._path.setAttribute('d', path);
- },
-
- // SVG does not have the concept of zIndex so we resort to changing the DOM order of elements
- _bringToFront: function (layer) {
- toFront(layer._path);
- },
-
- _bringToBack: function (layer) {
- toBack(layer._path);
- }
- });
-
- if (vml) {
- SVG.include(vmlMixin);
- }
-
- // @namespace SVG
- // @factory L.svg(options?: Renderer options)
- // Creates a SVG renderer with the given options.
- function svg$1(options) {
- return svg || vml ? new SVG(options) : null;
- }
-
- Map.include({
- // @namespace Map; @method getRenderer(layer: Path): Renderer
- // Returns the instance of `Renderer` that should be used to render the given
- // `Path`. It will ensure that the `renderer` options of the map and paths
- // are respected, and that the renderers do exist on the map.
- getRenderer: function (layer) {
- // @namespace Path; @option renderer: Renderer
- // Use this specific instance of `Renderer` for this path. Takes
- // precedence over the map's [default renderer](#map-renderer).
- var renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer;
-
- if (!renderer) {
- renderer = this._renderer = this._createRenderer();
- }
-
- if (!this.hasLayer(renderer)) {
- this.addLayer(renderer);
- }
- return renderer;
- },
-
- _getPaneRenderer: function (name) {
- if (name === 'overlayPane' || name === undefined) {
- return false;
- }
-
- var renderer = this._paneRenderers[name];
- if (renderer === undefined) {
- renderer = this._createRenderer({pane: name});
- this._paneRenderers[name] = renderer;
- }
- return renderer;
- },
-
- _createRenderer: function (options) {
- // @namespace Map; @option preferCanvas: Boolean = false
- // Whether `Path`s should be rendered on a `Canvas` renderer.
- // By default, all `Path`s are rendered in a `SVG` renderer.
- return (this.options.preferCanvas && canvas$1(options)) || svg$1(options);
- }
- });
-
- /*
- * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object.
- */
-
- /*
- * @class Rectangle
- * @aka L.Rectangle
- * @inherits Polygon
- *
- * A class for drawing rectangle overlays on a map. Extends `Polygon`.
- *
- * @example
- *
- * ```js
- * // define rectangle geographical bounds
- * var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
- *
- * // create an orange rectangle
- * L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
- *
- * // zoom the map to the rectangle bounds
- * map.fitBounds(bounds);
- * ```
- *
- */
-
-
- var Rectangle = Polygon.extend({
- initialize: function (latLngBounds, options) {
- Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options);
- },
-
- // @method setBounds(latLngBounds: LatLngBounds): this
- // Redraws the rectangle with the passed bounds.
- setBounds: function (latLngBounds) {
- return this.setLatLngs(this._boundsToLatLngs(latLngBounds));
- },
-
- _boundsToLatLngs: function (latLngBounds) {
- latLngBounds = toLatLngBounds(latLngBounds);
- return [
- latLngBounds.getSouthWest(),
- latLngBounds.getNorthWest(),
- latLngBounds.getNorthEast(),
- latLngBounds.getSouthEast()
- ];
- }
- });
-
-
- // @factory L.rectangle(latLngBounds: LatLngBounds, options?: Polyline options)
- function rectangle(latLngBounds, options) {
- return new Rectangle(latLngBounds, options);
- }
-
- SVG.create = create$2;
- SVG.pointsToPath = pointsToPath;
-
- GeoJSON.geometryToLayer = geometryToLayer;
- GeoJSON.coordsToLatLng = coordsToLatLng;
- GeoJSON.coordsToLatLngs = coordsToLatLngs;
- GeoJSON.latLngToCoords = latLngToCoords;
- GeoJSON.latLngsToCoords = latLngsToCoords;
- GeoJSON.getFeature = getFeature;
- GeoJSON.asFeature = asFeature;
-
- /*
- * L.Handler.BoxZoom is used to add shift-drag zoom interaction to the map
- * (zoom to a selected bounding box), enabled by default.
- */
-
- // @namespace Map
- // @section Interaction Options
- Map.mergeOptions({
- // @option boxZoom: Boolean = true
- // Whether the map can be zoomed to a rectangular area specified by
- // dragging the mouse while pressing the shift key.
- boxZoom: true
- });
-
- var BoxZoom = Handler.extend({
- initialize: function (map) {
- this._map = map;
- this._container = map._container;
- this._pane = map._panes.overlayPane;
- this._resetStateTimeout = 0;
- map.on('unload', this._destroy, this);
- },
-
- addHooks: function () {
- on(this._container, 'mousedown', this._onMouseDown, this);
- },
-
- removeHooks: function () {
- off(this._container, 'mousedown', this._onMouseDown, this);
- },
-
- moved: function () {
- return this._moved;
- },
-
- _destroy: function () {
- remove(this._pane);
- delete this._pane;
- },
-
- _resetState: function () {
- this._resetStateTimeout = 0;
- this._moved = false;
- },
-
- _clearDeferredResetState: function () {
- if (this._resetStateTimeout !== 0) {
- clearTimeout(this._resetStateTimeout);
- this._resetStateTimeout = 0;
- }
- },
-
- _onMouseDown: function (e) {
- if (!e.shiftKey || ((e.which !== 1) && (e.button !== 1))) { return false; }
-
- // Clear the deferred resetState if it hasn't executed yet, otherwise it
- // will interrupt the interaction and orphan a box element in the container.
- this._clearDeferredResetState();
- this._resetState();
-
- disableTextSelection();
- disableImageDrag();
-
- this._startPoint = this._map.mouseEventToContainerPoint(e);
-
- on(document, {
- contextmenu: stop,
- mousemove: this._onMouseMove,
- mouseup: this._onMouseUp,
- keydown: this._onKeyDown
- }, this);
- },
-
- _onMouseMove: function (e) {
- if (!this._moved) {
- this._moved = true;
-
- this._box = create$1('div', 'leaflet-zoom-box', this._container);
- addClass(this._container, 'leaflet-crosshair');
-
- this._map.fire('boxzoomstart');
- }
-
- this._point = this._map.mouseEventToContainerPoint(e);
-
- var bounds = new Bounds(this._point, this._startPoint),
- size = bounds.getSize();
-
- setPosition(this._box, bounds.min);
-
- this._box.style.width = size.x + 'px';
- this._box.style.height = size.y + 'px';
- },
-
- _finish: function () {
- if (this._moved) {
- remove(this._box);
- removeClass(this._container, 'leaflet-crosshair');
- }
-
- enableTextSelection();
- enableImageDrag();
-
- off(document, {
- contextmenu: stop,
- mousemove: this._onMouseMove,
- mouseup: this._onMouseUp,
- keydown: this._onKeyDown
- }, this);
- },
-
- _onMouseUp: function (e) {
- if ((e.which !== 1) && (e.button !== 1)) { return; }
-
- this._finish();
-
- if (!this._moved) { return; }
- // Postpone to next JS tick so internal click event handling
- // still see it as "moved".
- this._clearDeferredResetState();
- this._resetStateTimeout = setTimeout(bind(this._resetState, this), 0);
-
- var bounds = new LatLngBounds(
- this._map.containerPointToLatLng(this._startPoint),
- this._map.containerPointToLatLng(this._point));
-
- this._map
- .fitBounds(bounds)
- .fire('boxzoomend', {boxZoomBounds: bounds});
- },
-
- _onKeyDown: function (e) {
- if (e.keyCode === 27) {
- this._finish();
- }
- }
- });
-
- // @section Handlers
- // @property boxZoom: Handler
- // Box (shift-drag with mouse) zoom handler.
- Map.addInitHook('addHandler', 'boxZoom', BoxZoom);
-
- /*
- * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default.
- */
-
- // @namespace Map
- // @section Interaction Options
-
- Map.mergeOptions({
- // @option doubleClickZoom: Boolean|String = true
- // Whether the map can be zoomed in by double clicking on it and
- // zoomed out by double clicking while holding shift. If passed
- // `'center'`, double-click zoom will zoom to the center of the
- // view regardless of where the mouse was.
- doubleClickZoom: true
- });
-
- var DoubleClickZoom = Handler.extend({
- addHooks: function () {
- this._map.on('dblclick', this._onDoubleClick, this);
- },
-
- removeHooks: function () {
- this._map.off('dblclick', this._onDoubleClick, this);
- },
-
- _onDoubleClick: function (e) {
- var map = this._map,
- oldZoom = map.getZoom(),
- delta = map.options.zoomDelta,
- zoom = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta;
-
- if (map.options.doubleClickZoom === 'center') {
- map.setZoom(zoom);
- } else {
- map.setZoomAround(e.containerPoint, zoom);
- }
- }
- });
-
- // @section Handlers
- //
- // Map properties include interaction handlers that allow you to control
- // interaction behavior in runtime, enabling or disabling certain features such
- // as dragging or touch zoom (see `Handler` methods). For example:
- //
- // ```js
- // map.doubleClickZoom.disable();
- // ```
- //
- // @property doubleClickZoom: Handler
- // Double click zoom handler.
- Map.addInitHook('addHandler', 'doubleClickZoom', DoubleClickZoom);
-
- /*
- * L.Handler.MapDrag is used to make the map draggable (with panning inertia), enabled by default.
- */
-
- // @namespace Map
- // @section Interaction Options
- Map.mergeOptions({
- // @option dragging: Boolean = true
- // Whether the map be draggable with mouse/touch or not.
- dragging: true,
-
- // @section Panning Inertia Options
- // @option inertia: Boolean = *
- // If enabled, panning of the map will have an inertia effect where
- // the map builds momentum while dragging and continues moving in
- // the same direction for some time. Feels especially nice on touch
- // devices. Enabled by default unless running on old Android devices.
- inertia: !android23,
-
- // @option inertiaDeceleration: Number = 3000
- // The rate with which the inertial movement slows down, in pixels/second².
- inertiaDeceleration: 3400, // px/s^2
-
- // @option inertiaMaxSpeed: Number = Infinity
- // Max speed of the inertial movement, in pixels/second.
- inertiaMaxSpeed: Infinity, // px/s
-
- // @option easeLinearity: Number = 0.2
- easeLinearity: 0.2,
-
- // TODO refactor, move to CRS
- // @option worldCopyJump: Boolean = false
- // With this option enabled, the map tracks when you pan to another "copy"
- // of the world and seamlessly jumps to the original one so that all overlays
- // like markers and vector layers are still visible.
- worldCopyJump: false,
-
- // @option maxBoundsViscosity: Number = 0.0
- // If `maxBounds` is set, this option will control how solid the bounds
- // are when dragging the map around. The default value of `0.0` allows the
- // user to drag outside the bounds at normal speed, higher values will
- // slow down map dragging outside bounds, and `1.0` makes the bounds fully
- // solid, preventing the user from dragging outside the bounds.
- maxBoundsViscosity: 0.0
- });
-
- var Drag = Handler.extend({
- addHooks: function () {
- if (!this._draggable) {
- var map = this._map;
-
- this._draggable = new Draggable(map._mapPane, map._container);
-
- this._draggable.on({
- dragstart: this._onDragStart,
- drag: this._onDrag,
- dragend: this._onDragEnd
- }, this);
-
- this._draggable.on('predrag', this._onPreDragLimit, this);
- if (map.options.worldCopyJump) {
- this._draggable.on('predrag', this._onPreDragWrap, this);
- map.on('zoomend', this._onZoomEnd, this);
-
- map.whenReady(this._onZoomEnd, this);
- }
- }
- addClass(this._map._container, 'leaflet-grab leaflet-touch-drag');
- this._draggable.enable();
- this._positions = [];
- this._times = [];
- },
-
- removeHooks: function () {
- removeClass(this._map._container, 'leaflet-grab');
- removeClass(this._map._container, 'leaflet-touch-drag');
- this._draggable.disable();
- },
-
- moved: function () {
- return this._draggable && this._draggable._moved;
- },
-
- moving: function () {
- return this._draggable && this._draggable._moving;
- },
-
- _onDragStart: function () {
- var map = this._map;
-
- map._stop();
- if (this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {
- var bounds = toLatLngBounds(this._map.options.maxBounds);
-
- this._offsetLimit = toBounds(
- this._map.latLngToContainerPoint(bounds.getNorthWest()).multiplyBy(-1),
- this._map.latLngToContainerPoint(bounds.getSouthEast()).multiplyBy(-1)
- .add(this._map.getSize()));
-
- this._viscosity = Math.min(1.0, Math.max(0.0, this._map.options.maxBoundsViscosity));
- } else {
- this._offsetLimit = null;
- }
-
- map
- .fire('movestart')
- .fire('dragstart');
-
- if (map.options.inertia) {
- this._positions = [];
- this._times = [];
- }
- },
-
- _onDrag: function (e) {
- if (this._map.options.inertia) {
- var time = this._lastTime = +new Date(),
- pos = this._lastPos = this._draggable._absPos || this._draggable._newPos;
-
- this._positions.push(pos);
- this._times.push(time);
-
- this._prunePositions(time);
- }
-
- this._map
- .fire('move', e)
- .fire('drag', e);
- },
-
- _prunePositions: function (time) {
- while (this._positions.length > 1 && time - this._times[0] > 50) {
- this._positions.shift();
- this._times.shift();
- }
- },
-
- _onZoomEnd: function () {
- var pxCenter = this._map.getSize().divideBy(2),
- pxWorldCenter = this._map.latLngToLayerPoint([0, 0]);
-
- this._initialWorldOffset = pxWorldCenter.subtract(pxCenter).x;
- this._worldWidth = this._map.getPixelWorldBounds().getSize().x;
- },
-
- _viscousLimit: function (value, threshold) {
- return value - (value - threshold) * this._viscosity;
- },
-
- _onPreDragLimit: function () {
- if (!this._viscosity || !this._offsetLimit) { return; }
-
- var offset = this._draggable._newPos.subtract(this._draggable._startPos);
-
- var limit = this._offsetLimit;
- if (offset.x < limit.min.x) { offset.x = this._viscousLimit(offset.x, limit.min.x); }
- if (offset.y < limit.min.y) { offset.y = this._viscousLimit(offset.y, limit.min.y); }
- if (offset.x > limit.max.x) { offset.x = this._viscousLimit(offset.x, limit.max.x); }
- if (offset.y > limit.max.y) { offset.y = this._viscousLimit(offset.y, limit.max.y); }
-
- this._draggable._newPos = this._draggable._startPos.add(offset);
- },
-
- _onPreDragWrap: function () {
- // TODO refactor to be able to adjust map pane position after zoom
- var worldWidth = this._worldWidth,
- halfWidth = Math.round(worldWidth / 2),
- dx = this._initialWorldOffset,
- x = this._draggable._newPos.x,
- newX1 = (x - halfWidth + dx) % worldWidth + halfWidth - dx,
- newX2 = (x + halfWidth + dx) % worldWidth - halfWidth - dx,
- newX = Math.abs(newX1 + dx) < Math.abs(newX2 + dx) ? newX1 : newX2;
-
- this._draggable._absPos = this._draggable._newPos.clone();
- this._draggable._newPos.x = newX;
- },
-
- _onDragEnd: function (e) {
- var map = this._map,
- options = map.options,
-
- noInertia = !options.inertia || this._times.length < 2;
-
- map.fire('dragend', e);
-
- if (noInertia) {
- map.fire('moveend');
-
- } else {
- this._prunePositions(+new Date());
-
- var direction = this._lastPos.subtract(this._positions[0]),
- duration = (this._lastTime - this._times[0]) / 1000,
- ease = options.easeLinearity,
-
- speedVector = direction.multiplyBy(ease / duration),
- speed = speedVector.distanceTo([0, 0]),
-
- limitedSpeed = Math.min(options.inertiaMaxSpeed, speed),
- limitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed),
-
- decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease),
- offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();
-
- if (!offset.x && !offset.y) {
- map.fire('moveend');
-
- } else {
- offset = map._limitOffset(offset, map.options.maxBounds);
-
- requestAnimFrame(function () {
- map.panBy(offset, {
- duration: decelerationDuration,
- easeLinearity: ease,
- noMoveStart: true,
- animate: true
- });
- });
- }
- }
- }
- });
-
- // @section Handlers
- // @property dragging: Handler
- // Map dragging handler (by both mouse and touch).
- Map.addInitHook('addHandler', 'dragging', Drag);
-
- /*
- * L.Map.Keyboard is handling keyboard interaction with the map, enabled by default.
- */
-
- // @namespace Map
- // @section Keyboard Navigation Options
- Map.mergeOptions({
- // @option keyboard: Boolean = true
- // Makes the map focusable and allows users to navigate the map with keyboard
- // arrows and `+`/`-` keys.
- keyboard: true,
-
- // @option keyboardPanDelta: Number = 80
- // Amount of pixels to pan when pressing an arrow key.
- keyboardPanDelta: 80
- });
-
- var Keyboard = Handler.extend({
-
- keyCodes: {
- left: [37],
- right: [39],
- down: [40],
- up: [38],
- zoomIn: [187, 107, 61, 171],
- zoomOut: [189, 109, 54, 173]
- },
-
- initialize: function (map) {
- this._map = map;
-
- this._setPanDelta(map.options.keyboardPanDelta);
- this._setZoomDelta(map.options.zoomDelta);
- },
-
- addHooks: function () {
- var container = this._map._container;
-
- // make the container focusable by tabbing
- if (container.tabIndex <= 0) {
- container.tabIndex = '0';
- }
-
- on(container, {
- focus: this._onFocus,
- blur: this._onBlur,
- mousedown: this._onMouseDown
- }, this);
-
- this._map.on({
- focus: this._addHooks,
- blur: this._removeHooks
- }, this);
- },
-
- removeHooks: function () {
- this._removeHooks();
-
- off(this._map._container, {
- focus: this._onFocus,
- blur: this._onBlur,
- mousedown: this._onMouseDown
- }, this);
-
- this._map.off({
- focus: this._addHooks,
- blur: this._removeHooks
- }, this);
- },
-
- _onMouseDown: function () {
- if (this._focused) { return; }
-
- var body = document.body,
- docEl = document.documentElement,
- top = body.scrollTop || docEl.scrollTop,
- left = body.scrollLeft || docEl.scrollLeft;
-
- this._map._container.focus();
-
- window.scrollTo(left, top);
- },
-
- _onFocus: function () {
- this._focused = true;
- this._map.fire('focus');
- },
-
- _onBlur: function () {
- this._focused = false;
- this._map.fire('blur');
- },
-
- _setPanDelta: function (panDelta) {
- var keys = this._panKeys = {},
- codes = this.keyCodes,
- i, len;
-
- for (i = 0, len = codes.left.length; i < len; i++) {
- keys[codes.left[i]] = [-1 * panDelta, 0];
- }
- for (i = 0, len = codes.right.length; i < len; i++) {
- keys[codes.right[i]] = [panDelta, 0];
- }
- for (i = 0, len = codes.down.length; i < len; i++) {
- keys[codes.down[i]] = [0, panDelta];
- }
- for (i = 0, len = codes.up.length; i < len; i++) {
- keys[codes.up[i]] = [0, -1 * panDelta];
- }
- },
-
- _setZoomDelta: function (zoomDelta) {
- var keys = this._zoomKeys = {},
- codes = this.keyCodes,
- i, len;
-
- for (i = 0, len = codes.zoomIn.length; i < len; i++) {
- keys[codes.zoomIn[i]] = zoomDelta;
- }
- for (i = 0, len = codes.zoomOut.length; i < len; i++) {
- keys[codes.zoomOut[i]] = -zoomDelta;
- }
- },
-
- _addHooks: function () {
- on(document, 'keydown', this._onKeyDown, this);
- },
-
- _removeHooks: function () {
- off(document, 'keydown', this._onKeyDown, this);
- },
-
- _onKeyDown: function (e) {
- if (e.altKey || e.ctrlKey || e.metaKey) { return; }
-
- var key = e.keyCode,
- map = this._map,
- offset;
-
- if (key in this._panKeys) {
- if (!map._panAnim || !map._panAnim._inProgress) {
- offset = this._panKeys[key];
- if (e.shiftKey) {
- offset = toPoint(offset).multiplyBy(3);
- }
-
- map.panBy(offset);
-
- if (map.options.maxBounds) {
- map.panInsideBounds(map.options.maxBounds);
- }
- }
- } else if (key in this._zoomKeys) {
- map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]);
-
- } else if (key === 27 && map._popup && map._popup.options.closeOnEscapeKey) {
- map.closePopup();
-
- } else {
- return;
- }
-
- stop(e);
- }
- });
-
- // @section Handlers
- // @section Handlers
- // @property keyboard: Handler
- // Keyboard navigation handler.
- Map.addInitHook('addHandler', 'keyboard', Keyboard);
-
- /*
- * L.Handler.ScrollWheelZoom is used by L.Map to enable mouse scroll wheel zoom on the map.
- */
-
- // @namespace Map
- // @section Interaction Options
- Map.mergeOptions({
- // @section Mouse wheel options
- // @option scrollWheelZoom: Boolean|String = true
- // Whether the map can be zoomed by using the mouse wheel. If passed `'center'`,
- // it will zoom to the center of the view regardless of where the mouse was.
- scrollWheelZoom: true,
-
- // @option wheelDebounceTime: Number = 40
- // Limits the rate at which a wheel can fire (in milliseconds). By default
- // user can't zoom via wheel more often than once per 40 ms.
- wheelDebounceTime: 40,
-
- // @option wheelPxPerZoomLevel: Number = 60
- // How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta))
- // mean a change of one full zoom level. Smaller values will make wheel-zooming
- // faster (and vice versa).
- wheelPxPerZoomLevel: 60
- });
-
- var ScrollWheelZoom = Handler.extend({
- addHooks: function () {
- on(this._map._container, 'wheel', this._onWheelScroll, this);
-
- this._delta = 0;
- },
-
- removeHooks: function () {
- off(this._map._container, 'wheel', this._onWheelScroll, this);
- },
-
- _onWheelScroll: function (e) {
- var delta = getWheelDelta(e);
-
- var debounce = this._map.options.wheelDebounceTime;
-
- this._delta += delta;
- this._lastMousePos = this._map.mouseEventToContainerPoint(e);
-
- if (!this._startTime) {
- this._startTime = +new Date();
- }
-
- var left = Math.max(debounce - (+new Date() - this._startTime), 0);
-
- clearTimeout(this._timer);
- this._timer = setTimeout(bind(this._performZoom, this), left);
-
- stop(e);
- },
-
- _performZoom: function () {
- var map = this._map,
- zoom = map.getZoom(),
- snap = this._map.options.zoomSnap || 0;
-
- map._stop(); // stop panning and fly animations if any
-
- // map the delta with a sigmoid function to -4..4 range leaning on -1..1
- var d2 = this._delta / (this._map.options.wheelPxPerZoomLevel * 4),
- d3 = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(d2)))) / Math.LN2,
- d4 = snap ? Math.ceil(d3 / snap) * snap : d3,
- delta = map._limitZoom(zoom + (this._delta > 0 ? d4 : -d4)) - zoom;
-
- this._delta = 0;
- this._startTime = null;
-
- if (!delta) { return; }
-
- if (map.options.scrollWheelZoom === 'center') {
- map.setZoom(zoom + delta);
- } else {
- map.setZoomAround(this._lastMousePos, zoom + delta);
- }
- }
- });
-
- // @section Handlers
- // @property scrollWheelZoom: Handler
- // Scroll wheel zoom handler.
- Map.addInitHook('addHandler', 'scrollWheelZoom', ScrollWheelZoom);
-
- /*
- * L.Map.Tap is used to enable mobile hacks like quick taps and long hold.
- */
-
- // @namespace Map
- // @section Interaction Options
- Map.mergeOptions({
- // @section Touch interaction options
- // @option tap: Boolean = true
- // Enables mobile hacks for supporting instant taps (fixing 200ms click
- // delay on iOS/Android) and touch holds (fired as `contextmenu` events).
- tap: true,
-
- // @option tapTolerance: Number = 15
- // The max number of pixels a user can shift his finger during touch
- // for it to be considered a valid tap.
- tapTolerance: 15
- });
-
- var Tap = Handler.extend({
- addHooks: function () {
- on(this._map._container, 'touchstart', this._onDown, this);
- },
-
- removeHooks: function () {
- off(this._map._container, 'touchstart', this._onDown, this);
- },
-
- _onDown: function (e) {
- if (!e.touches) { return; }
-
- preventDefault(e);
-
- this._fireClick = true;
-
- // don't simulate click or track longpress if more than 1 touch
- if (e.touches.length > 1) {
- this._fireClick = false;
- clearTimeout(this._holdTimeout);
- return;
- }
-
- var first = e.touches[0],
- el = first.target;
-
- this._startPos = this._newPos = new Point(first.clientX, first.clientY);
-
- // if touching a link, highlight it
- if (el.tagName && el.tagName.toLowerCase() === 'a') {
- addClass(el, 'leaflet-active');
- }
-
- // simulate long hold but setting a timeout
- this._holdTimeout = setTimeout(bind(function () {
- if (this._isTapValid()) {
- this._fireClick = false;
- this._onUp();
- this._simulateEvent('contextmenu', first);
- }
- }, this), 1000);
-
- this._simulateEvent('mousedown', first);
-
- on(document, {
- touchmove: this._onMove,
- touchend: this._onUp
- }, this);
- },
-
- _onUp: function (e) {
- clearTimeout(this._holdTimeout);
-
- off(document, {
- touchmove: this._onMove,
- touchend: this._onUp
- }, this);
-
- if (this._fireClick && e && e.changedTouches) {
-
- var first = e.changedTouches[0],
- el = first.target;
-
- if (el && el.tagName && el.tagName.toLowerCase() === 'a') {
- removeClass(el, 'leaflet-active');
- }
-
- this._simulateEvent('mouseup', first);
-
- // simulate click if the touch didn't move too much
- if (this._isTapValid()) {
- this._simulateEvent('click', first);
- }
- }
- },
-
- _isTapValid: function () {
- return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance;
- },
-
- _onMove: function (e) {
- var first = e.touches[0];
- this._newPos = new Point(first.clientX, first.clientY);
- this._simulateEvent('mousemove', first);
- },
-
- _simulateEvent: function (type, e) {
- var simulatedEvent = document.createEvent('MouseEvents');
-
- simulatedEvent._simulated = true;
- e.target._simulatedClick = true;
-
- simulatedEvent.initMouseEvent(
- type, true, true, window, 1,
- e.screenX, e.screenY,
- e.clientX, e.clientY,
- false, false, false, false, 0, null);
-
- e.target.dispatchEvent(simulatedEvent);
- }
- });
-
- // @section Handlers
- // @property tap: Handler
- // Mobile touch hacks (quick tap and touch hold) handler.
- if (touch && (!pointer || safari)) {
- Map.addInitHook('addHandler', 'tap', Tap);
- }
-
- /*
- * L.Handler.TouchZoom is used by L.Map to add pinch zoom on supported mobile browsers.
- */
-
- // @namespace Map
- // @section Interaction Options
- Map.mergeOptions({
- // @section Touch interaction options
- // @option touchZoom: Boolean|String = *
- // Whether the map can be zoomed by touch-dragging with two fingers. If
- // passed `'center'`, it will zoom to the center of the view regardless of
- // where the touch events (fingers) were. Enabled for touch-capable web
- // browsers except for old Androids.
- touchZoom: touch && !android23,
-
- // @option bounceAtZoomLimits: Boolean = true
- // Set it to false if you don't want the map to zoom beyond min/max zoom
- // and then bounce back when pinch-zooming.
- bounceAtZoomLimits: true
- });
-
- var TouchZoom = Handler.extend({
- addHooks: function () {
- addClass(this._map._container, 'leaflet-touch-zoom');
- on(this._map._container, 'touchstart', this._onTouchStart, this);
- },
-
- removeHooks: function () {
- removeClass(this._map._container, 'leaflet-touch-zoom');
- off(this._map._container, 'touchstart', this._onTouchStart, this);
- },
-
- _onTouchStart: function (e) {
- var map = this._map;
- if (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming) { return; }
-
- var p1 = map.mouseEventToContainerPoint(e.touches[0]),
- p2 = map.mouseEventToContainerPoint(e.touches[1]);
-
- this._centerPoint = map.getSize()._divideBy(2);
- this._startLatLng = map.containerPointToLatLng(this._centerPoint);
- if (map.options.touchZoom !== 'center') {
- this._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2));
- }
-
- this._startDist = p1.distanceTo(p2);
- this._startZoom = map.getZoom();
-
- this._moved = false;
- this._zooming = true;
-
- map._stop();
-
- on(document, 'touchmove', this._onTouchMove, this);
- on(document, 'touchend', this._onTouchEnd, this);
-
- preventDefault(e);
- },
-
- _onTouchMove: function (e) {
- if (!e.touches || e.touches.length !== 2 || !this._zooming) { return; }
-
- var map = this._map,
- p1 = map.mouseEventToContainerPoint(e.touches[0]),
- p2 = map.mouseEventToContainerPoint(e.touches[1]),
- scale = p1.distanceTo(p2) / this._startDist;
-
- this._zoom = map.getScaleZoom(scale, this._startZoom);
-
- if (!map.options.bounceAtZoomLimits && (
- (this._zoom < map.getMinZoom() && scale < 1) ||
- (this._zoom > map.getMaxZoom() && scale > 1))) {
- this._zoom = map._limitZoom(this._zoom);
- }
-
- if (map.options.touchZoom === 'center') {
- this._center = this._startLatLng;
- if (scale === 1) { return; }
- } else {
- // Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng
- var delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint);
- if (scale === 1 && delta.x === 0 && delta.y === 0) { return; }
- this._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom);
- }
-
- if (!this._moved) {
- map._moveStart(true, false);
- this._moved = true;
- }
-
- cancelAnimFrame(this._animRequest);
-
- var moveFn = bind(map._move, map, this._center, this._zoom, {pinch: true, round: false});
- this._animRequest = requestAnimFrame(moveFn, this, true);
-
- preventDefault(e);
- },
-
- _onTouchEnd: function () {
- if (!this._moved || !this._zooming) {
- this._zooming = false;
- return;
- }
-
- this._zooming = false;
- cancelAnimFrame(this._animRequest);
-
- off(document, 'touchmove', this._onTouchMove, this);
- off(document, 'touchend', this._onTouchEnd, this);
-
- // Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate.
- if (this._map.options.zoomAnimation) {
- this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap);
- } else {
- this._map._resetView(this._center, this._map._limitZoom(this._zoom));
- }
- }
- });
-
- // @section Handlers
- // @property touchZoom: Handler
- // Touch zoom handler.
- Map.addInitHook('addHandler', 'touchZoom', TouchZoom);
-
- Map.BoxZoom = BoxZoom;
- Map.DoubleClickZoom = DoubleClickZoom;
- Map.Drag = Drag;
- Map.Keyboard = Keyboard;
- Map.ScrollWheelZoom = ScrollWheelZoom;
- Map.Tap = Tap;
- Map.TouchZoom = TouchZoom;
-
- exports.version = version;
- exports.Control = Control;
- exports.control = control;
- exports.Browser = Browser;
- exports.Evented = Evented;
- exports.Mixin = Mixin;
- exports.Util = Util;
- exports.Class = Class;
- exports.Handler = Handler;
- exports.extend = extend;
- exports.bind = bind;
- exports.stamp = stamp;
- exports.setOptions = setOptions;
- exports.DomEvent = DomEvent;
- exports.DomUtil = DomUtil;
- exports.PosAnimation = PosAnimation;
- exports.Draggable = Draggable;
- exports.LineUtil = LineUtil;
- exports.PolyUtil = PolyUtil;
- exports.Point = Point;
- exports.point = toPoint;
- exports.Bounds = Bounds;
- exports.bounds = toBounds;
- exports.Transformation = Transformation;
- exports.transformation = toTransformation;
- exports.Projection = index;
- exports.LatLng = LatLng;
- exports.latLng = toLatLng;
- exports.LatLngBounds = LatLngBounds;
- exports.latLngBounds = toLatLngBounds;
- exports.CRS = CRS;
- exports.GeoJSON = GeoJSON;
- exports.geoJSON = geoJSON;
- exports.geoJson = geoJson;
- exports.Layer = Layer;
- exports.LayerGroup = LayerGroup;
- exports.layerGroup = layerGroup;
- exports.FeatureGroup = FeatureGroup;
- exports.featureGroup = featureGroup;
- exports.ImageOverlay = ImageOverlay;
- exports.imageOverlay = imageOverlay;
- exports.VideoOverlay = VideoOverlay;
- exports.videoOverlay = videoOverlay;
- exports.SVGOverlay = SVGOverlay;
- exports.svgOverlay = svgOverlay;
- exports.DivOverlay = DivOverlay;
- exports.Popup = Popup;
- exports.popup = popup;
- exports.Tooltip = Tooltip;
- exports.tooltip = tooltip;
- exports.Icon = Icon;
- exports.icon = icon;
- exports.DivIcon = DivIcon;
- exports.divIcon = divIcon;
- exports.Marker = Marker;
- exports.marker = marker;
- exports.TileLayer = TileLayer;
- exports.tileLayer = tileLayer;
- exports.GridLayer = GridLayer;
- exports.gridLayer = gridLayer;
- exports.SVG = SVG;
- exports.svg = svg$1;
- exports.Renderer = Renderer;
- exports.Canvas = Canvas;
- exports.canvas = canvas$1;
- exports.Path = Path;
- exports.CircleMarker = CircleMarker;
- exports.circleMarker = circleMarker;
- exports.Circle = Circle;
- exports.circle = circle;
- exports.Polyline = Polyline;
- exports.polyline = polyline;
- exports.Polygon = Polygon;
- exports.polygon = polygon;
- exports.Rectangle = Rectangle;
- exports.rectangle = rectangle;
- exports.Map = Map;
- exports.map = createMap;
-
- var oldL = window.L;
- exports.noConflict = function() {
- window.L = oldL;
- return this;
- };
-
- // Always export us to window global (see #2364)
- window.L = exports;
-
- })));
-
- });
-
- var L$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), leafletSrc, {
- 'default': leafletSrc
- }));
-
- var Control_MiniMap_min = createCommonjsModule(function (module, exports) {
- (function(factory,window){{module.exports=factory(leafletSrc);}if(typeof window!=="undefined"&&window.L){window.L.Control.MiniMap=factory(L);window.L.control.minimap=function(layer,options){return new window.L.Control.MiniMap(layer,options)};}})(function(L){var MiniMap=L.Control.extend({includes:L.Evented?L.Evented.prototype:L.Mixin.Events,options:{position:"bottomright",toggleDisplay:false,zoomLevelOffset:-5,zoomLevelFixed:false,centerFixed:false,zoomAnimation:false,autoToggleDisplay:false,minimized:false,width:150,height:150,collapsedWidth:19,collapsedHeight:19,aimingRectOptions:{color:"#ff7800",weight:1,clickable:false},shadowRectOptions:{color:"#000000",weight:1,clickable:false,opacity:0,fillOpacity:0},strings:{hideText:"Hide MiniMap",showText:"Show MiniMap"},mapOptions:{}},initialize:function(layer,options){L.Util.setOptions(this,options);this.options.aimingRectOptions.clickable=false;this.options.shadowRectOptions.clickable=false;this._layer=layer;},onAdd:function(map){this._mainMap=map;this._container=L.DomUtil.create("div","leaflet-control-minimap");this._container.style.width=this.options.width+"px";this._container.style.height=this.options.height+"px";L.DomEvent.disableClickPropagation(this._container);L.DomEvent.on(this._container,"mousewheel",L.DomEvent.stopPropagation);var mapOptions={attributionControl:false,dragging:!this.options.centerFixed,zoomControl:false,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:map.options.crs};mapOptions=L.Util.extend(this.options.mapOptions,mapOptions);this._miniMap=new L.Map(this._container,mapOptions);this._miniMap.addLayer(this._layer);this._mainMapMoving=false;this._miniMapMoving=false;this._userToggledDisplay=false;this._minimized=false;if(this.options.toggleDisplay){this._addToggleButton();}this._miniMap.whenReady(L.Util.bind(function(){this._aimingRect=L.rectangle(this._mainMap.getBounds(),this.options.aimingRectOptions).addTo(this._miniMap);this._shadowRect=L.rectangle(this._mainMap.getBounds(),this.options.shadowRectOptions).addTo(this._miniMap);this._mainMap.on("moveend",this._onMainMapMoved,this);this._mainMap.on("move",this._onMainMapMoving,this);this._miniMap.on("movestart",this._onMiniMapMoveStarted,this);this._miniMap.on("move",this._onMiniMapMoving,this);this._miniMap.on("moveend",this._onMiniMapMoved,this);},this));return this._container},addTo:function(map){L.Control.prototype.addTo.call(this,map);var center=this.options.centerFixed||this._mainMap.getCenter();this._miniMap.setView(center,this._decideZoom(true));this._setDisplay(this.options.minimized);return this},onRemove:function(map){this._mainMap.off("moveend",this._onMainMapMoved,this);this._mainMap.off("move",this._onMainMapMoving,this);this._miniMap.off("moveend",this._onMiniMapMoved,this);this._miniMap.removeLayer(this._layer);},changeLayer:function(layer){this._miniMap.removeLayer(this._layer);this._layer=layer;this._miniMap.addLayer(this._layer);},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),"leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-"+this.options.position,this._container,this._toggleDisplayButtonClicked,this):undefined;this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px";this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px";},_toggleButtonInitialTitleText:function(){if(this.options.minimized){return this.options.strings.showText}else {return this.options.strings.hideText}},_createButton:function(html,title,className,container,fn,context){var link=L.DomUtil.create("a",className,container);link.innerHTML=html;link.href="#";link.title=title;var stop=L.DomEvent.stopPropagation;L.DomEvent.on(link,"click",stop).on(link,"mousedown",stop).on(link,"dblclick",stop).on(link,"click",L.DomEvent.preventDefault).on(link,"click",fn,context);return link},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=true;if(!this._minimized){this._minimize();}else {this._restore();}},_setDisplay:function(minimize){if(minimize!==this._minimized){if(!this._minimized){this._minimize();}else {this._restore();}}},_minimize:function(){if(this.options.toggleDisplay){this._container.style.width=this.options.collapsedWidth+"px";this._container.style.height=this.options.collapsedHeight+"px";this._toggleDisplayButton.className+=" minimized-"+this.options.position;this._toggleDisplayButton.title=this.options.strings.showText;}else {this._container.style.display="none";}this._minimized=true;this._onToggle();},_restore:function(){if(this.options.toggleDisplay){this._container.style.width=this.options.width+"px";this._container.style.height=this.options.height+"px";this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,"");this._toggleDisplayButton.title=this.options.strings.hideText;}else {this._container.style.display="block";}this._minimized=false;this._onToggle();},_onMainMapMoved:function(e){if(!this._miniMapMoving){var center=this.options.centerFixed||this._mainMap.getCenter();this._mainMapMoving=true;this._miniMap.setView(center,this._decideZoom(true));this._setDisplay(this._decideMinimized());}else {this._miniMapMoving=false;}this._aimingRect.setBounds(this._mainMap.getBounds());},_onMainMapMoving:function(e){this._aimingRect.setBounds(this._mainMap.getBounds());},_onMiniMapMoveStarted:function(e){if(!this.options.centerFixed){var lastAimingRect=this._aimingRect.getBounds();var sw=this._miniMap.latLngToContainerPoint(lastAimingRect.getSouthWest());var ne=this._miniMap.latLngToContainerPoint(lastAimingRect.getNorthEast());this._lastAimingRectPosition={sw:sw,ne:ne};}},_onMiniMapMoving:function(e){if(!this.options.centerFixed){if(!this._mainMapMoving&&this._lastAimingRectPosition){this._shadowRect.setBounds(new L.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne)));this._shadowRect.setStyle({opacity:1,fillOpacity:.3});}}},_onMiniMapMoved:function(e){if(!this._mainMapMoving){this._miniMapMoving=true;this._mainMap.setView(this._miniMap.getCenter(),this._decideZoom(false));this._shadowRect.setStyle({opacity:0,fillOpacity:0});}else {this._mainMapMoving=false;}},_isZoomLevelFixed:function(){var zoomLevelFixed=this.options.zoomLevelFixed;return this._isDefined(zoomLevelFixed)&&this._isInteger(zoomLevelFixed)},_decideZoom:function(fromMaintoMini){if(!this._isZoomLevelFixed()){if(fromMaintoMini){return this._mainMap.getZoom()+this.options.zoomLevelOffset}else {var currentDiff=this._miniMap.getZoom()-this._mainMap.getZoom();var proposedZoom=this._miniMap.getZoom()-this.options.zoomLevelOffset;var toRet;if(currentDiff>this.options.zoomLevelOffset&&this._mainMap.getZoom()<this._miniMap.getMinZoom()-this.options.zoomLevelOffset){if(this._miniMap.getZoom()>this._lastMiniMapZoom){toRet=this._mainMap.getZoom()+1;this._miniMap.setZoom(this._miniMap.getZoom()-1);}else {toRet=this._mainMap.getZoom();}}else {toRet=proposedZoom;}this._lastMiniMapZoom=this._miniMap.getZoom();return toRet}}else {if(fromMaintoMini){return this.options.zoomLevelFixed}else {return this._mainMap.getZoom()}}},_decideMinimized:function(){if(this._userToggledDisplay){return this._minimized}if(this.options.autoToggleDisplay){if(this._mainMap.getBounds().contains(this._miniMap.getBounds())){return true}return false}return this._minimized},_isInteger:function(value){return typeof value==="number"},_isDefined:function(value){return typeof value!=="undefined"},_onToggle:function(){L.Util.requestAnimFrame(function(){L.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this);if(!L.Browser.any3d){L.Util.requestAnimFrame(this._fireToggleEvents,this);}},this);},_fireToggleEvents:function(){L.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this);var data={minimized:this._minimized};this.fire(this._minimized?"minimize":"restore",data);this.fire("toggle",data);}});L.Map.mergeOptions({miniMapControl:false});L.Map.addInitHook(function(){if(this.options.miniMapControl){this.miniMapControl=(new MiniMap).addTo(this);}});return MiniMap},window);
- });
-
- var LMM = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), Control_MiniMap_min, {
- 'default': Control_MiniMap_min
- }));
-
- /* src/components/MapPosition.svelte generated by Svelte v3.31.2 */
- const file$7 = "src/components/MapPosition.svelte";
-
- function create_fragment$7(ctx) {
- let div2;
- let div0;
- let t0;
- let t1;
- let t2;
- let a0;
- let t3;
- let t4;
- let br0;
- let t5;
- let t6;
- let t7;
- let br1;
- let t8;
- let t9;
- let t10;
- let br2;
- let t11;
- let t12;
- let t13;
- let br3;
- let t14;
- let t15;
- let t16;
- let div1;
- let a1;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- div2 = element("div");
- div0 = element("div");
- t0 = text("map center: ");
- t1 = text(/*map_center*/ ctx[0]);
- t2 = space();
- a0 = element("a");
- t3 = text("view on osm.org");
- t4 = space();
- br0 = element("br");
- t5 = text("\n map zoom: ");
- t6 = text(/*map_zoom*/ ctx[1]);
- t7 = space();
- br1 = element("br");
- t8 = text("\n viewbox: ");
- t9 = text(/*map_viewbox*/ ctx[2]);
- t10 = space();
- br2 = element("br");
- t11 = text("\n last click: ");
- t12 = text(/*last_click*/ ctx[4]);
- t13 = space();
- br3 = element("br");
- t14 = text("\n mouse position: ");
- t15 = text(/*mouse_position*/ ctx[5]);
- t16 = space();
- div1 = element("div");
- a1 = element("a");
- a1.textContent = "hide";
- attr_dev(a0, "target", "_blank");
- attr_dev(a0, "href", /*view_on_osm_link*/ ctx[3]);
- add_location(a0, file$7, 86, 4, 2297);
- add_location(br0, file$7, 87, 4, 2366);
- add_location(br1, file$7, 89, 4, 2400);
- add_location(br2, file$7, 91, 4, 2436);
- add_location(br3, file$7, 93, 4, 2474);
- attr_dev(div0, "id", "map-position-inner");
- add_location(div0, file$7, 84, 2, 2234);
- attr_dev(a1, "href", "#");
- add_location(a1, file$7, 96, 31, 2556);
- attr_dev(div1, "id", "map-position-close");
- attr_dev(div1, "class", "svelte-1b30dq3");
- add_location(div1, file$7, 96, 2, 2527);
- attr_dev(div2, "id", "map-position");
- attr_dev(div2, "class", "svelte-1b30dq3");
- add_location(div2, file$7, 83, 0, 2208);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, div2, anchor);
- append_dev(div2, div0);
- append_dev(div0, t0);
- append_dev(div0, t1);
- append_dev(div0, t2);
- append_dev(div0, a0);
- append_dev(a0, t3);
- append_dev(div0, t4);
- append_dev(div0, br0);
- append_dev(div0, t5);
- append_dev(div0, t6);
- append_dev(div0, t7);
- append_dev(div0, br1);
- append_dev(div0, t8);
- append_dev(div0, t9);
- append_dev(div0, t10);
- append_dev(div0, br2);
- append_dev(div0, t11);
- append_dev(div0, t12);
- append_dev(div0, t13);
- append_dev(div0, br3);
- append_dev(div0, t14);
- append_dev(div0, t15);
- append_dev(div2, t16);
- append_dev(div2, div1);
- append_dev(div1, a1);
-
- if (!mounted) {
- dispose = listen_dev(a1, "click", handleHideClick, false, false, false);
- mounted = true;
- }
- },
- p: function update(ctx, [dirty]) {
- if (dirty & /*map_center*/ 1) set_data_dev(t1, /*map_center*/ ctx[0]);
-
- if (dirty & /*view_on_osm_link*/ 8) {
- attr_dev(a0, "href", /*view_on_osm_link*/ ctx[3]);
- }
-
- if (dirty & /*map_zoom*/ 2) set_data_dev(t6, /*map_zoom*/ ctx[1]);
- if (dirty & /*map_viewbox*/ 4) set_data_dev(t9, /*map_viewbox*/ ctx[2]);
- if (dirty & /*last_click*/ 16) set_data_dev(t12, /*last_click*/ ctx[4]);
- if (dirty & /*mouse_position*/ 32) set_data_dev(t15, /*mouse_position*/ ctx[5]);
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$7.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function map_link_to_osm(map) {
- var zoom = map.getZoom();
- var lat = map.getCenter().lat.toFixed(5);
- var lng = map.getCenter().lng.toFixed(5);
- return "https://openstreetmap.org/#map=" + zoom + "/" + lat + "/" + lng;
- }
-
- function map_viewbox_as_string$1(map) {
- var bounds = map.getBounds();
- var west = bounds.getWest();
- var east = bounds.getEast();
-
- if (east - west >= 360) {
- // covers more than whole planet
- west = map.getCenter().lng - 179.999;
-
- east = map.getCenter().lng + 179.999;
- }
-
- east = L.latLng(77, east).wrap().lng;
- west = L.latLng(77, west).wrap().lng;
-
- return [
- west.toFixed(5),
- bounds.getNorth().toFixed(5),
- east.toFixed(5),
- bounds.getSouth().toFixed(5)
- ].join(","); // left
- // top
- // right
- // bottom
- }
-
- function handleHideClick(e) {
- document.getElementById("map-position").style.display = "none";
- document.getElementById("show-map-position").style.display = "block";
- }
-
- function instance$7($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("MapPosition", slots, []);
- let last_click_latlng;
- let map_center;
- let map_zoom;
- let map_viewbox;
- let view_on_osm_link;
- let last_click;
- let mouse_position;
-
- function display_map_position(map, mouse_lat_lng) {
- $$invalidate(0, map_center = map.getCenter().lat.toFixed(5) + "," + map.getCenter().lng.toFixed(5));
- $$invalidate(3, view_on_osm_link = map_link_to_osm(map));
- $$invalidate(1, map_zoom = map.getZoom());
- $$invalidate(2, map_viewbox = map_viewbox_as_string$1(map));
- $$invalidate(5, mouse_position = "-");
-
- if (mouse_lat_lng) {
- $$invalidate(5, mouse_position = [mouse_lat_lng.lat.toFixed(5), mouse_lat_lng.lng.toFixed(5)].join(","));
- }
-
- if (last_click_latlng) {
- $$invalidate(4, last_click = [last_click_latlng.lat.toFixed(5), last_click_latlng.lng.toFixed(5)].join(","));
- }
- }
-
- map_store.subscribe(map => {
- if (!map) {
- return;
- }
-
- map.on("move", function () {
- display_map_position(map);
- }); // update_viewbox_field();
-
- map.on("mousemove", function (e) {
- display_map_position(map, e.latlng);
- });
-
- map.on("click", function (e) {
- last_click_latlng = e.latlng;
- display_map_position(map);
- });
-
- map.on("load", function () {
- display_map_position(map);
- });
- });
-
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<MapPosition> was created with unknown prop '${key}'`);
- });
-
- $$self.$capture_state = () => ({
- map_store,
- last_click_latlng,
- map_center,
- map_zoom,
- map_viewbox,
- view_on_osm_link,
- last_click,
- mouse_position,
- map_link_to_osm,
- map_viewbox_as_string: map_viewbox_as_string$1,
- display_map_position,
- handleHideClick
- });
-
- $$self.$inject_state = $$props => {
- if ("last_click_latlng" in $$props) last_click_latlng = $$props.last_click_latlng;
- if ("map_center" in $$props) $$invalidate(0, map_center = $$props.map_center);
- if ("map_zoom" in $$props) $$invalidate(1, map_zoom = $$props.map_zoom);
- if ("map_viewbox" in $$props) $$invalidate(2, map_viewbox = $$props.map_viewbox);
- if ("view_on_osm_link" in $$props) $$invalidate(3, view_on_osm_link = $$props.view_on_osm_link);
- if ("last_click" in $$props) $$invalidate(4, last_click = $$props.last_click);
- if ("mouse_position" in $$props) $$invalidate(5, mouse_position = $$props.mouse_position);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [
- map_center,
- map_zoom,
- map_viewbox,
- view_on_osm_link,
- last_click,
- mouse_position
- ];
- }
-
- class MapPosition extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$7, create_fragment$7, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "MapPosition",
- options,
- id: create_fragment$7.name
- });
- }
- }
-
- /* src/components/Map.svelte generated by Svelte v3.31.2 */
- const file$8 = "src/components/Map.svelte";
-
- function create_fragment$8(ctx) {
- let mapposition;
- let t0;
- let div0;
- let t1;
- let div1;
- let current;
- let mounted;
- let dispose;
- mapposition = new MapPosition({ $$inline: true });
-
- const block = {
- c: function create() {
- create_component(mapposition.$$.fragment);
- t0 = space();
- div0 = element("div");
- t1 = space();
- div1 = element("div");
- div1.textContent = "show map bounds";
- attr_dev(div0, "id", "map");
- attr_dev(div0, "class", "svelte-1vbvdrk");
- add_location(div0, file$8, 173, 0, 4682);
- attr_dev(div1, "id", "show-map-position");
- attr_dev(div1, "class", "leaflet-bar btn btn-sm btn-outline-secondary svelte-1vbvdrk");
- add_location(div1, file$8, 174, 0, 4713);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- mount_component(mapposition, target, anchor);
- insert_dev(target, t0, anchor);
- insert_dev(target, div0, anchor);
- insert_dev(target, t1, anchor);
- insert_dev(target, div1, anchor);
- current = true;
-
- if (!mounted) {
- dispose = [
- action_destroyer(/*mapAction*/ ctx[0].call(null, div0)),
- listen_dev(div1, "click", stop_propagation(show_map_position_click), false, false, true)
- ];
-
- mounted = true;
- }
- },
- p: noop,
- i: function intro(local) {
- if (current) return;
- transition_in(mapposition.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(mapposition.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(mapposition, detaching);
- if (detaching) detach_dev(t0);
- if (detaching) detach_dev(div0);
- if (detaching) detach_dev(t1);
- if (detaching) detach_dev(div1);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$8.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function parse_and_normalize_geojson_string(part) {
- // normalize places the geometry into a featurecollection, similar to
- // https://github.com/mapbox/geojson-normalize
- var parsed_geojson = {
- type: "FeatureCollection",
- features: [
- {
- type: "Feature",
- geometry: part,
- properties: {}
- }
- ]
- };
-
- return parsed_geojson;
- }
-
- function show_map_position_click(e) {
- e.target.style.display = "none";
- document.getElementById("map-position").style.display = "block";
- }
-
- function instance$8($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Map", slots, []);
- let { display_minimap = false } = $$props;
- let dataLayers = [];
-
- function createMap(container) {
- const attribution = get_config_value_1("Map_Tile_Attribution") || null;
-
- let map = new leafletSrc.map(container,
- {
- attributionControl: attribution && attribution.length,
- scrollWheelZoom: true, // !L.Browser.touch,
- touchZoom: false,
- center: [get_config_value_1("Map_Default_Lat"), get_config_value_1("Map_Default_Lon")],
- zoom: get_config_value_1("Map_Default_Zoom")
- });
-
- leafletSrc.tileLayer(get_config_value_1("Map_Tile_URL"), { attribution }).addTo(map);
-
- if (display_minimap) {
- let osm2 = new leafletSrc.TileLayer(get_config_value_1("Map_Tile_URL"), { minZoom: 0, maxZoom: 13, attribution });
- new leafletSrc.Control.MiniMap(osm2, { toggleDisplay: true }).addTo(map);
- }
-
- const MapPositionControl = leafletSrc.Control.extend({
- options: { position: "topright" },
- onAdd: () => {
- return document.getElementById("show-map-position");
- }
- });
-
- map.addControl(new MapPositionControl());
- return map;
- }
-
- function mapAction(container) {
- let map = createMap(container);
- map_store.set(map);
- setMapData(get_store_value(current_result_store));
-
- return {
- destroy: () => {
- map.remove();
- }
- };
- }
-
- function resetMapData() {
- let map = get_store_value(map_store);
-
- if (!map) {
- return;
- }
-
- dataLayers.forEach(function (layer) {
- map.removeLayer(layer);
- });
- }
-
- function setMapData(aFeature) {
- let map = get_store_value(map_store);
-
- if (!map) {
- return;
- }
-
- resetMapData();
- let request_latlon = get_store_value(current_request_latlon);
-
- if (request_latlon) {
- // We don't need a marker, but an L.circle instance changes radius once you zoom in/out
- let cm = leafletSrc.circleMarker(request_latlon, {
- radius: 5,
- weight: 2,
- fillColor: "#ff7800",
- color: "red",
- opacity: 0.75,
- zIndexOffset: 100,
- clickable: false
- });
-
- cm.addTo(map);
- dataLayers.push(cm);
- }
-
- var search_params = new URLSearchParams(window.location.search);
- var viewbox = search_params.get("viewbox");
-
- if (viewbox) {
- let coords = viewbox.split(","); // <x1>,<y1>,<x2>,<y2>
- let bounds = leafletSrc.latLngBounds([coords[1], coords[0]], [coords[3], coords[2]]);
-
- leafletSrc.rectangle(bounds, {
- color: "#69d53e",
- weight: 3,
- dashArray: "5 5",
- opacity: 0.8,
- fill: false
- }).addTo(map);
- }
-
- // nothing to do
- if (!aFeature) {
- return;
- }
-
- let lat = aFeature.centroid
- ? aFeature.centroid.coordinates[1]
- : aFeature.lat;
-
- let lon = aFeature.centroid
- ? aFeature.centroid.coordinates[0]
- : aFeature.lon;
-
- let geojson = aFeature.geometry || aFeature.geojson;
-
- if (lat && lon) {
- let circle = leafletSrc.circleMarker([lat, lon], {
- radius: 10,
- weight: 2,
- fillColor: "#ff7800",
- color: "blue",
- opacity: 0.75
- });
-
- map.addLayer(circle);
- dataLayers.push(circle);
- }
-
- if (geojson) {
- var geojson_layer = leafletSrc.geoJson(
- // https://leafletjs.com/reference-1.0.3.html#path-option
- parse_and_normalize_geojson_string(geojson),
- {
- style() {
- return { interactive: false, color: "blue" };
- }
- }
- );
-
- map.addLayer(geojson_layer);
- dataLayers.push(geojson_layer);
- map.fitBounds(geojson_layer.getBounds());
- } else if (lat && lon) {
- map.setView([lat, lon], 10);
- } else {
- map.fitWorld();
- }
- }
-
- current_result_store.subscribe(aFeature => {
- setMapData(aFeature);
- });
-
- const writable_props = ["display_minimap"];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Map> was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ("display_minimap" in $$props) $$invalidate(1, display_minimap = $$props.display_minimap);
- };
-
- $$self.$capture_state = () => ({
- L: L$1,
- LMM,
- get: get_store_value,
- get_config_value: get_config_value_1,
- map_store,
- current_result_store,
- current_request_latlon,
- MapPosition,
- display_minimap,
- dataLayers,
- createMap,
- mapAction,
- parse_and_normalize_geojson_string,
- resetMapData,
- setMapData,
- show_map_position_click
- });
-
- $$self.$inject_state = $$props => {
- if ("display_minimap" in $$props) $$invalidate(1, display_minimap = $$props.display_minimap);
- if ("dataLayers" in $$props) dataLayers = $$props.dataLayers;
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [mapAction, display_minimap];
- }
-
- class Map$1 extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$8, create_fragment$8, safe_not_equal, { display_minimap: 1 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Map",
- options,
- id: create_fragment$8.name
- });
- }
-
- get display_minimap() {
- throw new Error("<Map>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set display_minimap(value) {
- throw new Error("<Map>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
- }
-
- /* src/pages/SearchPage.svelte generated by Svelte v3.31.2 */
- const file$9 = "src/pages/SearchPage.svelte";
-
- function create_fragment$9(ctx) {
- let searchbar;
- let t0;
- let div2;
- let div0;
- let resultslist;
- let t1;
- let div1;
- let map;
- let current;
-
- searchbar = new SearchBar({
- props: {
- reverse_search: /*reverse_search*/ ctx[0],
- api_request_params: /*api_request_params*/ ctx[1],
- bStructuredSearch: /*bStructuredSearch*/ ctx[2]
- },
- $$inline: true
- });
-
- resultslist = new ResultsList({
- props: {
- reverse_search: /*reverse_search*/ ctx[0]
- },
- $$inline: true
- });
-
- map = new Map$1({
- props: { display_minimap: true },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(searchbar.$$.fragment);
- t0 = space();
- div2 = element("div");
- div0 = element("div");
- create_component(resultslist.$$.fragment);
- t1 = space();
- div1 = element("div");
- create_component(map.$$.fragment);
- attr_dev(div0, "class", "sidebar svelte-1wb4w3");
- add_location(div0, file$9, 93, 2, 3393);
- attr_dev(div1, "id", "map-wrapper");
- attr_dev(div1, "class", "svelte-1wb4w3");
- add_location(div1, file$9, 96, 2, 3478);
- attr_dev(div2, "id", "content");
- attr_dev(div2, "class", "svelte-1wb4w3");
- add_location(div2, file$9, 92, 0, 3372);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- mount_component(searchbar, target, anchor);
- insert_dev(target, t0, anchor);
- insert_dev(target, div2, anchor);
- append_dev(div2, div0);
- mount_component(resultslist, div0, null);
- append_dev(div2, t1);
- append_dev(div2, div1);
- mount_component(map, div1, null);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- const searchbar_changes = {};
- if (dirty & /*reverse_search*/ 1) searchbar_changes.reverse_search = /*reverse_search*/ ctx[0];
- if (dirty & /*api_request_params*/ 2) searchbar_changes.api_request_params = /*api_request_params*/ ctx[1];
- searchbar.$set(searchbar_changes);
- const resultslist_changes = {};
- if (dirty & /*reverse_search*/ 1) resultslist_changes.reverse_search = /*reverse_search*/ ctx[0];
- resultslist.$set(resultslist_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(searchbar.$$.fragment, local);
- transition_in(resultslist.$$.fragment, local);
- transition_in(map.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(searchbar.$$.fragment, local);
- transition_out(resultslist.$$.fragment, local);
- transition_out(map.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(searchbar, detaching);
- if (detaching) detach_dev(t0);
- if (detaching) detach_dev(div2);
- destroy_component(resultslist);
- destroy_component(map);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$9.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$9($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("SearchPage", slots, []);
- let { reverse_search = false } = $$props;
- let api_request_params;
- let bStructuredSearch;
-
- function loaddata() {
- let search_params = new URLSearchParams(window.location.search);
- update_html_title();
-
- if (reverse_search) {
- $$invalidate(1, api_request_params = {
- lat: search_params.get("lat"),
- lon: search_params.get("lon"),
- zoom: search_params.get("zoom") > 1
- ? Number(search_params.get("zoom"))
- : Number(get_config_value_1("Reverse_Default_Search_Zoom")),
- format: "jsonv2"
- });
-
- if (api_request_params.lat || api_request_params.lat) {
- fetch_from_api("reverse", api_request_params, function (data) {
- if (data && !data.error) {
- current_request_latlon.set([api_request_params.lat, api_request_params.lon]);
- results_store.set([data]);
- } else {
- results_store.set([]);
- }
-
- update_html_title("Reverse result for " + api_request_params.lat + "," + api_request_params.lon);
- document.querySelector("input[name=lat]").focus();
- });
- }
- } else {
- $$invalidate(1, api_request_params = {
- q: search_params.get("q"),
- street: search_params.get("street"),
- city: search_params.get("city"),
- county: search_params.get("county"),
- state: search_params.get("state"),
- country: search_params.get("country"),
- postalcode: search_params.get("postalcode"),
- polygon_geojson: get_config_value_1("Search_AreaPolygons", false) ? 1 : 0,
- viewbox: search_params.get("viewbox"),
- bounded: search_params.get("bounded"),
- dedupe: search_params.get("dedupe"),
- "accept-language": search_params.get("accept-language"),
- countrycodes: search_params.get("countrycodes"),
- limit: search_params.get("limit"),
- polygon_threshold: search_params.get("polygon_threshold"),
- exclude_place_ids: search_params.get("exclude_place_ids"),
- format: "jsonv2"
- });
-
- let bStructuredSearch = api_request_params.street || api_request_params.city || api_request_params.county || api_request_params.state || api_request_params.country || api_request_params.postalcode;
-
- if (api_request_params.q || bStructuredSearch) {
- fetch_from_api("search", api_request_params, function (data) {
- results_store.set(data);
- update_html_title("Result for " + api_request_params.q);
- document.querySelector("input[name=q]").focus();
- });
- }
- }
- }
-
- onMount(loaddata);
- const writable_props = ["reverse_search"];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<SearchPage> was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ("reverse_search" in $$props) $$invalidate(0, reverse_search = $$props.reverse_search);
- };
-
- $$self.$capture_state = () => ({
- onMount,
- results_store,
- current_result_store,
- current_request_latlon,
- get_config_value: get_config_value_1,
- fetch_from_api,
- update_html_title,
- SearchBar,
- ResultsList,
- Map: Map$1,
- reverse_search,
- api_request_params,
- bStructuredSearch,
- loaddata
- });
-
- $$self.$inject_state = $$props => {
- if ("reverse_search" in $$props) $$invalidate(0, reverse_search = $$props.reverse_search);
- if ("api_request_params" in $$props) $$invalidate(1, api_request_params = $$props.api_request_params);
- if ("bStructuredSearch" in $$props) $$invalidate(2, bStructuredSearch = $$props.bStructuredSearch);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [reverse_search, api_request_params, bStructuredSearch];
- }
-
- class SearchPage extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$9, create_fragment$9, safe_not_equal, { reverse_search: 0 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "SearchPage",
- options,
- id: create_fragment$9.name
- });
- }
-
- get reverse_search() {
- throw new Error("<SearchPage>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set reverse_search(value) {
- throw new Error("<SearchPage>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
- }
-
- /* src/components/DetailsIndex.svelte generated by Svelte v3.31.2 */
-
- const file$a = "src/components/DetailsIndex.svelte";
-
- function create_fragment$a(ctx) {
- let div5;
- let div4;
- let div3;
- let h1;
- let t1;
- let div0;
- let h40;
- let t3;
- let form0;
- let input0;
- let t4;
- let input1;
- let t5;
- let div1;
- let h41;
- let t7;
- let form1;
- let input2;
- let t8;
- let input3;
- let t9;
- let input4;
- let t10;
- let input5;
- let t11;
- let div2;
- let h42;
- let t13;
- let form2;
- let input6;
- let t14;
- let input7;
- let t15;
- let input8;
- let t16;
- let input9;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- div5 = element("div");
- div4 = element("div");
- div3 = element("div");
- h1 = element("h1");
- h1.textContent = "Show details for place";
- t1 = space();
- div0 = element("div");
- h40 = element("h4");
- h40.textContent = "Search by place id";
- t3 = space();
- form0 = element("form");
- input0 = element("input");
- t4 = space();
- input1 = element("input");
- t5 = space();
- div1 = element("div");
- h41 = element("h4");
- h41.textContent = "Search by OSM type and OSM id";
- t7 = space();
- form1 = element("form");
- input2 = element("input");
- t8 = space();
- input3 = element("input");
- t9 = space();
- input4 = element("input");
- t10 = space();
- input5 = element("input");
- t11 = space();
- div2 = element("div");
- h42 = element("h4");
- h42.textContent = "Search by openstreetmap.org URL";
- t13 = space();
- form2 = element("form");
- input6 = element("input");
- t14 = space();
- input7 = element("input");
- t15 = space();
- input8 = element("input");
- t16 = space();
- input9 = element("input");
- add_location(h1, file$a, 25, 6, 687);
- attr_dev(h40, "class", "svelte-k5v90i");
- add_location(h40, file$a, 28, 8, 760);
- attr_dev(input0, "type", "edit");
- attr_dev(input0, "class", "form-control form-control-sm svelte-k5v90i");
- attr_dev(input0, "pattern", "^[0-9]+$");
- attr_dev(input0, "name", "place_id");
- attr_dev(input0, "placeholder", "12345");
- add_location(input0, file$a, 31, 10, 856);
- attr_dev(input1, "type", "submit");
- attr_dev(input1, "class", "btn btn-primary btn-sm");
- input1.value = "Show";
- add_location(input1, file$a, 36, 10, 1048);
- attr_dev(form0, "class", "form-inline");
- attr_dev(form0, "action", "details.html");
- add_location(form0, file$a, 30, 8, 797);
- attr_dev(div0, "class", "search-form svelte-k5v90i");
- add_location(div0, file$a, 27, 6, 726);
- attr_dev(h41, "class", "svelte-k5v90i");
- add_location(h41, file$a, 43, 8, 1220);
- attr_dev(input2, "type", "edit");
- attr_dev(input2, "class", "form-control form-control-sm svelte-k5v90i");
- attr_dev(input2, "pattern", "^[NWR][0-9]+$");
- attr_dev(input2, "placeholder", "N123 or W123 or R123");
- add_location(input2, file$a, 49, 10, 1438);
- attr_dev(input3, "type", "hidden");
- attr_dev(input3, "name", "osmtype");
- add_location(input3, file$a, 53, 10, 1617);
- attr_dev(input4, "type", "hidden");
- attr_dev(input4, "name", "osmid");
- add_location(input4, file$a, 54, 10, 1666);
- attr_dev(input5, "type", "submit");
- attr_dev(input5, "class", "btn btn-primary btn-sm");
- input5.value = "Show";
- add_location(input5, file$a, 55, 10, 1713);
- attr_dev(form1, "id", "form-by-type-and-id");
- attr_dev(form1, "class", "form-inline");
- attr_dev(form1, "action", "details.html");
- add_location(form1, file$a, 45, 8, 1268);
- attr_dev(div1, "class", "search-form svelte-k5v90i");
- add_location(div1, file$a, 42, 6, 1186);
- attr_dev(h42, "class", "svelte-k5v90i");
- add_location(h42, file$a, 60, 8, 1851);
- attr_dev(input6, "type", "edit");
- attr_dev(input6, "class", "form-control form-control-sm svelte-k5v90i");
- attr_dev(input6, "pattern", ".*openstreetmap.*");
- attr_dev(input6, "placeholder", "https://www.openstreetmap.org/relation/123");
- add_location(input6, file$a, 66, 10, 2067);
- attr_dev(input7, "type", "hidden");
- attr_dev(input7, "name", "osmtype");
- add_location(input7, file$a, 70, 10, 2272);
- attr_dev(input8, "type", "hidden");
- attr_dev(input8, "name", "osmid");
- add_location(input8, file$a, 71, 10, 2321);
- attr_dev(input9, "type", "submit");
- attr_dev(input9, "class", "btn btn-primary btn-sm");
- input9.value = "Show";
- add_location(input9, file$a, 72, 10, 2368);
- attr_dev(form2, "id", "form-by-osm-url");
- attr_dev(form2, "class", "form-inline");
- attr_dev(form2, "action", "details.html");
- add_location(form2, file$a, 62, 8, 1901);
- attr_dev(div2, "class", "search-form svelte-k5v90i");
- add_location(div2, file$a, 59, 6, 1817);
- attr_dev(div3, "class", "col-md-12");
- add_location(div3, file$a, 23, 4, 656);
- attr_dev(div4, "class", "row");
- add_location(div4, file$a, 22, 2, 634);
- attr_dev(div5, "class", "container");
- attr_dev(div5, "id", "details-index-page");
- add_location(div5, file$a, 21, 0, 584);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, div5, anchor);
- append_dev(div5, div4);
- append_dev(div4, div3);
- append_dev(div3, h1);
- append_dev(div3, t1);
- append_dev(div3, div0);
- append_dev(div0, h40);
- append_dev(div0, t3);
- append_dev(div0, form0);
- append_dev(form0, input0);
- append_dev(form0, t4);
- append_dev(form0, input1);
- append_dev(div3, t5);
- append_dev(div3, div1);
- append_dev(div1, h41);
- append_dev(div1, t7);
- append_dev(div1, form1);
- append_dev(form1, input2);
- append_dev(form1, t8);
- append_dev(form1, input3);
- append_dev(form1, t9);
- append_dev(form1, input4);
- append_dev(form1, t10);
- append_dev(form1, input5);
- append_dev(div3, t11);
- append_dev(div3, div2);
- append_dev(div2, h42);
- append_dev(div2, t13);
- append_dev(div2, form2);
- append_dev(form2, input6);
- append_dev(form2, t14);
- append_dev(form2, input7);
- append_dev(form2, t15);
- append_dev(form2, input8);
- append_dev(form2, t16);
- append_dev(form2, input9);
-
- if (!mounted) {
- dispose = [
- listen_dev(form1, "submit", prevent_default(handleFormSubmit), false, true, false),
- listen_dev(form2, "submit", prevent_default(handleFormSubmit), false, true, false)
- ];
-
- mounted = true;
- }
- },
- p: noop,
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div5);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$a.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function handleFormSubmit(event) {
- let form_el = event.target;
- let val = form_el.querySelector("input[type=edit]").value;
- let matches = val.match(/^\s*([NWR])(\d+)\s*$/i);
-
- if (!matches) {
- matches = val.match(/\/(relation|way|node)\/(\d+)\s*$/);
- }
-
- if (!matches) {
- alert("invalid input");
- return;
- }
-
- form_el.querySelector("input[name=osmtype]").setAttribute("value", matches[1].charAt(0).toUpperCase());
- form_el.querySelector("input[name=osmid]").setAttribute("value", matches[2]);
- form_el.submit();
- }
-
- function instance$a($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("DetailsIndex", slots, []);
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<DetailsIndex> was created with unknown prop '${key}'`);
- });
-
- $$self.$capture_state = () => ({ handleFormSubmit });
- return [];
- }
-
- class DetailsIndex extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$a, create_fragment$a, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "DetailsIndex",
- options,
- id: create_fragment$a.name
- });
- }
- }
-
- /* src/components/DetailsOneRow.svelte generated by Svelte v3.31.2 */
-
- const file$b = "src/components/DetailsOneRow.svelte";
-
- // (16:4) {:else}
- function create_else_block$2(ctx) {
- let span;
-
- const block = {
- c: function create() {
- span = element("span");
- span.textContent = "No Name";
- attr_dev(span, "class", "noname svelte-rtfpp8");
- add_location(span, file$b, 16, 6, 377);
- },
- m: function mount(target, anchor) {
- insert_dev(target, span, anchor);
- },
- p: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(span);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block$2.name,
- type: "else",
- source: "(16:4) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (14:4) {#if addressLine.localname}
- function create_if_block_1$1(ctx) {
- let t_value = /*addressLine*/ ctx[0].localname + "";
- let t;
-
- const block = {
- c: function create() {
- t = text(t_value);
- },
- m: function mount(target, anchor) {
- insert_dev(target, t, anchor);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*addressLine*/ 1 && t_value !== (t_value = /*addressLine*/ ctx[0].localname + "")) set_data_dev(t, t_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(t);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_1$1.name,
- type: "if",
- source: "(14:4) {#if addressLine.localname}",
- ctx
- });
-
- return block;
- }
-
- // (25:6) {#if addressLine.osm_id}
- function create_if_block$4(ctx) {
- let a;
- let t;
- let a_href_value;
-
- const block = {
- c: function create() {
- a = element("a");
- t = text("details");
- attr_dev(a, "href", a_href_value = detailsURL_1(/*addressLine*/ ctx[0]));
- add_location(a, file$b, 24, 30, 711);
- },
- m: function mount(target, anchor) {
- insert_dev(target, a, anchor);
- append_dev(a, t);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*addressLine*/ 1 && a_href_value !== (a_href_value = detailsURL_1(/*addressLine*/ ctx[0]))) {
- attr_dev(a, "href", a_href_value);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(a);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$4.name,
- type: "if",
- source: "(25:6) {#if addressLine.osm_id}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$b(ctx) {
- let tr;
- let td0;
- let t0;
- let td1;
- let t1_value = formatPlaceType_1(/*addressLine*/ ctx[0]) + "";
- let t1;
- let t2;
- let td2;
- let raw0_value = osmLink_1(/*addressLine*/ ctx[0]) + "";
- let t3;
- let td3;
- let t4_value = /*addressLine*/ ctx[0].rank_address + "";
- let t4;
- let t5;
- let td4;
- let t6_value = formatAdminLevel_1(/*addressLine*/ ctx[0].admin_level) + "";
- let t6;
- let t7;
- let td5;
- let raw1_value = formatDistance_1(/*addressLine*/ ctx[0].distance, /*bDistanceInMeters*/ ctx[1]) + "";
- let t8;
- let td6;
-
- function select_block_type(ctx, dirty) {
- if (/*addressLine*/ ctx[0].localname) return create_if_block_1$1;
- return create_else_block$2;
- }
-
- let current_block_type = select_block_type(ctx);
- let if_block0 = current_block_type(ctx);
- let if_block1 = /*addressLine*/ ctx[0].osm_id && create_if_block$4(ctx);
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- if_block0.c();
- t0 = space();
- td1 = element("td");
- t1 = text(t1_value);
- t2 = space();
- td2 = element("td");
- t3 = space();
- td3 = element("td");
- t4 = text(t4_value);
- t5 = space();
- td4 = element("td");
- t6 = text(t6_value);
- t7 = space();
- td5 = element("td");
- t8 = space();
- td6 = element("td");
- if (if_block1) if_block1.c();
- attr_dev(td0, "class", "name svelte-rtfpp8");
- add_location(td0, file$b, 12, 2, 279);
- add_location(td1, file$b, 19, 2, 433);
- add_location(td2, file$b, 20, 2, 475);
- add_location(td3, file$b, 21, 2, 515);
- add_location(td4, file$b, 22, 2, 553);
- add_location(td5, file$b, 23, 2, 608);
- add_location(td6, file$b, 24, 2, 683);
- attr_dev(tr, "class", "svelte-rtfpp8");
- toggle_class(tr, "notused", !/*bAddressLineUsed*/ ctx[2]);
- add_location(tr, file$b, 11, 0, 238);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- if_block0.m(td0, null);
- append_dev(tr, t0);
- append_dev(tr, td1);
- append_dev(td1, t1);
- append_dev(tr, t2);
- append_dev(tr, td2);
- td2.innerHTML = raw0_value;
- append_dev(tr, t3);
- append_dev(tr, td3);
- append_dev(td3, t4);
- append_dev(tr, t5);
- append_dev(tr, td4);
- append_dev(td4, t6);
- append_dev(tr, t7);
- append_dev(tr, td5);
- td5.innerHTML = raw1_value;
- append_dev(tr, t8);
- append_dev(tr, td6);
- if (if_block1) if_block1.m(td6, null);
- },
- p: function update(ctx, [dirty]) {
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block0) {
- if_block0.p(ctx, dirty);
- } else {
- if_block0.d(1);
- if_block0 = current_block_type(ctx);
-
- if (if_block0) {
- if_block0.c();
- if_block0.m(td0, null);
- }
- }
-
- if (dirty & /*addressLine*/ 1 && t1_value !== (t1_value = formatPlaceType_1(/*addressLine*/ ctx[0]) + "")) set_data_dev(t1, t1_value);
- if (dirty & /*addressLine*/ 1 && raw0_value !== (raw0_value = osmLink_1(/*addressLine*/ ctx[0]) + "")) td2.innerHTML = raw0_value; if (dirty & /*addressLine*/ 1 && t4_value !== (t4_value = /*addressLine*/ ctx[0].rank_address + "")) set_data_dev(t4, t4_value);
- if (dirty & /*addressLine*/ 1 && t6_value !== (t6_value = formatAdminLevel_1(/*addressLine*/ ctx[0].admin_level) + "")) set_data_dev(t6, t6_value);
- if (dirty & /*addressLine, bDistanceInMeters*/ 3 && raw1_value !== (raw1_value = formatDistance_1(/*addressLine*/ ctx[0].distance, /*bDistanceInMeters*/ ctx[1]) + "")) td5.innerHTML = raw1_value;
- if (/*addressLine*/ ctx[0].osm_id) {
- if (if_block1) {
- if_block1.p(ctx, dirty);
- } else {
- if_block1 = create_if_block$4(ctx);
- if_block1.c();
- if_block1.m(td6, null);
- }
- } else if (if_block1) {
- if_block1.d(1);
- if_block1 = null;
- }
-
- if (dirty & /*bAddressLineUsed*/ 4) {
- toggle_class(tr, "notused", !/*bAddressLineUsed*/ ctx[2]);
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- if_block0.d();
- if (if_block1) if_block1.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$b.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$b($$self, $$props, $$invalidate) {
- let bAddressLineUsed;
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("DetailsOneRow", slots, []);
- let { addressLine } = $$props;
- let { bDistanceInMeters } = $$props;
- const writable_props = ["addressLine", "bDistanceInMeters"];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<DetailsOneRow> was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ("addressLine" in $$props) $$invalidate(0, addressLine = $$props.addressLine);
- if ("bDistanceInMeters" in $$props) $$invalidate(1, bDistanceInMeters = $$props.bDistanceInMeters);
- };
-
- $$self.$capture_state = () => ({
- addressLine,
- bDistanceInMeters,
- formatPlaceType: formatPlaceType_1,
- osmLink: osmLink_1,
- formatAdminLevel: formatAdminLevel_1,
- formatDistance: formatDistance_1,
- detailsURL: detailsURL_1,
- bAddressLineUsed
- });
-
- $$self.$inject_state = $$props => {
- if ("addressLine" in $$props) $$invalidate(0, addressLine = $$props.addressLine);
- if ("bDistanceInMeters" in $$props) $$invalidate(1, bDistanceInMeters = $$props.bDistanceInMeters);
- if ("bAddressLineUsed" in $$props) $$invalidate(2, bAddressLineUsed = $$props.bAddressLineUsed);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- $$self.$$.update = () => {
- if ($$self.$$.dirty & /*addressLine*/ 1) {
- $$invalidate(2, bAddressLineUsed = addressLine.isaddress);
- }
- };
-
- return [addressLine, bDistanceInMeters, bAddressLineUsed];
- }
-
- class DetailsOneRow extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$b, create_fragment$b, safe_not_equal, { addressLine: 0, bDistanceInMeters: 1 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "DetailsOneRow",
- options,
- id: create_fragment$b.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*addressLine*/ ctx[0] === undefined && !("addressLine" in props)) {
- console.warn("<DetailsOneRow> was created without expected prop 'addressLine'");
- }
-
- if (/*bDistanceInMeters*/ ctx[1] === undefined && !("bDistanceInMeters" in props)) {
- console.warn("<DetailsOneRow> was created without expected prop 'bDistanceInMeters'");
- }
- }
-
- get addressLine() {
- throw new Error("<DetailsOneRow>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set addressLine(value) {
- throw new Error("<DetailsOneRow>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- get bDistanceInMeters() {
- throw new Error("<DetailsOneRow>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
-
- set bDistanceInMeters(value) {
- throw new Error("<DetailsOneRow>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
- }
- }
-
- /* src/pages/DetailsPage.svelte generated by Svelte v3.31.2 */
-
- const { Object: Object_1 } = globals;
- const file$c = "src/pages/DetailsPage.svelte";
-
- function get_each_context$2(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[3] = list[i];
- return child_ctx;
- }
-
- function get_each_context_1(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[6] = list[i];
- return child_ctx;
- }
-
- function get_each_context_2(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[9] = list[i];
- return child_ctx;
- }
-
- function get_each_context_3(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[9] = list[i];
- return child_ctx;
- }
-
- function get_each_context_4(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[14] = list[i];
- return child_ctx;
- }
-
- function get_each_context_5(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[14] = list[i];
- return child_ctx;
- }
-
- function get_each_context_6(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[19] = list[i];
- return child_ctx;
- }
-
- function get_each_context_7(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[19] = list[i];
- return child_ctx;
- }
-
- function get_each_context_8(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[19] = list[i];
- return child_ctx;
- }
-
- // (258:0) {:else}
- function create_else_block_2(ctx) {
- let t;
-
- const block = {
- c: function create() {
- t = text("No such place found.");
- },
- m: function mount(target, anchor) {
- insert_dev(target, t, anchor);
- },
- p: noop,
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(t);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block_2.name,
- type: "else",
- source: "(258:0) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (256:35)
- function create_if_block_12(ctx) {
- let detailsindex;
- let current;
- detailsindex = new DetailsIndex({ $$inline: true });
-
- const block = {
- c: function create() {
- create_component(detailsindex.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(detailsindex, target, anchor);
- current = true;
- },
- p: noop,
- i: function intro(local) {
- if (current) return;
- transition_in(detailsindex.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(detailsindex.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(detailsindex, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_12.name,
- type: "if",
- source: "(256:35) ",
- ctx
- });
-
- return block;
- }
-
- // (53:0) {#if aPlace}
- function create_if_block$5(ctx) {
- let div9;
- let div2;
- let div0;
- let h1;
- let t0_value = /*aPlace*/ ctx[0].localname + "";
- let t0;
- let t1;
- let small;
- let a0;
- let t2;
- let a0_href_value;
- let t3;
- let div1;
- let mapicon;
- let t4;
- let div6;
- let div3;
- let table0;
- let tbody0;
- let tr0;
- let td0;
- let t6;
- let td1;
- let t7;
- let tr1;
- let td2;
- let t9;
- let td3;
- let t10_value = /*aPlace*/ ctx[0].category + "";
- let t10;
- let t11;
- let t12_value = /*aPlace*/ ctx[0].type + "";
- let t12;
- let t13;
- let tr2;
- let td4;
- let t15;
- let td5;
- let t16_value = /*aPlace*/ ctx[0].indexed_date + "";
- let t16;
- let t17;
- let show_if = isAdminBoundary_1(/*aPlace*/ ctx[0]);
- let t18;
- let tr3;
- let td6;
- let t20;
- let td7;
- let t21_value = /*aPlace*/ ctx[0].rank_search + "";
- let t21;
- let t22;
- let tr4;
- let td8;
- let t24;
- let td9;
- let t25_value = /*aPlace*/ ctx[0].rank_address + "";
- let t25;
- let t26;
- let t27_value = formatAddressRank_1(/*aPlace*/ ctx[0].rank_address) + "";
- let t27;
- let t28;
- let t29;
- let t30;
- let tr5;
- let td10;
- let t32;
- let td11;
- let t33_value = coverageType_1(/*aPlace*/ ctx[0]) + "";
- let t33;
- let t34;
- let tr6;
- let td12;
- let t36;
- let td13;
- let t37_value = /*aPlace*/ ctx[0].centroid.coordinates[1] + "";
- let t37;
- let t38;
- let t39_value = /*aPlace*/ ctx[0].centroid.coordinates[0] + "";
- let t39;
- let t40;
- let tr7;
- let td14;
- let t42;
- let td15;
- let raw_value = osmLink_1(/*aPlace*/ ctx[0]) + "";
- let t43;
- let tr8;
- let td16;
- let t44;
- let a1;
- let t46;
- let t47;
- let td17;
- let t48_value = /*aPlace*/ ctx[0].place_id + "";
- let t48;
- let t49;
- let t50;
- let tr9;
- let td18;
- let t52;
- let td19;
- let t53_value = /*aPlace*/ ctx[0].calculated_postcode + "";
- let t53;
- let t54;
- let tr10;
- let td20;
- let t56;
- let td21;
- let t57;
- let tr11;
- let td22;
- let t59;
- let td23;
- let t60;
- let div5;
- let div4;
- let map;
- let t61;
- let div8;
- let div7;
- let h20;
- let t63;
- let table1;
- let thead;
- let tr12;
- let th0;
- let t65;
- let th1;
- let t67;
- let th2;
- let t69;
- let th3;
- let t71;
- let th4;
- let t73;
- let th5;
- let t75;
- let th6;
- let t76;
- let tbody1;
- let t77;
- let t78;
- let tr13;
- let td24;
- let h21;
- let t80;
- let t81;
- let tr14;
- let td25;
- let h22;
- let t83;
- let current_block_type_index;
- let if_block6;
- let current;
-
- mapicon = new MapIcon({
- props: { aPlace: /*aPlace*/ ctx[0] },
- $$inline: true
- });
-
- let each_value_8 = Object.keys(/*aPlace*/ ctx[0].names);
- validate_each_argument(each_value_8);
- let each_blocks_2 = [];
-
- for (let i = 0; i < each_value_8.length; i += 1) {
- each_blocks_2[i] = create_each_block_8(get_each_context_8(ctx, each_value_8, i));
- }
-
- let if_block0 = show_if && create_if_block_11(ctx);
- let if_block1 = /*aPlace*/ ctx[0].calculated_importance && create_if_block_9(ctx);
- let if_block2 = /*aPlace*/ ctx[0].calculated_wikipedia && create_if_block_8(ctx);
- let each_value_7 = Object.keys(/*aPlace*/ ctx[0].addresstags);
- validate_each_argument(each_value_7);
- let each_blocks_1 = [];
-
- for (let i = 0; i < each_value_7.length; i += 1) {
- each_blocks_1[i] = create_each_block_7(get_each_context_7(ctx, each_value_7, i));
- }
-
- let each_value_6 = Object.keys(/*aPlace*/ ctx[0].extratags);
- validate_each_argument(each_value_6);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_6.length; i += 1) {
- each_blocks[i] = create_each_block_6(get_each_context_6(ctx, each_value_6, i));
- }
-
- map = new Map$1({ $$inline: true });
- let if_block3 = /*aPlace*/ ctx[0].address && create_if_block_7(ctx);
- let if_block4 = /*aPlace*/ ctx[0].linked_places && create_if_block_6(ctx);
-
- function select_block_type_1(ctx, dirty) {
- if (/*aPlace*/ ctx[0].keywords) return create_if_block_3$1;
- return create_else_block_1$1;
- }
-
- let current_block_type = select_block_type_1(ctx);
- let if_block5 = current_block_type(ctx);
- const if_block_creators = [create_if_block_1$2, create_else_block$3];
- const if_blocks = [];
-
- function select_block_type_2(ctx, dirty) {
- if (/*aPlace*/ ctx[0].hierarchy) return 0;
- return 1;
- }
-
- current_block_type_index = select_block_type_2(ctx);
- if_block6 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
-
- const block = {
- c: function create() {
- div9 = element("div");
- div2 = element("div");
- div0 = element("div");
- h1 = element("h1");
- t0 = text(t0_value);
- t1 = space();
- small = element("small");
- a0 = element("a");
- t2 = text("link to this page");
- t3 = space();
- div1 = element("div");
- create_component(mapicon.$$.fragment);
- t4 = space();
- div6 = element("div");
- div3 = element("div");
- table0 = element("table");
- tbody0 = element("tbody");
- tr0 = element("tr");
- td0 = element("td");
- td0.textContent = "Name";
- t6 = space();
- td1 = element("td");
-
- for (let i = 0; i < each_blocks_2.length; i += 1) {
- each_blocks_2[i].c();
- }
-
- t7 = space();
- tr1 = element("tr");
- td2 = element("td");
- td2.textContent = "Type";
- t9 = space();
- td3 = element("td");
- t10 = text(t10_value);
- t11 = text(":");
- t12 = text(t12_value);
- t13 = space();
- tr2 = element("tr");
- td4 = element("td");
- td4.textContent = "Last Updated";
- t15 = space();
- td5 = element("td");
- t16 = text(t16_value);
- t17 = space();
- if (if_block0) if_block0.c();
- t18 = space();
- tr3 = element("tr");
- td6 = element("td");
- td6.textContent = "Search Rank";
- t20 = space();
- td7 = element("td");
- t21 = text(t21_value);
- t22 = space();
- tr4 = element("tr");
- td8 = element("td");
- td8.textContent = "Address Rank";
- t24 = space();
- td9 = element("td");
- t25 = text(t25_value);
- t26 = text(" (");
- t27 = text(t27_value);
- t28 = text(")");
- t29 = space();
- if (if_block1) if_block1.c();
- t30 = space();
- tr5 = element("tr");
- td10 = element("td");
- td10.textContent = "Coverage";
- t32 = space();
- td11 = element("td");
- t33 = text(t33_value);
- t34 = space();
- tr6 = element("tr");
- td12 = element("td");
- td12.textContent = "Centre Point (lat,lon)";
- t36 = space();
- td13 = element("td");
- t37 = text(t37_value);
- t38 = text(",");
- t39 = text(t39_value);
- t40 = space();
- tr7 = element("tr");
- td14 = element("td");
- td14.textContent = "OSM";
- t42 = space();
- td15 = element("td");
- t43 = space();
- tr8 = element("tr");
- td16 = element("td");
- t44 = text("Place Id\n (");
- a1 = element("a");
- a1.textContent = "on this server";
- t46 = text(")");
- t47 = space();
- td17 = element("td");
- t48 = text(t48_value);
- t49 = space();
- if (if_block2) if_block2.c();
- t50 = space();
- tr9 = element("tr");
- td18 = element("td");
- td18.textContent = "Computed Postcode";
- t52 = space();
- td19 = element("td");
- t53 = text(t53_value);
- t54 = space();
- tr10 = element("tr");
- td20 = element("td");
- td20.textContent = "Address Tags";
- t56 = space();
- td21 = element("td");
-
- for (let i = 0; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].c();
- }
-
- t57 = space();
- tr11 = element("tr");
- td22 = element("td");
- td22.textContent = "Extra Tags";
- t59 = space();
- td23 = element("td");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t60 = space();
- div5 = element("div");
- div4 = element("div");
- create_component(map.$$.fragment);
- t61 = space();
- div8 = element("div");
- div7 = element("div");
- h20 = element("h2");
- h20.textContent = "Address";
- t63 = space();
- table1 = element("table");
- thead = element("thead");
- tr12 = element("tr");
- th0 = element("th");
- th0.textContent = "Local name";
- t65 = space();
- th1 = element("th");
- th1.textContent = "Type";
- t67 = space();
- th2 = element("th");
- th2.textContent = "OSM";
- t69 = space();
- th3 = element("th");
- th3.textContent = "Address rank";
- t71 = space();
- th4 = element("th");
- th4.textContent = "Admin level";
- t73 = space();
- th5 = element("th");
- th5.textContent = "Distance";
- t75 = space();
- th6 = element("th");
- t76 = space();
- tbody1 = element("tbody");
- if (if_block3) if_block3.c();
- t77 = space();
- if (if_block4) if_block4.c();
- t78 = space();
- tr13 = element("tr");
- td24 = element("td");
- h21 = element("h2");
- h21.textContent = "Keywords";
- t80 = space();
- if_block5.c();
- t81 = space();
- tr14 = element("tr");
- td25 = element("td");
- h22 = element("h2");
- h22.textContent = "Parent Of";
- t83 = space();
- if_block6.c();
- attr_dev(a0, "href", a0_href_value = detailsURL_1(/*aPlace*/ ctx[0]));
- attr_dev(a0, "class", "svelte-j6zgmy");
- add_location(a0, file$c, 58, 17, 1869);
- add_location(small, file$c, 58, 10, 1862);
- attr_dev(h1, "class", "svelte-j6zgmy");
- add_location(h1, file$c, 56, 8, 1818);
- attr_dev(div0, "class", "col-sm-10");
- add_location(div0, file$c, 55, 6, 1786);
- attr_dev(div1, "class", "col-sm-2 text-right");
- add_location(div1, file$c, 61, 6, 1963);
- attr_dev(div2, "class", "row");
- add_location(div2, file$c, 54, 4, 1762);
- attr_dev(td0, "class", "svelte-j6zgmy");
- add_location(td0, file$c, 70, 14, 2222);
- attr_dev(td1, "class", "svelte-j6zgmy");
- add_location(td1, file$c, 71, 14, 2250);
- attr_dev(tr0, "class", "svelte-j6zgmy");
- add_location(tr0, file$c, 69, 12, 2203);
- attr_dev(td2, "class", "svelte-j6zgmy");
- add_location(td2, file$c, 80, 14, 2544);
- attr_dev(td3, "class", "svelte-j6zgmy");
- add_location(td3, file$c, 81, 14, 2572);
- attr_dev(tr1, "class", "svelte-j6zgmy");
- add_location(tr1, file$c, 79, 12, 2525);
- attr_dev(td4, "class", "svelte-j6zgmy");
- add_location(td4, file$c, 84, 14, 2662);
- attr_dev(td5, "class", "svelte-j6zgmy");
- add_location(td5, file$c, 85, 14, 2698);
- attr_dev(tr2, "class", "svelte-j6zgmy");
- add_location(tr2, file$c, 83, 12, 2643);
- attr_dev(td6, "class", "svelte-j6zgmy");
- add_location(td6, file$c, 94, 14, 2955);
- attr_dev(td7, "class", "svelte-j6zgmy");
- add_location(td7, file$c, 95, 14, 2990);
- attr_dev(tr3, "class", "svelte-j6zgmy");
- add_location(tr3, file$c, 93, 12, 2936);
- attr_dev(td8, "class", "svelte-j6zgmy");
- add_location(td8, file$c, 98, 14, 3069);
- attr_dev(td9, "class", "svelte-j6zgmy");
- add_location(td9, file$c, 99, 14, 3105);
- attr_dev(tr4, "class", "svelte-j6zgmy");
- add_location(tr4, file$c, 97, 12, 3050);
- attr_dev(td10, "class", "svelte-j6zgmy");
- add_location(td10, file$c, 111, 14, 3520);
- attr_dev(td11, "class", "svelte-j6zgmy");
- add_location(td11, file$c, 112, 14, 3552);
- attr_dev(tr5, "class", "svelte-j6zgmy");
- add_location(tr5, file$c, 110, 12, 3501);
- attr_dev(td12, "class", "svelte-j6zgmy");
- add_location(td12, file$c, 115, 14, 3633);
- attr_dev(td13, "class", "svelte-j6zgmy");
- add_location(td13, file$c, 116, 14, 3679);
- attr_dev(tr6, "class", "svelte-j6zgmy");
- add_location(tr6, file$c, 114, 12, 3614);
- attr_dev(td14, "class", "svelte-j6zgmy");
- add_location(td14, file$c, 121, 14, 3835);
- attr_dev(td15, "class", "svelte-j6zgmy");
- add_location(td15, file$c, 122, 14, 3862);
- attr_dev(tr7, "class", "svelte-j6zgmy");
- add_location(tr7, file$c, 120, 12, 3816);
- attr_dev(a1, "href", "https://nominatim.org/release-docs/develop/api/Output/#place_id-is-not-a-persistent-id");
- add_location(a1, file$c, 127, 17, 3986);
- attr_dev(td16, "class", "svelte-j6zgmy");
- add_location(td16, file$c, 125, 14, 3939);
- attr_dev(td17, "class", "svelte-j6zgmy");
- add_location(td17, file$c, 129, 14, 4137);
- attr_dev(tr8, "class", "svelte-j6zgmy");
- add_location(tr8, file$c, 124, 12, 3920);
- attr_dev(td18, "class", "svelte-j6zgmy");
- add_location(td18, file$c, 138, 14, 4417);
- attr_dev(td19, "class", "svelte-j6zgmy");
- add_location(td19, file$c, 139, 14, 4458);
- attr_dev(tr9, "class", "svelte-j6zgmy");
- add_location(tr9, file$c, 137, 12, 4398);
- attr_dev(td20, "class", "svelte-j6zgmy");
- add_location(td20, file$c, 142, 14, 4545);
- attr_dev(td21, "class", "svelte-j6zgmy");
- add_location(td21, file$c, 143, 14, 4581);
- attr_dev(tr10, "class", "svelte-j6zgmy");
- add_location(tr10, file$c, 141, 12, 4526);
- attr_dev(td22, "class", "svelte-j6zgmy");
- add_location(td22, file$c, 152, 14, 4887);
- attr_dev(td23, "class", "svelte-j6zgmy");
- add_location(td23, file$c, 153, 14, 4921);
- attr_dev(tr11, "class", "svelte-j6zgmy");
- add_location(tr11, file$c, 151, 12, 4868);
- attr_dev(tbody0, "class", "svelte-j6zgmy");
- add_location(tbody0, file$c, 68, 10, 2183);
- attr_dev(table0, "id", "locationdetails");
- attr_dev(table0, "class", "table table-striped svelte-j6zgmy");
- add_location(table0, file$c, 67, 8, 2116);
- attr_dev(div3, "class", "col-md-6");
- add_location(div3, file$c, 66, 6, 2085);
- attr_dev(div4, "id", "map-wrapper");
- attr_dev(div4, "class", "svelte-j6zgmy");
- add_location(div4, file$c, 165, 8, 5278);
- attr_dev(div5, "class", "col-md-6");
- add_location(div5, file$c, 164, 6, 5247);
- attr_dev(div6, "class", "row");
- add_location(div6, file$c, 65, 4, 2061);
- attr_dev(h20, "class", "svelte-j6zgmy");
- add_location(h20, file$c, 172, 8, 5417);
- attr_dev(th0, "class", "svelte-j6zgmy");
- add_location(th0, file$c, 176, 14, 5553);
- attr_dev(th1, "class", "svelte-j6zgmy");
- add_location(th1, file$c, 177, 14, 5587);
- attr_dev(th2, "class", "svelte-j6zgmy");
- add_location(th2, file$c, 178, 14, 5615);
- attr_dev(th3, "class", "svelte-j6zgmy");
- add_location(th3, file$c, 179, 14, 5642);
- attr_dev(th4, "class", "svelte-j6zgmy");
- add_location(th4, file$c, 180, 14, 5678);
- attr_dev(th5, "class", "svelte-j6zgmy");
- add_location(th5, file$c, 181, 14, 5713);
- attr_dev(th6, "class", "svelte-j6zgmy");
- add_location(th6, file$c, 182, 14, 5745);
- attr_dev(tr12, "class", "svelte-j6zgmy");
- add_location(tr12, file$c, 175, 12, 5534);
- attr_dev(thead, "class", "svelte-j6zgmy");
- add_location(thead, file$c, 174, 10, 5514);
- attr_dev(h21, "class", "svelte-j6zgmy");
- add_location(h21, file$c, 199, 52, 6380);
- attr_dev(td24, "colspan", "6");
- attr_dev(td24, "class", "svelte-j6zgmy");
- add_location(td24, file$c, 199, 36, 6364);
- attr_dev(tr13, "class", "all-columns svelte-j6zgmy");
- add_location(tr13, file$c, 199, 12, 6340);
- attr_dev(h22, "class", "svelte-j6zgmy");
- add_location(h22, file$c, 229, 52, 7511);
- attr_dev(td25, "colspan", "6");
- attr_dev(td25, "class", "svelte-j6zgmy");
- add_location(td25, file$c, 229, 36, 7495);
- attr_dev(tr14, "class", "all-columns svelte-j6zgmy");
- add_location(tr14, file$c, 229, 12, 7471);
- attr_dev(tbody1, "class", "svelte-j6zgmy");
- add_location(tbody1, file$c, 185, 10, 5802);
- attr_dev(table1, "id", "address");
- attr_dev(table1, "class", "table table-striped table-small svelte-j6zgmy");
- add_location(table1, file$c, 173, 9, 5443);
- attr_dev(div7, "class", "col-md-12");
- add_location(div7, file$c, 171, 6, 5385);
- attr_dev(div8, "class", "row");
- add_location(div8, file$c, 170, 4, 5361);
- attr_dev(div9, "class", "container");
- add_location(div9, file$c, 53, 2, 1734);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div9, anchor);
- append_dev(div9, div2);
- append_dev(div2, div0);
- append_dev(div0, h1);
- append_dev(h1, t0);
- append_dev(h1, t1);
- append_dev(h1, small);
- append_dev(small, a0);
- append_dev(a0, t2);
- append_dev(div2, t3);
- append_dev(div2, div1);
- mount_component(mapicon, div1, null);
- append_dev(div9, t4);
- append_dev(div9, div6);
- append_dev(div6, div3);
- append_dev(div3, table0);
- append_dev(table0, tbody0);
- append_dev(tbody0, tr0);
- append_dev(tr0, td0);
- append_dev(tr0, t6);
- append_dev(tr0, td1);
-
- for (let i = 0; i < each_blocks_2.length; i += 1) {
- each_blocks_2[i].m(td1, null);
- }
-
- append_dev(tbody0, t7);
- append_dev(tbody0, tr1);
- append_dev(tr1, td2);
- append_dev(tr1, t9);
- append_dev(tr1, td3);
- append_dev(td3, t10);
- append_dev(td3, t11);
- append_dev(td3, t12);
- append_dev(tbody0, t13);
- append_dev(tbody0, tr2);
- append_dev(tr2, td4);
- append_dev(tr2, t15);
- append_dev(tr2, td5);
- append_dev(td5, t16);
- append_dev(tbody0, t17);
- if (if_block0) if_block0.m(tbody0, null);
- append_dev(tbody0, t18);
- append_dev(tbody0, tr3);
- append_dev(tr3, td6);
- append_dev(tr3, t20);
- append_dev(tr3, td7);
- append_dev(td7, t21);
- append_dev(tbody0, t22);
- append_dev(tbody0, tr4);
- append_dev(tr4, td8);
- append_dev(tr4, t24);
- append_dev(tr4, td9);
- append_dev(td9, t25);
- append_dev(td9, t26);
- append_dev(td9, t27);
- append_dev(td9, t28);
- append_dev(tbody0, t29);
- if (if_block1) if_block1.m(tbody0, null);
- append_dev(tbody0, t30);
- append_dev(tbody0, tr5);
- append_dev(tr5, td10);
- append_dev(tr5, t32);
- append_dev(tr5, td11);
- append_dev(td11, t33);
- append_dev(tbody0, t34);
- append_dev(tbody0, tr6);
- append_dev(tr6, td12);
- append_dev(tr6, t36);
- append_dev(tr6, td13);
- append_dev(td13, t37);
- append_dev(td13, t38);
- append_dev(td13, t39);
- append_dev(tbody0, t40);
- append_dev(tbody0, tr7);
- append_dev(tr7, td14);
- append_dev(tr7, t42);
- append_dev(tr7, td15);
- td15.innerHTML = raw_value;
- append_dev(tbody0, t43);
- append_dev(tbody0, tr8);
- append_dev(tr8, td16);
- append_dev(td16, t44);
- append_dev(td16, a1);
- append_dev(td16, t46);
- append_dev(tr8, t47);
- append_dev(tr8, td17);
- append_dev(td17, t48);
- append_dev(tbody0, t49);
- if (if_block2) if_block2.m(tbody0, null);
- append_dev(tbody0, t50);
- append_dev(tbody0, tr9);
- append_dev(tr9, td18);
- append_dev(tr9, t52);
- append_dev(tr9, td19);
- append_dev(td19, t53);
- append_dev(tbody0, t54);
- append_dev(tbody0, tr10);
- append_dev(tr10, td20);
- append_dev(tr10, t56);
- append_dev(tr10, td21);
-
- for (let i = 0; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].m(td21, null);
- }
-
- append_dev(tbody0, t57);
- append_dev(tbody0, tr11);
- append_dev(tr11, td22);
- append_dev(tr11, t59);
- append_dev(tr11, td23);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(td23, null);
- }
-
- append_dev(div6, t60);
- append_dev(div6, div5);
- append_dev(div5, div4);
- mount_component(map, div4, null);
- append_dev(div9, t61);
- append_dev(div9, div8);
- append_dev(div8, div7);
- append_dev(div7, h20);
- append_dev(div7, t63);
- append_dev(div7, table1);
- append_dev(table1, thead);
- append_dev(thead, tr12);
- append_dev(tr12, th0);
- append_dev(tr12, t65);
- append_dev(tr12, th1);
- append_dev(tr12, t67);
- append_dev(tr12, th2);
- append_dev(tr12, t69);
- append_dev(tr12, th3);
- append_dev(tr12, t71);
- append_dev(tr12, th4);
- append_dev(tr12, t73);
- append_dev(tr12, th5);
- append_dev(tr12, t75);
- append_dev(tr12, th6);
- append_dev(table1, t76);
- append_dev(table1, tbody1);
- if (if_block3) if_block3.m(tbody1, null);
- append_dev(tbody1, t77);
- if (if_block4) if_block4.m(tbody1, null);
- append_dev(tbody1, t78);
- append_dev(tbody1, tr13);
- append_dev(tr13, td24);
- append_dev(td24, h21);
- append_dev(tbody1, t80);
- if_block5.m(tbody1, null);
- append_dev(tbody1, t81);
- append_dev(tbody1, tr14);
- append_dev(tr14, td25);
- append_dev(td25, h22);
- append_dev(tbody1, t83);
- if_blocks[current_block_type_index].m(tbody1, null);
- current = true;
- },
- p: function update(ctx, dirty) {
- if ((!current || dirty & /*aPlace*/ 1) && t0_value !== (t0_value = /*aPlace*/ ctx[0].localname + "")) set_data_dev(t0, t0_value);
-
- if (!current || dirty & /*aPlace*/ 1 && a0_href_value !== (a0_href_value = detailsURL_1(/*aPlace*/ ctx[0]))) {
- attr_dev(a0, "href", a0_href_value);
- }
-
- const mapicon_changes = {};
- if (dirty & /*aPlace*/ 1) mapicon_changes.aPlace = /*aPlace*/ ctx[0];
- mapicon.$set(mapicon_changes);
-
- if (dirty & /*Object, aPlace*/ 1) {
- each_value_8 = Object.keys(/*aPlace*/ ctx[0].names);
- validate_each_argument(each_value_8);
- let i;
-
- for (i = 0; i < each_value_8.length; i += 1) {
- const child_ctx = get_each_context_8(ctx, each_value_8, i);
-
- if (each_blocks_2[i]) {
- each_blocks_2[i].p(child_ctx, dirty);
- } else {
- each_blocks_2[i] = create_each_block_8(child_ctx);
- each_blocks_2[i].c();
- each_blocks_2[i].m(td1, null);
- }
- }
-
- for (; i < each_blocks_2.length; i += 1) {
- each_blocks_2[i].d(1);
- }
-
- each_blocks_2.length = each_value_8.length;
- }
-
- if ((!current || dirty & /*aPlace*/ 1) && t10_value !== (t10_value = /*aPlace*/ ctx[0].category + "")) set_data_dev(t10, t10_value);
- if ((!current || dirty & /*aPlace*/ 1) && t12_value !== (t12_value = /*aPlace*/ ctx[0].type + "")) set_data_dev(t12, t12_value);
- if ((!current || dirty & /*aPlace*/ 1) && t16_value !== (t16_value = /*aPlace*/ ctx[0].indexed_date + "")) set_data_dev(t16, t16_value);
- if (dirty & /*aPlace*/ 1) show_if = isAdminBoundary_1(/*aPlace*/ ctx[0]);
-
- if (show_if) {
- if (if_block0) {
- if_block0.p(ctx, dirty);
- } else {
- if_block0 = create_if_block_11(ctx);
- if_block0.c();
- if_block0.m(tbody0, t18);
- }
- } else if (if_block0) {
- if_block0.d(1);
- if_block0 = null;
- }
-
- if ((!current || dirty & /*aPlace*/ 1) && t21_value !== (t21_value = /*aPlace*/ ctx[0].rank_search + "")) set_data_dev(t21, t21_value);
- if ((!current || dirty & /*aPlace*/ 1) && t25_value !== (t25_value = /*aPlace*/ ctx[0].rank_address + "")) set_data_dev(t25, t25_value);
- if ((!current || dirty & /*aPlace*/ 1) && t27_value !== (t27_value = formatAddressRank_1(/*aPlace*/ ctx[0].rank_address) + "")) set_data_dev(t27, t27_value);
-
- if (/*aPlace*/ ctx[0].calculated_importance) {
- if (if_block1) {
- if_block1.p(ctx, dirty);
- } else {
- if_block1 = create_if_block_9(ctx);
- if_block1.c();
- if_block1.m(tbody0, t30);
- }
- } else if (if_block1) {
- if_block1.d(1);
- if_block1 = null;
- }
-
- if ((!current || dirty & /*aPlace*/ 1) && t33_value !== (t33_value = coverageType_1(/*aPlace*/ ctx[0]) + "")) set_data_dev(t33, t33_value);
- if ((!current || dirty & /*aPlace*/ 1) && t37_value !== (t37_value = /*aPlace*/ ctx[0].centroid.coordinates[1] + "")) set_data_dev(t37, t37_value);
- if ((!current || dirty & /*aPlace*/ 1) && t39_value !== (t39_value = /*aPlace*/ ctx[0].centroid.coordinates[0] + "")) set_data_dev(t39, t39_value);
- if ((!current || dirty & /*aPlace*/ 1) && raw_value !== (raw_value = osmLink_1(/*aPlace*/ ctx[0]) + "")) td15.innerHTML = raw_value; if ((!current || dirty & /*aPlace*/ 1) && t48_value !== (t48_value = /*aPlace*/ ctx[0].place_id + "")) set_data_dev(t48, t48_value);
-
- if (/*aPlace*/ ctx[0].calculated_wikipedia) {
- if (if_block2) {
- if_block2.p(ctx, dirty);
- } else {
- if_block2 = create_if_block_8(ctx);
- if_block2.c();
- if_block2.m(tbody0, t50);
- }
- } else if (if_block2) {
- if_block2.d(1);
- if_block2 = null;
- }
-
- if ((!current || dirty & /*aPlace*/ 1) && t53_value !== (t53_value = /*aPlace*/ ctx[0].calculated_postcode + "")) set_data_dev(t53, t53_value);
-
- if (dirty & /*Object, aPlace*/ 1) {
- each_value_7 = Object.keys(/*aPlace*/ ctx[0].addresstags);
- validate_each_argument(each_value_7);
- let i;
-
- for (i = 0; i < each_value_7.length; i += 1) {
- const child_ctx = get_each_context_7(ctx, each_value_7, i);
-
- if (each_blocks_1[i]) {
- each_blocks_1[i].p(child_ctx, dirty);
- } else {
- each_blocks_1[i] = create_each_block_7(child_ctx);
- each_blocks_1[i].c();
- each_blocks_1[i].m(td21, null);
- }
- }
-
- for (; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].d(1);
- }
-
- each_blocks_1.length = each_value_7.length;
- }
-
- if (dirty & /*Object, aPlace*/ 1) {
- each_value_6 = Object.keys(/*aPlace*/ ctx[0].extratags);
- validate_each_argument(each_value_6);
- let i;
-
- for (i = 0; i < each_value_6.length; i += 1) {
- const child_ctx = get_each_context_6(ctx, each_value_6, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block_6(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(td23, null);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value_6.length;
- }
-
- if (/*aPlace*/ ctx[0].address) {
- if (if_block3) {
- if_block3.p(ctx, dirty);
-
- if (dirty & /*aPlace*/ 1) {
- transition_in(if_block3, 1);
- }
- } else {
- if_block3 = create_if_block_7(ctx);
- if_block3.c();
- transition_in(if_block3, 1);
- if_block3.m(tbody1, t77);
- }
- } else if (if_block3) {
- group_outros();
-
- transition_out(if_block3, 1, 1, () => {
- if_block3 = null;
- });
-
- check_outros();
- }
-
- if (/*aPlace*/ ctx[0].linked_places) {
- if (if_block4) {
- if_block4.p(ctx, dirty);
-
- if (dirty & /*aPlace*/ 1) {
- transition_in(if_block4, 1);
- }
- } else {
- if_block4 = create_if_block_6(ctx);
- if_block4.c();
- transition_in(if_block4, 1);
- if_block4.m(tbody1, t78);
- }
- } else if (if_block4) {
- group_outros();
-
- transition_out(if_block4, 1, 1, () => {
- if_block4 = null;
- });
-
- check_outros();
- }
-
- if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block5) {
- if_block5.p(ctx, dirty);
- } else {
- if_block5.d(1);
- if_block5 = current_block_type(ctx);
-
- if (if_block5) {
- if_block5.c();
- if_block5.m(tbody1, t81);
- }
- }
-
- let previous_block_index = current_block_type_index;
- current_block_type_index = select_block_type_2(ctx);
-
- if (current_block_type_index === previous_block_index) {
- if_blocks[current_block_type_index].p(ctx, dirty);
- } else {
- group_outros();
-
- transition_out(if_blocks[previous_block_index], 1, 1, () => {
- if_blocks[previous_block_index] = null;
- });
-
- check_outros();
- if_block6 = if_blocks[current_block_type_index];
-
- if (!if_block6) {
- if_block6 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
- if_block6.c();
- } else {
- if_block6.p(ctx, dirty);
- }
-
- transition_in(if_block6, 1);
- if_block6.m(tbody1, null);
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(mapicon.$$.fragment, local);
- transition_in(map.$$.fragment, local);
- transition_in(if_block3);
- transition_in(if_block4);
- transition_in(if_block6);
- current = true;
- },
- o: function outro(local) {
- transition_out(mapicon.$$.fragment, local);
- transition_out(map.$$.fragment, local);
- transition_out(if_block3);
- transition_out(if_block4);
- transition_out(if_block6);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div9);
- destroy_component(mapicon);
- destroy_each(each_blocks_2, detaching);
- if (if_block0) if_block0.d();
- if (if_block1) if_block1.d();
- if (if_block2) if_block2.d();
- destroy_each(each_blocks_1, detaching);
- destroy_each(each_blocks, detaching);
- destroy_component(map);
- if (if_block3) if_block3.d();
- if (if_block4) if_block4.d();
- if_block5.d();
- if_blocks[current_block_type_index].d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$5.name,
- type: "if",
- source: "(53:0) {#if aPlace}",
- ctx
- });
-
- return block;
- }
-
- // (73:16) {#each Object.keys(aPlace.names) as name}
- function create_each_block_8(ctx) {
- let div;
- let span;
- let t0_value = /*aPlace*/ ctx[0].names[/*name*/ ctx[19]] + "";
- let t0;
- let t1;
- let t2_value = /*name*/ ctx[19] + "";
- let t2;
- let t3;
-
- const block = {
- c: function create() {
- div = element("div");
- span = element("span");
- t0 = text(t0_value);
- t1 = text(" (");
- t2 = text(t2_value);
- t3 = text(")\n ");
- attr_dev(span, "class", "name svelte-j6zgmy");
- add_location(span, file$c, 74, 20, 2370);
- attr_dev(div, "class", "line");
- add_location(div, file$c, 73, 18, 2331);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, span);
- append_dev(span, t0);
- append_dev(div, t1);
- append_dev(div, t2);
- append_dev(div, t3);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t0_value !== (t0_value = /*aPlace*/ ctx[0].names[/*name*/ ctx[19]] + "")) set_data_dev(t0, t0_value);
- if (dirty & /*aPlace*/ 1 && t2_value !== (t2_value = /*name*/ ctx[19] + "")) set_data_dev(t2, t2_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_8.name,
- type: "each",
- source: "(73:16) {#each Object.keys(aPlace.names) as name}",
- ctx
- });
-
- return block;
- }
-
- // (88:12) {#if (isAdminBoundary(aPlace)) }
- function create_if_block_11(ctx) {
- let tr;
- let td0;
- let t1;
- let td1;
- let t2_value = /*aPlace*/ ctx[0].admin_level + "";
- let t2;
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- td0.textContent = "Admin Level";
- t1 = space();
- td1 = element("td");
- t2 = text(t2_value);
- attr_dev(td0, "class", "svelte-j6zgmy");
- add_location(td0, file$c, 89, 14, 2823);
- attr_dev(td1, "class", "svelte-j6zgmy");
- add_location(td1, file$c, 90, 14, 2858);
- attr_dev(tr, "class", "svelte-j6zgmy");
- add_location(tr, file$c, 88, 12, 2804);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(tr, t1);
- append_dev(tr, td1);
- append_dev(td1, t2);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t2_value !== (t2_value = /*aPlace*/ ctx[0].admin_level + "")) set_data_dev(t2, t2_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_11.name,
- type: "if",
- source: "(88:12) {#if (isAdminBoundary(aPlace)) }",
- ctx
- });
-
- return block;
- }
-
- // (102:12) {#if aPlace.calculated_importance}
- function create_if_block_9(ctx) {
- let tr;
- let td0;
- let t1;
- let td1;
- let t2_value = /*aPlace*/ ctx[0].calculated_importance + "";
- let t2;
- let t3;
- let if_block = !/*aPlace*/ ctx[0].importance && create_if_block_10(ctx);
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- td0.textContent = "Importance";
- t1 = space();
- td1 = element("td");
- t2 = text(t2_value);
- t3 = space();
- if (if_block) if_block.c();
- attr_dev(td0, "class", "svelte-j6zgmy");
- add_location(td0, file$c, 103, 16, 3279);
- attr_dev(td1, "class", "svelte-j6zgmy");
- add_location(td1, file$c, 104, 16, 3315);
- attr_dev(tr, "class", "svelte-j6zgmy");
- add_location(tr, file$c, 102, 14, 3258);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(tr, t1);
- append_dev(tr, td1);
- append_dev(td1, t2);
- append_dev(td1, t3);
- if (if_block) if_block.m(td1, null);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t2_value !== (t2_value = /*aPlace*/ ctx[0].calculated_importance + "")) set_data_dev(t2, t2_value);
-
- if (!/*aPlace*/ ctx[0].importance) {
- if (if_block) ; else {
- if_block = create_if_block_10(ctx);
- if_block.c();
- if_block.m(td1, null);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- if (if_block) if_block.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_9.name,
- type: "if",
- source: "(102:12) {#if aPlace.calculated_importance}",
- ctx
- });
-
- return block;
- }
-
- // (107:18) {#if !aPlace.importance}
- function create_if_block_10(ctx) {
- let t;
-
- const block = {
- c: function create() {
- t = text("(estimated)");
- },
- m: function mount(target, anchor) {
- insert_dev(target, t, anchor);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(t);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_10.name,
- type: "if",
- source: "(107:18) {#if !aPlace.importance}",
- ctx
- });
-
- return block;
- }
-
- // (132:12) {#if aPlace.calculated_wikipedia}
- function create_if_block_8(ctx) {
- let tr;
- let td0;
- let t1;
- let td1;
- let raw_value = wikipediaLink_1(/*aPlace*/ ctx[0]) + "";
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- td0.textContent = "Wikipedia Calculated";
- t1 = space();
- td1 = element("td");
- attr_dev(td0, "class", "svelte-j6zgmy");
- add_location(td0, file$c, 133, 16, 4263);
- attr_dev(td1, "class", "svelte-j6zgmy");
- add_location(td1, file$c, 134, 16, 4309);
- attr_dev(tr, "class", "svelte-j6zgmy");
- add_location(tr, file$c, 132, 14, 4242);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(tr, t1);
- append_dev(tr, td1);
- td1.innerHTML = raw_value;
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && raw_value !== (raw_value = wikipediaLink_1(/*aPlace*/ ctx[0]) + "")) td1.innerHTML = raw_value; },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_8.name,
- type: "if",
- source: "(132:12) {#if aPlace.calculated_wikipedia}",
- ctx
- });
-
- return block;
- }
-
- // (145:16) {#each Object.keys(aPlace.addresstags) as name}
- function create_each_block_7(ctx) {
- let div;
- let span;
- let t0_value = /*aPlace*/ ctx[0].addresstags[/*name*/ ctx[19]] + "";
- let t0;
- let t1;
- let t2_value = /*name*/ ctx[19] + "";
- let t2;
- let t3;
-
- const block = {
- c: function create() {
- div = element("div");
- span = element("span");
- t0 = text(t0_value);
- t1 = text(" (");
- t2 = text(t2_value);
- t3 = text(")\n ");
- attr_dev(span, "class", "name svelte-j6zgmy");
- add_location(span, file$c, 146, 20, 4707);
- attr_dev(div, "class", "line");
- add_location(div, file$c, 145, 18, 4668);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, span);
- append_dev(span, t0);
- append_dev(div, t1);
- append_dev(div, t2);
- append_dev(div, t3);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t0_value !== (t0_value = /*aPlace*/ ctx[0].addresstags[/*name*/ ctx[19]] + "")) set_data_dev(t0, t0_value);
- if (dirty & /*aPlace*/ 1 && t2_value !== (t2_value = /*name*/ ctx[19] + "")) set_data_dev(t2, t2_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_7.name,
- type: "each",
- source: "(145:16) {#each Object.keys(aPlace.addresstags) as name}",
- ctx
- });
-
- return block;
- }
-
- // (155:16) {#each Object.keys(aPlace.extratags) as name}
- function create_each_block_6(ctx) {
- let div;
- let span;
- let t0_value = /*aPlace*/ ctx[0].extratags[/*name*/ ctx[19]] + "";
- let t0;
- let t1;
- let t2_value = /*name*/ ctx[19] + "";
- let t2;
- let t3;
-
- const block = {
- c: function create() {
- div = element("div");
- span = element("span");
- t0 = text(t0_value);
- t1 = text(" (");
- t2 = text(t2_value);
- t3 = text(")\n ");
- attr_dev(span, "class", "name svelte-j6zgmy");
- add_location(span, file$c, 156, 20, 5045);
- attr_dev(div, "class", "line");
- add_location(div, file$c, 155, 18, 5006);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, span);
- append_dev(span, t0);
- append_dev(div, t1);
- append_dev(div, t2);
- append_dev(div, t3);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t0_value !== (t0_value = /*aPlace*/ ctx[0].extratags[/*name*/ ctx[19]] + "")) set_data_dev(t0, t0_value);
- if (dirty & /*aPlace*/ 1 && t2_value !== (t2_value = /*name*/ ctx[19] + "")) set_data_dev(t2, t2_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_6.name,
- type: "each",
- source: "(155:16) {#each Object.keys(aPlace.extratags) as name}",
- ctx
- });
-
- return block;
- }
-
- // (187:12) {#if aPlace.address}
- function create_if_block_7(ctx) {
- let each_1_anchor;
- let current;
- let each_value_5 = /*aPlace*/ ctx[0].address;
- validate_each_argument(each_value_5);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_5.length; i += 1) {
- each_blocks[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- const block = {
- c: function create() {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- each_1_anchor = empty();
- },
- m: function mount(target, anchor) {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, each_1_anchor, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1) {
- each_value_5 = /*aPlace*/ ctx[0].address;
- validate_each_argument(each_value_5);
- let i;
-
- for (i = 0; i < each_value_5.length; i += 1) {
- const child_ctx = get_each_context_5(ctx, each_value_5, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block_5(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
- }
- }
-
- group_outros();
-
- for (i = each_value_5.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value_5.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(each_1_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_7.name,
- type: "if",
- source: "(187:12) {#if aPlace.address}",
- ctx
- });
-
- return block;
- }
-
- // (188:14) {#each aPlace.address as addressLine}
- function create_each_block_5(ctx) {
- let detailsonerow;
- let current;
-
- detailsonerow = new DetailsOneRow({
- props: {
- addressLine: /*addressLine*/ ctx[14],
- bDistanceInMeters: "false"
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(detailsonerow.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(detailsonerow, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const detailsonerow_changes = {};
- if (dirty & /*aPlace*/ 1) detailsonerow_changes.addressLine = /*addressLine*/ ctx[14];
- detailsonerow.$set(detailsonerow_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(detailsonerow.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(detailsonerow.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(detailsonerow, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_5.name,
- type: "each",
- source: "(188:14) {#each aPlace.address as addressLine}",
- ctx
- });
-
- return block;
- }
-
- // (193:12) {#if aPlace.linked_places}
- function create_if_block_6(ctx) {
- let tr;
- let td;
- let h2;
- let t1;
- let each_1_anchor;
- let current;
- let each_value_4 = /*aPlace*/ ctx[0].linked_places;
- validate_each_argument(each_value_4);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_4.length; i += 1) {
- each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- const block = {
- c: function create() {
- tr = element("tr");
- td = element("td");
- h2 = element("h2");
- h2.textContent = "Linked Places";
- t1 = space();
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- each_1_anchor = empty();
- attr_dev(h2, "class", "svelte-j6zgmy");
- add_location(h2, file$c, 193, 54, 6113);
- attr_dev(td, "colspan", "6");
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 193, 38, 6097);
- attr_dev(tr, "class", "all-columns svelte-j6zgmy");
- add_location(tr, file$c, 193, 14, 6073);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td);
- append_dev(td, h2);
- insert_dev(target, t1, anchor);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, each_1_anchor, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1) {
- each_value_4 = /*aPlace*/ ctx[0].linked_places;
- validate_each_argument(each_value_4);
- let i;
-
- for (i = 0; i < each_value_4.length; i += 1) {
- const child_ctx = get_each_context_4(ctx, each_value_4, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block_4(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
- }
- }
-
- group_outros();
-
- for (i = each_value_4.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value_4.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- if (detaching) detach_dev(t1);
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(each_1_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_6.name,
- type: "if",
- source: "(193:12) {#if aPlace.linked_places}",
- ctx
- });
-
- return block;
- }
-
- // (195:14) {#each aPlace.linked_places as addressLine}
- function create_each_block_4(ctx) {
- let detailsonerow;
- let current;
-
- detailsonerow = new DetailsOneRow({
- props: {
- addressLine: /*addressLine*/ ctx[14],
- bDistanceInMeters: "true"
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(detailsonerow.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(detailsonerow, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const detailsonerow_changes = {};
- if (dirty & /*aPlace*/ 1) detailsonerow_changes.addressLine = /*addressLine*/ ctx[14];
- detailsonerow.$set(detailsonerow_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(detailsonerow.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(detailsonerow.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(detailsonerow, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_4.name,
- type: "each",
- source: "(195:14) {#each aPlace.linked_places as addressLine}",
- ctx
- });
-
- return block;
- }
-
- // (221:12) {:else}
- function create_else_block_1$1(ctx) {
- let tr;
- let td;
- let a;
- let t;
-
- const block = {
- c: function create() {
- tr = element("tr");
- td = element("td");
- a = element("a");
- t = text("display keywords");
- attr_dev(a, "class", "btn btn-outline-secondary btn-sm");
- attr_dev(a, "href", "" + (/*base_url*/ ctx[1] + "&keywords=1"));
- add_location(a, file$c, 223, 19, 7284);
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 222, 16, 7260);
- attr_dev(tr, "class", "svelte-j6zgmy");
- add_location(tr, file$c, 221, 14, 7239);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td);
- append_dev(td, a);
- append_dev(a, t);
- },
- p: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block_1$1.name,
- type: "else",
- source: "(221:12) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (201:12) {#if aPlace.keywords}
- function create_if_block_3$1(ctx) {
- let tr0;
- let td0;
- let h30;
- let t1;
- let t2;
- let tr1;
- let td1;
- let h31;
- let t4;
- let each1_anchor;
- let each_value_3 = /*aPlace*/ ctx[0].keywords.name;
- validate_each_argument(each_value_3);
- let each_blocks_1 = [];
-
- for (let i = 0; i < each_value_3.length; i += 1) {
- each_blocks_1[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i));
- }
-
- let each_value_2 = /*aPlace*/ ctx[0].keywords.address;
- validate_each_argument(each_value_2);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_2.length; i += 1) {
- each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i));
- }
-
- const block = {
- c: function create() {
- tr0 = element("tr");
- td0 = element("td");
- h30 = element("h3");
- h30.textContent = "Name Keywords";
- t1 = space();
-
- for (let i = 0; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].c();
- }
-
- t2 = space();
- tr1 = element("tr");
- td1 = element("td");
- h31 = element("h3");
- h31.textContent = "Address Keywords";
- t4 = space();
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- each1_anchor = empty();
- attr_dev(h30, "class", "svelte-j6zgmy");
- add_location(h30, file$c, 201, 54, 6496);
- attr_dev(td0, "colspan", "6");
- attr_dev(td0, "class", "svelte-j6zgmy");
- add_location(td0, file$c, 201, 38, 6480);
- attr_dev(tr0, "class", "all-columns svelte-j6zgmy");
- add_location(tr0, file$c, 201, 14, 6456);
- attr_dev(h31, "class", "svelte-j6zgmy");
- add_location(h31, file$c, 211, 54, 6876);
- attr_dev(td1, "colspan", "6");
- attr_dev(td1, "class", "svelte-j6zgmy");
- add_location(td1, file$c, 211, 38, 6860);
- attr_dev(tr1, "class", "all-columns svelte-j6zgmy");
- add_location(tr1, file$c, 211, 14, 6836);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr0, anchor);
- append_dev(tr0, td0);
- append_dev(td0, h30);
- insert_dev(target, t1, anchor);
-
- for (let i = 0; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].m(target, anchor);
- }
-
- insert_dev(target, t2, anchor);
- insert_dev(target, tr1, anchor);
- append_dev(tr1, td1);
- append_dev(td1, h31);
- insert_dev(target, t4, anchor);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, each1_anchor, anchor);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace, formatKeywordToken*/ 1) {
- each_value_3 = /*aPlace*/ ctx[0].keywords.name;
- validate_each_argument(each_value_3);
- let i;
-
- for (i = 0; i < each_value_3.length; i += 1) {
- const child_ctx = get_each_context_3(ctx, each_value_3, i);
-
- if (each_blocks_1[i]) {
- each_blocks_1[i].p(child_ctx, dirty);
- } else {
- each_blocks_1[i] = create_each_block_3(child_ctx);
- each_blocks_1[i].c();
- each_blocks_1[i].m(t2.parentNode, t2);
- }
- }
-
- for (; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].d(1);
- }
-
- each_blocks_1.length = each_value_3.length;
- }
-
- if (dirty & /*aPlace, formatKeywordToken*/ 1) {
- each_value_2 = /*aPlace*/ ctx[0].keywords.address;
- validate_each_argument(each_value_2);
- let i;
-
- for (i = 0; i < each_value_2.length; i += 1) {
- const child_ctx = get_each_context_2(ctx, each_value_2, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block_2(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(each1_anchor.parentNode, each1_anchor);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value_2.length;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr0);
- if (detaching) detach_dev(t1);
- destroy_each(each_blocks_1, detaching);
- if (detaching) detach_dev(t2);
- if (detaching) detach_dev(tr1);
- if (detaching) detach_dev(t4);
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(each1_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_3$1.name,
- type: "if",
- source: "(201:12) {#if aPlace.keywords}",
- ctx
- });
-
- return block;
- }
-
- // (206:18) {#if keyword.id}
- function create_if_block_5(ctx) {
- let td;
- let t0;
- let t1_value = /*keyword*/ ctx[9].id + "";
- let t1;
-
- const block = {
- c: function create() {
- td = element("td");
- t0 = text("word id: ");
- t1 = text(t1_value);
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 206, 20, 6722);
- },
- m: function mount(target, anchor) {
- insert_dev(target, td, anchor);
- append_dev(td, t0);
- append_dev(td, t1);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t1_value !== (t1_value = /*keyword*/ ctx[9].id + "")) set_data_dev(t1, t1_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(td);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_5.name,
- type: "if",
- source: "(206:18) {#if keyword.id}",
- ctx
- });
-
- return block;
- }
-
- // (203:14) {#each aPlace.keywords.name as keyword}
- function create_each_block_3(ctx) {
- let tr;
- let td;
- let t0_value = formatKeywordToken_1(/*keyword*/ ctx[9].token) + "";
- let t0;
- let t1;
- let if_block = /*keyword*/ ctx[9].id && create_if_block_5(ctx);
-
- const block = {
- c: function create() {
- tr = element("tr");
- td = element("td");
- t0 = text(t0_value);
- t1 = space();
- if (if_block) if_block.c();
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 204, 18, 6622);
- attr_dev(tr, "class", "svelte-j6zgmy");
- add_location(tr, file$c, 203, 16, 6599);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td);
- append_dev(td, t0);
- append_dev(tr, t1);
- if (if_block) if_block.m(tr, null);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t0_value !== (t0_value = formatKeywordToken_1(/*keyword*/ ctx[9].token) + "")) set_data_dev(t0, t0_value);
-
- if (/*keyword*/ ctx[9].id) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block_5(ctx);
- if_block.c();
- if_block.m(tr, null);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- if (if_block) if_block.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_3.name,
- type: "each",
- source: "(203:14) {#each aPlace.keywords.name as keyword}",
- ctx
- });
-
- return block;
- }
-
- // (216:18) {#if keyword.id}
- function create_if_block_4(ctx) {
- let td;
- let t0;
- let t1_value = /*keyword*/ ctx[9].id + "";
- let t1;
-
- const block = {
- c: function create() {
- td = element("td");
- t0 = text("word id: ");
- t1 = text(t1_value);
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 216, 20, 7108);
- },
- m: function mount(target, anchor) {
- insert_dev(target, td, anchor);
- append_dev(td, t0);
- append_dev(td, t1);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t1_value !== (t1_value = /*keyword*/ ctx[9].id + "")) set_data_dev(t1, t1_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(td);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_4.name,
- type: "if",
- source: "(216:18) {#if keyword.id}",
- ctx
- });
-
- return block;
- }
-
- // (213:14) {#each aPlace.keywords.address as keyword}
- function create_each_block_2(ctx) {
- let tr;
- let td;
- let t0_value = formatKeywordToken_1(/*keyword*/ ctx[9].token) + "";
- let t0;
- let t1;
- let t2;
- let if_block = /*keyword*/ ctx[9].id && create_if_block_4(ctx);
-
- const block = {
- c: function create() {
- tr = element("tr");
- td = element("td");
- t0 = text(t0_value);
- t1 = space();
- if (if_block) if_block.c();
- t2 = space();
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 214, 18, 7008);
- attr_dev(tr, "class", "svelte-j6zgmy");
- add_location(tr, file$c, 213, 16, 6985);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td);
- append_dev(td, t0);
- append_dev(tr, t1);
- if (if_block) if_block.m(tr, null);
- append_dev(tr, t2);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace*/ 1 && t0_value !== (t0_value = formatKeywordToken_1(/*keyword*/ ctx[9].token) + "")) set_data_dev(t0, t0_value);
-
- if (/*keyword*/ ctx[9].id) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block_4(ctx);
- if_block.c();
- if_block.m(tr, t2);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- if (if_block) if_block.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_2.name,
- type: "each",
- source: "(213:14) {#each aPlace.keywords.address as keyword}",
- ctx
- });
-
- return block;
- }
-
- // (243:12) {:else}
- function create_else_block$3(ctx) {
- let tr;
- let td;
- let a;
- let t;
-
- const block = {
- c: function create() {
- tr = element("tr");
- td = element("td");
- a = element("a");
- t = text("display child places");
- attr_dev(a, "class", "btn btn-outline-secondary btn-sm");
- attr_dev(a, "href", "" + (/*base_url*/ ctx[1] + "&hierarchy=1"));
- add_location(a, file$c, 245, 19, 8125);
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 244, 16, 8101);
- attr_dev(tr, "class", "svelte-j6zgmy");
- add_location(tr, file$c, 243, 14, 8080);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td);
- append_dev(td, a);
- append_dev(a, t);
- },
- p: noop,
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block$3.name,
- type: "else",
- source: "(243:12) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (231:12) {#if aPlace.hierarchy}
- function create_if_block_1$2(ctx) {
- let t;
- let show_if = Object.keys(/*aPlace*/ ctx[0].hierarchy) > 500;
- let if_block_anchor;
- let current;
- let each_value = Object.keys(/*aPlace*/ ctx[0].hierarchy);
- validate_each_argument(each_value);
- let each_blocks = [];
-
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- let if_block = show_if && create_if_block_2$1(ctx);
-
- const block = {
- c: function create() {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t = space();
- if (if_block) if_block.c();
- if_block_anchor = empty();
- },
- m: function mount(target, anchor) {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, t, anchor);
- if (if_block) if_block.m(target, anchor);
- insert_dev(target, if_block_anchor, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPlace, Object*/ 1) {
- each_value = Object.keys(/*aPlace*/ ctx[0].hierarchy);
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$2(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block$2(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(t.parentNode, t);
- }
- }
-
- group_outros();
-
- for (i = each_value.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
-
- if (dirty & /*aPlace*/ 1) show_if = Object.keys(/*aPlace*/ ctx[0].hierarchy) > 500;
-
- if (show_if) {
- if (if_block) ; else {
- if_block = create_if_block_2$1(ctx);
- if_block.c();
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(t);
- if (if_block) if_block.d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_1$2.name,
- type: "if",
- source: "(231:12) {#if aPlace.hierarchy}",
- ctx
- });
-
- return block;
- }
-
- // (235:16) {#each aPlace.hierarchy[type] as line}
- function create_each_block_1(ctx) {
- let detailsonerow;
- let current;
-
- detailsonerow = new DetailsOneRow({
- props: {
- addressLine: /*line*/ ctx[6],
- bDistanceInMeters: "true"
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(detailsonerow.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(detailsonerow, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const detailsonerow_changes = {};
- if (dirty & /*aPlace*/ 1) detailsonerow_changes.addressLine = /*line*/ ctx[6];
- detailsonerow.$set(detailsonerow_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(detailsonerow.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(detailsonerow.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(detailsonerow, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_1.name,
- type: "each",
- source: "(235:16) {#each aPlace.hierarchy[type] as line}",
- ctx
- });
-
- return block;
- }
-
- // (233:14) {#each Object.keys(aPlace.hierarchy) as type}
- function create_each_block$2(ctx) {
- let tr;
- let td;
- let h3;
- let t0_value = /*type*/ ctx[3] + "";
- let t0;
- let t1;
- let each_1_anchor;
- let current;
- let each_value_1 = /*aPlace*/ ctx[0].hierarchy[/*type*/ ctx[3]];
- validate_each_argument(each_value_1);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_1.length; i += 1) {
- each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- const block = {
- c: function create() {
- tr = element("tr");
- td = element("td");
- h3 = element("h3");
- t0 = text(t0_value);
- t1 = space();
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- each_1_anchor = empty();
- attr_dev(h3, "class", "svelte-j6zgmy");
- add_location(h3, file$c, 233, 56, 7692);
- attr_dev(td, "colspan", "6");
- attr_dev(td, "class", "svelte-j6zgmy");
- add_location(td, file$c, 233, 40, 7676);
- attr_dev(tr, "class", "all-columns svelte-j6zgmy");
- add_location(tr, file$c, 233, 16, 7652);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td);
- append_dev(td, h3);
- append_dev(h3, t0);
- insert_dev(target, t1, anchor);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, each_1_anchor, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- if ((!current || dirty & /*aPlace*/ 1) && t0_value !== (t0_value = /*type*/ ctx[3] + "")) set_data_dev(t0, t0_value);
-
- if (dirty & /*aPlace, Object*/ 1) {
- each_value_1 = /*aPlace*/ ctx[0].hierarchy[/*type*/ ctx[3]];
- validate_each_argument(each_value_1);
- let i;
-
- for (i = 0; i < each_value_1.length; i += 1) {
- const child_ctx = get_each_context_1(ctx, each_value_1, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block_1(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
- }
- }
-
- group_outros();
-
- for (i = each_value_1.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value_1.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- if (detaching) detach_dev(t1);
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(each_1_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$2.name,
- type: "each",
- source: "(233:14) {#each Object.keys(aPlace.hierarchy) as type}",
- ctx
- });
-
- return block;
- }
-
- // (240:14) {#if Object.keys(aPlace.hierarchy) > 500}
- function create_if_block_2$1(ctx) {
- let p;
-
- const block = {
- c: function create() {
- p = element("p");
- p.textContent = "There are more child objects which are not shown.";
- add_location(p, file$c, 240, 16, 7969);
- },
- m: function mount(target, anchor) {
- insert_dev(target, p, anchor);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(p);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_2$1.name,
- type: "if",
- source: "(240:14) {#if Object.keys(aPlace.hierarchy) > 500}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$c(ctx) {
- let current_block_type_index;
- let if_block;
- let if_block_anchor;
- let current;
- const if_block_creators = [create_if_block$5, create_if_block_12, create_else_block_2];
- const if_blocks = [];
-
- function select_block_type(ctx, dirty) {
- if (/*aPlace*/ ctx[0]) return 0;
- if (location.search === "") return 1;
- return 2;
- }
-
- current_block_type_index = select_block_type(ctx);
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
-
- const block = {
- c: function create() {
- if_block.c();
- if_block_anchor = empty();
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- if_blocks[current_block_type_index].m(target, anchor);
- insert_dev(target, if_block_anchor, anchor);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- let previous_block_index = current_block_type_index;
- current_block_type_index = select_block_type(ctx);
-
- if (current_block_type_index === previous_block_index) {
- if_blocks[current_block_type_index].p(ctx, dirty);
- } else {
- group_outros();
-
- transition_out(if_blocks[previous_block_index], 1, 1, () => {
- if_blocks[previous_block_index] = null;
- });
-
- check_outros();
- if_block = if_blocks[current_block_type_index];
-
- if (!if_block) {
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
- if_block.c();
- } else {
- if_block.p(ctx, dirty);
- }
-
- transition_in(if_block, 1);
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(if_block);
- current = true;
- },
- o: function outro(local) {
- transition_out(if_block);
- current = false;
- },
- d: function destroy(detaching) {
- if_blocks[current_block_type_index].d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$c.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$c($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("DetailsPage", slots, []);
- let aPlace;
- let base_url = window.location.search;
-
- function loaddata() {
- var search_params = new URLSearchParams(window.location.search);
-
- var api_request_params = {
- place_id: search_params.get("place_id"),
- osmtype: search_params.get("osmtype"),
- osmid: search_params.get("osmid"),
- class: search_params.get("class"),
- keywords: search_params.get("keywords"),
- addressdetails: 1,
- hierarchy: search_params.get("hierarchy") === "1" ? 1 : 0,
- group_hierarchy: 1,
- polygon_geojson: 1,
- format: "json"
- };
-
- if (api_request_params.place_id || api_request_params.osmtype && api_request_params.osmid) {
- if (api_request_params.place_id) {
- update_html_title("Details for " + api_request_params.place_id);
- } else {
- update_html_title("Details for " + api_request_params.osmtype + api_request_params.osmid);
- }
-
- fetch_from_api("details", api_request_params, function (data) {
- $$invalidate(0, aPlace = data);
- current_result_store.set(data);
- });
- } else {
- $$invalidate(0, aPlace = undefined);
- }
- }
-
- onMount(loaddata);
- const writable_props = [];
-
- Object_1.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<DetailsPage> was created with unknown prop '${key}'`);
- });
-
- $$self.$capture_state = () => ({
- onMount,
- fetch_from_api,
- update_html_title,
- current_result_store,
- osmLink: osmLink_1,
- detailsURL: detailsURL_1,
- wikipediaLink: wikipediaLink_1,
- coverageType: coverageType_1,
- isAdminBoundary: isAdminBoundary_1,
- formatAddressRank: formatAddressRank_1,
- formatKeywordToken: formatKeywordToken_1,
- MapIcon,
- DetailsIndex,
- DetailsOneRow,
- Map: Map$1,
- aPlace,
- base_url,
- loaddata
- });
-
- $$self.$inject_state = $$props => {
- if ("aPlace" in $$props) $$invalidate(0, aPlace = $$props.aPlace);
- if ("base_url" in $$props) $$invalidate(1, base_url = $$props.base_url);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [aPlace, base_url];
- }
-
- class DetailsPage extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$c, create_fragment$c, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "DetailsPage",
- options,
- id: create_fragment$c.name
- });
- }
- }
-
- /* src/pages/PolygonsPage.svelte generated by Svelte v3.31.2 */
- const file$d = "src/pages/PolygonsPage.svelte";
-
- function get_each_context$3(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[2] = list[i];
- return child_ctx;
- }
-
- // (40:10) {#each aPolygons as polygon}
- function create_each_block$3(ctx) {
- let tr;
- let td0;
- let t0_value = /*polygon*/ ctx[2].osm_type + "";
- let t0;
- let t1;
- let td1;
- let raw_value = osmLink_1(/*polygon*/ ctx[2]) + "";
- let t2;
- let td2;
- let t3_value = /*polygon*/ ctx[2].class + "";
- let t3;
- let t4;
- let td3;
- let t5_value = /*polygon*/ ctx[2].type + "";
- let t5;
- let t6;
- let td4;
- let t7_value = /*polygon*/ ctx[2].name + "";
- let t7;
- let t8;
- let td5;
- let t9_value = (/*polygon*/ ctx[2].country_code || "") + "";
- let t9;
- let t10;
- let td6;
- let t11_value = /*polygon*/ ctx[2].errormessage + "";
- let t11;
- let t12;
- let td7;
- let t13_value = /*polygon*/ ctx[2].updated + "";
- let t13;
- let t14;
- let td8;
- let a;
- let t15;
- let a_href_value;
- let t16;
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- t0 = text(t0_value);
- t1 = space();
- td1 = element("td");
- t2 = space();
- td2 = element("td");
- t3 = text(t3_value);
- t4 = space();
- td3 = element("td");
- t5 = text(t5_value);
- t6 = space();
- td4 = element("td");
- t7 = text(t7_value);
- t8 = space();
- td5 = element("td");
- t9 = text(t9_value);
- t10 = space();
- td6 = element("td");
- t11 = text(t11_value);
- t12 = space();
- td7 = element("td");
- t13 = text(t13_value);
- t14 = space();
- td8 = element("td");
- a = element("a");
- t15 = text("josm");
- t16 = space();
- add_location(td0, file$d, 41, 14, 1005);
- add_location(td1, file$d, 42, 14, 1047);
- add_location(td2, file$d, 43, 14, 1095);
- add_location(td3, file$d, 44, 14, 1134);
- add_location(td4, file$d, 45, 14, 1172);
- add_location(td5, file$d, 46, 14, 1210);
- add_location(td6, file$d, 47, 14, 1262);
- add_location(td7, file$d, 48, 14, 1308);
- attr_dev(a, "href", a_href_value = "http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/" + formatOSMType_1(/*polygon*/ ctx[2].osm_type) + "/" + /*polygon*/ ctx[2].osm_id + "/full");
- attr_dev(a, "target", "josm");
- add_location(a, file$d, 50, 16, 1370);
- add_location(td8, file$d, 49, 14, 1349);
- add_location(tr, file$d, 40, 12, 986);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(td0, t0);
- append_dev(tr, t1);
- append_dev(tr, td1);
- td1.innerHTML = raw_value;
- append_dev(tr, t2);
- append_dev(tr, td2);
- append_dev(td2, t3);
- append_dev(tr, t4);
- append_dev(tr, td3);
- append_dev(td3, t5);
- append_dev(tr, t6);
- append_dev(tr, td4);
- append_dev(td4, t7);
- append_dev(tr, t8);
- append_dev(tr, td5);
- append_dev(td5, t9);
- append_dev(tr, t10);
- append_dev(tr, td6);
- append_dev(td6, t11);
- append_dev(tr, t12);
- append_dev(tr, td7);
- append_dev(td7, t13);
- append_dev(tr, t14);
- append_dev(tr, td8);
- append_dev(td8, a);
- append_dev(a, t15);
- append_dev(tr, t16);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPolygons*/ 1 && t0_value !== (t0_value = /*polygon*/ ctx[2].osm_type + "")) set_data_dev(t0, t0_value);
- if (dirty & /*aPolygons*/ 1 && raw_value !== (raw_value = osmLink_1(/*polygon*/ ctx[2]) + "")) td1.innerHTML = raw_value; if (dirty & /*aPolygons*/ 1 && t3_value !== (t3_value = /*polygon*/ ctx[2].class + "")) set_data_dev(t3, t3_value);
- if (dirty & /*aPolygons*/ 1 && t5_value !== (t5_value = /*polygon*/ ctx[2].type + "")) set_data_dev(t5, t5_value);
- if (dirty & /*aPolygons*/ 1 && t7_value !== (t7_value = /*polygon*/ ctx[2].name + "")) set_data_dev(t7, t7_value);
- if (dirty & /*aPolygons*/ 1 && t9_value !== (t9_value = (/*polygon*/ ctx[2].country_code || "") + "")) set_data_dev(t9, t9_value);
- if (dirty & /*aPolygons*/ 1 && t11_value !== (t11_value = /*polygon*/ ctx[2].errormessage + "")) set_data_dev(t11, t11_value);
- if (dirty & /*aPolygons*/ 1 && t13_value !== (t13_value = /*polygon*/ ctx[2].updated + "")) set_data_dev(t13, t13_value);
-
- if (dirty & /*aPolygons*/ 1 && a_href_value !== (a_href_value = "http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/" + formatOSMType_1(/*polygon*/ ctx[2].osm_type) + "/" + /*polygon*/ ctx[2].osm_id + "/full")) {
- attr_dev(a, "href", a_href_value);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$3.name,
- type: "each",
- source: "(40:10) {#each aPolygons as polygon}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$d(ctx) {
- let div2;
- let div1;
- let div0;
- let h1;
- let t1;
- let p;
- let t2;
- let t3_value = /*aPolygons*/ ctx[0].length + "";
- let t3;
- let t4;
- let t5;
- let table;
- let thead;
- let th0;
- let t7;
- let th1;
- let t9;
- let th2;
- let t11;
- let th3;
- let t13;
- let th4;
- let t15;
- let th5;
- let t17;
- let th6;
- let t19;
- let th7;
- let t21;
- let th8;
- let t22;
- let tbody;
- let each_value = /*aPolygons*/ ctx[0];
- validate_each_argument(each_value);
- let each_blocks = [];
-
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
- }
-
- const block = {
- c: function create() {
- div2 = element("div");
- div1 = element("div");
- div0 = element("div");
- h1 = element("h1");
- h1.textContent = "Broken polygons";
- t1 = space();
- p = element("p");
- t2 = text("Total number of broken polygons: ");
- t3 = text(t3_value);
- t4 = text(".");
- t5 = space();
- table = element("table");
- thead = element("thead");
- th0 = element("th");
- th0.textContent = "OSM type";
- t7 = space();
- th1 = element("th");
- th1.textContent = "OSM id";
- t9 = space();
- th2 = element("th");
- th2.textContent = "Class";
- t11 = space();
- th3 = element("th");
- th3.textContent = "Type";
- t13 = space();
- th4 = element("th");
- th4.textContent = "Name";
- t15 = space();
- th5 = element("th");
- th5.textContent = "Country Code";
- t17 = space();
- th6 = element("th");
- th6.textContent = "Error message";
- t19 = space();
- th7 = element("th");
- th7.textContent = "Updated";
- t21 = space();
- th8 = element("th");
- t22 = space();
- tbody = element("tbody");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- add_location(h1, file$d, 20, 6, 484);
- add_location(p, file$d, 22, 6, 516);
- add_location(th0, file$d, 28, 10, 673);
- add_location(th1, file$d, 29, 10, 701);
- add_location(th2, file$d, 30, 10, 727);
- add_location(th3, file$d, 31, 10, 752);
- add_location(th4, file$d, 32, 10, 776);
- add_location(th5, file$d, 33, 10, 800);
- add_location(th6, file$d, 34, 10, 832);
- add_location(th7, file$d, 35, 10, 865);
- add_location(th8, file$d, 36, 10, 892);
- add_location(thead, file$d, 27, 8, 655);
- add_location(tbody, file$d, 38, 8, 927);
- attr_dev(table, "class", "table table-striped table-hover");
- add_location(table, file$d, 26, 6, 599);
- attr_dev(div0, "class", "col-sm-12");
- add_location(div0, file$d, 19, 4, 454);
- attr_dev(div1, "class", "row");
- add_location(div1, file$d, 18, 2, 432);
- attr_dev(div2, "class", "container");
- add_location(div2, file$d, 17, 0, 406);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, div2, anchor);
- append_dev(div2, div1);
- append_dev(div1, div0);
- append_dev(div0, h1);
- append_dev(div0, t1);
- append_dev(div0, p);
- append_dev(p, t2);
- append_dev(p, t3);
- append_dev(p, t4);
- append_dev(div0, t5);
- append_dev(div0, table);
- append_dev(table, thead);
- append_dev(thead, th0);
- append_dev(thead, t7);
- append_dev(thead, th1);
- append_dev(thead, t9);
- append_dev(thead, th2);
- append_dev(thead, t11);
- append_dev(thead, th3);
- append_dev(thead, t13);
- append_dev(thead, th4);
- append_dev(thead, t15);
- append_dev(thead, th5);
- append_dev(thead, t17);
- append_dev(thead, th6);
- append_dev(thead, t19);
- append_dev(thead, th7);
- append_dev(thead, t21);
- append_dev(thead, th8);
- append_dev(table, t22);
- append_dev(table, tbody);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(tbody, null);
- }
- },
- p: function update(ctx, [dirty]) {
- if (dirty & /*aPolygons*/ 1 && t3_value !== (t3_value = /*aPolygons*/ ctx[0].length + "")) set_data_dev(t3, t3_value);
-
- if (dirty & /*formatOSMType, aPolygons, osmLink*/ 1) {
- each_value = /*aPolygons*/ ctx[0];
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$3(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block$3(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(tbody, null);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value.length;
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- destroy_each(each_blocks, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$d.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$d($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("PolygonsPage", slots, []);
- let aPolygons = [];
-
- function loaddata() {
- fetch_from_api("polygons", { format: "json" }, function (data) {
- $$invalidate(0, aPolygons = data);
- });
-
- update_html_title("Broken polygons");
- }
-
- onMount(loaddata);
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<PolygonsPage> was created with unknown prop '${key}'`);
- });
-
- $$self.$capture_state = () => ({
- onMount,
- fetch_from_api,
- update_html_title,
- formatOSMType: formatOSMType_1,
- osmLink: osmLink_1,
- aPolygons,
- loaddata
- });
-
- $$self.$inject_state = $$props => {
- if ("aPolygons" in $$props) $$invalidate(0, aPolygons = $$props.aPolygons);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [aPolygons];
- }
-
- class PolygonsPage extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$d, create_fragment$d, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "PolygonsPage",
- options,
- id: create_fragment$d.name
- });
- }
- }
-
- /* src/pages/DeletablePage.svelte generated by Svelte v3.31.2 */
- const file$e = "src/pages/DeletablePage.svelte";
-
- function get_each_context$4(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[2] = list[i];
- return child_ctx;
- }
-
- // (37:10) {#each aPolygons as polygon}
- function create_each_block$4(ctx) {
- let tr;
- let td0;
- let a;
- let t0_value = /*polygon*/ ctx[2].place_id + "";
- let t0;
- let a_href_value;
- let t1;
- let td1;
- let t2_value = /*polygon*/ ctx[2].country_code + "";
- let t2;
- let t3;
- let td2;
- let t4_value = /*polygon*/ ctx[2].name + "";
- let t4;
- let t5;
- let td3;
- let raw_value = osmLink_1(/*polygon*/ ctx[2]) + "";
- let t6;
- let td4;
- let t7_value = /*polygon*/ ctx[2].osm_type + "";
- let t7;
- let t8;
- let td5;
- let t9_value = /*polygon*/ ctx[2].class + "";
- let t9;
- let t10;
- let td6;
- let t11_value = /*polygon*/ ctx[2].type + "";
- let t11;
- let t12;
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- a = element("a");
- t0 = text(t0_value);
- t1 = space();
- td1 = element("td");
- t2 = text(t2_value);
- t3 = space();
- td2 = element("td");
- t4 = text(t4_value);
- t5 = space();
- td3 = element("td");
- t6 = space();
- td4 = element("td");
- t7 = text(t7_value);
- t8 = space();
- td5 = element("td");
- t9 = text(t9_value);
- t10 = space();
- td6 = element("td");
- t11 = text(t11_value);
- t12 = space();
- attr_dev(a, "href", a_href_value = detailsURL_1(/*polygon*/ ctx[2]));
- add_location(a, file$e, 38, 16, 988);
- add_location(td0, file$e, 38, 12, 984);
- add_location(td1, file$e, 39, 12, 1060);
- add_location(td2, file$e, 40, 12, 1104);
- add_location(td3, file$e, 41, 12, 1140);
- add_location(td4, file$e, 42, 12, 1186);
- add_location(td5, file$e, 43, 12, 1226);
- add_location(td6, file$e, 44, 12, 1263);
- add_location(tr, file$e, 37, 10, 967);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(td0, a);
- append_dev(a, t0);
- append_dev(tr, t1);
- append_dev(tr, td1);
- append_dev(td1, t2);
- append_dev(tr, t3);
- append_dev(tr, td2);
- append_dev(td2, t4);
- append_dev(tr, t5);
- append_dev(tr, td3);
- td3.innerHTML = raw_value;
- append_dev(tr, t6);
- append_dev(tr, td4);
- append_dev(td4, t7);
- append_dev(tr, t8);
- append_dev(tr, td5);
- append_dev(td5, t9);
- append_dev(tr, t10);
- append_dev(tr, td6);
- append_dev(td6, t11);
- append_dev(tr, t12);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*aPolygons*/ 1 && t0_value !== (t0_value = /*polygon*/ ctx[2].place_id + "")) set_data_dev(t0, t0_value);
-
- if (dirty & /*aPolygons*/ 1 && a_href_value !== (a_href_value = detailsURL_1(/*polygon*/ ctx[2]))) {
- attr_dev(a, "href", a_href_value);
- }
-
- if (dirty & /*aPolygons*/ 1 && t2_value !== (t2_value = /*polygon*/ ctx[2].country_code + "")) set_data_dev(t2, t2_value);
- if (dirty & /*aPolygons*/ 1 && t4_value !== (t4_value = /*polygon*/ ctx[2].name + "")) set_data_dev(t4, t4_value);
- if (dirty & /*aPolygons*/ 1 && raw_value !== (raw_value = osmLink_1(/*polygon*/ ctx[2]) + "")) td3.innerHTML = raw_value; if (dirty & /*aPolygons*/ 1 && t7_value !== (t7_value = /*polygon*/ ctx[2].osm_type + "")) set_data_dev(t7, t7_value);
- if (dirty & /*aPolygons*/ 1 && t9_value !== (t9_value = /*polygon*/ ctx[2].class + "")) set_data_dev(t9, t9_value);
- if (dirty & /*aPolygons*/ 1 && t11_value !== (t11_value = /*polygon*/ ctx[2].type + "")) set_data_dev(t11, t11_value);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$4.name,
- type: "each",
- source: "(37:10) {#each aPolygons as polygon}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$e(ctx) {
- let div2;
- let div1;
- let div0;
- let h1;
- let t1;
- let p;
- let t2_value = /*aPolygons*/ ctx[0].length + "";
- let t2;
- let t3;
- let t4;
- let table;
- let thead;
- let th0;
- let t6;
- let th1;
- let t8;
- let th2;
- let t10;
- let th3;
- let t12;
- let th4;
- let t14;
- let th5;
- let t16;
- let th6;
- let t18;
- let tbody;
- let each_value = /*aPolygons*/ ctx[0];
- validate_each_argument(each_value);
- let each_blocks = [];
-
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
- }
-
- const block = {
- c: function create() {
- div2 = element("div");
- div1 = element("div");
- div0 = element("div");
- h1 = element("h1");
- h1.textContent = "Deletable";
- t1 = space();
- p = element("p");
- t2 = text(t2_value);
- t3 = text(" objects have been deleted in OSM but are still in the Nominatim database.");
- t4 = space();
- table = element("table");
- thead = element("thead");
- th0 = element("th");
- th0.textContent = "Place id";
- t6 = space();
- th1 = element("th");
- th1.textContent = "Country Code";
- t8 = space();
- th2 = element("th");
- th2.textContent = "Name";
- t10 = space();
- th3 = element("th");
- th3.textContent = "OSM id";
- t12 = space();
- th4 = element("th");
- th4.textContent = "OSM type";
- t14 = space();
- th5 = element("th");
- th5.textContent = "Class";
- t16 = space();
- th6 = element("th");
- th6.textContent = "Type";
- t18 = space();
- tbody = element("tbody");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- add_location(h1, file$e, 19, 6, 483);
- add_location(p, file$e, 21, 6, 509);
- add_location(th0, file$e, 27, 10, 708);
- add_location(th1, file$e, 28, 10, 736);
- add_location(th2, file$e, 29, 10, 768);
- add_location(th3, file$e, 30, 10, 792);
- add_location(th4, file$e, 31, 10, 818);
- add_location(th5, file$e, 32, 10, 846);
- add_location(th6, file$e, 33, 10, 871);
- add_location(thead, file$e, 26, 8, 690);
- add_location(tbody, file$e, 35, 8, 910);
- attr_dev(table, "class", "table table-striped table-hover");
- add_location(table, file$e, 25, 6, 634);
- attr_dev(div0, "class", "col-sm-12");
- add_location(div0, file$e, 18, 4, 453);
- attr_dev(div1, "class", "row");
- add_location(div1, file$e, 17, 2, 431);
- attr_dev(div2, "class", "container");
- add_location(div2, file$e, 16, 0, 405);
- },
- l: function claim(nodes) {
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
- },
- m: function mount(target, anchor) {
- insert_dev(target, div2, anchor);
- append_dev(div2, div1);
- append_dev(div1, div0);
- append_dev(div0, h1);
- append_dev(div0, t1);
- append_dev(div0, p);
- append_dev(p, t2);
- append_dev(p, t3);
- append_dev(div0, t4);
- append_dev(div0, table);
- append_dev(table, thead);
- append_dev(thead, th0);
- append_dev(thead, t6);
- append_dev(thead, th1);
- append_dev(thead, t8);
- append_dev(thead, th2);
- append_dev(thead, t10);
- append_dev(thead, th3);
- append_dev(thead, t12);
- append_dev(thead, th4);
- append_dev(thead, t14);
- append_dev(thead, th5);
- append_dev(thead, t16);
- append_dev(thead, th6);
- append_dev(table, t18);
- append_dev(table, tbody);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(tbody, null);
- }
- },
- p: function update(ctx, [dirty]) {
- if (dirty & /*aPolygons*/ 1 && t2_value !== (t2_value = /*aPolygons*/ ctx[0].length + "")) set_data_dev(t2, t2_value);
-
- if (dirty & /*aPolygons, osmLink, detailsURL*/ 1) {
- each_value = /*aPolygons*/ ctx[0];
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$4(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block$4(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(tbody, null);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value.length;
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- destroy_each(each_blocks, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$e.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$e($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("DeletablePage", slots, []);
- let aPolygons = [];
-
- function loaddata() {
- fetch_from_api("deletable", { format: "json" }, function (data) {
- $$invalidate(0, aPolygons = data);
- });
-
- update_html_title("Deletable objects");
- }
-
- onMount(loaddata);
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<DeletablePage> was created with unknown prop '${key}'`);
- });
-
- $$self.$capture_state = () => ({
- onMount,
- fetch_from_api,
- update_html_title,
- detailsURL: detailsURL_1,
- osmLink: osmLink_1,
- aPolygons,
- loaddata
- });
-
- $$self.$inject_state = $$props => {
- if ("aPolygons" in $$props) $$invalidate(0, aPolygons = $$props.aPolygons);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [aPolygons];
- }
-
- class DeletablePage extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$e, create_fragment$e, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "DeletablePage",
- options,
- id: create_fragment$e.name
- });
- }
- }
-
- let myhistory = [];
-
- new App({
- target: document.body
- });
-
-
-
-
- // inspects window.location
- function identify_current_page() {
- var pagename = window.location.pathname.replace('.html', '').replace(/^.*\//, '');
-
- if (pagename === '') { return 'search' }
-
- if (['search', 'reverse', 'details', 'deletable', 'polygons'].indexOf(pagename) != '-1') {
- return pagename;
- }
- }
-
-
-
- function parse_url_and_load_page() {
- let pagename = identify_current_page();
-
- document.getElementById('main').replaceChildren();
-
- if (pagename === 'search' || pagename === 'reverse') {
- new SearchPage({
- target: document.getElementById('main'),
- props: {
- reverse_search: (pagename === 'reverse')
- }
- });
- } else if (pagename === 'details') {
- new DetailsPage({
- target: document.getElementById('main')
- });
- } else if (pagename === 'deletable') {
- new DeletablePage({
- target: document.getElementById('main')
- });
- } else if (pagename === 'polygons') {
- new PolygonsPage({
- target: document.getElementById('main')
- });
- }
- }
-
-
-
- function is_relative_url(url) {
- if (!url) return false;
- if (url.indexOf('?') === 0) return true;
- if (url.indexOf('/') === 0) return true;
- if (url.indexOf('#') === 0) return false;
- if (url.match(/^http/)) return false;
- if (!url.match(/\.html/)) return true;
-
- return false;
- }
-
-
- parse_url_and_load_page();
-
- // load page after form submit
- document.addEventListener('submit', function (e) {
-
- // loop parent nodes from the target to the delegation node
- for (var target = e.target; target && target != this; target = target.parentNode) {
- if (target.matches('form')) {
- e.preventDefault();
-
- var target_url = serialize_form(target);
- target_url = clean_up_url_parameters(target_url);
-
- window.history.pushState(myhistory, '', '?' + target_url);
-
- parse_url_and_load_page();
- break;
- }
- }
-
- });
-
- // load page after click on relative URL
- document.addEventListener('click', function (e) {
-
- // loop parent nodes from the target to the delegation node
- for (var target = e.target; target && target != this; target = target.parentNode) {
- if (target.matches('a')) {
-
- var target_url = target.href;
-
- if (!is_relative_url(target_url)) return;
-
- e.preventDefault();
- e.stopPropagation();
-
- window.history.pushState(myhistory, '', target_url);
-
- parse_url_and_load_page();
- break;
- }
- }
- });
-
- // deal with back-button and other user action
- window.onpopstate = function () {
- parse_url_and_load_page();
- };
-
-}());
+ */var Ke=st((function(t,e){!function(t){var e="1.7.1";function n(t){var e,n,i,o;for(n=1,i=arguments.length;n<i;n++)for(e in o=arguments[n])t[e]=o[e];return t}var i=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function o(t,e){var n=Array.prototype.slice;if(t.bind)return t.bind.apply(t,n.call(arguments,1));var i=n.call(arguments,2);return function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)}}var r=0;function s(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function a(t,e,n){var i,o,r,s;return s=function(){i=!1,o&&(r.apply(n,o),o=!1)},r=function(){i?o=arguments:(t.apply(n,arguments),setTimeout(s,e),i=!0)}}function l(t,e,n){var i=e[1],o=e[0],r=i-o;return t===i&&n?t:((t-o)%r+r)%r+o}function u(){return!1}function c(t,e){var n=Math.pow(10,void 0===e?6:e);return Math.round(t*n)/n}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return h(t).split(/\s+/)}function f(t,e){for(var n in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?i(t.options):{}),e)t.options[n]=e[n];return t.options}function p(t,e,n){var i=[];for(var o in t)i.push(encodeURIComponent(n?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")}var m=/\{ *([\w_-]+) *\}/g;function g(t,e){return t.replace(m,(function(t,n){var i=e[n];if(void 0===i)throw new Error("No value provided for variable "+t);return"function"==typeof i&&(i=i(e)),i}))}var _=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}var y="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var x=0;function w(t){var e=+new Date,n=Math.max(0,16-(e-x));return x=e+n,window.setTimeout(t,n)}var T=window.requestAnimationFrame||b("RequestAnimationFrame")||w,C=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function E(t,e,n){if(!n||T!==w)return T.call(window,o(t,e));t.call(e)}function $(t){t&&C.call(window,t)}var k={extend:n,create:i,bind:o,lastId:r,stamp:s,throttle:a,wrapNum:l,falseFn:u,formatNum:c,trim:h,splitWords:d,setOptions:f,getParamString:p,template:g,isArray:_,indexOf:v,emptyImageUrl:y,requestFn:T,cancelFn:C,requestAnimFrame:E,cancelAnimFrame:$};function P(){}function S(t){if("undefined"!=typeof L&&L&&L.Mixin){t=_(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}P.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=e.__super__=this.prototype,r=i(o);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(S(t.includes),n.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=n(i(r.options),t.options)),n(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},P.include=function(t){return n(this.prototype,t),this},P.mergeOptions=function(t){return n(this.prototype.options,t),this},P.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),n="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var M={on:function(t,e,n){if("object"==typeof t)for(var i in t)this._on(i,t[i],e);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._on(t[o],e,n);return this},off:function(t,e,n){if(t)if("object"==typeof t)for(var i in t)this._off(i,t[i],e);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._off(t[o],e,n);else delete this._events;return this},_on:function(t,e,n){this._events=this._events||{};var i=this._events[t];i||(i=[],this._events[t]=i),n===this&&(n=void 0);for(var o={fn:e,ctx:n},r=i,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===n)return;r.push(o)},_off:function(t,e,n){var i,o,r;if(this._events&&(i=this._events[t]))if(e){if(n===this&&(n=void 0),i)for(o=0,r=i.length;o<r;o++){var s=i[o];if(s.ctx===n&&s.fn===e)return s.fn=u,this._firingCount&&(this._events[t]=i=i.slice()),void i.splice(o,1)}}else{for(o=0,r=i.length;o<r;o++)i[o].fn=u;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var n=this._events&&this._events[t];if(n&&n.length)return!0;if(e)for(var i in this._eventParents)if(this._eventParents[i].listens(t,e))return!0;return!1},once:function(t,e,n){if("object"==typeof t){for(var i in t)this.once(i,t[i],e);return this}var r=o((function(){this.off(t,e,n).off(t,r,n)}),this);return this.on(t,e,n).on(t,r,n)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};M.addEventListener=M.on,M.removeEventListener=M.clearAllEventListeners=M.off,M.addOneTimeEventListener=M.once,M.fireEvent=M.fire,M.hasEventListeners=M.listens;var A=P.extend(M);function N(t,e,n){this.x=n?Math.round(t):t,this.y=n?Math.round(e):e}var D=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function I(t,e,n){return t instanceof N?t:_(t)?new N(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new N(t.x,t.y):new N(t,e,n)}function O(t,e){if(t)for(var n=e?[t,e]:t,i=0,o=n.length;i<o;i++)this.extend(n[i])}function z(t,e){return!t||t instanceof O?t:new O(t,e)}function B(t,e){if(t)for(var n=e?[t,e]:t,i=0,o=n.length;i<o;i++)this.extend(n[i])}function j(t,e){return t instanceof B?t:new B(t,e)}function R(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==n&&(this.alt=+n)}function Z(t,e,n){return t instanceof R?t:_(t)&&"object"!=typeof t[0]?3===t.length?new R(t[0],t[1],t[2]):2===t.length?new R(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new R(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new R(t,e,n)}N.prototype={clone:function(){return new N(this.x,this.y)},add:function(t){return this.clone()._add(I(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(I(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new N(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new N(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=D(this.x),this.y=D(this.y),this},distanceTo:function(t){var e=(t=I(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=I(t)).x===this.x&&t.y===this.y},contains:function(t){return t=I(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},O.prototype={extend:function(t){return t=I(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new N((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new N(this.min.x,this.max.y)},getTopRight:function(){return new N(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof N?I(t):z(t))instanceof O?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=t.max,r=o.x>=e.x&&i.x<=n.x,s=o.y>=e.y&&i.y<=n.y;return r&&s},overlaps:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=t.max,r=o.x>e.x&&i.x<n.x,s=o.y>e.y&&i.y<n.y;return r&&s},isValid:function(){return!(!this.min||!this.max)}},B.prototype={extend:function(t){var e,n,i=this._southWest,o=this._northEast;if(t instanceof R)e=t,n=t;else{if(!(t instanceof B))return t?this.extend(Z(t)||j(t)):this;if(e=t._southWest,n=t._northEast,!e||!n)return this}return i||o?(i.lat=Math.min(e.lat,i.lat),i.lng=Math.min(e.lng,i.lng),o.lat=Math.max(n.lat,o.lat),o.lng=Math.max(n.lng,o.lng)):(this._southWest=new R(e.lat,e.lng),this._northEast=new R(n.lat,n.lng)),this},pad:function(t){var e=this._southWest,n=this._northEast,i=Math.abs(e.lat-n.lat)*t,o=Math.abs(e.lng-n.lng)*t;return new B(new R(e.lat-i,e.lng-o),new R(n.lat+i,n.lng+o))},getCenter:function(){return new R((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new R(this.getNorth(),this.getWest())},getSouthEast:function(){return new R(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof R||"lat"in t?Z(t):j(t);var e,n,i=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),n=t.getNorthEast()):e=n=t,e.lat>=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=j(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&i.lat<=n.lat,s=o.lng>=e.lng&&i.lng<=n.lng;return r&&s},overlaps:function(t){t=j(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&i.lat<n.lat,s=o.lng>e.lng&&i.lng<n.lng;return r&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=j(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},R.prototype={equals:function(t,e){return!!t&&(t=Z(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return F.distance(this,Z(t))},wrap:function(){return F.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return j([this.lat-e,this.lng-n],[this.lat+e,this.lng+n])},clone:function(){return new R(this.lat,this.lng,this.alt)}};var H,q={latLngToPoint:function(t,e){var n=this.projection.project(t),i=this.scale(e);return this.transformation._transform(n,i)},pointToLatLng:function(t,e){var n=this.scale(e),i=this.transformation.untransform(t,n);return this.projection.unproject(i)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,n=this.scale(t);return new O(this.transformation.transform(e.min,n),this.transformation.transform(e.max,n))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new R(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),n=this.wrapLatLng(e),i=e.lat-n.lat,o=e.lng-n.lng;if(0===i&&0===o)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new B(new R(r.lat-i,r.lng-o),new R(s.lat-i,s.lng-o))}},F=n({},q,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var n=Math.PI/180,i=t.lat*n,o=e.lat*n,r=Math.sin((e.lat-t.lat)*n/2),s=Math.sin((e.lng-t.lng)*n/2),a=r*r+Math.cos(i)*Math.cos(o)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),W=6378137,U={R:W,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,n=this.MAX_LATITUDE,i=Math.max(Math.min(n,t.lat),-n),o=Math.sin(i*e);return new N(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new R((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(H=W*Math.PI,new O([-H,-H],[H,H]))};function V(t,e,n,i){if(_(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=n,this._d=i}function G(t,e,n,i){return new V(t,e,n,i)}V.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new N((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=n({},F,{code:"EPSG:3857",projection:U,transformation:function(){var t=.5/(Math.PI*U.R);return G(t,.5,-t,.5)}()}),Y=n({},K,{code:"EPSG:900913"});function X(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Q(t,e){var n,i,o,r,s,a,l="";for(n=0,o=t.length;n<o;n++){for(i=0,r=(s=t[n]).length;i<r;i++)l+=(i?"L":"M")+(a=s[i]).x+" "+a.y;l+=e?St?"z":"x":""}return l||"M0 0"}var J=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,nt="msLaunchUri"in navigator&&!("documentMode"in document),it=At("webkit"),ot=At("android"),rt=At("android 2")||At("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&At("Google")&&st<537&&!("AudioNode"in window),lt=!!window.opera,ut=!nt&&At("chrome"),ct=At("gecko")&&!it&&!lt&&!tt,ht=!ut&&At("safari"),dt=At("phantom"),ft="OTransition"in J,pt=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in J,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,_t="MozPerspective"in J,vt=!window.L_DISABLE_3D&&(mt||gt||_t)&&!ft&&!dt,yt="undefined"!=typeof orientation||At("mobile"),bt=yt&&it,xt=yt&>,wt=!window.PointerEvent&&window.MSPointerEvent,Tt=!(!window.PointerEvent&&!wt),Ct=!window.L_NO_TOUCH&&(Tt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Et=yt&<,$t=yt&&ct,Lt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,kt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",u,e),window.removeEventListener("testPassiveEventSupport",u,e)}catch(t){}return t}(),Pt=!!document.createElement("canvas").getContext,St=!(!document.createElementNS||!X("svg").createSVGRect),Mt=!St&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function At(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Nt={ie:tt,ielt9:et,edge:nt,webkit:it,android:ot,android23:rt,androidStock:at,opera:lt,chrome:ut,gecko:ct,safari:ht,phantom:dt,opera12:ft,win:pt,ie3d:mt,webkit3d:gt,gecko3d:_t,any3d:vt,mobile:yt,mobileWebkit:bt,mobileWebkit3d:xt,msPointer:wt,pointer:Tt,touch:Ct,mobileOpera:Et,mobileGecko:$t,retina:Lt,passiveEvents:kt,canvas:Pt,svg:St,vml:Mt},Dt=wt?"MSPointerDown":"pointerdown",It=wt?"MSPointerMove":"pointermove",Ot=wt?"MSPointerUp":"pointerup",zt=wt?"MSPointerCancel":"pointercancel",Bt={},jt=!1;function Rt(t,e,n,i){return"touchstart"===e?Ht(t,n,i):"touchmove"===e?Vt(t,n,i):"touchend"===e&&Gt(t,n,i),this}function Zt(t,e,n){var i=t["_leaflet_"+e+n];return"touchstart"===e?t.removeEventListener(Dt,i,!1):"touchmove"===e?t.removeEventListener(It,i,!1):"touchend"===e&&(t.removeEventListener(Ot,i,!1),t.removeEventListener(zt,i,!1)),this}function Ht(t,e,n){var i=o((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Fe(t),Ut(t,e)}));t["_leaflet_touchstart"+n]=i,t.addEventListener(Dt,i,!1),jt||(document.addEventListener(Dt,qt,!0),document.addEventListener(It,Ft,!0),document.addEventListener(Ot,Wt,!0),document.addEventListener(zt,Wt,!0),jt=!0)}function qt(t){Bt[t.pointerId]=t}function Ft(t){Bt[t.pointerId]&&(Bt[t.pointerId]=t)}function Wt(t){delete Bt[t.pointerId]}function Ut(t,e){for(var n in t.touches=[],Bt)t.touches.push(Bt[n]);t.changedTouches=[t],e(t)}function Vt(t,e,n){var i=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Ut(t,e)};t["_leaflet_touchmove"+n]=i,t.addEventListener(It,i,!1)}function Gt(t,e,n){var i=function(t){Ut(t,e)};t["_leaflet_touchend"+n]=i,t.addEventListener(Ot,i,!1),t.addEventListener(zt,i,!1)}var Kt=wt?"MSPointerDown":Tt?"pointerdown":"touchstart",Yt=wt?"MSPointerUp":Tt?"pointerup":"touchend",Xt="_leaflet_";function Qt(t,e,n){var i,o,r=!1,s=250;function a(t){if(Tt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),n=e-(i||e);o=t.touches?t.touches[0]:t,r=n>0&&n<=s,i=e}function l(t){if(r&&!o.cancelBubble){if(Tt){if("mouse"===t.pointerType)return;var n,s,a={};for(s in o)n=o[s],a[s]=n&&n.bind?n.bind(o):n;o=a}o.type="dblclick",o.button=0,e(o),i=null}}return t[Xt+Kt+n]=a,t[Xt+Yt+n]=l,t[Xt+"dblclick"+n]=e,t.addEventListener(Kt,a,!!kt&&{passive:!1}),t.addEventListener(Yt,l,!!kt&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function Jt(t,e){var n=t[Xt+Kt+e],i=t[Xt+Yt+e],o=t[Xt+"dblclick"+e];return t.removeEventListener(Kt,n,!!kt&&{passive:!1}),t.removeEventListener(Yt,i,!!kt&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ne,ie,oe,re=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function le(t){return"string"==typeof t?document.getElementById(t):t}function ue(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function ce(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function he(t){var e=t.parentNode;e&&e.removeChild(t)}function de(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function pe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=ye(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function ge(t,e){if(void 0!==t.classList)for(var n=d(e),i=0,o=n.length;i<o;i++)t.classList.add(n[i]);else if(!me(t,e)){var r=ye(t);ve(t,(r?r+" ":"")+e)}}function _e(t,e){void 0!==t.classList?t.classList.remove(e):ve(t,h((" "+ye(t)+" ").replace(" "+e+" "," ")))}function ve(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ye(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&xe(t,e)}function xe(t,e){var n=!1,i="DXImageTransform.Microsoft.Alpha";try{n=t.filters.item(i)}catch(t){if(1===e)return}e=Math.round(100*e),n?(n.Enabled=100!==e,n.Opacity=e):t.style.filter+=" progid:"+i+"(opacity="+e+")"}function we(t){for(var e=document.documentElement.style,n=0;n<t.length;n++)if(t[n]in e)return t[n];return!1}function Te(t,e,n){var i=e||new N(0,0);t.style[re]=(mt?"translate("+i.x+"px,"+i.y+"px)":"translate3d("+i.x+"px,"+i.y+"px,0)")+(n?" scale("+n+")":"")}function Ce(t,e){t._leaflet_pos=e,vt?Te(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ee(t){return t._leaflet_pos||new N(0,0)}if("onselectstart"in document)te=function(){De(window,"selectstart",Fe)},ee=function(){Oe(window,"selectstart",Fe)};else{var $e=we(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if($e){var t=document.documentElement.style;ne=t[$e],t[$e]="none"}},ee=function(){$e&&(document.documentElement.style[$e]=ne,ne=void 0)}}function Le(){De(window,"dragstart",Fe)}function ke(){Oe(window,"dragstart",Fe)}function Pe(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Se(),ie=t,oe=t.style.outline,t.style.outline="none",De(window,"keydown",Se))}function Se(){ie&&(ie.style.outline=oe,ie=void 0,oe=void 0,Oe(window,"keydown",Se))}function Me(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Ae(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ne={TRANSFORM:re,TRANSITION:se,TRANSITION_END:ae,get:le,getStyle:ue,create:ce,remove:he,empty:de,toFront:fe,toBack:pe,hasClass:me,addClass:ge,removeClass:_e,setClass:ve,getClass:ye,setOpacity:be,testProp:we,setTransform:Te,setPosition:Ce,getPosition:Ee,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:Le,enableImageDrag:ke,preventOutline:Pe,restoreOutline:Se,getSizedParentNode:Me,getScale:Ae};function De(t,e,n,i){if("object"==typeof e)for(var o in e)je(t,o,e[o],n);else for(var r=0,s=(e=d(e)).length;r<s;r++)je(t,e[r],n,i);return this}var Ie="_leaflet_events";function Oe(t,e,n,i){if("object"==typeof e)for(var o in e)Re(t,o,e[o],n);else if(e)for(var r=0,s=(e=d(e)).length;r<s;r++)Re(t,e[r],n,i);else{for(var a in t[Ie])Re(t,a,t[Ie][a]);delete t[Ie]}return this}function ze(){if(Tt)return!(nt||ht)}var Be={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function je(t,e,n,i){var o=e+s(n)+(i?"_"+s(i):"");if(t[Ie]&&t[Ie][o])return this;var r=function(e){return n.call(i||t,e||window.event)},a=r;Tt&&0===e.indexOf("touch")?Rt(t,e,r,o):Ct&&"dblclick"===e&&!ze()?Qt(t,r,o):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Be[e]||e,r,!!kt&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(r=function(e){e=e||window.event,Qe(t,e)&&a(e)},t.addEventListener(Be[e],r,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,r),t[Ie]=t[Ie]||{},t[Ie][o]=r}function Re(t,e,n,i){var o=e+s(n)+(i?"_"+s(i):""),r=t[Ie]&&t[Ie][o];if(!r)return this;Tt&&0===e.indexOf("touch")?Zt(t,e,o):Ct&&"dblclick"===e&&!ze()?Jt(t,o):"removeEventListener"in t?t.removeEventListener(Be[e]||e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[Ie][o]=null}function Ze(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Xe(t),this}function He(t){return je(t,"wheel",Ze),this}function qe(t){return De(t,"mousedown touchstart dblclick",Ze),je(t,"click",Ye),this}function Fe(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function We(t){return Fe(t),Ze(t),this}function Ue(t,e){if(!e)return new N(t.clientX,t.clientY);var n=Ae(e),i=n.boundingClientRect;return new N((t.clientX-i.left)/n.x-e.clientLeft,(t.clientY-i.top)/n.y-e.clientTop)}var Ve=pt&&ut?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Ge(t){return nt?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ve:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Xe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Qe(t,e){var n=e.relatedTarget;if(!n)return!0;try{for(;n&&n!==t;)n=n.parentNode}catch(t){return!1}return n!==t}var Je={on:De,off:Oe,stopPropagation:Ze,disableScrollPropagation:He,disableClickPropagation:qe,preventDefault:Fe,stop:We,getMousePosition:Ue,getWheelDelta:Ge,fakeStop:Ye,skipped:Xe,isExternalTarget:Qe,addListener:De,removeListener:Oe},tn=A.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Ee(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=E(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;e<n?this._runFrame(this._easeOut(e/n),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var n=this._startPos.add(this._offset.multiplyBy(t));e&&n._round(),Ce(this._el,n),this.fire("step")},_complete:function(){$(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),en=A.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=f(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(Z(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&&vt&&!Et&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),De(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(Z(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(vt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(vt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,n){var i=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof N?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/i),s=this.containerPointToLatLng(o.add(r));return this.setView(s,e,{zoom:n})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():j(t);var n=I(e.paddingTopLeft||e.padding||[0,0]),i=I(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,n.add(i));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=i.subtract(n).divideBy(2),s=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=j(t)).isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(t,e);return this.setView(n.center,n.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=I(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new tn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ge(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,n,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,n){if(!1===(n=n||{}).animate||!vt)return this.setView(t,e,n);this._stop();var i=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),s=this._zoom;t=Z(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),u=o.distanceTo(i)||1,c=1.42,h=c*c;function d(t){var e=(l*l-a*a+(t?-1:1)*h*h*u*u)/(2*(t?l:a)*h*u),n=Math.sqrt(e*e+1)-e;return n<1e-9?-18:Math.log(n)}function f(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return f(t)/p(t)}var g=d(0);function _(t){return a*(p(g)/p(g+c*t))}function v(t){return a*(p(g)*m(g+c*t)-f(g))/h}function y(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),x=(d(1)-g)/c,w=n.duration?1e3*n.duration:1e3*x*.8;function T(){var n=(Date.now()-b)/w,r=y(n)*x;n<=1?(this._flyToFrame=E(T,this),this._move(this.unproject(i.add(o.subtract(i).multiplyBy(v(r)/u)),s),this.getScaleZoom(a/_(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),T.call(this),this},flyToBounds:function(t,e){var n=this._getBoundsCenterZoom(t,e);return this.flyTo(n.center,n.zoom,e)},setMaxBounds:function(t){return(t=j(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,j(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=I((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=I(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),r=this.project(o),s=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),u=z([a.min.add(n),a.max.subtract(i)]);if(!u.contains(s)){this._enforcingBounds=!0;var c=r.subtract(s),h=I(s.x+c.x,s.y+c.y);(s.x<u.min.x||s.x>u.max.x)&&(h.x=r.x-c.x,c.x>0?h.x+=l.x-n.x:h.x-=l.x-i.x),(s.y<u.min.y||s.y>u.max.y)&&(h.y=r.y-c.y,c.y>0?h.y+=l.y-n.y:h.y-=l.y-i.y),this.panTo(this.unproject(h),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),r=e.divideBy(2).round(),s=i.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),i=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(t){var e=new R(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var o=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(o,i.maxZoom):o)}var r={latlng:e,bounds:n,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),he(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&($(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)he(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=ce("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=j(t),n=I(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(n),u=z(this.project(a,i),this.project(s,i)).getSize(),c=vt?this.options.zoomSnap:1,h=l.x/u.x,d=l.y/u.y,f=e?Math.max(h,d):Math.min(h,d);return i=this.getScaleZoom(f,i),c&&(i=Math.round(i/(c/100))*(c/100),i=e?Math.ceil(i/c)*c:Math.floor(i/c)*c),Math.max(o,Math.min(r,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new N(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new O(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e;var i=n.zoom(t*n.scale(e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(Z(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(I(t),e)},layerPointToLatLng:function(t){var e=I(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(Z(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(Z(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(j(t))},distance:function(t,e){return this.options.crs.distance(Z(t),Z(e))},containerPointToLayerPoint:function(t){return I(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return I(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(I(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Z(t)))},mouseEventToContainerPoint:function(t){return Ue(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=le(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");De(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&vt,ge(t,"leaflet-container"+(Ct?" leaflet-touch":"")+(Lt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ht?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ue(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ce(this._mapPane,new N(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ge(t.markerPane,"leaflet-zoom-hide"),ge(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ce(this._mapPane,new N(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var i=this._zoom!==e;this._moveStart(i,!1)._move(t,e)._moveEnd(i),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n){void 0===e&&(e=this._zoom);var i=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(i||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return $(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ce(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Oe:De;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),vt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){$(this._resizeRequest),this._resizeRequest=E((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((n=this._targets[s(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(e,!0)){if(o&&!Qe(r,t))break;if(i.push(n),o)break}if(r===this._container)break;r=r.parentNode}return i.length||a||o||!Qe(r,t)||(i=[this]),i},_handleDOMEvent:function(t){if(this._loaded&&!Xe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Pe(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var r=i[0];"contextmenu"===e&&r.listens(e,!0)&&Fe(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,s,!0),s.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ee(this._mapPane)||new N(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var n=this.getSize()._divideBy(2);return this.project(t,e)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return z([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,n){if(!n)return t;var i=this.project(t,e),o=this.getSize().divideBy(2),r=new O(i.subtract(o),i.add(o)),s=this._getBoundsOffset(r,n,e);return s.round().equals([0,0])?t:this.unproject(i.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var n=this.getPixelBounds(),i=new O(n.min.add(t),n.max.add(t));return t.add(this._getBoundsOffset(i,e))},_getBoundsOffset:function(t,e,n){var i=z(this.project(e.getNorthEast(),n),this.project(e.getSouthWest(),n)),o=i.min.subtract(t.min),r=i.max.subtract(t.max);return new N(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=vt?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_e(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=ce("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,n=this._proxy.style[e];Te(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){he(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Te(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(o)||(E((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ge(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_e(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),E((function(){this._moveEnd(!0)}),this))}});function nn(t,e){return new en(t,e)}var on=P.extend({options:{position:"topright"},initialize:function(t){f(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return ge(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(he(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),rn=function(t){return new on(t)};en.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=ce("div",e+"control-container",this._container);function i(i,o){var r=e+i+" "+e+o;t[i+o]=ce("div",r,n)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)he(this._controlCorners[t]);he(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var sn=on.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n<i?-1:i<n?1:0}},initialize:function(t,e,n){for(var i in f(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[i],i);for(i in e)this._addLayer(e[i],i,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return on.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ge(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ge(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):_e(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return _e(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=ce("div",t),n=this.options.collapsed;e.setAttribute("aria-haspopup",!0),qe(e),He(e);var i=this._section=ce("section",t+"-list");n&&(this._map.on("click",this.collapse,this),ot||De(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=ce("a",t+"-toggle",e);o.href="#",o.title="Layers",Ct?(De(o,"click",We),De(o,"click",this.expand,this)):De(o,"focus",this.expand,this),n||this.expand(),this._baseLayersList=ce("div",t+"-base",i),this._separator=ce("div",t+"-separator",i),this._overlaysList=ce("div",t+"-overlays",i),e.appendChild(i)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,n){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:n}),this.options.sortLayers&&this._layers.sort(o((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;de(this._baseLayersList),de(this._overlaysList),this._layerControlInputs=[];var t,e,n,i,o=0;for(n=0;n<this._layers.length;n++)i=this._layers[n],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,o+=i.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+s(this),i),this._layerControlInputs.push(e),e.layerId=s(t.layer),De(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("div");return n.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)t=n[r],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<i.length;r++)this._map.hasLayer(i[r])||this._map.addLayer(i[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,n=this._layerControlInputs,i=this._map.getZoom(),o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&i<e.options.minZoom||void 0!==e.options.maxZoom&&i>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),an=function(t,e,n){return new sn(t,e,n)},ln=on.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=ce("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var r=ce("a",n,i);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),qe(r),De(r,"click",We),De(r,"click",o,this),De(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";_e(this._zoomInButton,e),_e(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ge(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ge(this._zoomInButton,e)}});en.mergeOptions({zoomControl:!0}),en.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ln,this.addControl(this.zoomControl))}));var un=function(t){return new ln(t)},cn=on.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=ce("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=ce("div",e,n)),t.imperial&&(this._iScale=ce("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,i,o=3.2808399*t;o>5280?(e=o/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(o),this._updateScale(this._iScale,i+" ft",i/o))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),hn=function(t){return new cn(t)},dn=on.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){f(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=ce("div","leaflet-control-attribution"),qe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(" | ")}}});en.mergeOptions({attributionControl:!0}),en.addInitHook((function(){this.options.attributionControl&&(new dn).addTo(this)}));var fn=function(t){return new dn(t)};on.Layers=sn,on.Zoom=ln,on.Scale=cn,on.Attribution=dn,rn.layers=an,rn.zoom=un,rn.scale=hn,rn.attribution=fn;var pn=P.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});pn.addTo=function(t,e){return t.addHandler(e,this),this};var mn,gn={Events:M},_n=Ct?"touchstart mousedown":"mousedown",vn={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},yn={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},bn=A.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){f(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(De(this._dragStartTarget,_n,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bn._dragging===this&&this.finishDrag(),Oe(this._dragStartTarget,_n,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(bn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bn._dragging=this,this._preventOutline&&Pe(this._element),Le(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,n=Me(this._element);this._startPoint=new N(e.clientX,e.clientY),this._parentScale=Ae(n),De(document,yn[t.type],this._onMove,this),De(document,vn[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new N(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,Fe(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ee(this._element).subtract(n),ge(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ge(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,$(this._animRequest),this._lastEvent=t,this._animRequest=E(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ce(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in _e(document.body,"leaflet-dragging"),this._lastTarget&&(_e(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yn)Oe(document,yn[t],this._onMove,this),Oe(document,vn[t],this._onUp,this);ke(),ee(),this._moved&&this._moving&&($(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,bn._dragging=!1}});function xn(t,e){if(!e||!t.length)return t.slice();var n=e*e;return t=Cn(t=$n(t,n),n)}function wn(t,e,n){return Math.sqrt(Mn(t,e,n,!0))}function Tn(t,e,n){return Mn(t,e,n)}function Cn(t,e){var n=t.length,i=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(n);i[0]=i[n-1]=1,En(t,i,e,0,n-1);var o,r=[];for(o=0;o<n;o++)i[o]&&r.push(t[o]);return r}function En(t,e,n,i,o){var r,s,a,l=0;for(s=i+1;s<=o-1;s++)(a=Mn(t[s],t[i],t[o],!0))>l&&(r=s,l=a);l>n&&(e[r]=1,En(t,e,n,i,r),En(t,e,n,r,o))}function $n(t,e){for(var n=[t[0]],i=1,o=0,r=t.length;i<r;i++)Sn(t[i],t[o])>e&&(n.push(t[i]),o=i);return o<r-1&&n.push(t[r-1]),n}function Ln(t,e,n,i,o){var r,s,a,l=i?mn:Pn(t,n),u=Pn(e,n);for(mn=u;;){if(!(l|u))return[t,e];if(l&u)return!1;a=Pn(s=kn(t,e,r=l||u,n,o),n),r===l?(t=s,l=a):(e=s,u=a)}}function kn(t,e,n,i,o){var r,s,a=e.x-t.x,l=e.y-t.y,u=i.min,c=i.max;return 8&n?(r=t.x+a*(c.y-t.y)/l,s=c.y):4&n?(r=t.x+a*(u.y-t.y)/l,s=u.y):2&n?(r=c.x,s=t.y+l*(c.x-t.x)/a):1&n&&(r=u.x,s=t.y+l*(u.x-t.x)/a),new N(r,s,o)}function Pn(t,e){var n=0;return t.x<e.min.x?n|=1:t.x>e.max.x&&(n|=2),t.y<e.min.y?n|=4:t.y>e.max.y&&(n|=8),n}function Sn(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function Mn(t,e,n,i){var o,r=e.x,s=e.y,a=n.x-r,l=n.y-s,u=a*a+l*l;return u>0&&((o=((t.x-r)*a+(t.y-s)*l)/u)>1?(r=n.x,s=n.y):o>0&&(r+=a*o,s+=l*o)),a=t.x-r,l=t.y-s,i?a*a+l*l:new N(r,s)}function An(t){return!_(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Nn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),An(t)}var Dn={simplify:xn,pointToSegmentDistance:wn,closestPointOnSegment:Tn,clipSegment:Ln,_getEdgeIntersection:kn,_getBitCode:Pn,_sqClosestPointOnSegment:Mn,isFlat:An,_flat:Nn};function In(t,e,n){var i,o,r,s,a,l,u,c,h,d=[1,4,2,8];for(o=0,u=t.length;o<u;o++)t[o]._code=Pn(t[o],e);for(s=0;s<4;s++){for(c=d[s],i=[],o=0,r=(u=t.length)-1;o<u;r=o++)a=t[o],l=t[r],a._code&c?l._code&c||((h=kn(l,a,c,e,n))._code=Pn(h,e),i.push(h)):(l._code&c&&((h=kn(l,a,c,e,n))._code=Pn(h,e),i.push(h)),i.push(a));t=i}return t}var On={clipPolygon:In},zn={project:function(t){return new N(t.lng,t.lat)},unproject:function(t){return new R(t.y,t.x)},bounds:new O([-180,-90],[180,90])},Bn={R:6378137,R_MINOR:6356752.314245179,bounds:new O([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,n=this.R,i=t.lat*e,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=r*Math.sin(i),a=Math.tan(Math.PI/4-i/2)/Math.pow((1-s)/(1+s),r/2);return i=-n*Math.log(Math.max(a,1e-10)),new N(t.lng*e*n,i)},unproject:function(t){for(var e,n=180/Math.PI,i=this.R,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=Math.exp(-t.y/i),a=Math.PI/2-2*Math.atan(s),l=0,u=.1;l<15&&Math.abs(u)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=u=Math.PI/2-2*Math.atan(s*e)-a;return new R(a*n,t.x*n/i)}},jn={LonLat:zn,Mercator:Bn,SphericalMercator:U},Rn=n({},F,{code:"EPSG:3395",projection:Bn,transformation:function(){var t=.5/(Math.PI*Bn.R);return G(t,.5,-t,.5)}()}),Zn=n({},F,{code:"EPSG:4326",projection:zn,transformation:G(1/180,1,-1/180,.5)}),Hn=n({},q,{projection:zn,transformation:G(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});q.Earth=F,q.EPSG3395=Rn,q.EPSG3857=K,q.EPSG900913=Y,q.EPSG4326=Zn,q.Simple=Hn;var qn=A.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",(function(){e.off(n,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});en.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&s(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?_(t)?t:[t]:[]).length;e<n;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,n=this._getZoomSpan();for(var i in this._zoomBoundLayers){var o=this._zoomBoundLayers[i].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Fn=qn.extend({initialize:function(t,e){var n,i;if(f(this,e),this._layers={},t)for(n=0,i=t.length;n<i;n++)this.addLayer(t[n])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,n,i=Array.prototype.slice.call(arguments,1);for(e in this._layers)(n=this._layers[e])[t]&&n[t].apply(n,i);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Wn=function(t,e){return new Fn(t,e)},Un=Fn.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Fn.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Fn.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new B;for(var e in this._layers){var n=this._layers[e];t.extend(n.getBounds?n.getBounds():n.getLatLng())}return t}}),Vn=function(t,e){return new Un(t,e)},Gn=P.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){f(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var n=this._getIconUrl(t);if(!n){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(n,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var n=this.options,i=n[e+"Size"];"number"==typeof i&&(i=[i,i]);var o=I(i),r=I("shadow"===e&&n.shadowAnchor||n.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(n.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Lt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Kn(t){return new Gn(t)}var Yn=Gn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yn.imagePath||(Yn.imagePath=this._detectIconPath()),(this.options.imagePath||Yn.imagePath)+Gn.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ce("div","leaflet-default-icon-path",document.body),e=ue(t,"background-image")||ue(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Xn=pn.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new bn(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ge(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&_e(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,n=e._map,i=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Ee(e._icon),s=n.getPixelBounds(),a=n.getPixelOrigin(),l=z(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!l.contains(r)){var u=I((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(i);n.panBy(u,{animate:!1}),this._draggable._newPos._add(u),this._draggable._startPos._add(u),Ce(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=E(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&($(this._panRequest),this._panRequest=E(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,n=e._shadow,i=Ee(e._icon),o=e._map.layerPointToLatLng(i);n&&Ce(n,i),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){$(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qn=qn.extend({options:{icon:new Yn,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){f(this,e),this._latlng=Z(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=Z(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=t.icon.createIcon(this._icon),i=!1;n!==this._icon&&(this._icon&&this._removeIcon(),i=!0,t.title&&(n.title=t.title),"IMG"===n.tagName&&(n.alt=t.alt||"")),ge(n,e),t.keyboard&&(n.tabIndex="0"),this._icon=n,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(ge(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),i&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),he(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&he(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Ce(this._icon,t),this._shadow&&Ce(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ge(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Xn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Xn(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Jn(t,e){return new Qn(t,e)}var ti=qn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return f(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),ei=ti.extend({options:{fill:!0,radius:10},initialize:function(t,e){f(this,e),this._latlng=Z(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=Z(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return ti.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,n=this._clickTolerance(),i=[t+n,e+n];this._pxBounds=new O(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ni(t,e){return new ei(t,e)}var ii=ei.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),f(this,e),this._latlng=Z(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:ti.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,n=this._map,i=n.options.crs;if(i.distance===F.distance){var o=Math.PI/180,r=this._mRadius/F.R/o,s=n.project([e+r,t]),a=n.project([e-r,t]),l=s.add(a).divideBy(2),u=n.unproject(l).lat,c=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(u*o))/(Math.cos(e*o)*Math.cos(u*o)))/o;(isNaN(c)||0===c)&&(c=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-n.project([u,t-c]).x,this._radiusY=l.y-s.y}else{var h=i.unproject(i.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(h).x}this._updateBounds()}});function oi(t,e,n){return new ii(t,e,n)}var ri=ti.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){f(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,n,i=1/0,o=null,r=Mn,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],u=1,c=l.length;u<c;u++){var h=r(t,e=l[u-1],n=l[u],!0);h<i&&(i=h,o=r(t,e,n))}return o&&(o.distance=Math.sqrt(i)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,i,o,r,s,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,i=0;t<l-1;t++)if(o=a[t],r=a[t+1],(i+=n=o.distanceTo(r))>e)return s=(i-e)/n,this._map.layerPointToLatLng([r.x-s*(r.x-o.x),r.y-s*(r.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=Z(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new B,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return An(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],n=An(t),i=0,o=t.length;i<o;i++)n?(e[i]=Z(t[i]),this._bounds.extend(e[i])):e[i]=this._convertLatLngs(t[i]);return e},_project:function(){var t=new O;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new N(t,t);this._pxBounds=new O([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,n){var i,o,r=t[0]instanceof R,s=t.length;if(r){for(o=[],i=0;i<s;i++)o[i]=this._map.latLngToLayerPoint(t[i]),n.extend(o[i]);e.push(o)}else for(i=0;i<s;i++)this._projectLatlngs(t[i],e,n)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,n,i,o,r,s,a,l=this._parts;for(e=0,i=0,o=this._rings.length;e<o;e++)for(n=0,r=(a=this._rings[e]).length;n<r-1;n++)(s=Ln(a[n],a[n+1],t,n,!0))&&(l[i]=l[i]||[],l[i].push(s[0]),s[1]===a[n+1]&&n!==r-2||(l[i].push(s[1]),i++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,n=0,i=t.length;n<i;n++)t[n]=xn(t[n],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var n,i,o,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,r=this._parts.length;n<r;n++)for(i=0,o=(s=(a=this._parts[n]).length)-1;i<s;o=i++)if((e||0!==i)&&wn(t,a[o],a[i])<=l)return!0;return!1}});function si(t,e){return new ri(t,e)}ri._flat=Nn;var ai=ri.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,i,o,r,s,a,l,u=this._rings[0],c=u.length;if(!c)return null;for(r=s=a=0,t=0,e=c-1;t<c;e=t++)n=u[t],i=u[e],o=n.y*i.x-i.y*n.x,s+=(n.x+i.x)*o,a+=(n.y+i.y)*o,r+=3*o;return l=0===r?u[0]:[s/r,a/r],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=ri.prototype._convertLatLngs.call(this,t),n=e.length;return n>=2&&e[0]instanceof R&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){ri.prototype._setLatLngs.call(this,t),An(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return An(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new N(e,e);if(t=new O(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,o=0,r=this._rings.length;o<r;o++)(i=In(this._rings[o],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,n,i,o,r,s,a,l,u=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(l=(e=this._parts[o]).length)-1;r<l;s=r++)n=e[r],i=e[s],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||ri.prototype._containsPoint.call(this,t,!0)}});function li(t,e){return new ai(t,e)}var ui=Un.extend({initialize:function(t,e){f(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=_(t)?t:t.features;if(o){for(e=0,n=o.length;e<n;e++)((i=o[e]).geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=ci(t,r);return s?(s.feature=_i(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function ci(t,e){var n,i,o,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],u=e&&e.pointToLayer,c=e&&e.coordsToLatLng||di;if(!a&&!s)return null;switch(s.type){case"Point":return hi(u,t,n=c(a),e);case"MultiPoint":for(o=0,r=a.length;o<r;o++)n=c(a[o]),l.push(hi(u,t,n,e));return new Un(l);case"LineString":case"MultiLineString":return i=fi(a,"LineString"===s.type?0:1,c),new ri(i,e);case"Polygon":case"MultiPolygon":return i=fi(a,"Polygon"===s.type?1:2,c),new ai(i,e);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var h=ci({geometry:s.geometries[o],type:"Feature",properties:t.properties},e);h&&l.push(h)}return new Un(l);default:throw new Error("Invalid GeoJSON object.")}}function hi(t,e,n,i){return t?t(e,n):new Qn(n,i&&i.markersInheritOptions&&i)}function di(t){return new R(t[1],t[0],t[2])}function fi(t,e,n){for(var i,o=[],r=0,s=t.length;r<s;r++)i=e?fi(t[r],e-1,n):(n||di)(t[r]),o.push(i);return o}function pi(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[c(t.lng,e),c(t.lat,e),c(t.alt,e)]:[c(t.lng,e),c(t.lat,e)]}function mi(t,e,n,i){for(var o=[],r=0,s=t.length;r<s;r++)o.push(e?mi(t[r],e-1,n,i):pi(t[r],i));return!e&&n&&o.push(o[0]),o}function gi(t,e){return t.feature?n({},t.feature,{geometry:e}):_i(e)}function _i(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var vi={toGeoJSON:function(t){return gi(this,{type:"Point",coordinates:pi(this.getLatLng(),t)})}};function yi(t,e){return new ui(t,e)}Qn.include(vi),ii.include(vi),ei.include(vi),ri.include({toGeoJSON:function(t){var e=!An(this._latlngs);return gi(this,{type:(e?"Multi":"")+"LineString",coordinates:mi(this._latlngs,e?1:0,!1,t)})}}),ai.include({toGeoJSON:function(t){var e=!An(this._latlngs),n=e&&!An(this._latlngs[0]),i=mi(this._latlngs,n?2:e?1:0,!0,t);return e||(i=[i]),gi(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Fn.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(n){e.push(n.toGeoJSON(t).geometry.coordinates)})),gi(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var n="GeometryCollection"===e,i=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(n)i.push(o.geometry);else{var r=_i(o);"FeatureCollection"===r.type?i.push.apply(i,r.features):i.push(r)}}})),n?gi(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});var bi=yi,xi=qn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=j(e),f(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ge(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){he(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fe(this._image),this},bringToBack:function(){return this._map&&pe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=j(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:ce("img");ge(e,"leaflet-image-layer"),this._zoomAnimated&&ge(e,"leaflet-zoom-animated"),this.options.className&&ge(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Te(this._image,n,e)},_reset:function(){var t=this._image,e=new O(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();Ce(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),wi=function(t,e,n){return new xi(t,e,n)},Ti=xi.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:ce("video");if(ge(e,"leaflet-image-layer"),this._zoomAnimated&&ge(e,"leaflet-zoom-animated"),this.options.className&&ge(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=o(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),i=[],r=0;r<n.length;r++)i.push(n[r].src);this._url=n.length>0?i:[e.src]}else{_(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var s=0;s<this._url.length;s++){var a=ce("source");a.src=this._url[s],e.appendChild(a)}}}});function Ci(t,e,n){return new Ti(t,e,n)}var Ei=xi.extend({_initImage:function(){var t=this._image=this._url;ge(t,"leaflet-image-layer"),this._zoomAnimated&&ge(t,"leaflet-zoom-animated"),this.options.className&&ge(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});function $i(t,e,n){return new Ei(t,e,n)}var Li=qn.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){f(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(o(he,void 0,this._container),200)):he(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=Z(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fe(this._container),this},bringToBack:function(){return this._map&&pe(this._container),this},_prepareOpen:function(t,e,n){if(e instanceof qn||(n=e,e=t),e instanceof Un)for(var i in t._layers){e=t._layers[i];break}if(!n)if(e.getCenter)n=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");n=e.getLatLng()}return this._source=e,this.update(),n},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=I(this.options.offset),n=this._getAnchor();this._zoomAnimated?Ce(this._container,t.add(n)):e=e.add(t).add(n);var i=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=i+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),ki=Li.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Li.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ti||this._source.on("preclick",Ze))},onRemove:function(t){Li.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ti||this._source.off("preclick",Ze))},getEvents:function(){var t=Li.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=ce("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=ce("div",t+"-content-wrapper",e);if(this._contentNode=ce("div",t+"-content",n),qe(e),He(this._contentNode),De(e,"contextmenu",Ze),this._tipContainer=ce("div",t+"-tip-container",e),this._tip=ce("div",t+"-tip",this._tipContainer),this.options.closeButton){var i=this._closeButton=ce("a",t+"-close-button",e);i.href="#close",i.innerHTML="×",De(i,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var n=t.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),e.width=n+1+"px",e.whiteSpace="",e.height="";var i=t.offsetHeight,o=this.options.maxHeight,r="leaflet-popup-scrolled";o&&i>o?(e.height=o+"px",ge(t,r)):_e(t,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();Ce(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ue(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new N(this._containerLeft,-n-this._containerBottom);o._add(Ee(this._container));var r=t.layerPointToContainerPoint(o),s=I(this.options.autoPanPadding),a=I(this.options.autoPanPaddingTopLeft||s),l=I(this.options.autoPanPaddingBottomRight||s),u=t.getSize(),c=0,h=0;r.x+i+l.x>u.x&&(c=r.x+i-u.x+l.x),r.x-c-a.x<0&&(c=r.x-a.x),r.y+n+l.y>u.y&&(h=r.y+n-u.y+l.y),r.y-h-a.y<0&&(h=r.y-a.y),(c||h)&&t.fire("autopanstart").panBy([c,h])}},_onCloseButtonClick:function(t){this._close(),We(t)},_getAnchor:function(){return I(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Pi=function(t,e){return new ki(t,e)};en.mergeOptions({closePopupOnClick:!0}),en.include({openPopup:function(t,e,n){return t instanceof ki||(t=new ki(n).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),qn.include({bindPopup:function(t,e){return t instanceof ki?(f(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new ki(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(We(t),e instanceof ti?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Si=Li.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Li.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Li.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Li.prototype.getEvents.call(this);return Ct&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ce("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,o=this._container,r=i.latLngToContainerPoint(i.getCenter()),s=i.layerPointToContainerPoint(t),a=this.options.direction,l=o.offsetWidth,u=o.offsetHeight,c=I(this.options.offset),h=this._getAnchor();"top"===a?(e=l/2,n=u):"bottom"===a?(e=l/2,n=0):"center"===a?(e=l/2,n=u/2):"right"===a?(e=0,n=u/2):"left"===a?(e=l,n=u/2):s.x<r.x?(a="right",e=0,n=u/2):(a="left",e=l+2*(c.x+h.x),n=u/2),t=t.subtract(I(e,n,!0)).add(c).add(h),_e(o,"leaflet-tooltip-right"),_e(o,"leaflet-tooltip-left"),_e(o,"leaflet-tooltip-top"),_e(o,"leaflet-tooltip-bottom"),ge(o,"leaflet-tooltip-"+a),Ce(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return I(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Mi=function(t,e){return new Si(t,e)};en.include({openTooltip:function(t,e,n){return t instanceof Si||(t=new Si(n).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),qn.include({bindTooltip:function(t,e){return t instanceof Si?(f(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Si(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),Ct&&(n.click=this._openTooltip)),this[e](n),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ge(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(_e(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,n,i=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),n=this._map.containerPointToLayerPoint(e),i=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(i)}});var Ai=Gn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),n=this.options;if(n.html instanceof Element?(de(e),e.appendChild(n.html)):e.innerHTML=!1!==n.html?n.html:"",n.bgPos){var i=I(n.bgPos);e.style.backgroundPosition=-i.x+"px "+-i.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Ni(t){return new Ai(t)}Gn.Default=Yn;var Di=qn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:yt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){f(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),he(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(pe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof N?t:new N(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,n=this.getPane().children,i=-t(-1/0,1/0),o=0,r=n.length;o<r;o++)e=n[o].style.zIndex,n[o]!==this._container&&e&&(i=t(i,+e));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,n=!1;for(var i in this._tiles){var o=this._tiles[i];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);be(o.el,r),r<1?e=!0:(o.active?n=!0:this._onOpaqueTile(o),o.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),e&&($(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=ce("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===t?(this._levels[n].el.style.zIndex=e-Math.abs(t-n),this._onUpdateLevel(n)):(he(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var i=this._levels[t],o=this._map;return i||((i=this._levels[t]={}).el=ce("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,o.getCenter(),o.getZoom()),u(i.el.offsetWidth),this._onCreateLevel(i)),this._level=i,i}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)he(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,n,i){var o=Math.floor(t/2),r=Math.floor(e/2),s=n-1,a=new N(+o,+r);a.z=+s;var l=this._tileCoordsToKey(a),u=this._tiles[l];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),s>i&&this._retainParent(o,r,s,i))},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new N(o,r);s.z=n+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1<i&&this._retainChildren(o,r,n+1,i))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,n,i){var o=Math.round(e);o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o);var r=this.options.updateWhenZooming&&o!==this._tileZoom;i&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var n in this._levels)this._setZoomTransform(this._levels[n],t,e)},_setZoomTransform:function(t,e,n){var i=this._map.getZoomScale(n,t.zoom),o=t.origin.multiplyBy(i).subtract(this._map._getNewPixelOrigin(e,n)).round();vt?Te(t.el,o,i):Ce(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,n=this._tileSize=this.getTileSize(),i=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],i).x/n.x),Math.ceil(t.project([0,e.wrapLng[1]],i).x/n.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],i).y/n.x),Math.ceil(t.project([e.wrapLat[1],0],i).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,n=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(n,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*i);return new O(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var n=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var i=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(i),r=o.getCenter(),s=[],a=this.options.keepBuffer,l=new O(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var c=this._tiles[u].coords;c.z===this._tileZoom&&l.contains(new N(c.x,c.y))||(this._tiles[u].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(t,n);else{for(var h=o.min.y;h<=o.max.y;h++)for(var d=o.min.x;d<=o.max.x;d++){var f=new N(d,h);if(f.z=this._tileZoom,this._isValidTile(f)){var p=this._tiles[this._tileCoordsToKey(f)];p?p.current=!0:s.push(f)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(d=0;d<s.length;d++)this._addTile(s[d],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var n=this._globalTileRange;if(!e.wrapLng&&(t.x<n.min.x||t.x>n.max.x)||!e.wrapLat&&(t.y<n.min.y||t.y>n.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return j(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n);return[e.unproject(i,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new B(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new N(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(he(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ge(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,et&&this.options.opacity<1&&be(t,this.options.opacity),ot&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&E(o(this._tileReady,this,t,null,r)),Ce(r,n),this._tiles[i]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(be(n.el,0),$(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(ge(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new N(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new O(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Ii(t){return new Di(t)}var Oi=Di.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=f(this,e)).detectRetina&&Lt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return De(n,"load",o(this._tileOnLoad,this,e,n)),De(n,"error",o(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Lt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return g(this._url,n(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=u,e.onerror=u,e.complete||(e.src=y,he(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",y),Di.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==y))return Di.prototype._tileReady.call(this,t,e,n)}});function zi(t,e){return new Oi(t,e)}var Bi=Oi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var r=(e=f(this,e)).detectRetina&&Lt?2:1,s=this.getTileSize();i.width=s.x*r,i.height=s.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Oi.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=z(n.project(e[0]),n.project(e[1])),o=i.min,r=i.max,s=(this._wmsVersion>=1.3&&this._crs===Zn?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=Oi.prototype.getTileUrl.call(this,t);return a+p(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function ji(t,e){return new Bi(t,e)}Oi.WMS=Bi,zi.wms=ji;var Ri=qn.extend({options:{padding:.1,tolerance:0},initialize:function(t){f(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ge(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=Ee(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),s=this._map.project(t,e).subtract(r),a=o.multiplyBy(-n).add(i).add(o).subtract(s);vt?Te(this._container,a,n):Ce(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new O(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zi=Ri.extend({getEvents:function(){var t=Ri.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ri.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");De(t,"mousemove",this._onMouseMove,this),De(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),De(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){$(this._redrawRequest),delete this._ctx,he(this._container),Oe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Ri.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Lt?2:1;Ce(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Lt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Ri.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,i=e.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),o=[];for(n=0;n<i.length;n++){if(e=Number(i[n]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||E(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new O,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var n=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var i=this._drawFirst;i;i=i.next)t=i.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var n,i,o,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),n=0;n<a;n++){for(i=0,o=s[n].length;i<o;i++)r=s[n][i],l[i?"lineTo":"moveTo"](r.x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,n=this._ctx,i=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||i)/i;1!==o&&(n.save(),n.scale(1,o)),n.beginPath(),n.arc(e.x,e.y/o,i,0,2*Math.PI,!1),1!==o&&n.restore(),this._fillStroke(n,t)}},_fillStroke:function(t,e){var n=e.options;n.fill&&(t.globalAlpha=n.fillOpacity,t.fillStyle=n.fillColor||n.color,t.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=n.opacity,t.lineWidth=n.weight,t.strokeStyle=n.color,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.stroke())},_onClick:function(t){for(var e,n,i=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(i)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(n=e);n&&(Ye(t),this._fireEvent([n],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(_e(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var n,i,r=this._drawFirst;r;r=r.next)(n=r.layer).options.interactive&&n._containsPoint(e)&&(i=n);i!==this._hoveredLayer&&(this._handleMouseOut(t),i&&(ge(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseover"),this._hoveredLayer=i)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,n){this._map._fireDOMEvent(e,n||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;n&&(n.prev=i,i?i.next=n:n&&(this._drawFirst=n),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;i&&(i.next=n,n?n.prev=i:i&&(this._drawLast=i),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Hi(t){return Pt?new Zi(t):null}var qi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Fi={_initContainer:function(){this._container=ce("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ri.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=qi("shape");ge(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=qi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;he(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=qi("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=_(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=qi("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){pe(t._container)}},Wi=Mt?qi:X,Ui=Ri.extend({getEvents:function(){var t=Ri.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Wi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Wi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){he(this._container),Oe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){Ri.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),Ce(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Wi("path");t.options.className&&ge(e,t.options.className),t.options.interactive&&ge(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){he(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Q(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){pe(t._path)}});function Vi(t){return St||Mt?new Ui(t):null}Mt&&Ui.include(Fi),en.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Hi(t)||Vi(t)}});var Gi=ai.extend({initialize:function(t,e){ai.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=j(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Ki(t,e){return new Gi(t,e)}Ui.create=Wi,Ui.pointsToPath=Q,ui.geometryToLayer=ci,ui.coordsToLatLng=di,ui.coordsToLatLngs=fi,ui.latLngToCoords=pi,ui.latLngsToCoords=mi,ui.getFeature=gi,ui.asFeature=_i,en.mergeOptions({boxZoom:!0});var Yi=pn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){De(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Oe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){he(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),De(document,{contextmenu:We,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ce("div","leaflet-zoom-box",this._container),ge(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new O(this._point,this._startPoint),n=e.getSize();Ce(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(he(this._box),_e(this._container,"leaflet-crosshair")),ee(),ke(),Oe(document,{contextmenu:We,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});en.addInitHook("addHandler","boxZoom",Yi),en.mergeOptions({doubleClickZoom:!0});var Xi=pn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});en.addInitHook("addHandler","doubleClickZoom",Xi),en.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Qi=pn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ge(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_e(this._map._container,"leaflet-grab"),_e(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=j(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,r=(i+e+n)%t-e-n,s=Math.abs(o+n)<Math.abs(r+n)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,n=e.options,i=!n.inertia||this._times.length<2;if(e.fire("dragend",t),i)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,s=n.easeLinearity,a=o.multiplyBy(s/r),l=a.distanceTo([0,0]),u=Math.min(n.inertiaMaxSpeed,l),c=a.multiplyBy(u/l),h=u/(n.inertiaDeceleration*s),d=c.multiplyBy(-h/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),E((function(){e.panBy(d,{duration:h,easeLinearity:s,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});en.addInitHook("addHandler","dragging",Qi),en.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Ji=pn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),De(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Oe(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,n=t.scrollTop||e.scrollTop,i=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(i,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,n,i=this._panKeys={},o=this.keyCodes;for(e=0,n=o.left.length;e<n;e++)i[o.left[e]]=[-1*t,0];for(e=0,n=o.right.length;e<n;e++)i[o.right[e]]=[t,0];for(e=0,n=o.down.length;e<n;e++)i[o.down[e]]=[0,t];for(e=0,n=o.up.length;e<n;e++)i[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,n,i=this._zoomKeys={},o=this.keyCodes;for(e=0,n=o.zoomIn.length;e<n;e++)i[o.zoomIn[e]]=t;for(e=0,n=o.zoomOut.length;e<n;e++)i[o.zoomOut[e]]=-t},_addHooks:function(){De(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Oe(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,n=t.keyCode,i=this._map;if(n in this._panKeys)i._panAnim&&i._panAnim._inProgress||(e=this._panKeys[n],t.shiftKey&&(e=I(e).multiplyBy(3)),i.panBy(e),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds));else if(n in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!i._popup||!i._popup.options.closeOnEscapeKey)return;i.closePopup()}We(t)}}});en.addInitHook("addHandler","keyboard",Ji),en.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=pn.extend({addHooks:function(){De(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Oe(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Ge(t),n=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),i),We(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),n=this._map.options.zoomSnap||0;t._stop();var i=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(i))))/Math.LN2,r=n?Math.ceil(o/n)*n:o,s=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});en.addInitHook("addHandler","scrollWheelZoom",to),en.mergeOptions({tap:!0,tapTolerance:15});var eo=pn.extend({addHooks:function(){De(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Oe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Fe(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],n=e.target;this._startPos=this._newPos=new N(e.clientX,e.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&ge(n,"leaflet-active"),this._holdTimeout=setTimeout(o((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),De(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Oe(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],n=e.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&_e(n,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new N(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var n=document.createEvent("MouseEvents");n._simulated=!0,e.target._simulatedClick=!0,n.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(n)}});!Ct||Tt&&!ht||en.addInitHook("addHandler","tap",eo),en.mergeOptions({touchZoom:Ct&&!rt,bounceAtZoomLimits:!0});var no=pn.extend({addHooks:function(){ge(this._map._container,"leaflet-touch-zoom"),De(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),Oe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),De(document,"touchmove",this._onTouchMove,this),De(document,"touchend",this._onTouchEnd,this),Fe(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]),r=n.distanceTo(i)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),$(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=E(a,this,!0),Fe(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,$(this._animRequest),Oe(document,"touchmove",this._onTouchMove,this),Oe(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});en.addInitHook("addHandler","touchZoom",no),en.BoxZoom=Yi,en.DoubleClickZoom=Xi,en.Drag=Qi,en.Keyboard=Ji,en.ScrollWheelZoom=to,en.Tap=eo,en.TouchZoom=no,t.version=e,t.Control=on,t.control=rn,t.Browser=Nt,t.Evented=A,t.Mixin=gn,t.Util=k,t.Class=P,t.Handler=pn,t.extend=n,t.bind=o,t.stamp=s,t.setOptions=f,t.DomEvent=Je,t.DomUtil=Ne,t.PosAnimation=tn,t.Draggable=bn,t.LineUtil=Dn,t.PolyUtil=On,t.Point=N,t.point=I,t.Bounds=O,t.bounds=z,t.Transformation=V,t.transformation=G,t.Projection=jn,t.LatLng=R,t.latLng=Z,t.LatLngBounds=B,t.latLngBounds=j,t.CRS=q,t.GeoJSON=ui,t.geoJSON=yi,t.geoJson=bi,t.Layer=qn,t.LayerGroup=Fn,t.layerGroup=Wn,t.FeatureGroup=Un,t.featureGroup=Vn,t.ImageOverlay=xi,t.imageOverlay=wi,t.VideoOverlay=Ti,t.videoOverlay=Ci,t.SVGOverlay=Ei,t.svgOverlay=$i,t.DivOverlay=Li,t.Popup=ki,t.popup=Pi,t.Tooltip=Si,t.tooltip=Mi,t.Icon=Gn,t.icon=Kn,t.DivIcon=Ai,t.divIcon=Ni,t.Marker=Qn,t.marker=Jn,t.TileLayer=Oi,t.tileLayer=zi,t.GridLayer=Di,t.gridLayer=Ii,t.SVG=Ui,t.svg=Vi,t.Renderer=Ri,t.Canvas=Zi,t.canvas=Hi,t.Path=ti,t.CircleMarker=ei,t.circleMarker=ni,t.Circle=ii,t.circle=oi,t.Polyline=ri,t.polyline=si,t.Polygon=ai,t.polygon=li,t.Rectangle=Gi,t.rectangle=Ki,t.Map=en,t.map=nn;var io=window.L;t.noConflict=function(){return window.L=io,this},window.L=t}(e)}));function Ye(e){let n,i,o,r,s,a,l,u,c,h,d,g,b,w,T,$,L,k,P,S,M,A,N,D,I,O,z,B;return{c(){n=_("div"),i=_("div"),o=v("map center: "),r=v(e[0]),s=y(),a=_("a"),l=v("view on osm.org"),u=y(),c=_("br"),h=v("\n map zoom: "),d=v(e[1]),g=y(),b=_("br"),w=v("\n viewbox: "),T=v(e[2]),$=y(),L=_("br"),k=v("\n last click: "),P=v(e[4]),S=y(),M=_("br"),A=v("\n mouse position: "),N=v(e[5]),D=y(),I=_("div"),O=_("a"),O.textContent="hide",C(a,"target","_blank"),C(a,"href",e[3]),C(i,"id","map-position-inner"),C(O,"href","#hide"),C(I,"id","map-position-close"),C(I,"class","svelte-1b30dq3"),C(n,"id","map-position"),C(n,"class","svelte-1b30dq3")},m(t,e){p(t,n,e),f(n,i),f(i,o),f(i,r),f(i,s),f(i,a),f(a,l),f(i,u),f(i,c),f(i,h),f(i,d),f(i,g),f(i,b),f(i,w),f(i,T),f(i,$),f(i,L),f(i,k),f(i,P),f(i,S),f(i,M),f(i,A),f(i,N),f(n,D),f(n,I),f(I,O),z||(B=x(O,"click",Xe),z=!0)},p(t,[e]){1&e&&E(r,t[0]),8&e&&C(a,"href",t[3]),2&e&&E(d,t[1]),4&e&&E(T,t[2]),16&e&&E(P,t[4]),32&e&&E(N,t[5])},i:t,o:t,d(t){t&&m(n),z=!1,B()}}}function Xe(){document.getElementById("map-position").style.display="none",document.getElementById("show-map-position").style.display="block"}function Qe(t,e,n){let i,o,r,s,a,l,u;function c(t,e){n(0,o=t.getCenter().lat.toFixed(5)+","+t.getCenter().lng.toFixed(5)),n(3,a=function(t){return"https://openstreetmap.org/#map="+t.getZoom()+"/"+t.getCenter().lat.toFixed(5)+"/"+t.getCenter().lng.toFixed(5)}(t)),n(1,r=t.getZoom()),n(2,s=function(t){var e=t.getBounds(),n=e.getWest(),i=e.getEast();return i-n>=360&&(n=t.getCenter().lng-179.999,i=t.getCenter().lng+179.999),i=L.latLng(77,i).wrap().lng,[(n=L.latLng(77,n).wrap().lng).toFixed(5),e.getNorth().toFixed(5),i.toFixed(5),e.getSouth().toFixed(5)].join(",")}(t)),n(5,u="-"),e&&n(5,u=[e.lat.toFixed(5),e.lng.toFixed(5)].join(",")),i&&n(4,l=[i.lat.toFixed(5),i.lng.toFixed(5)].join(","))}return ct.subscribe((t=>{t&&(t.on("move",(function(){c(t)})),t.on("mousemove",(function(e){c(t,e.latlng)})),t.on("click",(function(e){i=e.latlng,c(t)})),t.on("load",(function(){c(t)})))})),[o,r,s,a,l,u]}st((function(t,e){!function(e,n){t.exports=e(Ke),void 0!==n&&n.L&&(n.L.Control.MiniMap=e(L),n.L.control.minimap=function(t,e){return new n.L.Control.MiniMap(t,e)})}((function(t){var e=t.Control.extend({includes:t.Evented?t.Evented.prototype:t.Mixin.Events,options:{position:"bottomright",toggleDisplay:!1,zoomLevelOffset:-5,zoomLevelFixed:!1,centerFixed:!1,zoomAnimation:!1,autoToggleDisplay:!1,minimized:!1,width:150,height:150,collapsedWidth:19,collapsedHeight:19,aimingRectOptions:{color:"#ff7800",weight:1,clickable:!1},shadowRectOptions:{color:"#000000",weight:1,clickable:!1,opacity:0,fillOpacity:0},strings:{hideText:"Hide MiniMap",showText:"Show MiniMap"},mapOptions:{}},initialize:function(e,n){t.Util.setOptions(this,n),this.options.aimingRectOptions.clickable=!1,this.options.shadowRectOptions.clickable=!1,this._layer=e},onAdd:function(e){this._mainMap=e,this._container=t.DomUtil.create("div","leaflet-control-minimap"),this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",t.DomEvent.disableClickPropagation(this._container),t.DomEvent.on(this._container,"mousewheel",t.DomEvent.stopPropagation);var n={attributionControl:!1,dragging:!this.options.centerFixed,zoomControl:!1,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:e.options.crs};return n=t.Util.extend(this.options.mapOptions,n),this._miniMap=new t.Map(this._container,n),this._miniMap.addLayer(this._layer),this._mainMapMoving=!1,this._miniMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._miniMap.whenReady(t.Util.bind((function(){this._aimingRect=t.rectangle(this._mainMap.getBounds(),this.options.aimingRectOptions).addTo(this._miniMap),this._shadowRect=t.rectangle(this._mainMap.getBounds(),this.options.shadowRectOptions).addTo(this._miniMap),this._mainMap.on("moveend",this._onMainMapMoved,this),this._mainMap.on("move",this._onMainMapMoving,this),this._miniMap.on("movestart",this._onMiniMapMoveStarted,this),this._miniMap.on("move",this._onMiniMapMoving,this),this._miniMap.on("moveend",this._onMiniMapMoved,this)}),this)),this._container},addTo:function(e){t.Control.prototype.addTo.call(this,e);var n=this.options.centerFixed||this._mainMap.getCenter();return this._miniMap.setView(n,this._decideZoom(!0)),this._setDisplay(this.options.minimized),this},onRemove:function(t){this._mainMap.off("moveend",this._onMainMapMoved,this),this._mainMap.off("move",this._onMainMapMoving,this),this._miniMap.off("moveend",this._onMiniMapMoved,this),this._miniMap.removeLayer(this._layer)},changeLayer:function(t){this._miniMap.removeLayer(this._layer),this._layer=t,this._miniMap.addLayer(this._layer)},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),"leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-"+this.options.position,this._container,this._toggleDisplayButtonClicked,this):void 0,this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px",this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px"},_toggleButtonInitialTitleText:function(){return this.options.minimized?this.options.strings.showText:this.options.strings.hideText},_createButton:function(e,n,i,o,r,s){var a=t.DomUtil.create("a",i,o);a.innerHTML=e,a.href="#",a.title=n;var l=t.DomEvent.stopPropagation;return t.DomEvent.on(a,"click",l).on(a,"mousedown",l).on(a,"dblclick",l).on(a,"click",t.DomEvent.preventDefault).on(a,"click",r,s),a},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=!0,this._minimized?this._restore():this._minimize()},_setDisplay:function(t){t!==this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize:function(){this.options.toggleDisplay?(this._container.style.width=this.options.collapsedWidth+"px",this._container.style.height=this.options.collapsedHeight+"px",this._toggleDisplayButton.className+=" minimized-"+this.options.position,this._toggleDisplayButton.title=this.options.strings.showText):this._container.style.display="none",this._minimized=!0,this._onToggle()},_restore:function(){this.options.toggleDisplay?(this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,""),this._toggleDisplayButton.title=this.options.strings.hideText):this._container.style.display="block",this._minimized=!1,this._onToggle()},_onMainMapMoved:function(t){if(this._miniMapMoving)this._miniMapMoving=!1;else{var e=this.options.centerFixed||this._mainMap.getCenter();this._mainMapMoving=!0,this._miniMap.setView(e,this._decideZoom(!0)),this._setDisplay(this._decideMinimized())}this._aimingRect.setBounds(this._mainMap.getBounds())},_onMainMapMoving:function(t){this._aimingRect.setBounds(this._mainMap.getBounds())},_onMiniMapMoveStarted:function(t){if(!this.options.centerFixed){var e=this._aimingRect.getBounds(),n=this._miniMap.latLngToContainerPoint(e.getSouthWest()),i=this._miniMap.latLngToContainerPoint(e.getNorthEast());this._lastAimingRectPosition={sw:n,ne:i}}},_onMiniMapMoving:function(e){this.options.centerFixed||!this._mainMapMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new t.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onMiniMapMoved:function(t){this._mainMapMoving?this._mainMapMoving=!1:(this._miniMapMoving=!0,this._mainMap.setView(this._miniMap.getCenter(),this._decideZoom(!1)),this._shadowRect.setStyle({opacity:0,fillOpacity:0}))},_isZoomLevelFixed:function(){var t=this.options.zoomLevelFixed;return this._isDefined(t)&&this._isInteger(t)},_decideZoom:function(t){if(this._isZoomLevelFixed())return t?this.options.zoomLevelFixed:this._mainMap.getZoom();if(t)return this._mainMap.getZoom()+this.options.zoomLevelOffset;var e,n=this._miniMap.getZoom()-this._mainMap.getZoom(),i=this._miniMap.getZoom()-this.options.zoomLevelOffset;return n>this.options.zoomLevelOffset&&this._mainMap.getZoom()<this._miniMap.getMinZoom()-this.options.zoomLevelOffset?this._miniMap.getZoom()>this._lastMiniMapZoom?(e=this._mainMap.getZoom()+1,this._miniMap.setZoom(this._miniMap.getZoom()-1)):e=this._mainMap.getZoom():e=i,this._lastMiniMapZoom=this._miniMap.getZoom(),e},_decideMinimized:function(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?!!this._mainMap.getBounds().contains(this._miniMap.getBounds()):this._minimized},_isInteger:function(t){return"number"==typeof t},_isDefined:function(t){return void 0!==t},_onToggle:function(){t.Util.requestAnimFrame((function(){t.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this),t.Browser.any3d||t.Util.requestAnimFrame(this._fireToggleEvents,this)}),this)},_fireToggleEvents:function(){t.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this);var e={minimized:this._minimized};this.fire(this._minimized?"minimize":"restore",e),this.fire("toggle",e)}});return t.Map.mergeOptions({miniMapControl:!1}),t.Map.addInitHook((function(){this.options.miniMapControl&&(this.miniMapControl=(new e).addTo(this))})),e}),window)}));class Je extends ot{constructor(t){super(),it(this,t,Qe,Ye,s,{})}}function tn(e){let n,i,s,a,l,u,c,h;return n=new Je({}),{c(){J(n.$$.fragment),i=y(),s=_("div"),a=y(),l=_("div"),l.textContent="show map bounds",C(s,"id","map"),C(s,"class","svelte-1vbvdrk"),C(l,"id","show-map-position"),C(l,"class","leaflet-bar btn btn-sm btn-outline-secondary svelte-1vbvdrk")},m(o,d){var f;tt(n,o,d),p(o,i,d),p(o,s,d),p(o,a,d),p(o,l,d),u=!0,c||(h=[(f=e[0].call(null,s),f&&r(f.destroy)?f.destroy:t),x(l,"click",T(en))],c=!0)},p:t,i(t){u||(Y(n.$$.fragment,t),u=!0)},o(t){X(n.$$.fragment,t),u=!1},d(t){et(n,t),t&&m(i),t&&m(s),t&&m(a),t&&m(l),c=!1,o(h)}}}function en(t){t.target.style.display="none",document.getElementById("map-position").style.display="block"}function nn(t,e,n){let{display_minimap:i=!1}=e,{current_result:o=null}=e,{position_marker:r=null}=e,s=[];function a(t){let e=l(ct);if(!e)return;if(function(){let t=l(ct);t&&s.forEach((function(e){t.removeLayer(e)}))}(),r){let t=Ke.circleMarker(r,{radius:5,weight:2,fillColor:"#ff7800",color:"red",opacity:.75,zIndexOffset:100,clickable:!1});t.addTo(e),s.push(t)}var n=new URLSearchParams(window.location.search).get("viewbox");if(n){let t=n.split(","),i=Ke.latLngBounds([t[1],t[0]],[t[3],t[2]]);Ke.rectangle(i,{color:"#69d53e",weight:3,dashArray:"5 5",opacity:.8,fill:!1}).addTo(e)}if(!t)return;let i=t.centroid?t.centroid.coordinates[1]:t.lat,o=t.centroid?t.centroid.coordinates[0]:t.lon,a=t.geometry||t.geojson;if(i&&o){let t=Ke.circleMarker([i,o],{radius:10,weight:2,fillColor:"#ff7800",color:"blue",opacity:.75});e.addLayer(t),s.push(t)}if(a){var u=Ke.geoJson({type:"FeatureCollection",features:[{type:"Feature",geometry:a,properties:{}}]},{style:()=>({interactive:!1,color:"blue"})});e.addLayer(u),s.push(u),e.fitBounds(u.getBounds())}else i&&o&&r?e.fitBounds([[i,o],r],{padding:[50,50]}):i&&o&&e.setView([i,o],10)}return t.$$set=t=>{"display_minimap"in t&&n(1,i=t.display_minimap),"current_result"in t&&n(2,o=t.current_result),"position_marker"in t&&n(3,r=t.position_marker)},t.$$.update=()=>{4&t.$$.dirty&&a(o)},[function(t){let e=function(t){const e=Nominatim_Config.Map_Tile_Attribution;let n=new Ke.map(t,{attributionControl:e&&e.length,scrollWheelZoom:!0,touchZoom:!1,center:[Nominatim_Config.Map_Default_Lat,Nominatim_Config.Map_Default_Lon],zoom:Nominatim_Config.Map_Default_Zoom});if(Ke.tileLayer(Nominatim_Config.Map_Tile_URL,{attribution:e}).addTo(n),i){let t=new Ke.TileLayer(Nominatim_Config.Map_Tile_URL,{minZoom:0,maxZoom:13,attribution:e});new Ke.Control.MiniMap(t,{toggleDisplay:!0}).addTo(n)}const o=Ke.Control.extend({options:{position:"topright"},onAdd:()=>document.getElementById("show-map-position")});return n.addControl(new o),n}(t);return ct.set(e),a(o),{destroy:()=>{ct.set(null),e.remove()}}},i,o,r]}class on extends ot{constructor(t){super(),it(this,t,nn,tn,s,{display_minimap:1,current_result:2,position_marker:3})}}function rn(t){let e,n;return e=new he({props:{api_request_params:t[0],bStructuredSearch:t[2]}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.api_request_params=t[0]),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function sn(t){let e,n,i,o,r,s,a,l,u,c;function h(e){t[4](e)}e=new te({props:{$$slots:{default:[rn]},$$scope:{ctx:t}}});let d={reverse_search:!1};return void 0!==t[1]&&(d.current_result=t[1]),r=new Ge({props:d}),I.push((()=>Q(r,"current_result",h))),u=new on({props:{current_result:t[1],display_minimap:!0}}),{c(){J(e.$$.fragment),n=y(),i=_("div"),o=_("div"),J(r.$$.fragment),a=y(),l=_("div"),J(u.$$.fragment),C(o,"class","sidebar svelte-1d53ob0"),C(l,"id","map-wrapper"),C(l,"class","svelte-1d53ob0"),C(i,"id","content"),C(i,"class","svelte-1d53ob0")},m(t,s){tt(e,t,s),p(t,n,s),p(t,i,s),f(i,o),tt(r,o,null),f(i,a),f(i,l),tt(u,l,null),c=!0},p(t,[n]){const i={};65&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i);const o={};!s&&2&n&&(s=!0,o.current_result=t[1],Z((()=>s=!1))),r.$set(o);const a={};2&n&&(a.current_result=t[1]),u.$set(a)},i(t){c||(Y(e.$$.fragment,t),Y(r.$$.fragment,t),Y(u.$$.fragment,t),c=!0)},o(t){X(e.$$.fragment,t),X(r.$$.fragment,t),X(u.$$.fragment,t),c=!1},d(t){et(e,t),t&&m(n),t&&m(i),et(r),et(u)}}}function an(t,e,n){let i,o,r;return u(t,pt,(t=>n(3,i=t))),t.$$.update=()=>{if(8&t.$$.dirty){let t=i;"search"===t.tab&&function(t){Tt(),n(0,o={q:t.get("q"),street:t.get("street"),city:t.get("city"),county:t.get("county"),state:t.get("state"),country:t.get("country"),postalcode:t.get("postalcode"),polygon_geojson:Nominatim_Config.Search_AreaPolygons?1:0,viewbox:t.get("viewbox"),bounded:t.get("bounded"),dedupe:t.get("dedupe"),"accept-language":t.get("accept-language"),countrycodes:t.get("countrycodes"),limit:t.get("limit"),polygon_threshold:t.get("polygon_threshold"),exclude_place_ids:t.get("exclude_place_ids"),format:"jsonv2"});let e=o.street||o.city||o.county||o.state||o.country||o.postalcode;o.q||e?bt("search",o,(function(t){ht.set(t),Tt("Result for "+o.q),e?(document.querySelector(".nav-tabs a[href='#structured']").click(),document.querySelector("input[name=street]").focus()):document.querySelector("input[name=q]").focus()})):ht.set(void 0)}(t.params)}},[o,r,undefined,i,function(t){r=t,n(1,r)}]}class ln extends ot{constructor(t){super(),it(this,t,an,sn,s,{})}}function un(t,e,n){const i=t.slice();return i[8]=e[n],i[10]=n,i}function cn(e){let n,i,o,r,s=e[8]+"";return{c(){n=_("option"),i=v(e[10]),o=v(" - "),r=v(s),n.__value=e[10],n.value=n.__value},m(t,e){p(t,n,e),f(n,i),f(n,o),f(n,r)},p:t,d(t){t&&m(n)}}}function hn(t){let e,n,i,r,s,a,l,u,c,h,d,v,b,E,L,P,S,M,A,N,D,I,O=Ee(),z=[];for(let e=0;e<O.length;e+=1)z[e]=cn(un(t,O,e));return{c(){e=_("div"),n=_("label"),n.textContent="lat",i=y(),r=_("input"),s=y(),a=_("div"),l=_("a"),l.textContent="<>",u=y(),c=_("div"),h=_("label"),h.textContent="lon",d=y(),v=_("input"),b=y(),E=_("div"),L=_("label"),L.textContent="max zoom",P=y(),S=_("select"),M=_("option"),M.textContent="---";for(let t=0;t<z.length;t+=1)z[t].c();A=y(),N=_("div"),N.innerHTML='<button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>',C(n,"for","reverse-lat"),C(n,"class","svelte-1z124cx"),C(r,"id","reverse-lat"),C(r,"name","lat"),C(r,"type","text"),C(r,"class","form-control form-control-sm svelte-1z124cx"),C(r,"placeholder","latitude"),C(r,"pattern","^-?\\d+(\\.\\d+)?$"),C(e,"class","form-group"),C(l,"id","switch-coords"),C(l,"class","btn btn-outline-secondary btn-sm svelte-1z124cx"),C(l,"title","switch lat and lon"),C(a,"class","form-group"),C(h,"for","reverse-lon"),C(h,"class","svelte-1z124cx"),C(v,"id","reverse-lon"),C(v,"name","lon"),C(v,"type","text"),C(v,"class","form-control form-control-sm svelte-1z124cx"),C(v,"placeholder","longitude"),C(v,"pattern","^-?\\d+(\\.\\d+)?$"),C(c,"class","form-group"),C(L,"for","reverse-zoom"),C(L,"class","svelte-1z124cx"),M.__value="",M.value=M.__value,C(S,"id","reverse-zoom"),C(S,"name","zoom"),C(S,"class","form-control form-control-sm svelte-1z124cx"),void 0===t[2]&&R((()=>t[7].call(S))),C(E,"class","form-group"),C(N,"class","form-group")},m(o,m){p(o,e,m),f(e,n),f(e,i),f(e,r),$(r,t[0]),p(o,s,m),p(o,a,m),f(a,l),p(o,u,m),p(o,c,m),f(c,h),f(c,d),f(c,v),$(v,t[1]),p(o,b,m),p(o,E,m),f(E,L),f(E,P),f(E,S),f(S,M);for(let t=0;t<z.length;t+=1)z[t].m(S,null);k(S,t[2]),p(o,A,m),p(o,N,m),D||(I=[x(r,"input",t[4]),x(r,"change",fn),x(l,"click",T(w(t[5]))),x(v,"input",t[6]),x(S,"change",t[7])],D=!0)},p(t,e){if(1&e&&r.value!==t[0]&&$(r,t[0]),2&e&&v.value!==t[1]&&$(v,t[1]),0&e){let n;for(O=Ee(),n=0;n<O.length;n+=1){const i=un(t,O,n);z[n]?z[n].p(i,e):(z[n]=cn(i),z[n].c(),z[n].m(S,null))}for(;n<z.length;n+=1)z[n].d(1);z.length=O.length}4&e&&k(S,t[2])},d(t){t&&m(e),t&&m(s),t&&m(a),t&&m(u),t&&m(c),t&&m(b),t&&m(E),g(z,t),t&&m(A),t&&m(N),D=!1,o(I)}}}function dn(t){let e,n;return e=new ie({props:{page:"reverse",$$slots:{default:[hn]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,[n]){const i={};2055&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function fn(t){var e=t.target.value.split(",");2===e.length&&(document.querySelector("input[name=lat]").value=L.Util.trim(e[0]),document.querySelector("input[name=lon]").value=L.Util.trim(e[1]))}function pn(t,e,n){let{lat:i=""}=e,{lon:o=""}=e,{zoom:r=""}=e;function s(t,e,n){if(null===t||null===e)return;let i=new URLSearchParams;i.set("lat",t),i.set("lon",e),i.set("zoom",n||r),gt("reverse",i)}ct.subscribe((t=>{t&&t.on("click",(t=>{let e=t.latlng.wrap();s(e.lat.toFixed(5),e.lng.toFixed(5))}))}));return t.$$set=t=>{"lat"in t&&n(0,i=t.lat),"lon"in t&&n(1,o=t.lon),"zoom"in t&&n(2,r=t.zoom)},[i,o,r,s,function(){i=this.value,n(0,i)},()=>s(o,i),function(){o=this.value,n(1,o)},function(){r=function(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}(this),n(2,r)}]}class mn extends ot{constructor(t){super(),it(this,t,pn,dn,s,{lat:0,lon:1,zoom:2})}}function gn(t){let n,i;const o=[t[0]];let r={};for(let t=0;t<o.length;t+=1)r=e(r,o[t]);return n=new mn({props:r}),{c(){J(n.$$.fragment)},m(t,e){tt(n,t,e),i=!0},p(t,e){const i=1&e?function(t,e){const n={},i={},o={$$scope:1};let r=t.length;for(;r--;){const s=t[r],a=e[r];if(a){for(const t in s)t in a||(i[t]=1);for(const t in a)o[t]||(n[t]=a[t],o[t]=1);t[r]=a}else for(const t in s)o[t]=1}for(const t in i)t in n||(n[t]=void 0);return n}(o,[(r=t[0],"object"==typeof r&&null!==r?r:{})]):{};var r;n.$set(i)},i(t){i||(Y(n.$$.fragment,t),i=!0)},o(t){X(n.$$.fragment,t),i=!1},d(t){et(n,t)}}}function _n(t){let e,n,i,o,r,s,a,l,u,c;function h(e){t[4](e)}e=new te({props:{$$slots:{default:[gn]},$$scope:{ctx:t}}});let d={reverse_search:!0};return void 0!==t[1]&&(d.current_result=t[1]),r=new Ge({props:d}),I.push((()=>Q(r,"current_result",h))),u=new on({props:{current_result:t[1],position_marker:t[2],display_minimap:!0}}),{c(){J(e.$$.fragment),n=y(),i=_("div"),o=_("div"),J(r.$$.fragment),a=y(),l=_("div"),J(u.$$.fragment),C(o,"class","sidebar svelte-1d53ob0"),C(l,"id","map-wrapper"),C(l,"class","svelte-1d53ob0"),C(i,"id","content"),C(i,"class","svelte-1d53ob0")},m(t,s){tt(e,t,s),p(t,n,s),p(t,i,s),f(i,o),tt(r,o,null),f(i,a),f(i,l),tt(u,l,null),c=!0},p(t,[n]){const i={};65&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i);const o={};!s&&2&n&&(s=!0,o.current_result=t[1],Z((()=>s=!1))),r.$set(o);const a={};2&n&&(a.current_result=t[1]),4&n&&(a.position_marker=t[2]),u.$set(a)},i(t){c||(Y(e.$$.fragment,t),Y(r.$$.fragment,t),Y(u.$$.fragment,t),c=!0)},o(t){X(e.$$.fragment,t),X(r.$$.fragment,t),X(u.$$.fragment,t),c=!1},d(t){et(e,t),t&&m(n),t&&m(i),et(r),et(u)}}}function vn(t,e,n){let i,o,r,s;return u(t,pt,(t=>n(3,i=t))),t.$$.update=()=>{if(8&t.$$.dirty){let t=i;"reverse"===t.tab&&(e=t.params,Tt(),n(0,o={lat:e.get("lat"),lon:e.get("lon"),zoom:e.get("zoom")>1?Number(e.get("zoom")):Number(Nominatim_Config.Reverse_Default_Search_Zoom),format:"jsonv2"}),o.lat||o.lat?bt("reverse",o,(function(t){t&&!t.error?(n(2,s=[o.lat,o.lon]),ht.set([t])):ht.set([]),Tt("Reverse result for "+o.lat+","+o.lon),document.querySelector("input[name=lat]").focus()})):ht.set(void 0))}var e},[o,r,s,i,function(t){r=t,n(1,r)}]}class yn extends ot{constructor(t){super(),it(this,t,vn,_n,s,{})}}function bn(e){let n,i,o,r,s,a,l,u,c;return{c(){n=_("form"),i=_("input"),r=y(),s=_("button"),s.textContent="Show",a=y(),l=_("small"),l.innerHTML='OSM type+id (<em class="svelte-1kvo9ki">N123</em>, <em class="svelte-1kvo9ki">W123</em>, <em class="svelte-1kvo9ki">R123</em>),\n Place id (<em class="svelte-1kvo9ki">1234</em>) or\n URL (<em class="svelte-1kvo9ki">https://openstreetmap.org/way/123</em>)',C(i,"type","edit"),C(i,"class","form-control form-control-sm mr-1 svelte-1kvo9ki"),C(i,"pattern","^[NWR]?[0-9]+$|.*openstreetmap.*"),i.value=o=""+((e[0].osmtype||"")+(e[0].osmid||"")+(e[0].place_id||"")),C(s,"type","submit"),C(s,"class","btn btn-primary btn-sm"),C(n,"class","form-inline svelte-1kvo9ki"),C(n,"action","details.html"),C(l,"class","form-text text-muted svelte-1kvo9ki")},m(t,o){p(t,n,o),f(n,i),f(n,r),f(n,s),p(t,a,o),p(t,l,o),u||(c=x(n,"submit",w(e[1])),u=!0)},p(t,[e]){1&e&&o!==(o=""+((t[0].osmtype||"")+(t[0].osmid||"")+(t[0].place_id||"")))&&(i.value=o)},i:t,o:t,d(t){t&&m(n),t&&m(a),t&&m(l),u=!1,c()}}}function xn(t,e,n){let{api_request_params:i={}}=e;return t.$$set=t=>{"api_request_params"in t&&n(0,i=t.api_request_params)},[i,function(t){let e=t.target.querySelector("input[type=edit]").value.trim(),n=e.match(/^\s*([NWR])(\d+)\s*$/i)||e.match(/\/(relation|way|node)\/(\d+)\s*$/);var i=new URLSearchParams;if(n)i.set("osmtype",n[1].charAt(0).toUpperCase()),i.set("osmid",n[2]);else{if(!e.match(/^\d+$/))return void alert("invalid input");i.set("place_id",e)}gt("details",i)}]}class wn extends ot{constructor(t){super(),it(this,t,xn,bn,s,{api_request_params:0})}}function Tn(e){let n;return{c(){n=_("span"),n.textContent="No Name",C(n,"class","noname")},m(t,e){p(t,n,e)},p:t,d(t){t&&m(n)}}}function Cn(t){let e,n=t[0].localname+"";return{c(){e=v(n)},m(t,n){p(t,e,n)},p(t,i){1&i&&n!==(n=t[0].localname+"")&&E(e,n)},d(t){t&&m(e)}}}function En(t){let e,n;return e=new $t({props:{page:"search",params_hash:{postalcode:t[0].localname},$$slots:{default:[kn]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.params_hash={postalcode:t[0].localname}),16&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function $n(t){let e,n;return e=new $t({props:{page:"search",params_hash:{country:t[0].localname},$$slots:{default:[Pn]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.params_hash={country:t[0].localname}),16&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function Ln(t){let e,n;return e=new Pe({props:{feature:t[0],$$slots:{default:[Sn]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.feature=t[0]),16&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function kn(t){let e;return{c(){e=v("search by name")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Pn(t){let e;return{c(){e=v("search by name")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Sn(t){let e;return{c(){e=v("details")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Mn(t){let e,n,i,o,r,s,a,l,u,c,h,d,g,b,x,w,T,$,L,k,S,M=xe(t[0])+"",A=me(t[0])+"",N=t[0].rank_address+"",D=we(t[0].admin_level)+"",I=Te(t[0].distance,t[1])+"";function O(t,e){return t[0].localname?Cn:Tn}let z=O(t),B=z(t);const j=[Ln,$n,En],R=[];function Z(t,e){return t[0].osm_id?0:(1&e&&($=!!t[0].type.match(/^country/)),$?1:"postcode"===t[0].type?2:-1)}return~(L=Z(t,-1))&&(k=R[L]=j[L](t)),{c(){e=_("tr"),n=_("td"),B.c(),i=y(),o=_("td"),r=v(M),s=y(),a=_("td"),l=y(),u=_("td"),c=v(N),h=y(),d=_("td"),g=v(D),b=y(),x=_("td"),w=y(),T=_("td"),k&&k.c(),C(n,"class","name font-weight-bold svelte-1p3h587"),C(o,"class","svelte-1p3h587"),C(a,"class","svelte-1p3h587"),C(u,"class","svelte-1p3h587"),C(d,"class","svelte-1p3h587"),C(x,"class","svelte-1p3h587"),C(T,"class","svelte-1p3h587"),C(e,"class","svelte-1p3h587"),P(e,"notused",t[2]&&!t[3])},m(t,m){p(t,e,m),f(e,n),B.m(n,null),f(e,i),f(e,o),f(o,r),f(e,s),f(e,a),a.innerHTML=A,f(e,l),f(e,u),f(u,c),f(e,h),f(e,d),f(d,g),f(e,b),f(e,x),x.innerHTML=I,f(e,w),f(e,T),~L&&R[L].m(T,null),S=!0},p(t,[i]){z===(z=O(t))&&B?B.p(t,i):(B.d(1),B=z(t),B&&(B.c(),B.m(n,null))),(!S||1&i)&&M!==(M=xe(t[0])+"")&&E(r,M),(!S||1&i)&&A!==(A=me(t[0])+"")&&(a.innerHTML=A),(!S||1&i)&&N!==(N=t[0].rank_address+"")&&E(c,N),(!S||1&i)&&D!==(D=we(t[0].admin_level)+"")&&E(g,D),(!S||3&i)&&I!==(I=Te(t[0].distance,t[1])+"")&&(x.innerHTML=I);let o=L;L=Z(t,i),L===o?~L&&R[L].p(t,i):(k&&(G(),X(R[o],1,1,(()=>{R[o]=null})),K()),~L?(k=R[L],k?k.p(t,i):(k=R[L]=j[L](t),k.c()),Y(k,1),k.m(T,null)):k=null),12&i&&P(e,"notused",t[2]&&!t[3])},i(t){S||(Y(k),S=!0)},o(t){X(k),S=!1},d(t){t&&m(e),B.d(),~L&&R[L].d()}}}function An(t,e,n){let i,{addressLine:o}=e,{bDistanceInMeters:r}=e,{bMarkUnusedLines:s=!1}=e;return t.$$set=t=>{"addressLine"in t&&n(0,o=t.addressLine),"bDistanceInMeters"in t&&n(1,r=t.bDistanceInMeters),"bMarkUnusedLines"in t&&n(2,s=t.bMarkUnusedLines)},t.$$.update=()=>{1&t.$$.dirty&&n(3,i=o.isaddress)},[o,r,s,i]}class Nn extends ot{constructor(t){super(),it(this,t,An,Mn,s,{addressLine:0,bDistanceInMeters:1,bMarkUnusedLines:2})}}function Dn(e){let n,i,r,s,a,l,u,c,h,d,g,y,b;return{c(){n=v("("),i=_("a"),i.textContent="how?",r=v(")\n\n"),s=_("div"),a=_("button"),a.innerHTML='<span aria-hidden="true">×</span>',l=v("\n\n Nightly calculated from nearby places having this postcode.\n "),u=_("a"),u.textContent="Documentation",c=v(".\n You can search for those with an "),h=_("a"),d=v("Overpass Turbo query"),g=v("."),C(i,"href","#openHint"),C(a,"type","button"),C(a,"class","close svelte-yw4tm0"),C(a,"aria-label","Close"),C(u,"href","https://nominatim.org/release-docs/latest/develop/Postcodes/"),C(h,"href",e[0]),C(h,"target","_blank"),C(s,"id","postcode-hint"),C(s,"class","my-2 p-2 svelte-yw4tm0")},m(t,e){p(t,n,e),p(t,i,e),p(t,r,e),p(t,s,e),f(s,a),f(s,l),f(s,u),f(s,c),f(s,h),f(h,d),f(s,g),y||(b=[x(i,"click",T(w(In))),x(a,"click",T(On))],y=!0)},p:t,i:t,o:t,d(t){t&&m(n),t&&m(i),t&&m(r),t&&m(s),y=!1,o(b)}}}function In(){document.getElementById("postcode-hint").style.display="block"}function On(){document.getElementById("postcode-hint").style.display="none"}function zn(t,e,n){let{postcode:i}=e,{lat:o}=e,{lon:r}=e,s=`\n // Based on the map bounds, you can zoom out and rerun the query\n\n [timeout:30]; // in seconds\n\n // we define a shortcut\n // https://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Turbo_Queries\n {{postcode=${i}}}\n\n (\n node["addr:postcode"="{{postcode}}"]({{bbox}});\n way["addr:postcode"="{{postcode}}"]({{bbox}});\n relation["addr:postcode"="{{postcode}}"]({{bbox}});\n\n node["postal_code"="{{postcode}}"]({{bbox}});\n way["postal_code"="{{postcode}}"]({{bbox}});\n relation["postal_code"="{{postcode}}"]({{bbox}});\n );\n\n out body;\n >;\n out skel qt;\n `.replace(/^ {4}/gm,""),a="https://overpass-turbo.eu/?Q="+encodeURIComponent(s)+"&C="+encodeURIComponent([o,r,15].join(";"))+"&R";return t.$$set=t=>{"postcode"in t&&n(1,i=t.postcode),"lat"in t&&n(2,o=t.lat),"lon"in t&&n(3,r=t.lon)},[a,i,o,r]}class Bn extends ot{constructor(t){super(),it(this,t,zn,Dn,s,{postcode:1,lat:2,lon:3})}}function jn(t){let e,n,i,o,r,s;const a=t[2].default,l=c(a,t,t[1],null);return{c(){e=_("tr"),n=_("td"),i=v(t[0]),o=y(),r=_("td"),l&&l.c(),C(n,"class","svelte-1184nr4"),C(r,"class","svelte-1184nr4")},m(t,a){p(t,e,a),f(e,n),f(n,i),f(e,o),f(e,r),l&&l.m(r,null),s=!0},p(t,[e]){(!s||1&e)&&E(i,t[0]),l&&l.p&&2&e&&d(l,a,t,t[1],e,null,null)},i(t){s||(Y(l,t),s=!0)},o(t){X(l,t),s=!1},d(t){t&&m(e),l&&l.d(t)}}}function Rn(t,e,n){let{$$slots:i={},$$scope:o}=e,{title:r}=e;return t.$$set=t=>{"title"in t&&n(0,r=t.title),"$$scope"in t&&n(1,o=t.$$scope)},[r,o,i]}class Zn extends ot{constructor(t){super(),it(this,t,Rn,jn,s,{title:0})}}function Hn(t,e,n){const i=t.slice();return i[1]=e[n],i}function qn(t){let e,n,i,o,r,s,a=t[0][t[1]]+"",l=t[1]+"";return{c(){e=_("div"),n=_("span"),i=v(a),o=v(" ("),r=v(l),s=v(")\n "),C(n,"class","name svelte-ndknvb"),C(e,"class","line")},m(t,a){p(t,e,a),f(e,n),f(n,i),f(e,o),f(e,r),f(e,s)},p(t,e){1&e&&a!==(a=t[0][t[1]]+"")&&E(i,a),1&e&&l!==(l=t[1]+"")&&E(r,l)},d(t){t&&m(e)}}}function Fn(e){let n,i=Object.keys(e[0]),o=[];for(let t=0;t<i.length;t+=1)o[t]=qn(Hn(e,i,t));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();n=b()},m(t,e){for(let n=0;n<o.length;n+=1)o[n].m(t,e);p(t,n,e)},p(t,[e]){if(1&e){let r;for(i=Object.keys(t[0]),r=0;r<i.length;r+=1){const s=Hn(t,i,r);o[r]?o[r].p(s,e):(o[r]=qn(s),o[r].c(),o[r].m(n.parentNode,n))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},i:t,o:t,d(t){g(o,t),t&&m(n)}}}function Wn(t,e,n){let{items:i}=e;return t.$$set=t=>{"items"in t&&n(0,i=t.items)},[i]}class Un extends ot{constructor(t){super(),it(this,t,Wn,Fn,s,{items:0})}}function Vn(t,e,n){const i=t.slice();return i[6]=e[n],i}function Gn(t,e,n){const i=t.slice();return i[9]=e[n],i}function Kn(t,e,n){const i=t.slice();return i[12]=e[n],i}function Yn(t,e,n){const i=t.slice();return i[12]=e[n],i}function Xn(t,e,n){const i=t.slice();return i[17]=e[n],i}function Qn(t,e,n){const i=t.slice();return i[17]=e[n],i}function Jn(t){let e,n;return e=new wn({props:{api_request_params:t[2]}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};4&n&&(i.api_request_params=t[2]),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function ti(e){let n;return{c(){n=v("No such place found.")},m(t,e){p(t,n,e)},p:t,i:t,o:t,d(t){t&&m(n)}}}function ei(t){let e,n,i,o,r,s,a,l,u,c,h,d,g,b,x,w,T,$,L,k,P,S,M,A,N,D,I,O,z,B,j,R,Z,H,q,F,W,U,V,Q,nt,it,ot,rt,st,at,lt,ut,ct,ht,dt,ft,pt,mt,gt,_t,vt,yt,bt,xt,wt,Tt,Ct,Et,$t=(t[0].localname||`${pe(t[0].osm_type)} ${t[0].osm_id}`)+"",Lt=ye(t[0]);a=new Pe({props:{feature:t[0],$$slots:{default:[ni]},$$scope:{ctx:t}}}),c=new Oe({props:{aPlace:t[0]}}),w=new Zn({props:{title:"Name",$$slots:{default:[ri]},$$scope:{ctx:t}}}),$=new Zn({props:{title:"Type",$$slots:{default:[si]},$$scope:{ctx:t}}}),k=new Zn({props:{title:"Last Updated",$$slots:{default:[ai]},$$scope:{ctx:t}}});let kt=Lt&&li(t);M=new Zn({props:{title:"Search Rank",$$slots:{default:[ci]},$$scope:{ctx:t}}}),N=new Zn({props:{title:"Address Rank",$$slots:{default:[hi]},$$scope:{ctx:t}}});let Pt=t[0].calculated_importance&&di(t);O=new Zn({props:{title:"Coverage",$$slots:{default:[mi]},$$scope:{ctx:t}}}),B=new Zn({props:{title:"Centre Point (lat,lon)",$$slots:{default:[gi]},$$scope:{ctx:t}}}),R=new Zn({props:{title:"OSM",$$slots:{default:[_i]},$$scope:{ctx:t}}}),H=new Zn({props:{title:"Place Id",$$slots:{default:[vi]},$$scope:{ctx:t}}});let St=t[0].calculated_wikipedia&&yi(t);W=new Zn({props:{title:"Computed Postcode",$$slots:{default:[wi]},$$scope:{ctx:t}}}),V=new Zn({props:{title:"Address Tags",$$slots:{default:[Ti]},$$scope:{ctx:t}}}),nt=new Zn({props:{title:"Extra Tags",$$slots:{default:[Ci]},$$scope:{ctx:t}}}),st=new on({props:{current_result:t[0]}});let Mt=t[0].address&&Ei(t),At=t[0].linked_places&&Li(t);function Nt(t,e){return t[0].keywords?Si:Pi}let Dt=Nt(t),It=Dt(t);const Ot=[zi,Oi],zt=[];function Bt(t,e){return t[0].hierarchy?0:1}return Tt=Bt(t),Ct=zt[Tt]=Ot[Tt](t),{c(){e=_("div"),n=_("div"),i=_("h1"),o=v($t),r=y(),s=_("small"),J(a.$$.fragment),l=y(),u=_("div"),J(c.$$.fragment),h=y(),d=_("div"),g=_("div"),b=_("table"),x=_("tbody"),J(w.$$.fragment),T=y(),J($.$$.fragment),L=y(),J(k.$$.fragment),P=y(),kt&&kt.c(),S=y(),J(M.$$.fragment),A=y(),J(N.$$.fragment),D=y(),Pt&&Pt.c(),I=y(),J(O.$$.fragment),z=y(),J(B.$$.fragment),j=y(),J(R.$$.fragment),Z=y(),J(H.$$.fragment),q=y(),St&&St.c(),F=y(),J(W.$$.fragment),U=y(),J(V.$$.fragment),Q=y(),J(nt.$$.fragment),it=y(),ot=_("div"),rt=_("div"),J(st.$$.fragment),at=y(),lt=_("div"),ut=_("div"),ct=_("h2"),ct.textContent="Address",ht=y(),dt=_("table"),ft=_("thead"),ft.innerHTML="<tr><th>Local name</th> \n <th>Type</th> \n <th>OSM</th> \n <th>Address rank</th> \n <th>Admin level</th> \n <th>Distance</th> \n <th></th></tr>",pt=y(),mt=_("tbody"),Mt&&Mt.c(),gt=y(),At&&At.c(),_t=y(),vt=_("tr"),vt.innerHTML='<td colspan="6" class="svelte-dl2ttu"><h2 class="svelte-dl2ttu">Keywords</h2></td>',yt=y(),It.c(),bt=y(),xt=_("tr"),xt.innerHTML='<td colspan="6" class="svelte-dl2ttu"><h2 class="svelte-dl2ttu">Parent Of</h2></td>',wt=y(),Ct.c(),C(s,"class","svelte-dl2ttu"),C(i,"class","svelte-dl2ttu"),C(n,"class","col-sm-10"),C(u,"class","col-sm-2 text-right"),C(e,"class","row"),C(b,"id","locationdetails"),C(b,"class","table table-striped table-responsive"),C(g,"class","col-md-6"),C(rt,"id","map-wrapper"),C(rt,"class","svelte-dl2ttu"),C(ot,"class","col-md-6"),C(d,"class","row"),C(ct,"class","svelte-dl2ttu"),C(vt,"class","all-columns svelte-dl2ttu"),C(xt,"class","all-columns svelte-dl2ttu"),C(dt,"id","address"),C(dt,"class","table table-striped table-small"),C(ut,"class","col-md-12"),C(lt,"class","row")},m(t,m){p(t,e,m),f(e,n),f(n,i),f(i,o),f(i,r),f(i,s),tt(a,s,null),f(e,l),f(e,u),tt(c,u,null),p(t,h,m),p(t,d,m),f(d,g),f(g,b),f(b,x),tt(w,x,null),f(x,T),tt($,x,null),f(x,L),tt(k,x,null),f(x,P),kt&&kt.m(x,null),f(x,S),tt(M,x,null),f(x,A),tt(N,x,null),f(x,D),Pt&&Pt.m(x,null),f(x,I),tt(O,x,null),f(x,z),tt(B,x,null),f(x,j),tt(R,x,null),f(x,Z),tt(H,x,null),f(x,q),St&&St.m(x,null),f(x,F),tt(W,x,null),f(x,U),tt(V,x,null),f(x,Q),tt(nt,x,null),f(d,it),f(d,ot),f(ot,rt),tt(st,rt,null),p(t,at,m),p(t,lt,m),f(lt,ut),f(ut,ct),f(ut,ht),f(ut,dt),f(dt,ft),f(dt,pt),f(dt,mt),Mt&&Mt.m(mt,null),f(mt,gt),At&&At.m(mt,null),f(mt,_t),f(mt,vt),f(mt,yt),It.m(mt,null),f(mt,bt),f(mt,xt),f(mt,wt),zt[Tt].m(mt,null),Et=!0},p(t,e){(!Et||1&e)&&$t!==($t=(t[0].localname||`${pe(t[0].osm_type)} ${t[0].osm_id}`)+"")&&E(o,$t);const n={};1&e&&(n.feature=t[0]),4194304&e&&(n.$$scope={dirty:e,ctx:t}),a.$set(n);const i={};1&e&&(i.aPlace=t[0]),c.$set(i);const r={};4194305&e&&(r.$$scope={dirty:e,ctx:t}),w.$set(r);const s={};4194305&e&&(s.$$scope={dirty:e,ctx:t}),$.$set(s);const l={};4194305&e&&(l.$$scope={dirty:e,ctx:t}),k.$set(l),1&e&&(Lt=ye(t[0])),Lt?kt?(kt.p(t,e),1&e&&Y(kt,1)):(kt=li(t),kt.c(),Y(kt,1),kt.m(x,S)):kt&&(G(),X(kt,1,1,(()=>{kt=null})),K());const u={};4194305&e&&(u.$$scope={dirty:e,ctx:t}),M.$set(u);const h={};4194305&e&&(h.$$scope={dirty:e,ctx:t}),N.$set(h),t[0].calculated_importance?Pt?(Pt.p(t,e),1&e&&Y(Pt,1)):(Pt=di(t),Pt.c(),Y(Pt,1),Pt.m(x,I)):Pt&&(G(),X(Pt,1,1,(()=>{Pt=null})),K());const d={};4194305&e&&(d.$$scope={dirty:e,ctx:t}),O.$set(d);const f={};4194305&e&&(f.$$scope={dirty:e,ctx:t}),B.$set(f);const p={};4194305&e&&(p.$$scope={dirty:e,ctx:t}),R.$set(p);const m={};4194305&e&&(m.$$scope={dirty:e,ctx:t}),H.$set(m),t[0].calculated_wikipedia?St?(St.p(t,e),1&e&&Y(St,1)):(St=yi(t),St.c(),Y(St,1),St.m(x,F)):St&&(G(),X(St,1,1,(()=>{St=null})),K());const g={};4194305&e&&(g.$$scope={dirty:e,ctx:t}),W.$set(g);const _={};4194305&e&&(_.$$scope={dirty:e,ctx:t}),V.$set(_);const v={};4194305&e&&(v.$$scope={dirty:e,ctx:t}),nt.$set(v);const y={};1&e&&(y.current_result=t[0]),st.$set(y),t[0].address?Mt?(Mt.p(t,e),1&e&&Y(Mt,1)):(Mt=Ei(t),Mt.c(),Y(Mt,1),Mt.m(mt,gt)):Mt&&(G(),X(Mt,1,1,(()=>{Mt=null})),K()),t[0].linked_places?At?(At.p(t,e),1&e&&Y(At,1)):(At=Li(t),At.c(),Y(At,1),At.m(mt,_t)):At&&(G(),X(At,1,1,(()=>{At=null})),K()),Dt===(Dt=Nt(t))&&It?It.p(t,e):(It.d(1),It=Dt(t),It&&(It.c(),It.m(mt,bt)));let b=Tt;Tt=Bt(t),Tt===b?zt[Tt].p(t,e):(G(),X(zt[b],1,1,(()=>{zt[b]=null})),K(),Ct=zt[Tt],Ct?Ct.p(t,e):(Ct=zt[Tt]=Ot[Tt](t),Ct.c()),Y(Ct,1),Ct.m(mt,null))},i(t){Et||(Y(a.$$.fragment,t),Y(c.$$.fragment,t),Y(w.$$.fragment,t),Y($.$$.fragment,t),Y(k.$$.fragment,t),Y(kt),Y(M.$$.fragment,t),Y(N.$$.fragment,t),Y(Pt),Y(O.$$.fragment,t),Y(B.$$.fragment,t),Y(R.$$.fragment,t),Y(H.$$.fragment,t),Y(St),Y(W.$$.fragment,t),Y(V.$$.fragment,t),Y(nt.$$.fragment,t),Y(st.$$.fragment,t),Y(Mt),Y(At),Y(Ct),Et=!0)},o(t){X(a.$$.fragment,t),X(c.$$.fragment,t),X(w.$$.fragment,t),X($.$$.fragment,t),X(k.$$.fragment,t),X(kt),X(M.$$.fragment,t),X(N.$$.fragment,t),X(Pt),X(O.$$.fragment,t),X(B.$$.fragment,t),X(R.$$.fragment,t),X(H.$$.fragment,t),X(St),X(W.$$.fragment,t),X(V.$$.fragment,t),X(nt.$$.fragment,t),X(st.$$.fragment,t),X(Mt),X(At),X(Ct),Et=!1},d(t){t&&m(e),et(a),et(c),t&&m(h),t&&m(d),et(w),et($),et(k),kt&&kt.d(),et(M),et(N),Pt&&Pt.d(),et(O),et(B),et(R),et(H),St&&St.d(),et(W),et(V),et(nt),et(st),t&&m(at),t&&m(lt),Mt&&Mt.d(),At&&At.d(),It.d(),zt[Tt].d()}}}function ni(t){let e;return{c(){e=v("link to this page")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function ii(t){let e,n;return e=new Un({props:{items:t[0].names}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.items=t[0].names),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function oi(e){let n;return{c(){n=_("span"),n.textContent="No Name",C(n,"class","noname font-weight-bold")},m(t,e){p(t,n,e)},p:t,i:t,o:t,d(t){t&&m(n)}}}function ri(t){let e,n,i,o,r;const s=[oi,ii],a=[];function l(t,n){return 1&n&&(e=!!Array.isArray(t[0].names)),e?0:1}return n=l(t,-1),i=a[n]=s[n](t),{c(){i.c(),o=b()},m(t,e){a[n].m(t,e),p(t,o,e),r=!0},p(t,e){let r=n;n=l(t,e),n===r?a[n].p(t,e):(G(),X(a[r],1,1,(()=>{a[r]=null})),K(),i=a[n],i?i.p(t,e):(i=a[n]=s[n](t),i.c()),Y(i,1),i.m(o.parentNode,o))},i(t){r||(Y(i),r=!0)},o(t){X(i),r=!1},d(t){a[n].d(t),t&&m(o)}}}function si(t){let e,n,i,o=t[0].category+"",r=t[0].type+"";return{c(){e=v(o),n=v(":"),i=v(r)},m(t,o){p(t,e,o),p(t,n,o),p(t,i,o)},p(t,n){1&n&&o!==(o=t[0].category+"")&&E(e,o),1&n&&r!==(r=t[0].type+"")&&E(i,r)},d(t){t&&m(e),t&&m(n),t&&m(i)}}}function ai(t){let e,n=t[0].indexed_date+"";return{c(){e=v(n)},m(t,n){p(t,e,n)},p(t,i){1&i&&n!==(n=t[0].indexed_date+"")&&E(e,n)},d(t){t&&m(e)}}}function li(t){let e,n;return e=new Zn({props:{title:"Admin Level",$$slots:{default:[ui]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};4194305&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function ui(t){let e,n=t[0].admin_level+"";return{c(){e=v(n)},m(t,n){p(t,e,n)},p(t,i){1&i&&n!==(n=t[0].admin_level+"")&&E(e,n)},d(t){t&&m(e)}}}function ci(t){let e,n=t[0].rank_search+"";return{c(){e=v(n)},m(t,n){p(t,e,n)},p(t,i){1&i&&n!==(n=t[0].rank_search+"")&&E(e,n)},d(t){t&&m(e)}}}function hi(t){let e,n,i,o,r=t[0].rank_address+"",s=be(t[0].rank_address)+"";return{c(){e=v(r),n=v(" ("),i=v(s),o=v(")")},m(t,r){p(t,e,r),p(t,n,r),p(t,i,r),p(t,o,r)},p(t,n){1&n&&r!==(r=t[0].rank_address+"")&&E(e,r),1&n&&s!==(s=be(t[0].rank_address)+"")&&E(i,s)},d(t){t&&m(e),t&&m(n),t&&m(i),t&&m(o)}}}function di(t){let e,n;return e=new Zn({props:{title:"Importance",$$slots:{default:[pi]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};4194305&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function fi(t){let e;return{c(){e=v("(estimated)")},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function pi(t){let e,n,i,o=t[0].calculated_importance+"",r=!t[0].importance&&fi();return{c(){e=v(o),n=y(),r&&r.c(),i=b()},m(t,o){p(t,e,o),p(t,n,o),r&&r.m(t,o),p(t,i,o)},p(t,n){1&n&&o!==(o=t[0].calculated_importance+"")&&E(e,o),t[0].importance?r&&(r.d(1),r=null):r||(r=fi(),r.c(),r.m(i.parentNode,i))},d(t){t&&m(e),t&&m(n),r&&r.d(t),t&&m(i)}}}function mi(t){let e,n=ve(t[0])+"";return{c(){e=v(n)},m(t,n){p(t,e,n)},p(t,i){1&i&&n!==(n=ve(t[0])+"")&&E(e,n)},d(t){t&&m(e)}}}function gi(t){let e,n,i,o=t[0].centroid.coordinates[1]+"",r=t[0].centroid.coordinates[0]+"";return{c(){e=v(o),n=v(","),i=v(r)},m(t,o){p(t,e,o),p(t,n,o),p(t,i,o)},p(t,n){1&n&&o!==(o=t[0].centroid.coordinates[1]+"")&&E(e,o),1&n&&r!==(r=t[0].centroid.coordinates[0]+"")&&E(i,r)},d(t){t&&m(e),t&&m(n),t&&m(i)}}}function _i(t){let e,n,i=me(t[0])+"";return{c(){n=b(),e=new S(n)},m(t,o){e.m(i,t,o),p(t,n,o)},p(t,n){1&n&&i!==(i=me(t[0])+"")&&e.p(i)},d(t){t&&m(n),t&&e.d()}}}function vi(t){let e,n,i,o,r=t[0].place_id+"";return{c(){e=v(r),n=v("\n ("),i=_("a"),i.textContent="on this server",o=v(")"),C(i,"href","https://nominatim.org/release-docs/develop/api/Output/#place_id-is-not-a-persistent-id")},m(t,r){p(t,e,r),p(t,n,r),p(t,i,r),p(t,o,r)},p(t,n){1&n&&r!==(r=t[0].place_id+"")&&E(e,r)},d(t){t&&m(e),t&&m(n),t&&m(i),t&&m(o)}}}function yi(t){let e,n;return e=new Zn({props:{title:"Wikipedia Calculated",$$slots:{default:[bi]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};4194305&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function bi(t){let e,n,i=_e(t[0])+"";return{c(){n=b(),e=new S(n)},m(t,o){e.m(i,t,o),p(t,n,o)},p(t,n){1&n&&i!==(i=_e(t[0])+"")&&e.p(i)},d(t){t&&m(n),t&&e.d()}}}function xi(t){let e,n,i,o,r=t[0].calculated_postcode+"";return i=new Bn({props:{postcode:t[0].calculated_postcode,lat:t[0].centroid.coordinates[1],lon:t[0].centroid.coordinates[0]}}),{c(){e=v(r),n=y(),J(i.$$.fragment)},m(t,r){p(t,e,r),p(t,n,r),tt(i,t,r),o=!0},p(t,n){(!o||1&n)&&r!==(r=t[0].calculated_postcode+"")&&E(e,r);const s={};1&n&&(s.postcode=t[0].calculated_postcode),1&n&&(s.lat=t[0].centroid.coordinates[1]),1&n&&(s.lon=t[0].centroid.coordinates[0]),i.$set(s)},i(t){o||(Y(i.$$.fragment,t),o=!0)},o(t){X(i.$$.fragment,t),o=!1},d(t){t&&m(e),t&&m(n),et(i,t)}}}function wi(t){let e,n,i=t[0].calculated_postcode&&xi(t);return{c(){i&&i.c(),e=b()},m(t,o){i&&i.m(t,o),p(t,e,o),n=!0},p(t,n){t[0].calculated_postcode?i?(i.p(t,n),1&n&&Y(i,1)):(i=xi(t),i.c(),Y(i,1),i.m(e.parentNode,e)):i&&(G(),X(i,1,1,(()=>{i=null})),K())},i(t){n||(Y(i),n=!0)},o(t){X(i),n=!1},d(t){i&&i.d(t),t&&m(e)}}}function Ti(t){let e,n;return e=new Un({props:{items:t[0].addresstags}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.items=t[0].addresstags),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function Ci(t){let e,n;return e=new Un({props:{items:t[0].extratags}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.items=t[0].extratags),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function Ei(t){let e,n,i=t[0].address,o=[];for(let e=0;e<i.length;e+=1)o[e]=$i(Qn(t,i,e));const r=t=>X(o[t],1,1,(()=>{o[t]=null}));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=b()},m(t,i){for(let e=0;e<o.length;e+=1)o[e].m(t,i);p(t,e,i),n=!0},p(t,n){if(1&n){let s;for(i=t[0].address,s=0;s<i.length;s+=1){const r=Qn(t,i,s);o[s]?(o[s].p(r,n),Y(o[s],1)):(o[s]=$i(r),o[s].c(),Y(o[s],1),o[s].m(e.parentNode,e))}for(G(),s=i.length;s<o.length;s+=1)r(s);K()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)Y(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)X(o[t]);n=!1},d(t){g(o,t),t&&m(e)}}}function $i(t){let e,n;return e=new Nn({props:{addressLine:t[17],bMarkUnusedLines:"true",bDistanceInMeters:"false"}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.addressLine=t[17]),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function Li(t){let e,n,i,o,r=t[0].linked_places,s=[];for(let e=0;e<r.length;e+=1)s[e]=ki(Xn(t,r,e));const a=t=>X(s[t],1,1,(()=>{s[t]=null}));return{c(){e=_("tr"),e.innerHTML='<td colspan="6" class="svelte-dl2ttu"><h2 class="svelte-dl2ttu">Linked Places</h2></td>',n=y();for(let t=0;t<s.length;t+=1)s[t].c();i=b(),C(e,"class","all-columns svelte-dl2ttu")},m(t,r){p(t,e,r),p(t,n,r);for(let e=0;e<s.length;e+=1)s[e].m(t,r);p(t,i,r),o=!0},p(t,e){if(1&e){let n;for(r=t[0].linked_places,n=0;n<r.length;n+=1){const o=Xn(t,r,n);s[n]?(s[n].p(o,e),Y(s[n],1)):(s[n]=ki(o),s[n].c(),Y(s[n],1),s[n].m(i.parentNode,i))}for(G(),n=r.length;n<s.length;n+=1)a(n);K()}},i(t){if(!o){for(let t=0;t<r.length;t+=1)Y(s[t]);o=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)X(s[t]);o=!1},d(t){t&&m(e),t&&m(n),g(s,t),t&&m(i)}}}function ki(t){let e,n;return e=new Nn({props:{addressLine:t[17],bMarkUnusedLines:"true",bDistanceInMeters:"true"}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.addressLine=t[17]),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function Pi(t){let e,n,i,o,r;return{c(){e=_("tr"),n=_("td"),i=_("a"),o=v("display keywords"),C(i,"class","btn btn-outline-secondary btn-sm"),C(i,"href",r=t[1]+"&keywords=1")},m(t,r){p(t,e,r),f(e,n),f(n,i),f(i,o)},p(t,e){2&e&&r!==(r=t[1]+"&keywords=1")&&C(i,"href",r)},d(t){t&&m(e)}}}function Si(t){let e,n,i,o,r=t[0].keywords.name,s=[];for(let e=0;e<r.length;e+=1)s[e]=Ai(Yn(t,r,e));let a=t[0].keywords.address&&Ni(t);return{c(){e=_("tr"),e.innerHTML='<td colspan="6" class="svelte-dl2ttu"><h3 class="svelte-dl2ttu">Name Keywords</h3></td>',n=y();for(let t=0;t<s.length;t+=1)s[t].c();i=y(),a&&a.c(),o=b(),C(e,"class","all-columns svelte-dl2ttu")},m(t,r){p(t,e,r),p(t,n,r);for(let e=0;e<s.length;e+=1)s[e].m(t,r);p(t,i,r),a&&a.m(t,r),p(t,o,r)},p(t,e){if(1&e){let n;for(r=t[0].keywords.name,n=0;n<r.length;n+=1){const o=Yn(t,r,n);s[n]?s[n].p(o,e):(s[n]=Ai(o),s[n].c(),s[n].m(i.parentNode,i))}for(;n<s.length;n+=1)s[n].d(1);s.length=r.length}t[0].keywords.address?a?a.p(t,e):(a=Ni(t),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(t){t&&m(e),t&&m(n),g(s,t),t&&m(i),a&&a.d(t),t&&m(o)}}}function Mi(t){let e,n,i,o=t[12].id+"";return{c(){e=_("td"),n=v("word id: "),i=v(o)},m(t,o){p(t,e,o),f(e,n),f(e,i)},p(t,e){1&e&&o!==(o=t[12].id+"")&&E(i,o)},d(t){t&&m(e)}}}function Ai(t){let e,n,i,o,r=Ce(t[12].token)+"",s=t[12].id&&Mi(t);return{c(){e=_("tr"),n=_("td"),i=v(r),o=y(),s&&s.c()},m(t,r){p(t,e,r),f(e,n),f(n,i),f(e,o),s&&s.m(e,null)},p(t,n){1&n&&r!==(r=Ce(t[12].token)+"")&&E(i,r),t[12].id?s?s.p(t,n):(s=Mi(t),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(t){t&&m(e),s&&s.d()}}}function Ni(t){let e,n,i,o=t[0].keywords.address,r=[];for(let e=0;e<o.length;e+=1)r[e]=Ii(Kn(t,o,e));return{c(){e=_("tr"),e.innerHTML='<td colspan="6" class="svelte-dl2ttu"><h3 class="svelte-dl2ttu">Address Keywords</h3></td>',n=y();for(let t=0;t<r.length;t+=1)r[t].c();i=b(),C(e,"class","all-columns svelte-dl2ttu")},m(t,o){p(t,e,o),p(t,n,o);for(let e=0;e<r.length;e+=1)r[e].m(t,o);p(t,i,o)},p(t,e){if(1&e){let n;for(o=t[0].keywords.address,n=0;n<o.length;n+=1){const s=Kn(t,o,n);r[n]?r[n].p(s,e):(r[n]=Ii(s),r[n].c(),r[n].m(i.parentNode,i))}for(;n<r.length;n+=1)r[n].d(1);r.length=o.length}},d(t){t&&m(e),t&&m(n),g(r,t),t&&m(i)}}}function Di(t){let e,n,i,o=t[12].id+"";return{c(){e=_("td"),n=v("word id: "),i=v(o)},m(t,o){p(t,e,o),f(e,n),f(e,i)},p(t,e){1&e&&o!==(o=t[12].id+"")&&E(i,o)},d(t){t&&m(e)}}}function Ii(t){let e,n,i,o,r,s=Ce(t[12].token)+"",a=t[12].id&&Di(t);return{c(){e=_("tr"),n=_("td"),i=v(s),o=y(),a&&a.c(),r=y()},m(t,s){p(t,e,s),f(e,n),f(n,i),f(e,o),a&&a.m(e,null),f(e,r)},p(t,n){1&n&&s!==(s=Ce(t[12].token)+"")&&E(i,s),t[12].id?a?a.p(t,n):(a=Di(t),a.c(),a.m(e,r)):a&&(a.d(1),a=null)},d(t){t&&m(e),a&&a.d()}}}function Oi(e){let n,i,o,r,s;return{c(){n=_("tr"),i=_("td"),o=_("a"),r=v("display child places"),C(o,"class","btn btn-outline-secondary btn-sm"),C(o,"href",s=e[1]+"&hierarchy=1")},m(t,e){p(t,n,e),f(n,i),f(i,o),f(o,r)},p(t,e){2&e&&s!==(s=t[1]+"&hierarchy=1")&&C(o,"href",s)},i:t,o:t,d(t){t&&m(n)}}}function zi(t){let e,n,i,o=Object.keys(t[0].hierarchy)>500,r=Object.keys(t[0].hierarchy),s=[];for(let e=0;e<r.length;e+=1)s[e]=ji(Vn(t,r,e));const a=t=>X(s[t],1,1,(()=>{s[t]=null}));let l=o&&Ri();return{c(){for(let t=0;t<s.length;t+=1)s[t].c();e=y(),l&&l.c(),n=b()},m(t,o){for(let e=0;e<s.length;e+=1)s[e].m(t,o);p(t,e,o),l&&l.m(t,o),p(t,n,o),i=!0},p(t,i){if(1&i){let n;for(r=Object.keys(t[0].hierarchy),n=0;n<r.length;n+=1){const o=Vn(t,r,n);s[n]?(s[n].p(o,i),Y(s[n],1)):(s[n]=ji(o),s[n].c(),Y(s[n],1),s[n].m(e.parentNode,e))}for(G(),n=r.length;n<s.length;n+=1)a(n);K()}1&i&&(o=Object.keys(t[0].hierarchy)>500),o?l||(l=Ri(),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i(t){if(!i){for(let t=0;t<r.length;t+=1)Y(s[t]);i=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)X(s[t]);i=!1},d(t){g(s,t),t&&m(e),l&&l.d(t),t&&m(n)}}}function Bi(t){let e,n;return e=new Nn({props:{addressLine:t[9],bDistanceInMeters:"true"}}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.addressLine=t[9]),e.$set(i)},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function ji(t){let e,n,i,o,r,s,a,l=t[6]+"",u=t[0].hierarchy[t[6]],c=[];for(let e=0;e<u.length;e+=1)c[e]=Bi(Gn(t,u,e));const h=t=>X(c[t],1,1,(()=>{c[t]=null}));return{c(){e=_("tr"),n=_("td"),i=_("h3"),o=v(l),r=y();for(let t=0;t<c.length;t+=1)c[t].c();s=b(),C(i,"class","svelte-dl2ttu"),C(n,"colspan","6"),C(n,"class","svelte-dl2ttu"),C(e,"class","all-columns svelte-dl2ttu")},m(t,l){p(t,e,l),f(e,n),f(n,i),f(i,o),p(t,r,l);for(let e=0;e<c.length;e+=1)c[e].m(t,l);p(t,s,l),a=!0},p(t,e){if((!a||1&e)&&l!==(l=t[6]+"")&&E(o,l),1&e){let n;for(u=t[0].hierarchy[t[6]],n=0;n<u.length;n+=1){const i=Gn(t,u,n);c[n]?(c[n].p(i,e),Y(c[n],1)):(c[n]=Bi(i),c[n].c(),Y(c[n],1),c[n].m(s.parentNode,s))}for(G(),n=u.length;n<c.length;n+=1)h(n);K()}},i(t){if(!a){for(let t=0;t<u.length;t+=1)Y(c[t]);a=!0}},o(t){c=c.filter(Boolean);for(let t=0;t<c.length;t+=1)X(c[t]);a=!1},d(t){t&&m(e),t&&m(r),g(c,t),t&&m(s)}}}function Ri(t){let e;return{c(){e=_("p"),e.textContent="There are more child objects which are not shown."},m(t,n){p(t,e,n)},d(t){t&&m(e)}}}function Zi(t){let e,n,i,o,r,s;e=new te({props:{$$slots:{default:[Jn]},$$scope:{ctx:t}}});const a=[ei,ti],l=[];function u(t,e){return t[0]?0:""!==window.location.search&&t[3]?1:-1}return~(o=u(t))&&(r=l[o]=a[o](t)),{c(){J(e.$$.fragment),n=y(),i=_("div"),r&&r.c(),C(i,"class","container")},m(t,r){tt(e,t,r),p(t,n,r),p(t,i,r),~o&&l[o].m(i,null),s=!0},p(t,[n]){const s={};4194308&n&&(s.$$scope={dirty:n,ctx:t}),e.$set(s);let c=o;o=u(t),o===c?~o&&l[o].p(t,n):(r&&(G(),X(l[c],1,1,(()=>{l[c]=null})),K()),~o?(r=l[o],r?r.p(t,n):(r=l[o]=a[o](t),r.c()),Y(r,1),r.m(i,null)):r=null)},i(t){s||(Y(e.$$.fragment,t),Y(r),s=!0)},o(t){X(e.$$.fragment,t),X(r),s=!1},d(t){et(e,t),t&&m(n),t&&m(i),~o&&l[o].d()}}}function Hi(t,e,n){let i,o,r,s;u(t,pt,(t=>n(4,i=t)));let a=!1;return t.$$.update=()=>{if(16&t.$$.dirty){let t=i;"details"===t.tab&&(e=t.params,n(2,s={place_id:e.get("place_id"),osmtype:e.get("osmtype"),osmid:e.get("osmid"),class:e.get("class"),keywords:e.get("keywords"),addressdetails:1,hierarchy:"1"===e.get("hierarchy")?1:0,group_hierarchy:1,polygon_geojson:1,format:"json"}),n(3,a=!1),s.place_id||s.osmtype&&s.osmid?(s.place_id?Tt("Details for "+s.place_id):Tt("Details for "+s.osmtype+s.osmid),bt("details",s,(function(t){window.scrollTo(0,0),n(3,a=!0),n(0,o=t&&!t.error?t:void 0)}))):n(0,o=void 0),n(1,r=window.location.search))}var e},[o,r,s,a,i]}class qi extends ot{constructor(t){super(),it(this,t,Hi,Zi,s,{})}}function Fi(t,e,n){const i=t.slice();return i[2]=e[n],i}function Wi(t){let e,n,i,o,r,s,a,l,u,c,h,d,g,b,x,w,T,$,L,k,P,S,M,A,N,D,I,O,z,B=t[2].osm_type+"",j=me(t[2])+"",R=t[2].class+"",Z=t[2].type+"",H=t[2].name+"",q=(t[2].country_code||"")+"",F=t[2].errormessage+"",W=t[2].updated+"";return{c(){e=_("tr"),n=_("td"),i=v(B),o=y(),r=_("td"),s=y(),a=_("td"),l=v(R),u=y(),c=_("td"),h=v(Z),d=y(),g=_("td"),b=v(H),x=y(),w=_("td"),T=v(q),$=y(),L=_("td"),k=v(F),P=y(),S=_("td"),M=v(W),A=y(),N=_("td"),D=_("a"),I=v("josm"),z=y(),C(D,"href",O="http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/"+pe(t[2].osm_type)+"/"+t[2].osm_id+"/full"),C(D,"target","josm")},m(t,m){p(t,e,m),f(e,n),f(n,i),f(e,o),f(e,r),r.innerHTML=j,f(e,s),f(e,a),f(a,l),f(e,u),f(e,c),f(c,h),f(e,d),f(e,g),f(g,b),f(e,x),f(e,w),f(w,T),f(e,$),f(e,L),f(L,k),f(e,P),f(e,S),f(S,M),f(e,A),f(e,N),f(N,D),f(D,I),f(e,z)},p(t,e){1&e&&B!==(B=t[2].osm_type+"")&&E(i,B),1&e&&j!==(j=me(t[2])+"")&&(r.innerHTML=j),1&e&&R!==(R=t[2].class+"")&&E(l,R),1&e&&Z!==(Z=t[2].type+"")&&E(h,Z),1&e&&H!==(H=t[2].name+"")&&E(b,H),1&e&&q!==(q=(t[2].country_code||"")+"")&&E(T,q),1&e&&F!==(F=t[2].errormessage+"")&&E(k,F),1&e&&W!==(W=t[2].updated+"")&&E(M,W),1&e&&O!==(O="http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/"+pe(t[2].osm_type)+"/"+t[2].osm_id+"/full")&&C(D,"href",O)},d(t){t&&m(e)}}}function Ui(t){let e,n,i,o,r,s,a,l,u,c,h,d,b,x,w,T,$,L=t[0].length+"";e=new te({});let k=t[0],P=[];for(let e=0;e<k.length;e+=1)P[e]=Wi(Fi(t,k,e));return{c(){J(e.$$.fragment),n=y(),i=_("div"),o=_("div"),r=_("div"),s=_("h1"),s.textContent="Broken polygons",a=y(),l=_("p"),u=v("Total number of broken polygons: "),c=v(L),h=v("."),d=y(),b=_("table"),x=_("thead"),x.innerHTML="<th>OSM type</th> \n <th>OSM id</th> \n <th>Class</th> \n <th>Type</th> \n <th>Name</th> \n <th>Country Code</th> \n <th>Error message</th> \n <th>Updated</th> \n <th></th>",w=y(),T=_("tbody");for(let t=0;t<P.length;t+=1)P[t].c();C(b,"class","table table-striped table-hover"),C(r,"class","col-sm-12"),C(o,"class","row"),C(i,"class","container")},m(t,m){tt(e,t,m),p(t,n,m),p(t,i,m),f(i,o),f(o,r),f(r,s),f(r,a),f(r,l),f(l,u),f(l,c),f(l,h),f(r,d),f(r,b),f(b,x),f(b,w),f(b,T);for(let t=0;t<P.length;t+=1)P[t].m(T,null);$=!0},p(t,[e]){if((!$||1&e)&&L!==(L=t[0].length+"")&&E(c,L),1&e){let n;for(k=t[0],n=0;n<k.length;n+=1){const i=Fi(t,k,n);P[n]?P[n].p(i,e):(P[n]=Wi(i),P[n].c(),P[n].m(T,null))}for(;n<P.length;n+=1)P[n].d(1);P.length=k.length}},i(t){$||(Y(e.$$.fragment,t),$=!0)},o(t){X(e.$$.fragment,t),$=!1},d(t){et(e,t),t&&m(n),t&&m(i),g(P,t)}}}function Vi(t,e,n){let i=[];return N((function(){bt("polygons",{format:"json"},(function(t){n(0,i=t)})),Tt("Broken polygons")})),[i]}class Gi extends ot{constructor(t){super(),it(this,t,Vi,Ui,s,{})}}function Ki(t,e,n){const i=t.slice();return i[2]=e[n],i}function Yi(t){let e,n=t[2].place_id+"";return{c(){e=v(n)},m(t,n){p(t,e,n)},p(t,i){1&i&&n!==(n=t[2].place_id+"")&&E(e,n)},d(t){t&&m(e)}}}function Xi(t){let e,n,i,o,r,s,a,l,u,c,h,d,g,b,x,w,T,C,$,L,k,P,S=t[2].country_code+"",M=t[2].name+"",A=me(t[2])+"",N=t[2].osm_type+"",D=t[2].class+"",I=t[2].type+"";return i=new Pe({props:{feature:t[2],$$slots:{default:[Yi]},$$scope:{ctx:t}}}),{c(){e=_("tr"),n=_("td"),J(i.$$.fragment),o=y(),r=_("td"),s=v(S),a=y(),l=_("td"),u=v(M),c=y(),h=_("td"),d=y(),g=_("td"),b=v(N),x=y(),w=_("td"),T=v(D),C=y(),$=_("td"),L=v(I),k=y()},m(t,m){p(t,e,m),f(e,n),tt(i,n,null),f(e,o),f(e,r),f(r,s),f(e,a),f(e,l),f(l,u),f(e,c),f(e,h),h.innerHTML=A,f(e,d),f(e,g),f(g,b),f(e,x),f(e,w),f(w,T),f(e,C),f(e,$),f($,L),f(e,k),P=!0},p(t,e){const n={};1&e&&(n.feature=t[2]),33&e&&(n.$$scope={dirty:e,ctx:t}),i.$set(n),(!P||1&e)&&S!==(S=t[2].country_code+"")&&E(s,S),(!P||1&e)&&M!==(M=t[2].name+"")&&E(u,M),(!P||1&e)&&A!==(A=me(t[2])+"")&&(h.innerHTML=A),(!P||1&e)&&N!==(N=t[2].osm_type+"")&&E(b,N),(!P||1&e)&&D!==(D=t[2].class+"")&&E(T,D),(!P||1&e)&&I!==(I=t[2].type+"")&&E(L,I)},i(t){P||(Y(i.$$.fragment,t),P=!0)},o(t){X(i.$$.fragment,t),P=!1},d(t){t&&m(e),et(i)}}}function Qi(t){let e,n,i,o,r,s,a,l,u,c,h,d,b,x,w,T,$=t[0].length+"";e=new te({});let L=t[0],k=[];for(let e=0;e<L.length;e+=1)k[e]=Xi(Ki(t,L,e));const P=t=>X(k[t],1,1,(()=>{k[t]=null}));return{c(){J(e.$$.fragment),n=y(),i=_("div"),o=_("div"),r=_("div"),s=_("h1"),s.textContent="Deletable",a=y(),l=_("p"),u=v($),c=v(" objects have been deleted in OSM but are still in the Nominatim database."),h=y(),d=_("table"),b=_("thead"),b.innerHTML="<th>Place id</th> \n <th>Country Code</th> \n <th>Name</th> \n <th>OSM id</th> \n <th>OSM type</th> \n <th>Class</th> \n <th>Type</th>",x=y(),w=_("tbody");for(let t=0;t<k.length;t+=1)k[t].c();C(d,"class","table table-striped table-hover"),C(r,"class","col-sm-12"),C(o,"class","row"),C(i,"class","container")},m(t,m){tt(e,t,m),p(t,n,m),p(t,i,m),f(i,o),f(o,r),f(r,s),f(r,a),f(r,l),f(l,u),f(l,c),f(r,h),f(r,d),f(d,b),f(d,x),f(d,w);for(let t=0;t<k.length;t+=1)k[t].m(w,null);T=!0},p(t,[e]){if((!T||1&e)&&$!==($=t[0].length+"")&&E(u,$),1&e){let n;for(L=t[0],n=0;n<L.length;n+=1){const i=Ki(t,L,n);k[n]?(k[n].p(i,e),Y(k[n],1)):(k[n]=Xi(i),k[n].c(),Y(k[n],1),k[n].m(w,null))}for(G(),n=L.length;n<k.length;n+=1)P(n);K()}},i(t){if(!T){Y(e.$$.fragment,t);for(let t=0;t<L.length;t+=1)Y(k[t]);T=!0}},o(t){X(e.$$.fragment,t),k=k.filter(Boolean);for(let t=0;t<k.length;t+=1)X(k[t]);T=!1},d(t){et(e,t),t&&m(n),t&&m(i),g(k,t)}}}function Ji(t,e,n){let i=[];return N((function(){bt("deletable",{format:"json"},(function(t){n(0,i=t)})),Tt("Deletable objects")})),[i]}class to extends ot{constructor(t){super(),it(this,t,Ji,Qi,s,{})}}function eo(t){let e,n,i,o,r,s,a,l,u,c,h,d,g,b,x,w,T,$,L,k,P,S,M=t[1].Nominatim_API_Endpoint+"",A=t[0].software_version+"",N=t[0].database_version+"",D=t[0].data_updated+"";return e=new te({}),{c(){J(e.$$.fragment),n=y(),i=_("div"),o=_("div"),r=_("div"),s=_("h1"),s.textContent="Server status",a=y(),l=_("dl"),u=_("dt"),u.textContent="API Endpoint",c=_("dd"),h=_("a"),d=v(M),g=_("dt"),g.textContent="Software version",b=_("dd"),x=v(A),w=_("dt"),w.textContent="Database version",T=_("dd"),$=v(N),L=_("dt"),L.textContent="Data last updated",k=_("dd"),P=v(D),C(h,"href",t[1].Nominatim_API_Endpoint),C(r,"class","col-sm-12"),C(o,"class","row"),C(i,"class","container")},m(t,m){tt(e,t,m),p(t,n,m),p(t,i,m),f(i,o),f(o,r),f(r,s),f(r,a),f(r,l),f(l,u),f(l,c),f(c,h),f(h,d),f(l,g),f(l,b),f(b,x),f(l,w),f(l,T),f(T,$),f(l,L),f(l,k),f(k,P),S=!0},p(t,[e]){(!S||1&e)&&A!==(A=t[0].software_version+"")&&E(x,A),(!S||1&e)&&N!==(N=t[0].database_version+"")&&E($,N),(!S||1&e)&&D!==(D=t[0].data_updated+"")&&E(P,D)},i(t){S||(Y(e.$$.fragment,t),S=!0)},o(t){X(e.$$.fragment,t),S=!1},d(t){et(e,t),t&&m(n),t&&m(i)}}}function no(t,e,n){let i={},o=Nominatim_Config;return N((function(){bt("status",{format:"json"},(function(t){n(0,i=t)})),Tt("Server status")})),[i,o]}class io extends ot{constructor(t){super(),it(this,t,no,eo,s,{})}}function oo(e){let n,i,o,r;return n=new te({}),{c(){J(n.$$.fragment),i=y(),o=_("div"),C(o,"id","about-help"),C(o,"class","container svelte-1l5yrvt")},m(t,e){tt(n,t,e),p(t,i,e),p(t,o,e),r=!0},p:t,i(t){r||(Y(n.$$.fragment,t),r=!0)},o(t){X(n.$$.fragment,t),r=!1},d(t){et(n,t),t&&m(i),t&&m(o)}}}function ro(t){return N((()=>{wt("theme/about-help.html",document.getElementById("about-help"))})),[]}class so extends ot{constructor(t){super(),it(this,t,ro,oo,s,{})}}function ao(t){let e,n;return e=new so({}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function lo(t){let e,n;return e=new io({}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function uo(t){let e,n;return e=new Gi({}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function co(t){let e,n;return e=new to({}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function ho(t){let e,n;return e=new qi({}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function fo(t){let e,n;return e=new yn({}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function po(t){let e,n;return e=new ln({}),{c(){J(e.$$.fragment)},m(t,i){tt(e,t,i),n=!0},i(t){n||(Y(e.$$.fragment,t),n=!0)},o(t){X(e.$$.fragment,t),n=!1},d(t){et(e,t)}}}function mo(t){let e,n,i,o,r,s,a;const l=[po,fo,ho,co,uo,lo,ao],u=[];function c(t,e){return"search"===t[0]?0:"reverse"===t[0]?1:"details"===t[0]?2:"deletable"===t[0]?3:"polygons"===t[0]?4:"status"===t[0]?5:"about"===t[0]?6:-1}return~(e=c(t))&&(n=u[e]=l[e](t)),o=new vt({}),{c(){n&&n.c(),i=y(),J(o.$$.fragment)},m(n,l){~e&&u[e].m(n,l),p(n,i,l),tt(o,n,l),r=!0,s||(a=x(window,"popstate",t[2]),s=!0)},p(t,[o]){let r=e;e=c(t),e!==r&&(n&&(G(),X(u[r],1,1,(()=>{u[r]=null})),K()),~e?(n=u[e],n||(n=u[e]=l[e](t),n.c()),Y(n,1),n.m(i.parentNode,i)):n=null)},i(t){r||(Y(n),Y(o.$$.fragment,t),r=!0)},o(t){X(n),X(o.$$.fragment,t),r=!1},d(t){~e&&u[e].d(t),t&&m(i),et(o,t),s=!1,a()}}}function go(t,e,n){let i,o;u(t,pt,(t=>n(1,o=t))),gt();return t.$$.update=()=>{2&t.$$.dirty&&n(0,i=o.tab)},[i,o,()=>gt()]}new class extends ot{constructor(t){super(),it(this,t,go,mo,s,{})}}({target:document.body})}();
//# sourceMappingURL=bundle.js.map