{
  "version": 3,
  "sources": ["../../../node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/@rails/actioncable/src/index.js", "../../../node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/@popperjs/core/lib/modifiers/index.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/@popperjs/core/lib/popper-lite.js", "../../../node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/@popperjs/core/lib/index.js", "../../../node_modules/leaflet/src/core/Util.js", "../../../node_modules/leaflet/src/core/Class.js", "../../../node_modules/leaflet/src/core/Events.js", "../../../node_modules/leaflet/src/geometry/Point.js", "../../../node_modules/leaflet/src/geometry/Bounds.js", "../../../node_modules/leaflet/src/geo/LatLngBounds.js", "../../../node_modules/leaflet/src/geo/LatLng.js", "../../../node_modules/leaflet/src/geo/crs/CRS.js", "../../../node_modules/leaflet/src/geo/crs/CRS.Earth.js", "../../../node_modules/leaflet/src/geo/projection/Projection.SphericalMercator.js", "../../../node_modules/leaflet/src/geometry/Transformation.js", "../../../node_modules/leaflet/src/geo/crs/CRS.EPSG3857.js", "../../../node_modules/leaflet/src/layer/vector/SVG.Util.js", "../../../node_modules/leaflet/src/core/Browser.js", "../../../node_modules/leaflet/src/dom/DomEvent.Pointer.js", "../../../node_modules/leaflet/src/dom/DomEvent.DoubleTap.js", "../../../node_modules/leaflet/src/dom/DomUtil.js", "../../../node_modules/leaflet/src/dom/DomEvent.js", "../../../node_modules/leaflet/src/dom/PosAnimation.js", "../../../node_modules/leaflet/src/map/Map.js", "../../../node_modules/leaflet/src/control/Control.js", "../../../node_modules/leaflet/src/control/Control.Layers.js", "../../../node_modules/leaflet/src/control/Control.Zoom.js", "../../../node_modules/leaflet/src/control/Control.Scale.js", "../../../node_modules/leaflet/src/control/Control.Attribution.js", "../../../node_modules/leaflet/src/control/index.js", "../../../node_modules/leaflet/src/core/Handler.js", "../../../node_modules/leaflet/src/core/index.js", "../../../node_modules/leaflet/src/dom/Draggable.js", "../../../node_modules/leaflet/src/geometry/PolyUtil.js", "../../../node_modules/leaflet/src/geometry/LineUtil.js", "../../../node_modules/leaflet/src/geo/projection/Projection.LonLat.js", "../../../node_modules/leaflet/src/geo/projection/Projection.Mercator.js", "../../../node_modules/leaflet/src/geo/projection/index.js", "../../../node_modules/leaflet/src/geo/crs/CRS.EPSG3395.js", "../../../node_modules/leaflet/src/geo/crs/CRS.EPSG4326.js", "../../../node_modules/leaflet/src/geo/crs/CRS.Simple.js", "../../../node_modules/leaflet/src/geo/crs/index.js", "../../../node_modules/leaflet/src/layer/Layer.js", "../../../node_modules/leaflet/src/layer/LayerGroup.js", "../../../node_modules/leaflet/src/layer/FeatureGroup.js", "../../../node_modules/leaflet/src/layer/marker/Icon.js", "../../../node_modules/leaflet/src/layer/marker/Icon.Default.js", "../../../node_modules/leaflet/src/layer/marker/Marker.Drag.js", "../../../node_modules/leaflet/src/layer/marker/Marker.js", "../../../node_modules/leaflet/src/layer/vector/Path.js", "../../../node_modules/leaflet/src/layer/vector/CircleMarker.js", "../../../node_modules/leaflet/src/layer/vector/Circle.js", "../../../node_modules/leaflet/src/layer/vector/Polyline.js", "../../../node_modules/leaflet/src/layer/vector/Polygon.js", "../../../node_modules/leaflet/src/layer/GeoJSON.js", "../../../node_modules/leaflet/src/layer/ImageOverlay.js", "../../../node_modules/leaflet/src/layer/VideoOverlay.js", "../../../node_modules/leaflet/src/layer/SVGOverlay.js", "../../../node_modules/leaflet/src/layer/DivOverlay.js", "../../../node_modules/leaflet/src/layer/Popup.js", "../../../node_modules/leaflet/src/layer/Tooltip.js", "../../../node_modules/leaflet/src/layer/marker/DivIcon.js", "../../../node_modules/leaflet/src/layer/marker/index.js", "../../../node_modules/leaflet/src/layer/tile/GridLayer.js", "../../../node_modules/leaflet/src/layer/tile/TileLayer.js", "../../../node_modules/leaflet/src/layer/tile/TileLayer.WMS.js", "../../../node_modules/leaflet/src/layer/tile/index.js", "../../../node_modules/leaflet/src/layer/vector/Renderer.js", "../../../node_modules/leaflet/src/layer/vector/Canvas.js", "../../../node_modules/leaflet/src/layer/vector/SVG.VML.js", "../../../node_modules/leaflet/src/layer/vector/SVG.js", "../../../node_modules/leaflet/src/layer/vector/Renderer.getRenderer.js", "../../../node_modules/leaflet/src/layer/vector/Rectangle.js", "../../../node_modules/leaflet/src/layer/vector/index.js", "../../../node_modules/leaflet/src/layer/index.js", "../../../node_modules/leaflet/src/map/handler/Map.BoxZoom.js", "../../../node_modules/leaflet/src/map/handler/Map.DoubleClickZoom.js", "../../../node_modules/leaflet/src/map/handler/Map.Drag.js", "../../../node_modules/leaflet/src/map/handler/Map.Keyboard.js", "../../../node_modules/leaflet/src/map/handler/Map.ScrollWheelZoom.js", "../../../node_modules/leaflet/src/map/handler/Map.TapHold.js", "../../../node_modules/leaflet/src/map/handler/Map.TouchZoom.js", "../../../node_modules/leaflet/src/map/index.js", "../../../node_modules/pdfobject/pdfobject.js", "../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../../node_modules/choices.js/public/assets/scripts/choices.mjs", "../../javascript/controllers/choices_controller.js", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/errors.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/namespace.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-format-localization.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/datetime.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/service-locator.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/calendar-modes.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionsStore.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/validation.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-emitter.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-options.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/typeChecker.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionProcessor.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionConverter.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/dates.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/action-types.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/date-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/month-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/year-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/decade-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/time-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/hour-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/minute-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/second-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/collapse.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/index.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/actions.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/tempus-dominus.ts", "../../javascript/libs/tempus-dominus.js", "../../javascript/controllers/datepicker_controller.js", "../../javascript/controllers/datepicker_range_controller.js", "../../javascript/controllers/form_submit_controller.js", "../../javascript/controllers/hello_controller.js", "../../javascript/controllers/map_controller.js", "../../../node_modules/bootstrap/js/src/dom/data.js", "../../../node_modules/bootstrap/js/src/util/index.js", "../../../node_modules/bootstrap/js/src/dom/event-handler.js", "../../../node_modules/bootstrap/js/src/dom/manipulator.js", "../../../node_modules/bootstrap/js/src/util/config.js", "../../../node_modules/bootstrap/js/src/base-component.js", "../../../node_modules/bootstrap/js/src/dom/selector-engine.js", "../../../node_modules/bootstrap/js/src/util/component-functions.js", "../../../node_modules/bootstrap/js/src/alert.js", "../../../node_modules/bootstrap/js/src/button.js", "../../../node_modules/bootstrap/js/src/util/swipe.js", "../../../node_modules/bootstrap/js/src/carousel.js", "../../../node_modules/bootstrap/js/src/collapse.js", "../../../node_modules/bootstrap/js/src/dropdown.js", "../../../node_modules/bootstrap/js/src/util/backdrop.js", "../../../node_modules/bootstrap/js/src/util/focustrap.js", "../../../node_modules/bootstrap/js/src/util/scrollbar.js", "../../../node_modules/bootstrap/js/src/modal.js", "../../../node_modules/bootstrap/js/src/offcanvas.js", "../../../node_modules/bootstrap/js/src/util/sanitizer.js", "../../../node_modules/bootstrap/js/src/util/template-factory.js", "../../../node_modules/bootstrap/js/src/tooltip.js", "../../../node_modules/bootstrap/js/src/popover.js", "../../../node_modules/bootstrap/js/src/scrollspy.js", "../../../node_modules/bootstrap/js/src/tab.js", "../../../node_modules/bootstrap/js/src/toast.js", "../../javascript/controllers/modal_controller.js", "../../javascript/controllers/pdf_object_controller.js", "../../javascript/controllers/redirect_controller.js", "../../javascript/controllers/toggle_class_controller.js", "../../javascript/controllers/tooltip_controller.js", "../../javascript/controllers/index.js", "../../javascript/config/cookiebot.js"],
  "sourcesContent": ["export default {\n  logger: self.console,\n  WebSocket: self.WebSocket\n}\n", "import adapters from \"./adapters\"\n\n// The logger is disabled by default. You can enable it with:\n//\n//   ActionCable.logger.enabled = true\n//\n//   Example:\n//\n//   import * as ActionCable from '@rails/actioncable'\n//\n//   ActionCable.logger.enabled = true\n//   ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n  log(...messages) {\n    if (this.enabled) {\n      messages.push(Date.now())\n      adapters.logger.log(\"[ActionCable]\", ...messages)\n    }\n  },\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n  constructor(connection) {\n    this.visibilityDidChange = this.visibilityDidChange.bind(this)\n    this.connection = connection\n    this.reconnectAttempts = 0\n  }\n\n  start() {\n    if (!this.isRunning()) {\n      this.startedAt = now()\n      delete this.stoppedAt\n      this.startPolling()\n      addEventListener(\"visibilitychange\", this.visibilityDidChange)\n      logger.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`)\n    }\n  }\n\n  stop() {\n    if (this.isRunning()) {\n      this.stoppedAt = now()\n      this.stopPolling()\n      removeEventListener(\"visibilitychange\", this.visibilityDidChange)\n      logger.log(\"ConnectionMonitor stopped\")\n    }\n  }\n\n  isRunning() {\n    return this.startedAt && !this.stoppedAt\n  }\n\n  recordPing() {\n    this.pingedAt = now()\n  }\n\n  recordConnect() {\n    this.reconnectAttempts = 0\n    this.recordPing()\n    delete this.disconnectedAt\n    logger.log(\"ConnectionMonitor recorded connect\")\n  }\n\n  recordDisconnect() {\n    this.disconnectedAt = now()\n    logger.log(\"ConnectionMonitor recorded disconnect\")\n  }\n\n  // Private\n\n  startPolling() {\n    this.stopPolling()\n    this.poll()\n  }\n\n  stopPolling() {\n    clearTimeout(this.pollTimeout)\n  }\n\n  poll() {\n    this.pollTimeout = setTimeout(() => {\n      this.reconnectIfStale()\n      this.poll()\n    }\n    , this.getPollInterval())\n  }\n\n  getPollInterval() {\n    const { staleThreshold, reconnectionBackoffRate } = this.constructor\n    const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n    const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n    const jitter = jitterMax * Math.random()\n    return staleThreshold * 1000 * backoff * (1 + jitter)\n  }\n\n  reconnectIfStale() {\n    if (this.connectionIsStale()) {\n      logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n      this.reconnectAttempts++\n      if (this.disconnectedRecently()) {\n        logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n      } else {\n        logger.log(\"ConnectionMonitor reopening\")\n        this.connection.reopen()\n      }\n    }\n  }\n\n  get refreshedAt() {\n    return this.pingedAt ? this.pingedAt : this.startedAt\n  }\n\n  connectionIsStale() {\n    return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n  }\n\n  disconnectedRecently() {\n    return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n  }\n\n  visibilityDidChange() {\n    if (document.visibilityState === \"visible\") {\n      setTimeout(() => {\n        if (this.connectionIsStale() || !this.connection.isOpen()) {\n          logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n          this.connection.reopen()\n        }\n      }\n      , 200)\n    }\n  }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "export default {\n  \"message_types\": {\n    \"welcome\": \"welcome\",\n    \"disconnect\": \"disconnect\",\n    \"ping\": \"ping\",\n    \"confirmation\": \"confirm_subscription\",\n    \"rejection\": \"reject_subscription\"\n  },\n  \"disconnect_reasons\": {\n    \"unauthorized\": \"unauthorized\",\n    \"invalid_request\": \"invalid_request\",\n    \"server_restart\": \"server_restart\",\n    \"remote\": \"remote\"\n  },\n  \"default_mount_path\": \"/cable\",\n  \"protocols\": [\n    \"actioncable-v1-json\",\n    \"actioncable-unsupported\"\n  ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n  constructor(consumer) {\n    this.open = this.open.bind(this)\n    this.consumer = consumer\n    this.subscriptions = this.consumer.subscriptions\n    this.monitor = new ConnectionMonitor(this)\n    this.disconnected = true\n  }\n\n  send(data) {\n    if (this.isOpen()) {\n      this.webSocket.send(JSON.stringify(data))\n      return true\n    } else {\n      return false\n    }\n  }\n\n  open() {\n    if (this.isActive()) {\n      logger.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`)\n      return false\n    } else {\n      const socketProtocols = [...protocols, ...this.consumer.subprotocols || []]\n      logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${socketProtocols}`)\n      if (this.webSocket) { this.uninstallEventHandlers() }\n      this.webSocket = new adapters.WebSocket(this.consumer.url, socketProtocols)\n      this.installEventHandlers()\n      this.monitor.start()\n      return true\n    }\n  }\n\n  close({allowReconnect} = {allowReconnect: true}) {\n    if (!allowReconnect) { this.monitor.stop() }\n    // Avoid closing websockets in a \"connecting\" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478\n    if (this.isOpen()) {\n      return this.webSocket.close()\n    }\n  }\n\n  reopen() {\n    logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n    if (this.isActive()) {\n      try {\n        return this.close()\n      } catch (error) {\n        logger.log(\"Failed to reopen WebSocket\", error)\n      }\n      finally {\n        logger.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`)\n        setTimeout(this.open, this.constructor.reopenDelay)\n      }\n    } else {\n      return this.open()\n    }\n  }\n\n  getProtocol() {\n    if (this.webSocket) {\n      return this.webSocket.protocol\n    }\n  }\n\n  isOpen() {\n    return this.isState(\"open\")\n  }\n\n  isActive() {\n    return this.isState(\"open\", \"connecting\")\n  }\n\n  triedToReconnect() {\n    return this.monitor.reconnectAttempts > 0\n  }\n\n  // Private\n\n  isProtocolSupported() {\n    return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n  }\n\n  isState(...states) {\n    return indexOf.call(states, this.getState()) >= 0\n  }\n\n  getState() {\n    if (this.webSocket) {\n      for (let state in adapters.WebSocket) {\n        if (adapters.WebSocket[state] === this.webSocket.readyState) {\n          return state.toLowerCase()\n        }\n      }\n    }\n    return null\n  }\n\n  installEventHandlers() {\n    for (let eventName in this.events) {\n      const handler = this.events[eventName].bind(this)\n      this.webSocket[`on${eventName}`] = handler\n    }\n  }\n\n  uninstallEventHandlers() {\n    for (let eventName in this.events) {\n      this.webSocket[`on${eventName}`] = function() {}\n    }\n  }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n  message(event) {\n    if (!this.isProtocolSupported()) { return }\n    const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n    switch (type) {\n      case message_types.welcome:\n        if (this.triedToReconnect()) {\n          this.reconnectAttempted = true\n        }\n        this.monitor.recordConnect()\n        return this.subscriptions.reload()\n      case message_types.disconnect:\n        logger.log(`Disconnecting. Reason: ${reason}`)\n        return this.close({allowReconnect: reconnect})\n      case message_types.ping:\n        return this.monitor.recordPing()\n      case message_types.confirmation:\n        this.subscriptions.confirmSubscription(identifier)\n        if (this.reconnectAttempted) {\n          this.reconnectAttempted = false\n          return this.subscriptions.notify(identifier, \"connected\", {reconnected: true})\n        } else {\n          return this.subscriptions.notify(identifier, \"connected\", {reconnected: false})\n        }\n      case message_types.rejection:\n        return this.subscriptions.reject(identifier)\n      default:\n        return this.subscriptions.notify(identifier, \"received\", message)\n    }\n  },\n\n  open() {\n    logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n    this.disconnected = false\n    if (!this.isProtocolSupported()) {\n      logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n      return this.close({allowReconnect: false})\n    }\n  },\n\n  close(event) {\n    logger.log(\"WebSocket onclose event\")\n    if (this.disconnected) { return }\n    this.disconnected = true\n    this.monitor.recordDisconnect()\n    return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n  },\n\n  error() {\n    logger.log(\"WebSocket onerror event\")\n  }\n}\n\nexport default Connection\n", "// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n//   App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n//     connected() {\n//       // Called once the subscription has been successfully completed\n//     },\n//\n//     disconnected({ willAttemptReconnect: boolean }) {\n//       // Called when the client has disconnected with the server.\n//       // The object will have an `willAttemptReconnect` property which\n//       // says whether the client has the intention of attempting\n//       // to reconnect.\n//     },\n//\n//     appear() {\n//       this.perform('appear', {appearing_on: this.appearingOn()})\n//     },\n//\n//     away() {\n//       this.perform('away')\n//     },\n//\n//     appearingOn() {\n//       $('main').data('appearing-on')\n//     }\n//   })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n//   class AppearanceChannel < ApplicationActionCable::Channel\n//     def subscribed\n//       current_user.appear\n//     end\n//\n//     def unsubscribed\n//       current_user.disappear\n//     end\n//\n//     def appear(data)\n//       current_user.appear on: data['appearing_on']\n//     end\n//\n//     def away\n//       current_user.away\n//     end\n//   end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\n\nconst extend = function(object, properties) {\n  if (properties != null) {\n    for (let key in properties) {\n      const value = properties[key]\n      object[key] = value\n    }\n  }\n  return object\n}\n\nexport default class Subscription {\n  constructor(consumer, params = {}, mixin) {\n    this.consumer = consumer\n    this.identifier = JSON.stringify(params)\n    extend(this, mixin)\n  }\n\n  // Perform a channel action with the optional data passed as an attribute\n  perform(action, data = {}) {\n    data.action = action\n    return this.send(data)\n  }\n\n  send(data) {\n    return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n  }\n\n  unsubscribe() {\n    return this.consumer.subscriptions.remove(this)\n  }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n  constructor(subscriptions) {\n    this.subscriptions = subscriptions\n    this.pendingSubscriptions = []\n  }\n\n  guarantee(subscription) {\n    if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n      logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n      this.pendingSubscriptions.push(subscription) \n    }\n    else {\n      logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n    }\n    this.startGuaranteeing()\n  }\n\n  forget(subscription) {\n    logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n    this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n  }\n\n  startGuaranteeing() {\n    this.stopGuaranteeing()\n    this.retrySubscribing()\n  }\n  \n  stopGuaranteeing() {\n    clearTimeout(this.retryTimeout)\n  }\n\n  retrySubscribing() {\n    this.retryTimeout = setTimeout(() => {\n      if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n        this.pendingSubscriptions.map((subscription) => {\n          logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n          this.subscriptions.subscribe(subscription)\n        })\n      }\n    }\n    , 500)\n  }\n}\n\nexport default SubscriptionGuarantor", "import Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\n\n// Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n//   App = {}\n//   App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n//   App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nexport default class Subscriptions {\n  constructor(consumer) {\n    this.consumer = consumer\n    this.guarantor = new SubscriptionGuarantor(this)\n    this.subscriptions = []\n  }\n\n  create(channelName, mixin) {\n    const channel = channelName\n    const params = typeof channel === \"object\" ? channel : {channel}\n    const subscription = new Subscription(this.consumer, params, mixin)\n    return this.add(subscription)\n  }\n\n  // Private\n\n  add(subscription) {\n    this.subscriptions.push(subscription)\n    this.consumer.ensureActiveConnection()\n    this.notify(subscription, \"initialized\")\n    this.subscribe(subscription)\n    return subscription\n  }\n\n  remove(subscription) {\n    this.forget(subscription)\n    if (!this.findAll(subscription.identifier).length) {\n      this.sendCommand(subscription, \"unsubscribe\")\n    }\n    return subscription\n  }\n\n  reject(identifier) {\n    return this.findAll(identifier).map((subscription) => {\n      this.forget(subscription)\n      this.notify(subscription, \"rejected\")\n      return subscription\n    })\n  }\n\n  forget(subscription) {\n    this.guarantor.forget(subscription)\n    this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n    return subscription\n  }\n\n  findAll(identifier) {\n    return this.subscriptions.filter((s) => s.identifier === identifier)\n  }\n\n  reload() {\n    return this.subscriptions.map((subscription) =>\n      this.subscribe(subscription))\n  }\n\n  notifyAll(callbackName, ...args) {\n    return this.subscriptions.map((subscription) =>\n      this.notify(subscription, callbackName, ...args))\n  }\n\n  notify(subscription, callbackName, ...args) {\n    let subscriptions\n    if (typeof subscription === \"string\") {\n      subscriptions = this.findAll(subscription)\n    } else {\n      subscriptions = [subscription]\n    }\n\n    return subscriptions.map((subscription) =>\n      (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n  }\n\n  subscribe(subscription) {\n    if (this.sendCommand(subscription, \"subscribe\")) {\n      this.guarantor.guarantee(subscription)\n    }\n  }\n\n  confirmSubscription(identifier) {\n    logger.log(`Subscription confirmed ${identifier}`)\n    this.findAll(identifier).map((subscription) =>\n      this.guarantor.forget(subscription))\n  }\n\n  sendCommand(subscription, command) {\n    const {identifier} = subscription\n    return this.consumer.send({command, identifier})\n  }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n//   App = {}\n//   App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n//   App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n//   App.cable.disconnect()\n//\n// and to restart the connection:\n//\n//   App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nexport default class Consumer {\n  constructor(url) {\n    this._url = url\n    this.subscriptions = new Subscriptions(this)\n    this.connection = new Connection(this)\n    this.subprotocols = []\n  }\n\n  get url() {\n    return createWebSocketURL(this._url)\n  }\n\n  send(data) {\n    return this.connection.send(data)\n  }\n\n  connect() {\n    return this.connection.open()\n  }\n\n  disconnect() {\n    return this.connection.close({allowReconnect: false})\n  }\n\n  ensureActiveConnection() {\n    if (!this.connection.isActive()) {\n      return this.connection.open()\n    }\n  }\n\n  addSubProtocol(subprotocol) {\n    this.subprotocols = [...this.subprotocols, subprotocol]\n  }\n}\n\nexport function createWebSocketURL(url) {\n  if (typeof url === \"function\") {\n    url = url()\n  }\n\n  if (url && !/^wss?:/i.test(url)) {\n    const a = document.createElement(\"a\")\n    a.href = url\n    // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n    a.href = a.href\n    a.protocol = a.protocol.replace(\"http\", \"ws\")\n    return a.href\n  } else {\n    return url\n  }\n}\n", "import Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport Subscription from \"./subscription\"\nimport Subscriptions from \"./subscriptions\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\n\nexport {\n  Connection,\n  ConnectionMonitor,\n  Consumer,\n  INTERNAL,\n  Subscription,\n  Subscriptions,\n  SubscriptionGuarantor,\n  adapters,\n  createWebSocketURL,\n  logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n  return new Consumer(url)\n}\n\nexport function getConfig(name) {\n  const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n  if (element) {\n    return element.getAttribute(\"content\")\n  }\n}\n", "export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n  return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n  return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];", "export default function getNodeName(element) {\n  return element ? (element.nodeName || '').toLowerCase() : null;\n}", "export default function getWindow(node) {\n  if (node == null) {\n    return window;\n  }\n\n  if (node.toString() !== '[object Window]') {\n    var ownerDocument = node.ownerDocument;\n    return ownerDocument ? ownerDocument.defaultView || window : window;\n  }\n\n  return node;\n}", "import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n  var OwnElement = getWindow(node).Element;\n  return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n  var OwnElement = getWindow(node).HTMLElement;\n  return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n  // IE 11 has no ShadowRoot\n  if (typeof ShadowRoot === 'undefined') {\n    return false;\n  }\n\n  var OwnElement = getWindow(node).ShadowRoot;\n  return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };", "import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n  var state = _ref.state;\n  Object.keys(state.elements).forEach(function (name) {\n    var style = state.styles[name] || {};\n    var attributes = state.attributes[name] || {};\n    var element = state.elements[name]; // arrow is optional + virtual elements\n\n    if (!isHTMLElement(element) || !getNodeName(element)) {\n      return;\n    } // Flow doesn't support to extend this property, but it's the most\n    // effective way to apply styles to an HTMLElement\n    // $FlowFixMe[cannot-write]\n\n\n    Object.assign(element.style, style);\n    Object.keys(attributes).forEach(function (name) {\n      var value = attributes[name];\n\n      if (value === false) {\n        element.removeAttribute(name);\n      } else {\n        element.setAttribute(name, value === true ? '' : value);\n      }\n    });\n  });\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state;\n  var initialStyles = {\n    popper: {\n      position: state.options.strategy,\n      left: '0',\n      top: '0',\n      margin: '0'\n    },\n    arrow: {\n      position: 'absolute'\n    },\n    reference: {}\n  };\n  Object.assign(state.elements.popper.style, initialStyles.popper);\n  state.styles = initialStyles;\n\n  if (state.elements.arrow) {\n    Object.assign(state.elements.arrow.style, initialStyles.arrow);\n  }\n\n  return function () {\n    Object.keys(state.elements).forEach(function (name) {\n      var element = state.elements[name];\n      var attributes = state.attributes[name] || {};\n      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n      var style = styleProperties.reduce(function (style, property) {\n        style[property] = '';\n        return style;\n      }, {}); // arrow is optional + virtual elements\n\n      if (!isHTMLElement(element) || !getNodeName(element)) {\n        return;\n      }\n\n      Object.assign(element.style, style);\n      Object.keys(attributes).forEach(function (attribute) {\n        element.removeAttribute(attribute);\n      });\n    });\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'applyStyles',\n  enabled: true,\n  phase: 'write',\n  fn: applyStyles,\n  effect: effect,\n  requires: ['computeStyles']\n};", "import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n  return placement.split('-')[0];\n}", "export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;", "import { isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nexport default function getBoundingClientRect(element, includeScale) {\n  if (includeScale === void 0) {\n    includeScale = false;\n  }\n\n  var rect = element.getBoundingClientRect();\n  var scaleX = 1;\n  var scaleY = 1;\n\n  if (isHTMLElement(element) && includeScale) {\n    var offsetHeight = element.offsetHeight;\n    var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n    // Fallback to 1 in case both values are `0`\n\n    if (offsetWidth > 0) {\n      scaleX = round(rect.width) / offsetWidth || 1;\n    }\n\n    if (offsetHeight > 0) {\n      scaleY = round(rect.height) / offsetHeight || 1;\n    }\n  }\n\n  return {\n    width: rect.width / scaleX,\n    height: rect.height / scaleY,\n    top: rect.top / scaleY,\n    right: rect.right / scaleX,\n    bottom: rect.bottom / scaleY,\n    left: rect.left / scaleX,\n    x: rect.left / scaleX,\n    y: rect.top / scaleY\n  };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n  var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n  // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n  var width = element.offsetWidth;\n  var height = element.offsetHeight;\n\n  if (Math.abs(clientRect.width - width) <= 1) {\n    width = clientRect.width;\n  }\n\n  if (Math.abs(clientRect.height - height) <= 1) {\n    height = clientRect.height;\n  }\n\n  return {\n    x: element.offsetLeft,\n    y: element.offsetTop,\n    width: width,\n    height: height\n  };\n}", "import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n  var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n  if (parent.contains(child)) {\n    return true;\n  } // then fallback to custom implementation with Shadow DOM support\n  else if (rootNode && isShadowRoot(rootNode)) {\n      var next = child;\n\n      do {\n        if (next && parent.isSameNode(next)) {\n          return true;\n        } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n        next = next.parentNode || next.host;\n      } while (next);\n    } // Give up, the result is false\n\n\n  return false;\n}", "import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n  return getWindow(element).getComputedStyle(element);\n}", "import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n  return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}", "import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n  // $FlowFixMe[incompatible-return]: assume body is always available\n  return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n  element.document) || window.document).documentElement;\n}", "import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n  if (getNodeName(element) === 'html') {\n    return element;\n  }\n\n  return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n    // $FlowFixMe[incompatible-return]\n    // $FlowFixMe[prop-missing]\n    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n    element.parentNode || ( // DOM Element detected\n    isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n    // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n    getDocumentElement(element) // fallback\n\n  );\n}", "import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\n\nfunction getTrueOffsetParent(element) {\n  if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n  getComputedStyle(element).position === 'fixed') {\n    return null;\n  }\n\n  return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n  var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n  var isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\n  if (isIE && isHTMLElement(element)) {\n    // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n    var elementCss = getComputedStyle(element);\n\n    if (elementCss.position === 'fixed') {\n      return null;\n    }\n  }\n\n  var currentNode = getParentNode(element);\n\n  if (isShadowRoot(currentNode)) {\n    currentNode = currentNode.host;\n  }\n\n  while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n    var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n    // create a containing block.\n    // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n    if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n      return currentNode;\n    } else {\n      currentNode = currentNode.parentNode;\n    }\n  }\n\n  return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n  var window = getWindow(element);\n  var offsetParent = getTrueOffsetParent(element);\n\n  while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n    offsetParent = getTrueOffsetParent(offsetParent);\n  }\n\n  if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n    return window;\n  }\n\n  return offsetParent || getContainingBlock(element) || window;\n}", "export default function getMainAxisFromPlacement(placement) {\n  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}", "import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n  return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n  var v = within(min, value, max);\n  return v > max ? max : v;\n}", "export default function getFreshSideObject() {\n  return {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  };\n}", "import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n  return Object.assign({}, getFreshSideObject(), paddingObject);\n}", "export default function expandToHashMap(value, keys) {\n  return keys.reduce(function (hashMap, key) {\n    hashMap[key] = value;\n    return hashMap;\n  }, {});\n}", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n  padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : padding;\n  return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n  var _state$modifiersData$;\n\n  var state = _ref.state,\n      name = _ref.name,\n      options = _ref.options;\n  var arrowElement = state.elements.arrow;\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var basePlacement = getBasePlacement(state.placement);\n  var axis = getMainAxisFromPlacement(basePlacement);\n  var isVertical = [left, right].indexOf(basePlacement) >= 0;\n  var len = isVertical ? 'height' : 'width';\n\n  if (!arrowElement || !popperOffsets) {\n    return;\n  }\n\n  var paddingObject = toPaddingObject(options.padding, state);\n  var arrowRect = getLayoutRect(arrowElement);\n  var minProp = axis === 'y' ? top : left;\n  var maxProp = axis === 'y' ? bottom : right;\n  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n  var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n  var arrowOffsetParent = getOffsetParent(arrowElement);\n  var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n  var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n  // outside of the popper bounds\n\n  var min = paddingObject[minProp];\n  var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n  var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n  var axisProp = axis;\n  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options;\n  var _options$element = options.element,\n      arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n  if (arrowElement == null) {\n    return;\n  } // CSS selector\n\n\n  if (typeof arrowElement === 'string') {\n    arrowElement = state.elements.popper.querySelector(arrowElement);\n\n    if (!arrowElement) {\n      return;\n    }\n  }\n\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isHTMLElement(arrowElement)) {\n      console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n    }\n  }\n\n  if (!contains(state.elements.popper, arrowElement)) {\n    if (process.env.NODE_ENV !== \"production\") {\n      console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n    }\n\n    return;\n  }\n\n  state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'arrow',\n  enabled: true,\n  phase: 'main',\n  fn: arrow,\n  effect: effect,\n  requires: ['popperOffsets'],\n  requiresIfExists: ['preventOverflow']\n};", "export default function getVariation(placement) {\n  return placement.split('-')[1];\n}", "import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n  top: 'auto',\n  right: 'auto',\n  bottom: 'auto',\n  left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n  var x = _ref.x,\n      y = _ref.y;\n  var win = window;\n  var dpr = win.devicePixelRatio || 1;\n  return {\n    x: round(x * dpr) / dpr || 0,\n    y: round(y * dpr) / dpr || 0\n  };\n}\n\nexport function mapToStyles(_ref2) {\n  var _Object$assign2;\n\n  var popper = _ref2.popper,\n      popperRect = _ref2.popperRect,\n      placement = _ref2.placement,\n      variation = _ref2.variation,\n      offsets = _ref2.offsets,\n      position = _ref2.position,\n      gpuAcceleration = _ref2.gpuAcceleration,\n      adaptive = _ref2.adaptive,\n      roundOffsets = _ref2.roundOffsets,\n      isFixed = _ref2.isFixed;\n  var _offsets$x = offsets.x,\n      x = _offsets$x === void 0 ? 0 : _offsets$x,\n      _offsets$y = offsets.y,\n      y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n  var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n    x: x,\n    y: y\n  }) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref3.x;\n  y = _ref3.y;\n  var hasX = offsets.hasOwnProperty('x');\n  var hasY = offsets.hasOwnProperty('y');\n  var sideX = left;\n  var sideY = top;\n  var win = window;\n\n  if (adaptive) {\n    var offsetParent = getOffsetParent(popper);\n    var heightProp = 'clientHeight';\n    var widthProp = 'clientWidth';\n\n    if (offsetParent === getWindow(popper)) {\n      offsetParent = getDocumentElement(popper);\n\n      if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n        heightProp = 'scrollHeight';\n        widthProp = 'scrollWidth';\n      }\n    } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n    offsetParent = offsetParent;\n\n    if (placement === top || (placement === left || placement === right) && variation === end) {\n      sideY = bottom;\n      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n      offsetParent[heightProp];\n      y -= offsetY - popperRect.height;\n      y *= gpuAcceleration ? 1 : -1;\n    }\n\n    if (placement === left || (placement === top || placement === bottom) && variation === end) {\n      sideX = right;\n      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n      offsetParent[widthProp];\n      x -= offsetX - popperRect.width;\n      x *= gpuAcceleration ? 1 : -1;\n    }\n  }\n\n  var commonStyles = Object.assign({\n    position: position\n  }, adaptive && unsetSides);\n\n  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n    x: x,\n    y: y\n  }) : {\n    x: x,\n    y: y\n  };\n\n  x = _ref4.x;\n  y = _ref4.y;\n\n  if (gpuAcceleration) {\n    var _Object$assign;\n\n    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n  }\n\n  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n  var state = _ref5.state,\n      options = _ref5.options;\n  var _options$gpuAccelerat = options.gpuAcceleration,\n      gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n      _options$adaptive = options.adaptive,\n      adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n      _options$roundOffsets = options.roundOffsets,\n      roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n  if (process.env.NODE_ENV !== \"production\") {\n    var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n    if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n      return transitionProperty.indexOf(property) >= 0;\n    })) {\n      console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n    }\n  }\n\n  var commonStyles = {\n    placement: getBasePlacement(state.placement),\n    variation: getVariation(state.placement),\n    popper: state.elements.popper,\n    popperRect: state.rects.popper,\n    gpuAcceleration: gpuAcceleration,\n    isFixed: state.options.strategy === 'fixed'\n  };\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.popperOffsets,\n      position: state.options.strategy,\n      adaptive: adaptive,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  if (state.modifiersData.arrow != null) {\n    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n      offsets: state.modifiersData.arrow,\n      position: 'absolute',\n      adaptive: false,\n      roundOffsets: roundOffsets\n    })));\n  }\n\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-placement': state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'computeStyles',\n  enabled: true,\n  phase: 'beforeWrite',\n  fn: computeStyles,\n  data: {}\n};", "import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n  passive: true\n};\n\nfunction effect(_ref) {\n  var state = _ref.state,\n      instance = _ref.instance,\n      options = _ref.options;\n  var _options$scroll = options.scroll,\n      scroll = _options$scroll === void 0 ? true : _options$scroll,\n      _options$resize = options.resize,\n      resize = _options$resize === void 0 ? true : _options$resize;\n  var window = getWindow(state.elements.popper);\n  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n  if (scroll) {\n    scrollParents.forEach(function (scrollParent) {\n      scrollParent.addEventListener('scroll', instance.update, passive);\n    });\n  }\n\n  if (resize) {\n    window.addEventListener('resize', instance.update, passive);\n  }\n\n  return function () {\n    if (scroll) {\n      scrollParents.forEach(function (scrollParent) {\n        scrollParent.removeEventListener('scroll', instance.update, passive);\n      });\n    }\n\n    if (resize) {\n      window.removeEventListener('resize', instance.update, passive);\n    }\n  };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'eventListeners',\n  enabled: true,\n  phase: 'write',\n  fn: function fn() {},\n  effect: effect,\n  data: {}\n};", "var hash = {\n  left: 'right',\n  right: 'left',\n  bottom: 'top',\n  top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n  return placement.replace(/left|right|bottom|top/g, function (matched) {\n    return hash[matched];\n  });\n}", "var hash = {\n  start: 'end',\n  end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n  return placement.replace(/start|end/g, function (matched) {\n    return hash[matched];\n  });\n}", "import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n  var win = getWindow(node);\n  var scrollLeft = win.pageXOffset;\n  var scrollTop = win.pageYOffset;\n  return {\n    scrollLeft: scrollLeft,\n    scrollTop: scrollTop\n  };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n  // If <html> has a CSS width greater than the viewport, then this will be\n  // incorrect for RTL.\n  // Popper 1 is broken in this case and never had a bug report so let's assume\n  // it's not an issue. I don't think anyone ever specifies width on <html>\n  // anyway.\n  // Browsers where the left scrollbar doesn't cause an issue report `0` for\n  // this (e.g. Edge 2019, IE11, Safari)\n  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}", "import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nexport default function getViewportRect(element) {\n  var win = getWindow(element);\n  var html = getDocumentElement(element);\n  var visualViewport = win.visualViewport;\n  var width = html.clientWidth;\n  var height = html.clientHeight;\n  var x = 0;\n  var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n  // can be obscured underneath it.\n  // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n  // if it isn't open, so if this isn't available, the popper will be detected\n  // to overflow the bottom of the screen too early.\n\n  if (visualViewport) {\n    width = visualViewport.width;\n    height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n    // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n    // errors due to floating point numbers, so we need to check precision.\n    // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n    // Feature detection fails in mobile emulation mode in Chrome.\n    // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n    // 0.001\n    // Fallback here: \"Not Safari\" userAgent\n\n    if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n      x = visualViewport.offsetLeft;\n      y = visualViewport.offsetTop;\n    }\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x + getWindowScrollBarX(element),\n    y: y\n  };\n}", "import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n  var _element$ownerDocumen;\n\n  var html = getDocumentElement(element);\n  var winScroll = getWindowScroll(element);\n  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n  var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n  var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n  var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n  var y = -winScroll.scrollTop;\n\n  if (getComputedStyle(body || html).direction === 'rtl') {\n    x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n  }\n\n  return {\n    width: width,\n    height: height,\n    x: x,\n    y: y\n  };\n}", "import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n  // Firefox wants us to check `-x` and `-y` variations as well\n  var _getComputedStyle = getComputedStyle(element),\n      overflow = _getComputedStyle.overflow,\n      overflowX = _getComputedStyle.overflowX,\n      overflowY = _getComputedStyle.overflowY;\n\n  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}", "import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n  if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n    // $FlowFixMe[incompatible-return]: assume body is always available\n    return node.ownerDocument.body;\n  }\n\n  if (isHTMLElement(node) && isScrollParent(node)) {\n    return node;\n  }\n\n  return getScrollParent(getParentNode(node));\n}", "import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n  var _element$ownerDocumen;\n\n  if (list === void 0) {\n    list = [];\n  }\n\n  var scrollParent = getScrollParent(element);\n  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n  var win = getWindow(scrollParent);\n  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n  var updatedList = list.concat(target);\n  return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n  updatedList.concat(listScrollParents(getParentNode(target)));\n}", "export default function rectToClientRect(rect) {\n  return Object.assign({}, rect, {\n    left: rect.x,\n    top: rect.y,\n    right: rect.x + rect.width,\n    bottom: rect.y + rect.height\n  });\n}", "import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element) {\n  var rect = getBoundingClientRect(element);\n  rect.top = rect.top + element.clientTop;\n  rect.left = rect.left + element.clientLeft;\n  rect.bottom = rect.top + element.clientHeight;\n  rect.right = rect.left + element.clientWidth;\n  rect.width = element.clientWidth;\n  rect.height = element.clientHeight;\n  rect.x = rect.left;\n  rect.y = rect.top;\n  return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n  return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n  var clippingParents = listScrollParents(getParentNode(element));\n  var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n  var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n  if (!isElement(clipperElement)) {\n    return [];\n  } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n  return clippingParents.filter(function (clippingParent) {\n    return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n  });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary) {\n  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n  var firstClippingParent = clippingParents[0];\n  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n    var rect = getClientRectFromMixedType(element, clippingParent);\n    accRect.top = max(rect.top, accRect.top);\n    accRect.right = min(rect.right, accRect.right);\n    accRect.bottom = min(rect.bottom, accRect.bottom);\n    accRect.left = max(rect.left, accRect.left);\n    return accRect;\n  }, getClientRectFromMixedType(element, firstClippingParent));\n  clippingRect.width = clippingRect.right - clippingRect.left;\n  clippingRect.height = clippingRect.bottom - clippingRect.top;\n  clippingRect.x = clippingRect.left;\n  clippingRect.y = clippingRect.top;\n  return clippingRect;\n}", "import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n  var reference = _ref.reference,\n      element = _ref.element,\n      placement = _ref.placement;\n  var basePlacement = placement ? getBasePlacement(placement) : null;\n  var variation = placement ? getVariation(placement) : null;\n  var commonX = reference.x + reference.width / 2 - element.width / 2;\n  var commonY = reference.y + reference.height / 2 - element.height / 2;\n  var offsets;\n\n  switch (basePlacement) {\n    case top:\n      offsets = {\n        x: commonX,\n        y: reference.y - element.height\n      };\n      break;\n\n    case bottom:\n      offsets = {\n        x: commonX,\n        y: reference.y + reference.height\n      };\n      break;\n\n    case right:\n      offsets = {\n        x: reference.x + reference.width,\n        y: commonY\n      };\n      break;\n\n    case left:\n      offsets = {\n        x: reference.x - element.width,\n        y: commonY\n      };\n      break;\n\n    default:\n      offsets = {\n        x: reference.x,\n        y: reference.y\n      };\n  }\n\n  var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n  if (mainAxis != null) {\n    var len = mainAxis === 'y' ? 'height' : 'width';\n\n    switch (variation) {\n      case start:\n        offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n        break;\n\n      case end:\n        offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n        break;\n\n      default:\n    }\n  }\n\n  return offsets;\n}", "import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      _options$placement = _options.placement,\n      placement = _options$placement === void 0 ? state.placement : _options$placement,\n      _options$boundary = _options.boundary,\n      boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n      _options$rootBoundary = _options.rootBoundary,\n      rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n      _options$elementConte = _options.elementContext,\n      elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n      _options$altBoundary = _options.altBoundary,\n      altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n      _options$padding = _options.padding,\n      padding = _options$padding === void 0 ? 0 : _options$padding;\n  var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n  var altContext = elementContext === popper ? reference : popper;\n  var popperRect = state.rects.popper;\n  var element = state.elements[altBoundary ? altContext : elementContext];\n  var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n  var referenceClientRect = getBoundingClientRect(state.elements.reference);\n  var popperOffsets = computeOffsets({\n    reference: referenceClientRect,\n    element: popperRect,\n    strategy: 'absolute',\n    placement: placement\n  });\n  var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n  var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n  // 0 or negative = within the clipping rect\n\n  var overflowOffsets = {\n    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n    right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n  };\n  var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n  if (elementContext === popper && offsetData) {\n    var offset = offsetData[placement];\n    Object.keys(overflowOffsets).forEach(function (key) {\n      var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n      var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n      overflowOffsets[key] += offset[axis] * multiply;\n    });\n  }\n\n  return overflowOffsets;\n}", "import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      placement = _options.placement,\n      boundary = _options.boundary,\n      rootBoundary = _options.rootBoundary,\n      padding = _options.padding,\n      flipVariations = _options.flipVariations,\n      _options$allowedAutoP = _options.allowedAutoPlacements,\n      allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n  var variation = getVariation(placement);\n  var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n    return getVariation(placement) === variation;\n  }) : basePlacements;\n  var allowedPlacements = placements.filter(function (placement) {\n    return allowedAutoPlacements.indexOf(placement) >= 0;\n  });\n\n  if (allowedPlacements.length === 0) {\n    allowedPlacements = placements;\n\n    if (process.env.NODE_ENV !== \"production\") {\n      console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n    }\n  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n  var overflows = allowedPlacements.reduce(function (acc, placement) {\n    acc[placement] = detectOverflow(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding\n    })[getBasePlacement(placement)];\n    return acc;\n  }, {});\n  return Object.keys(overflows).sort(function (a, b) {\n    return overflows[a] - overflows[b];\n  });\n}", "import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n  if (getBasePlacement(placement) === auto) {\n    return [];\n  }\n\n  var oppositePlacement = getOppositePlacement(placement);\n  return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n\n  if (state.modifiersData[name]._skip) {\n    return;\n  }\n\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n      specifiedFallbackPlacements = options.fallbackPlacements,\n      padding = options.padding,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      _options$flipVariatio = options.flipVariations,\n      flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n      allowedAutoPlacements = options.allowedAutoPlacements;\n  var preferredPlacement = state.options.placement;\n  var basePlacement = getBasePlacement(preferredPlacement);\n  var isBasePlacement = basePlacement === preferredPlacement;\n  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n  var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n    return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      padding: padding,\n      flipVariations: flipVariations,\n      allowedAutoPlacements: allowedAutoPlacements\n    }) : placement);\n  }, []);\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var checksMap = new Map();\n  var makeFallbackChecks = true;\n  var firstFittingPlacement = placements[0];\n\n  for (var i = 0; i < placements.length; i++) {\n    var placement = placements[i];\n\n    var _basePlacement = getBasePlacement(placement);\n\n    var isStartVariation = getVariation(placement) === start;\n    var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n    var len = isVertical ? 'width' : 'height';\n    var overflow = detectOverflow(state, {\n      placement: placement,\n      boundary: boundary,\n      rootBoundary: rootBoundary,\n      altBoundary: altBoundary,\n      padding: padding\n    });\n    var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n    if (referenceRect[len] > popperRect[len]) {\n      mainVariationSide = getOppositePlacement(mainVariationSide);\n    }\n\n    var altVariationSide = getOppositePlacement(mainVariationSide);\n    var checks = [];\n\n    if (checkMainAxis) {\n      checks.push(overflow[_basePlacement] <= 0);\n    }\n\n    if (checkAltAxis) {\n      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n    }\n\n    if (checks.every(function (check) {\n      return check;\n    })) {\n      firstFittingPlacement = placement;\n      makeFallbackChecks = false;\n      break;\n    }\n\n    checksMap.set(placement, checks);\n  }\n\n  if (makeFallbackChecks) {\n    // `2` may be desired in some cases \u2013 research later\n    var numberOfChecks = flipVariations ? 3 : 1;\n\n    var _loop = function _loop(_i) {\n      var fittingPlacement = placements.find(function (placement) {\n        var checks = checksMap.get(placement);\n\n        if (checks) {\n          return checks.slice(0, _i).every(function (check) {\n            return check;\n          });\n        }\n      });\n\n      if (fittingPlacement) {\n        firstFittingPlacement = fittingPlacement;\n        return \"break\";\n      }\n    };\n\n    for (var _i = numberOfChecks; _i > 0; _i--) {\n      var _ret = _loop(_i);\n\n      if (_ret === \"break\") break;\n    }\n  }\n\n  if (state.placement !== firstFittingPlacement) {\n    state.modifiersData[name]._skip = true;\n    state.placement = firstFittingPlacement;\n    state.reset = true;\n  }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'flip',\n  enabled: true,\n  phase: 'main',\n  fn: flip,\n  requiresIfExists: ['offset'],\n  data: {\n    _skip: false\n  }\n};", "import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n  if (preventedOffsets === void 0) {\n    preventedOffsets = {\n      x: 0,\n      y: 0\n    };\n  }\n\n  return {\n    top: overflow.top - rect.height - preventedOffsets.y,\n    right: overflow.right - rect.width + preventedOffsets.x,\n    bottom: overflow.bottom - rect.height + preventedOffsets.y,\n    left: overflow.left - rect.width - preventedOffsets.x\n  };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n  return [top, right, bottom, left].some(function (side) {\n    return overflow[side] >= 0;\n  });\n}\n\nfunction hide(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var preventedOffsets = state.modifiersData.preventOverflow;\n  var referenceOverflow = detectOverflow(state, {\n    elementContext: 'reference'\n  });\n  var popperAltOverflow = detectOverflow(state, {\n    altBoundary: true\n  });\n  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n  state.modifiersData[name] = {\n    referenceClippingOffsets: referenceClippingOffsets,\n    popperEscapeOffsets: popperEscapeOffsets,\n    isReferenceHidden: isReferenceHidden,\n    hasPopperEscaped: hasPopperEscaped\n  };\n  state.attributes.popper = Object.assign({}, state.attributes.popper, {\n    'data-popper-reference-hidden': isReferenceHidden,\n    'data-popper-escaped': hasPopperEscaped\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'hide',\n  enabled: true,\n  phase: 'main',\n  requiresIfExists: ['preventOverflow'],\n  fn: hide\n};", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n  var basePlacement = getBasePlacement(placement);\n  var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n  var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n    placement: placement\n  })) : offset,\n      skidding = _ref[0],\n      distance = _ref[1];\n\n  skidding = skidding || 0;\n  distance = (distance || 0) * invertDistance;\n  return [left, right].indexOf(basePlacement) >= 0 ? {\n    x: distance,\n    y: skidding\n  } : {\n    x: skidding,\n    y: distance\n  };\n}\n\nfunction offset(_ref2) {\n  var state = _ref2.state,\n      options = _ref2.options,\n      name = _ref2.name;\n  var _options$offset = options.offset,\n      offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n  var data = placements.reduce(function (acc, placement) {\n    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n    return acc;\n  }, {});\n  var _data$state$placement = data[state.placement],\n      x = _data$state$placement.x,\n      y = _data$state$placement.y;\n\n  if (state.modifiersData.popperOffsets != null) {\n    state.modifiersData.popperOffsets.x += x;\n    state.modifiersData.popperOffsets.y += y;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'offset',\n  enabled: true,\n  phase: 'main',\n  requires: ['popperOffsets'],\n  fn: offset\n};", "import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n  var state = _ref.state,\n      name = _ref.name;\n  // Offsets are the actual position the popper needs to have to be\n  // properly positioned near its reference element\n  // This is the most basic placement, and will be adjusted by\n  // the modifiers in the next step\n  state.modifiersData[name] = computeOffsets({\n    reference: state.rects.reference,\n    element: state.rects.popper,\n    strategy: 'absolute',\n    placement: state.placement\n  });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'popperOffsets',\n  enabled: true,\n  phase: 'read',\n  fn: popperOffsets,\n  data: {}\n};", "export default function getAltAxis(axis) {\n  return axis === 'x' ? 'y' : 'x';\n}", "import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n  var state = _ref.state,\n      options = _ref.options,\n      name = _ref.name;\n  var _options$mainAxis = options.mainAxis,\n      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n      _options$altAxis = options.altAxis,\n      checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n      boundary = options.boundary,\n      rootBoundary = options.rootBoundary,\n      altBoundary = options.altBoundary,\n      padding = options.padding,\n      _options$tether = options.tether,\n      tether = _options$tether === void 0 ? true : _options$tether,\n      _options$tetherOffset = options.tetherOffset,\n      tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n  var overflow = detectOverflow(state, {\n    boundary: boundary,\n    rootBoundary: rootBoundary,\n    padding: padding,\n    altBoundary: altBoundary\n  });\n  var basePlacement = getBasePlacement(state.placement);\n  var variation = getVariation(state.placement);\n  var isBasePlacement = !variation;\n  var mainAxis = getMainAxisFromPlacement(basePlacement);\n  var altAxis = getAltAxis(mainAxis);\n  var popperOffsets = state.modifiersData.popperOffsets;\n  var referenceRect = state.rects.reference;\n  var popperRect = state.rects.popper;\n  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n    placement: state.placement\n  })) : tetherOffset;\n  var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n    mainAxis: tetherOffsetValue,\n    altAxis: tetherOffsetValue\n  } : Object.assign({\n    mainAxis: 0,\n    altAxis: 0\n  }, tetherOffsetValue);\n  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n  var data = {\n    x: 0,\n    y: 0\n  };\n\n  if (!popperOffsets) {\n    return;\n  }\n\n  if (checkMainAxis) {\n    var _offsetModifierState$;\n\n    var mainSide = mainAxis === 'y' ? top : left;\n    var altSide = mainAxis === 'y' ? bottom : right;\n    var len = mainAxis === 'y' ? 'height' : 'width';\n    var offset = popperOffsets[mainAxis];\n    var min = offset + overflow[mainSide];\n    var max = offset - overflow[altSide];\n    var additive = tether ? -popperRect[len] / 2 : 0;\n    var minLen = variation === start ? referenceRect[len] : popperRect[len];\n    var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n    // outside the reference bounds\n\n    var arrowElement = state.elements.arrow;\n    var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n      width: 0,\n      height: 0\n    };\n    var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n    var arrowPaddingMin = arrowPaddingObject[mainSide];\n    var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n    // to include its full size in the calculation. If the reference is small\n    // and near the edge of a boundary, the popper can overflow even if the\n    // reference is not overflowing as well (e.g. virtual elements with no\n    // width or height)\n\n    var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n    var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n    var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n    var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n    var tetherMax = offset + maxOffset - offsetModifierValue;\n    var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n    popperOffsets[mainAxis] = preventedOffset;\n    data[mainAxis] = preventedOffset - offset;\n  }\n\n  if (checkAltAxis) {\n    var _offsetModifierState$2;\n\n    var _mainSide = mainAxis === 'x' ? top : left;\n\n    var _altSide = mainAxis === 'x' ? bottom : right;\n\n    var _offset = popperOffsets[altAxis];\n\n    var _len = altAxis === 'y' ? 'height' : 'width';\n\n    var _min = _offset + overflow[_mainSide];\n\n    var _max = _offset - overflow[_altSide];\n\n    var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n    var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n    popperOffsets[altAxis] = _preventedOffset;\n    data[altAxis] = _preventedOffset - _offset;\n  }\n\n  state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n  name: 'preventOverflow',\n  enabled: true,\n  phase: 'main',\n  fn: preventOverflow,\n  requiresIfExists: ['offset']\n};", "export { default as applyStyles } from \"./applyStyles.js\";\nexport { default as arrow } from \"./arrow.js\";\nexport { default as computeStyles } from \"./computeStyles.js\";\nexport { default as eventListeners } from \"./eventListeners.js\";\nexport { default as flip } from \"./flip.js\";\nexport { default as hide } from \"./hide.js\";\nexport { default as offset } from \"./offset.js\";\nexport { default as popperOffsets } from \"./popperOffsets.js\";\nexport { default as preventOverflow } from \"./preventOverflow.js\";", "export default function getHTMLElementScroll(element) {\n  return {\n    scrollLeft: element.scrollLeft,\n    scrollTop: element.scrollTop\n  };\n}", "import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n  if (node === getWindow(node) || !isHTMLElement(node)) {\n    return getWindowScroll(node);\n  } else {\n    return getHTMLElementScroll(node);\n  }\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n  var rect = element.getBoundingClientRect();\n  var scaleX = round(rect.width) / element.offsetWidth || 1;\n  var scaleY = round(rect.height) / element.offsetHeight || 1;\n  return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n  if (isFixed === void 0) {\n    isFixed = false;\n  }\n\n  var isOffsetParentAnElement = isHTMLElement(offsetParent);\n  var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n  var documentElement = getDocumentElement(offsetParent);\n  var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);\n  var scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  var offsets = {\n    x: 0,\n    y: 0\n  };\n\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n    isScrollParent(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n\n    if (isHTMLElement(offsetParent)) {\n      offsets = getBoundingClientRect(offsetParent, true);\n      offsets.x += offsetParent.clientLeft;\n      offsets.y += offsetParent.clientTop;\n    } else if (documentElement) {\n      offsets.x = getWindowScrollBarX(documentElement);\n    }\n  }\n\n  return {\n    x: rect.left + scroll.scrollLeft - offsets.x,\n    y: rect.top + scroll.scrollTop - offsets.y,\n    width: rect.width,\n    height: rect.height\n  };\n}", "import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n  var map = new Map();\n  var visited = new Set();\n  var result = [];\n  modifiers.forEach(function (modifier) {\n    map.set(modifier.name, modifier);\n  }); // On visiting object, check for its dependencies and visit them recursively\n\n  function sort(modifier) {\n    visited.add(modifier.name);\n    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n    requires.forEach(function (dep) {\n      if (!visited.has(dep)) {\n        var depModifier = map.get(dep);\n\n        if (depModifier) {\n          sort(depModifier);\n        }\n      }\n    });\n    result.push(modifier);\n  }\n\n  modifiers.forEach(function (modifier) {\n    if (!visited.has(modifier.name)) {\n      // check for visited object\n      sort(modifier);\n    }\n  });\n  return result;\n}\n\nexport default function orderModifiers(modifiers) {\n  // order based on dependencies\n  var orderedModifiers = order(modifiers); // order based on phase\n\n  return modifierPhases.reduce(function (acc, phase) {\n    return acc.concat(orderedModifiers.filter(function (modifier) {\n      return modifier.phase === phase;\n    }));\n  }, []);\n}", "export default function debounce(fn) {\n  var pending;\n  return function () {\n    if (!pending) {\n      pending = new Promise(function (resolve) {\n        Promise.resolve().then(function () {\n          pending = undefined;\n          resolve(fn());\n        });\n      });\n    }\n\n    return pending;\n  };\n}", "export default function mergeByName(modifiers) {\n  var merged = modifiers.reduce(function (merged, current) {\n    var existing = merged[current.name];\n    merged[current.name] = existing ? Object.assign({}, existing, current, {\n      options: Object.assign({}, existing.options, current.options),\n      data: Object.assign({}, existing.data, current.data)\n    }) : current;\n    return merged;\n  }, {}); // IE11 does not support Object.values\n\n  return Object.keys(merged).map(function (key) {\n    return merged[key];\n  });\n}", "import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n  placement: 'bottom',\n  modifiers: [],\n  strategy: 'absolute'\n};\n\nfunction areValidElements() {\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n\n  return !args.some(function (element) {\n    return !(element && typeof element.getBoundingClientRect === 'function');\n  });\n}\n\nexport function popperGenerator(generatorOptions) {\n  if (generatorOptions === void 0) {\n    generatorOptions = {};\n  }\n\n  var _generatorOptions = generatorOptions,\n      _generatorOptions$def = _generatorOptions.defaultModifiers,\n      defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n      _generatorOptions$def2 = _generatorOptions.defaultOptions,\n      defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n  return function createPopper(reference, popper, options) {\n    if (options === void 0) {\n      options = defaultOptions;\n    }\n\n    var state = {\n      placement: 'bottom',\n      orderedModifiers: [],\n      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n      modifiersData: {},\n      elements: {\n        reference: reference,\n        popper: popper\n      },\n      attributes: {},\n      styles: {}\n    };\n    var effectCleanupFns = [];\n    var isDestroyed = false;\n    var instance = {\n      state: state,\n      setOptions: function setOptions(setOptionsAction) {\n        var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n        cleanupModifierEffects();\n        state.options = Object.assign({}, defaultOptions, state.options, options);\n        state.scrollParents = {\n          reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n          popper: listScrollParents(popper)\n        }; // Orders the modifiers based on their dependencies and `phase`\n        // properties\n\n        var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n        state.orderedModifiers = orderedModifiers.filter(function (m) {\n          return m.enabled;\n        }); // Validate the provided modifiers so that the consumer will get warned\n        // if one of the modifiers is invalid for any reason\n\n        if (process.env.NODE_ENV !== \"production\") {\n          var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n            var name = _ref.name;\n            return name;\n          });\n          validateModifiers(modifiers);\n\n          if (getBasePlacement(state.options.placement) === auto) {\n            var flipModifier = state.orderedModifiers.find(function (_ref2) {\n              var name = _ref2.name;\n              return name === 'flip';\n            });\n\n            if (!flipModifier) {\n              console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n            }\n          }\n\n          var _getComputedStyle = getComputedStyle(popper),\n              marginTop = _getComputedStyle.marginTop,\n              marginRight = _getComputedStyle.marginRight,\n              marginBottom = _getComputedStyle.marginBottom,\n              marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n          // cause bugs with positioning, so we'll warn the consumer\n\n\n          if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n            return parseFloat(margin);\n          })) {\n            console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n          }\n        }\n\n        runModifierEffects();\n        return instance.update();\n      },\n      // Sync update \u2013 it will always be executed, even if not necessary. This\n      // is useful for low frequency updates where sync behavior simplifies the\n      // logic.\n      // For high frequency updates (e.g. `resize` and `scroll` events), always\n      // prefer the async Popper#update method\n      forceUpdate: function forceUpdate() {\n        if (isDestroyed) {\n          return;\n        }\n\n        var _state$elements = state.elements,\n            reference = _state$elements.reference,\n            popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n        // anymore\n\n        if (!areValidElements(reference, popper)) {\n          if (process.env.NODE_ENV !== \"production\") {\n            console.error(INVALID_ELEMENT_ERROR);\n          }\n\n          return;\n        } // Store the reference and popper rects to be read by modifiers\n\n\n        state.rects = {\n          reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n          popper: getLayoutRect(popper)\n        }; // Modifiers have the ability to reset the current update cycle. The\n        // most common use case for this is the `flip` modifier changing the\n        // placement, which then needs to re-run all the modifiers, because the\n        // logic was previously ran for the previous placement and is therefore\n        // stale/incorrect\n\n        state.reset = false;\n        state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n        // is filled with the initial data specified by the modifier. This means\n        // it doesn't persist and is fresh on each update.\n        // To ensure persistent data, use `${name}#persistent`\n\n        state.orderedModifiers.forEach(function (modifier) {\n          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n        });\n        var __debug_loops__ = 0;\n\n        for (var index = 0; index < state.orderedModifiers.length; index++) {\n          if (process.env.NODE_ENV !== \"production\") {\n            __debug_loops__ += 1;\n\n            if (__debug_loops__ > 100) {\n              console.error(INFINITE_LOOP_ERROR);\n              break;\n            }\n          }\n\n          if (state.reset === true) {\n            state.reset = false;\n            index = -1;\n            continue;\n          }\n\n          var _state$orderedModifie = state.orderedModifiers[index],\n              fn = _state$orderedModifie.fn,\n              _state$orderedModifie2 = _state$orderedModifie.options,\n              _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n              name = _state$orderedModifie.name;\n\n          if (typeof fn === 'function') {\n            state = fn({\n              state: state,\n              options: _options,\n              name: name,\n              instance: instance\n            }) || state;\n          }\n        }\n      },\n      // Async and optimistically optimized update \u2013 it will not be executed if\n      // not necessary (debounced to run at most once-per-tick)\n      update: debounce(function () {\n        return new Promise(function (resolve) {\n          instance.forceUpdate();\n          resolve(state);\n        });\n      }),\n      destroy: function destroy() {\n        cleanupModifierEffects();\n        isDestroyed = true;\n      }\n    };\n\n    if (!areValidElements(reference, popper)) {\n      if (process.env.NODE_ENV !== \"production\") {\n        console.error(INVALID_ELEMENT_ERROR);\n      }\n\n      return instance;\n    }\n\n    instance.setOptions(options).then(function (state) {\n      if (!isDestroyed && options.onFirstUpdate) {\n        options.onFirstUpdate(state);\n      }\n    }); // Modifiers have the ability to execute arbitrary code before the first\n    // update cycle runs. They will be executed in the same order as the update\n    // cycle. This is useful when a modifier adds some persistent data that\n    // other modifiers need to use, but the modifier is run after the dependent\n    // one.\n\n    function runModifierEffects() {\n      state.orderedModifiers.forEach(function (_ref3) {\n        var name = _ref3.name,\n            _ref3$options = _ref3.options,\n            options = _ref3$options === void 0 ? {} : _ref3$options,\n            effect = _ref3.effect;\n\n        if (typeof effect === 'function') {\n          var cleanupFn = effect({\n            state: state,\n            name: name,\n            instance: instance,\n            options: options\n          });\n\n          var noopFn = function noopFn() {};\n\n          effectCleanupFns.push(cleanupFn || noopFn);\n        }\n      });\n    }\n\n    function cleanupModifierEffects() {\n      effectCleanupFns.forEach(function (fn) {\n        return fn();\n      });\n      effectCleanupFns = [];\n    }\n\n    return instance;\n  };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n  defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";", "export * from \"./enums.js\";\nexport * from \"./modifiers/index.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { popperGenerator, detectOverflow, createPopper as createPopperBase } from \"./createPopper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper } from \"./popper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\";", "/*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\n// @function extend(dest: Object, src?: Object): Object\r\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\nexport function extend(dest) {\r\n\tvar i, j, len, src;\r\n\r\n\tfor (j = 1, len = arguments.length; j < len; j++) {\r\n\t\tsrc = arguments[j];\r\n\t\tfor (i in src) {\r\n\t\t\tdest[i] = src[i];\r\n\t\t}\r\n\t}\r\n\treturn dest;\r\n}\r\n\r\n// @function create(proto: Object, properties?: Object): Object\r\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\nexport var create = Object.create || (function () {\r\n\tfunction F() {}\r\n\treturn function (proto) {\r\n\t\tF.prototype = proto;\r\n\t\treturn new F();\r\n\t};\r\n})();\r\n\r\n// @function bind(fn: Function, \u2026): Function\r\n// 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\n// Has a `L.bind()` shortcut.\r\nexport function bind(fn, obj) {\r\n\tvar slice = Array.prototype.slice;\r\n\r\n\tif (fn.bind) {\r\n\t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n\t}\r\n\r\n\tvar args = slice.call(arguments, 2);\r\n\r\n\treturn function () {\r\n\t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n\t};\r\n}\r\n\r\n// @property lastId: Number\r\n// Last unique ID used by [`stamp()`](#util-stamp)\r\nexport var lastId = 0;\r\n\r\n// @function stamp(obj: Object): Number\r\n// Returns the unique ID of an object, assigning it one if it doesn't have it.\r\nexport function stamp(obj) {\r\n\tif (!('_leaflet_id' in obj)) {\r\n\t\tobj['_leaflet_id'] = ++lastId;\r\n\t}\r\n\treturn obj._leaflet_id;\r\n}\r\n\r\n// @function throttle(fn: Function, time: Number, context: Object): Function\r\n// Returns a function which executes function `fn` with the given scope `context`\r\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n// `fn` will be called no more than one time per given amount of `time`. The arguments\r\n// received by the bound function will be any arguments passed when binding the\r\n// function, followed by any arguments passed when invoking the bound function.\r\n// Has an `L.throttle` shortcut.\r\nexport function throttle(fn, time, context) {\r\n\tvar lock, args, wrapperFn, later;\r\n\r\n\tlater = function () {\r\n\t\t// reset lock and call if queued\r\n\t\tlock = false;\r\n\t\tif (args) {\r\n\t\t\twrapperFn.apply(context, args);\r\n\t\t\targs = false;\r\n\t\t}\r\n\t};\r\n\r\n\twrapperFn = function () {\r\n\t\tif (lock) {\r\n\t\t\t// called too soon, queue to call later\r\n\t\t\targs = arguments;\r\n\r\n\t\t} else {\r\n\t\t\t// call and lock until later\r\n\t\t\tfn.apply(context, arguments);\r\n\t\t\tsetTimeout(later, time);\r\n\t\t\tlock = true;\r\n\t\t}\r\n\t};\r\n\r\n\treturn wrapperFn;\r\n}\r\n\r\n// @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\r\n// Returns the number `num` modulo `range` in such a way so it lies within\r\n// `range[0]` and `range[1]`. The returned value will be always smaller than\r\n// `range[1]` unless `includeMax` is set to `true`.\r\nexport function wrapNum(x, range, includeMax) {\r\n\tvar max = range[1],\r\n\t    min = range[0],\r\n\t    d = max - min;\r\n\treturn x === max && includeMax ? x : ((x - min) % d + d) % d + min;\r\n}\r\n\r\n// @function falseFn(): Function\r\n// Returns a function which always returns `false`.\r\nexport function falseFn() { return false; }\r\n\r\n// @function formatNum(num: Number, precision?: Number|false): Number\r\n// Returns the number `num` rounded with specified `precision`.\r\n// The default `precision` value is 6 decimal places.\r\n// `false` can be passed to skip any processing (can be useful to avoid round-off errors).\r\nexport function formatNum(num, precision) {\r\n\tif (precision === false) { return num; }\r\n\tvar pow = Math.pow(10, precision === undefined ? 6 : precision);\r\n\treturn Math.round(num * pow) / pow;\r\n}\r\n\r\n// @function trim(str: String): String\r\n// Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\r\nexport function trim(str) {\r\n\treturn str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\r\n}\r\n\r\n// @function splitWords(str: String): String[]\r\n// Trims and splits the string on whitespace and returns the array of parts.\r\nexport function splitWords(str) {\r\n\treturn trim(str).split(/\\s+/);\r\n}\r\n\r\n// @function setOptions(obj: Object, options: Object): Object\r\n// Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\r\nexport function setOptions(obj, options) {\r\n\tif (!Object.prototype.hasOwnProperty.call(obj, 'options')) {\r\n\t\tobj.options = obj.options ? create(obj.options) : {};\r\n\t}\r\n\tfor (var i in options) {\r\n\t\tobj.options[i] = options[i];\r\n\t}\r\n\treturn obj.options;\r\n}\r\n\r\n// @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\r\n// Converts an object into a parameter URL string, e.g. `{a: \"foo\", b: \"bar\"}`\r\n// translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\r\n// be appended at the end. If `uppercase` is `true`, the parameter names will\r\n// be uppercased (e.g. `'?A=foo&B=bar'`)\r\nexport function getParamString(obj, existingUrl, uppercase) {\r\n\tvar params = [];\r\n\tfor (var i in obj) {\r\n\t\tparams.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\r\n\t}\r\n\treturn ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\r\n}\r\n\r\nvar templateRe = /\\{ *([\\w_ -]+) *\\}/g;\r\n\r\n// @function template(str: String, data: Object): String\r\n// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\r\n// and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\r\n// `('Hello foo, bar')`. You can also specify functions instead of strings for\r\n// data values \u2014 they will be evaluated passing `data` as an argument.\r\nexport function template(str, data) {\r\n\treturn str.replace(templateRe, function (str, key) {\r\n\t\tvar value = data[key];\r\n\r\n\t\tif (value === undefined) {\r\n\t\t\tthrow new Error('No value provided for variable ' + str);\r\n\r\n\t\t} else if (typeof value === 'function') {\r\n\t\t\tvalue = value(data);\r\n\t\t}\r\n\t\treturn value;\r\n\t});\r\n}\r\n\r\n// @function isArray(obj): Boolean\r\n// Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\r\nexport var isArray = Array.isArray || function (obj) {\r\n\treturn (Object.prototype.toString.call(obj) === '[object Array]');\r\n};\r\n\r\n// @function indexOf(array: Array, el: Object): Number\r\n// Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\r\nexport function indexOf(array, el) {\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tif (array[i] === el) { return i; }\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\n// @property emptyImageUrl: String\r\n// Data URI string containing a base64-encoded empty GIF image.\r\n// Used as a hack to free memory from unused images on WebKit-powered\r\n// mobile devices (by setting image `src` to this string).\r\nexport var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\r\n\r\n// inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n\r\nfunction getPrefixed(name) {\r\n\treturn window['webkit' + name] || window['moz' + name] || window['ms' + name];\r\n}\r\n\r\nvar lastTime = 0;\r\n\r\n// fallback for IE 7-8\r\nfunction timeoutDefer(fn) {\r\n\tvar time = +new Date(),\r\n\t    timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n\tlastTime = time + timeToCall;\r\n\treturn window.setTimeout(fn, timeToCall);\r\n}\r\n\r\nexport var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\r\nexport var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\r\n\t\tgetPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\r\n\r\n// @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\r\n// Schedules `fn` to be executed when the browser repaints. `fn` is bound to\r\n// `context` if given. When `immediate` is set, `fn` is called immediately if\r\n// the browser doesn't have native support for\r\n// [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\r\n// otherwise it's delayed. Returns a request ID that can be used to cancel the request.\r\nexport function requestAnimFrame(fn, context, immediate) {\r\n\tif (immediate && requestFn === timeoutDefer) {\r\n\t\tfn.call(context);\r\n\t} else {\r\n\t\treturn requestFn.call(window, bind(fn, context));\r\n\t}\r\n}\r\n\r\n// @function cancelAnimFrame(id: Number): undefined\r\n// Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\r\nexport function cancelAnimFrame(id) {\r\n\tif (id) {\r\n\t\tcancelFn.call(window, id);\r\n\t}\r\n}\r\n", "import * as Util from './Util';\r\n\r\n// @class Class\r\n// @aka L.Class\r\n\r\n// @section\r\n// @uninheritable\r\n\r\n// Thanks to John Resig and Dean Edwards for inspiration!\r\n\r\nexport function Class() {}\r\n\r\nClass.extend = function (props) {\r\n\r\n\t// @function extend(props: Object): Function\r\n\t// [Extends the current class](#class-inheritance) given the properties to be included.\r\n\t// Returns a Javascript function that is a class constructor (to be called with `new`).\r\n\tvar NewClass = function () {\r\n\r\n\t\tUtil.setOptions(this);\r\n\r\n\t\t// call the constructor\r\n\t\tif (this.initialize) {\r\n\t\t\tthis.initialize.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\t// call all constructor hooks\r\n\t\tthis.callInitHooks();\r\n\t};\r\n\r\n\tvar parentProto = NewClass.__super__ = this.prototype;\r\n\r\n\tvar proto = Util.create(parentProto);\r\n\tproto.constructor = NewClass;\r\n\r\n\tNewClass.prototype = proto;\r\n\r\n\t// inherit parent's statics\r\n\tfor (var i in this) {\r\n\t\tif (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') {\r\n\t\t\tNewClass[i] = this[i];\r\n\t\t}\r\n\t}\r\n\r\n\t// mix static properties into the class\r\n\tif (props.statics) {\r\n\t\tUtil.extend(NewClass, props.statics);\r\n\t}\r\n\r\n\t// mix includes into the prototype\r\n\tif (props.includes) {\r\n\t\tcheckDeprecatedMixinEvents(props.includes);\r\n\t\tUtil.extend.apply(null, [proto].concat(props.includes));\r\n\t}\r\n\r\n\t// mix given properties into the prototype\r\n\tUtil.extend(proto, props);\r\n\tdelete proto.statics;\r\n\tdelete proto.includes;\r\n\r\n\t// merge options\r\n\tif (proto.options) {\r\n\t\tproto.options = parentProto.options ? Util.create(parentProto.options) : {};\r\n\t\tUtil.extend(proto.options, props.options);\r\n\t}\r\n\r\n\tproto._initHooks = [];\r\n\r\n\t// add method for calling all hooks\r\n\tproto.callInitHooks = function () {\r\n\r\n\t\tif (this._initHooksCalled) { return; }\r\n\r\n\t\tif (parentProto.callInitHooks) {\r\n\t\t\tparentProto.callInitHooks.call(this);\r\n\t\t}\r\n\r\n\t\tthis._initHooksCalled = true;\r\n\r\n\t\tfor (var i = 0, len = proto._initHooks.length; i < len; i++) {\r\n\t\t\tproto._initHooks[i].call(this);\r\n\t\t}\r\n\t};\r\n\r\n\treturn NewClass;\r\n};\r\n\r\n\r\n// @function include(properties: Object): this\r\n// [Includes a mixin](#class-includes) into the current class.\r\nClass.include = function (props) {\r\n\tvar parentOptions = this.prototype.options;\r\n\tUtil.extend(this.prototype, props);\r\n\tif (props.options) {\r\n\t\tthis.prototype.options = parentOptions;\r\n\t\tthis.mergeOptions(props.options);\r\n\t}\r\n\treturn this;\r\n};\r\n\r\n// @function mergeOptions(options: Object): this\r\n// [Merges `options`](#class-options) into the defaults of the class.\r\nClass.mergeOptions = function (options) {\r\n\tUtil.extend(this.prototype.options, options);\r\n\treturn this;\r\n};\r\n\r\n// @function addInitHook(fn: Function): this\r\n// Adds a [constructor hook](#class-constructor-hooks) to the class.\r\nClass.addInitHook = function (fn) { // (Function) || (String, args...)\r\n\tvar args = Array.prototype.slice.call(arguments, 1);\r\n\r\n\tvar init = typeof fn === 'function' ? fn : function () {\r\n\t\tthis[fn].apply(this, args);\r\n\t};\r\n\r\n\tthis.prototype._initHooks = this.prototype._initHooks || [];\r\n\tthis.prototype._initHooks.push(init);\r\n\treturn this;\r\n};\r\n\r\nfunction checkDeprecatedMixinEvents(includes) {\r\n\t/* global L: true */\r\n\tif (typeof L === 'undefined' || !L || !L.Mixin) { return; }\r\n\r\n\tincludes = Util.isArray(includes) ? includes : [includes];\r\n\r\n\tfor (var i = 0; i < includes.length; i++) {\r\n\t\tif (includes[i] === L.Mixin.Events) {\r\n\t\t\tconsole.warn('Deprecated include of L.Mixin.Events: ' +\r\n\t\t\t\t'this property will be removed in future releases, ' +\r\n\t\t\t\t'please inherit from L.Evented instead.', new Error().stack);\r\n\t\t}\r\n\t}\r\n}\r\n", "import {Class} from './Class';\r\nimport * as Util from './Util';\r\n\r\n/*\r\n * @class Evented\r\n * @aka L.Evented\r\n * @inherits Class\r\n *\r\n * 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\n *\r\n * @example\r\n *\r\n * ```js\r\n * map.on('click', function(e) {\r\n * \talert(e.latlng);\r\n * } );\r\n * ```\r\n *\r\n * 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\n *\r\n * ```js\r\n * function onClick(e) { ... }\r\n *\r\n * map.on('click', onClick);\r\n * map.off('click', onClick);\r\n * ```\r\n */\r\n\r\nexport var Events = {\r\n\t/* @method on(type: String, fn: Function, context?: Object): this\r\n\t * 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\n\t *\r\n\t * @alternative\r\n\t * @method on(eventMap: Object): this\r\n\t * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\t */\r\n\ton: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/* @method off(type: String, fn?: Function, context?: Object): this\r\n\t * 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\n\t *\r\n\t * @alternative\r\n\t * @method off(eventMap: Object): this\r\n\t * Removes a set of type/listener pairs.\r\n\t *\r\n\t * @alternative\r\n\t * @method off: this\r\n\t * Removes all listeners to all events on the object. This includes implicitly attached events.\r\n\t */\r\n\toff: function (types, fn, context) {\r\n\r\n\t\tif (!arguments.length) {\r\n\t\t\t// clear all listeners if called without arguments\r\n\t\t\tdelete this._events;\r\n\r\n\t\t} else if (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\tthis._off(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tvar removeAll = arguments.length === 1;\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tif (removeAll) {\r\n\t\t\t\t\tthis._off(types[i]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._off(types[i], fn, context);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// attach listener (without syntactic sugar now)\r\n\t_on: function (type, fn, context, _once) {\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// check if fn already there\r\n\t\tif (this._listens(type, fn, context) !== false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tvar newListener = {fn: fn, ctx: context};\r\n\t\tif (_once) {\r\n\t\t\tnewListener.once = true;\r\n\t\t}\r\n\r\n\t\tthis._events = this._events || {};\r\n\t\tthis._events[type] = this._events[type] || [];\r\n\t\tthis._events[type].push(newListener);\r\n\t},\r\n\r\n\t_off: function (type, fn, context) {\r\n\t\tvar listeners,\r\n\t\t    i,\r\n\t\t    len;\r\n\r\n\t\tif (!this._events) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlisteners = this._events[type];\r\n\t\tif (!listeners) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (arguments.length === 1) { // remove all\r\n\t\t\tif (this._firingCount) {\r\n\t\t\t\t// Set all removed listeners to noop\r\n\t\t\t\t// so they are not called if remove happens in fire\r\n\t\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tlisteners[i].fn = Util.falseFn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// clear all listeners for a type if function isn't specified\r\n\t\t\tdelete this._events[type];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// find fn and remove it\r\n\t\tvar index = this._listens(type, fn, context);\r\n\t\tif (index !== false) {\r\n\t\t\tvar listener = listeners[index];\r\n\t\t\tif (this._firingCount) {\r\n\t\t\t\t// set the removed listener to noop so that's not called if remove happens in fire\r\n\t\t\t\tlistener.fn = Util.falseFn;\r\n\r\n\t\t\t\t/* copy array in case events are being fired */\r\n\t\t\t\tthis._events[type] = listeners = listeners.slice();\r\n\t\t\t}\r\n\t\t\tlisteners.splice(index, 1);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method fire(type: String, data?: Object, propagate?: Boolean): this\r\n\t// Fires an event of the specified type. You can optionally provide a data\r\n\t// object \u2014 the first argument of the listener function will contain its\r\n\t// properties. The event can optionally be propagated to event parents.\r\n\tfire: function (type, data, propagate) {\r\n\t\tif (!this.listens(type, propagate)) { return this; }\r\n\r\n\t\tvar event = Util.extend({}, data, {\r\n\t\t\ttype: type,\r\n\t\t\ttarget: this,\r\n\t\t\tsourceTarget: data && data.sourceTarget || this\r\n\t\t});\r\n\r\n\t\tif (this._events) {\r\n\t\t\tvar listeners = this._events[type];\r\n\t\t\tif (listeners) {\r\n\t\t\t\tthis._firingCount = (this._firingCount + 1) || 1;\r\n\t\t\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tvar l = listeners[i];\r\n\t\t\t\t\t// off overwrites l.fn, so we need to copy fn to a var\r\n\t\t\t\t\tvar fn = l.fn;\r\n\t\t\t\t\tif (l.once) {\r\n\t\t\t\t\t\tthis.off(type, fn, l.ctx);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfn.call(l.ctx || this, event);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._firingCount--;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// propagate the event to parents (set with addEventParent)\r\n\t\t\tthis._propagateEvent(event);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method listens(type: String, propagate?: Boolean): Boolean\r\n\t// @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean\r\n\t// Returns `true` if a particular event type has any listeners attached to it.\r\n\t// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.\r\n\tlistens: function (type, fn, context, propagate) {\r\n\t\tif (typeof type !== 'string') {\r\n\t\t\tconsole.warn('\"string\" type argument expected');\r\n\t\t}\r\n\r\n\t\t// we don't overwrite the input `fn` value, because we need to use it for propagation\r\n\t\tvar _fn = fn;\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tpropagate = !!fn;\r\n\t\t\t_fn = undefined;\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tvar listeners = this._events && this._events[type];\r\n\t\tif (listeners && listeners.length) {\r\n\t\t\tif (this._listens(type, _fn, context) !== false) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// also check parents for listeners if event propagates\r\n\t\t\tfor (var id in this._eventParents) {\r\n\t\t\t\tif (this._eventParents[id].listens(type, fn, context, propagate)) { return true; }\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t// returns the index (number) or false\r\n\t_listens: function (type, fn, context) {\r\n\t\tif (!this._events) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar listeners = this._events[type] || [];\r\n\t\tif (!fn) {\r\n\t\t\treturn !!listeners.length;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\tif (listeners[i].fn === fn && listeners[i].ctx === context) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t},\r\n\r\n\t// @method once(\u2026): this\r\n\t// Behaves as [`on(\u2026)`](#evented-on), except the listener will only get fired once and then removed.\r\n\tonce: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn, true);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method addEventParent(obj: Evented): this\r\n\t// Adds an event parent - an `Evented` that will receive propagated events\r\n\taddEventParent: function (obj) {\r\n\t\tthis._eventParents = this._eventParents || {};\r\n\t\tthis._eventParents[Util.stamp(obj)] = obj;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeEventParent(obj: Evented): this\r\n\t// Removes an event parent, so it will stop receiving propagated events\r\n\tremoveEventParent: function (obj) {\r\n\t\tif (this._eventParents) {\r\n\t\t\tdelete this._eventParents[Util.stamp(obj)];\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_propagateEvent: function (e) {\r\n\t\tfor (var id in this._eventParents) {\r\n\t\t\tthis._eventParents[id].fire(e.type, Util.extend({\r\n\t\t\t\tlayer: e.target,\r\n\t\t\t\tpropagatedFrom: e.target\r\n\t\t\t}, e), true);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n// aliases; we should ditch those eventually\r\n\r\n// @method addEventListener(\u2026): this\r\n// Alias to [`on(\u2026)`](#evented-on)\r\nEvents.addEventListener = Events.on;\r\n\r\n// @method removeEventListener(\u2026): this\r\n// Alias to [`off(\u2026)`](#evented-off)\r\n\r\n// @method clearAllEventListeners(\u2026): this\r\n// Alias to [`off()`](#evented-off)\r\nEvents.removeEventListener = Events.clearAllEventListeners = Events.off;\r\n\r\n// @method addOneTimeEventListener(\u2026): this\r\n// Alias to [`once(\u2026)`](#evented-once)\r\nEvents.addOneTimeEventListener = Events.once;\r\n\r\n// @method fireEvent(\u2026): this\r\n// Alias to [`fire(\u2026)`](#evented-fire)\r\nEvents.fireEvent = Events.fire;\r\n\r\n// @method hasEventListeners(\u2026): Boolean\r\n// Alias to [`listens(\u2026)`](#evented-listens)\r\nEvents.hasEventListeners = Events.listens;\r\n\r\nexport var Evented = Class.extend(Events);\r\n", "import {isArray, formatNum} from '../core/Util';\r\n\r\n/*\r\n * @class Point\r\n * @aka L.Point\r\n *\r\n * Represents a point with `x` and `y` coordinates in pixels.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var point = L.point(200, 300);\r\n * ```\r\n *\r\n * 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\n *\r\n * ```js\r\n * map.panBy([200, 300]);\r\n * map.panBy(L.point(200, 300));\r\n * ```\r\n *\r\n * Note that `Point` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function Point(x, y, round) {\r\n\t// @property x: Number; The `x` coordinate of the point\r\n\tthis.x = (round ? Math.round(x) : x);\r\n\t// @property y: Number; The `y` coordinate of the point\r\n\tthis.y = (round ? Math.round(y) : y);\r\n}\r\n\r\nvar trunc = Math.trunc || function (v) {\r\n\treturn v > 0 ? Math.floor(v) : Math.ceil(v);\r\n};\r\n\r\nPoint.prototype = {\r\n\r\n\t// @method clone(): Point\r\n\t// Returns a copy of the current point.\r\n\tclone: function () {\r\n\t\treturn new Point(this.x, this.y);\r\n\t},\r\n\r\n\t// @method add(otherPoint: Point): Point\r\n\t// Returns the result of addition of the current and the given points.\r\n\tadd: function (point) {\r\n\t\t// non-destructive, returns a new point\r\n\t\treturn this.clone()._add(toPoint(point));\r\n\t},\r\n\r\n\t_add: function (point) {\r\n\t\t// destructive, used directly for performance in situations where it's safe to modify existing point\r\n\t\tthis.x += point.x;\r\n\t\tthis.y += point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method subtract(otherPoint: Point): Point\r\n\t// Returns the result of subtraction of the given point from the current.\r\n\tsubtract: function (point) {\r\n\t\treturn this.clone()._subtract(toPoint(point));\r\n\t},\r\n\r\n\t_subtract: function (point) {\r\n\t\tthis.x -= point.x;\r\n\t\tthis.y -= point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method divideBy(num: Number): Point\r\n\t// Returns the result of division of the current point by the given number.\r\n\tdivideBy: function (num) {\r\n\t\treturn this.clone()._divideBy(num);\r\n\t},\r\n\r\n\t_divideBy: function (num) {\r\n\t\tthis.x /= num;\r\n\t\tthis.y /= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method multiplyBy(num: Number): Point\r\n\t// Returns the result of multiplication of the current point by the given number.\r\n\tmultiplyBy: function (num) {\r\n\t\treturn this.clone()._multiplyBy(num);\r\n\t},\r\n\r\n\t_multiplyBy: function (num) {\r\n\t\tthis.x *= num;\r\n\t\tthis.y *= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method scaleBy(scale: Point): Point\r\n\t// Multiply each coordinate of the current point by each coordinate of\r\n\t// `scale`. In linear algebra terms, multiply the point by the\r\n\t// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r\n\t// defined by `scale`.\r\n\tscaleBy: function (point) {\r\n\t\treturn new Point(this.x * point.x, this.y * point.y);\r\n\t},\r\n\r\n\t// @method unscaleBy(scale: Point): Point\r\n\t// Inverse of `scaleBy`. Divide each coordinate of the current point by\r\n\t// each coordinate of `scale`.\r\n\tunscaleBy: function (point) {\r\n\t\treturn new Point(this.x / point.x, this.y / point.y);\r\n\t},\r\n\r\n\t// @method round(): Point\r\n\t// Returns a copy of the current point with rounded coordinates.\r\n\tround: function () {\r\n\t\treturn this.clone()._round();\r\n\t},\r\n\r\n\t_round: function () {\r\n\t\tthis.x = Math.round(this.x);\r\n\t\tthis.y = Math.round(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method floor(): Point\r\n\t// Returns a copy of the current point with floored coordinates (rounded down).\r\n\tfloor: function () {\r\n\t\treturn this.clone()._floor();\r\n\t},\r\n\r\n\t_floor: function () {\r\n\t\tthis.x = Math.floor(this.x);\r\n\t\tthis.y = Math.floor(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method ceil(): Point\r\n\t// Returns a copy of the current point with ceiled coordinates (rounded up).\r\n\tceil: function () {\r\n\t\treturn this.clone()._ceil();\r\n\t},\r\n\r\n\t_ceil: function () {\r\n\t\tthis.x = Math.ceil(this.x);\r\n\t\tthis.y = Math.ceil(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method trunc(): Point\r\n\t// Returns a copy of the current point with truncated coordinates (rounded towards zero).\r\n\ttrunc: function () {\r\n\t\treturn this.clone()._trunc();\r\n\t},\r\n\r\n\t_trunc: function () {\r\n\t\tthis.x = trunc(this.x);\r\n\t\tthis.y = trunc(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method distanceTo(otherPoint: Point): Number\r\n\t// Returns the cartesian distance between the current and the given points.\r\n\tdistanceTo: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\tvar x = point.x - this.x,\r\n\t\t    y = point.y - this.y;\r\n\r\n\t\treturn Math.sqrt(x * x + y * y);\r\n\t},\r\n\r\n\t// @method equals(otherPoint: Point): Boolean\r\n\t// Returns `true` if the given point has the same coordinates.\r\n\tequals: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn point.x === this.x &&\r\n\t\t       point.y === this.y;\r\n\t},\r\n\r\n\t// @method contains(otherPoint: Point): Boolean\r\n\t// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r\n\tcontains: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn Math.abs(point.x) <= Math.abs(this.x) &&\r\n\t\t       Math.abs(point.y) <= Math.abs(this.y);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point for debugging purposes.\r\n\ttoString: function () {\r\n\t\treturn 'Point(' +\r\n\t\t        formatNum(this.x) + ', ' +\r\n\t\t        formatNum(this.y) + ')';\r\n\t}\r\n};\r\n\r\n// @factory L.point(x: Number, y: Number, round?: Boolean)\r\n// 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\n\r\n// @alternative\r\n// @factory L.point(coords: Number[])\r\n// Expects an array of the form `[x, y]` instead.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Object)\r\n// Expects a plain object of the form `{x: Number, y: Number}` instead.\r\nexport function toPoint(x, y, round) {\r\n\tif (x instanceof Point) {\r\n\t\treturn x;\r\n\t}\r\n\tif (isArray(x)) {\r\n\t\treturn new Point(x[0], x[1]);\r\n\t}\r\n\tif (x === undefined || x === null) {\r\n\t\treturn x;\r\n\t}\r\n\tif (typeof x === 'object' && 'x' in x && 'y' in x) {\r\n\t\treturn new Point(x.x, x.y);\r\n\t}\r\n\treturn new Point(x, y, round);\r\n}\r\n", "import {Point, toPoint} from './Point';\r\n\r\n/*\r\n * @class Bounds\r\n * @aka L.Bounds\r\n *\r\n * Represents a rectangular area in pixel coordinates.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var p1 = L.point(10, 10),\r\n * p2 = L.point(40, 60),\r\n * bounds = L.bounds(p1, p2);\r\n * ```\r\n *\r\n * 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\n *\r\n * ```js\r\n * otherBounds.intersects([[10, 10], [40, 60]]);\r\n * ```\r\n *\r\n * Note that `Bounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function Bounds(a, b) {\r\n\tif (!a) { return; }\r\n\r\n\tvar points = b ? [a, b] : a;\r\n\r\n\tfor (var i = 0, len = points.length; i < len; i++) {\r\n\t\tthis.extend(points[i]);\r\n\t}\r\n}\r\n\r\nBounds.prototype = {\r\n\t// @method extend(point: Point): this\r\n\t// Extends the bounds to contain the given point.\r\n\r\n\t// @alternative\r\n\t// @method extend(otherBounds: Bounds): this\r\n\t// Extend the bounds to contain the given bounds\r\n\textend: function (obj) {\r\n\t\tvar min2, max2;\r\n\t\tif (!obj) { return this; }\r\n\r\n\t\tif (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) {\r\n\t\t\tmin2 = max2 = toPoint(obj);\r\n\t\t} else {\r\n\t\t\tobj = toBounds(obj);\r\n\t\t\tmin2 = obj.min;\r\n\t\t\tmax2 = obj.max;\r\n\r\n\t\t\tif (!min2 || !max2) { return this; }\r\n\t\t}\r\n\r\n\t\t// @property min: Point\r\n\t\t// The top left corner of the rectangle.\r\n\t\t// @property max: Point\r\n\t\t// The bottom right corner of the rectangle.\r\n\t\tif (!this.min && !this.max) {\r\n\t\t\tthis.min = min2.clone();\r\n\t\t\tthis.max = max2.clone();\r\n\t\t} else {\r\n\t\t\tthis.min.x = Math.min(min2.x, this.min.x);\r\n\t\t\tthis.max.x = Math.max(max2.x, this.max.x);\r\n\t\t\tthis.min.y = Math.min(min2.y, this.min.y);\r\n\t\t\tthis.max.y = Math.max(max2.y, this.max.y);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getCenter(round?: Boolean): Point\r\n\t// Returns the center point of the bounds.\r\n\tgetCenter: function (round) {\r\n\t\treturn toPoint(\r\n\t\t        (this.min.x + this.max.x) / 2,\r\n\t\t        (this.min.y + this.max.y) / 2, round);\r\n\t},\r\n\r\n\t// @method getBottomLeft(): Point\r\n\t// Returns the bottom-left point of the bounds.\r\n\tgetBottomLeft: function () {\r\n\t\treturn toPoint(this.min.x, this.max.y);\r\n\t},\r\n\r\n\t// @method getTopRight(): Point\r\n\t// Returns the top-right point of the bounds.\r\n\tgetTopRight: function () { // -> Point\r\n\t\treturn toPoint(this.max.x, this.min.y);\r\n\t},\r\n\r\n\t// @method getTopLeft(): Point\r\n\t// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).\r\n\tgetTopLeft: function () {\r\n\t\treturn this.min; // left, top\r\n\t},\r\n\r\n\t// @method getBottomRight(): Point\r\n\t// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).\r\n\tgetBottomRight: function () {\r\n\t\treturn this.max; // right, bottom\r\n\t},\r\n\r\n\t// @method getSize(): Point\r\n\t// Returns the size of the given bounds\r\n\tgetSize: function () {\r\n\t\treturn this.max.subtract(this.min);\r\n\t},\r\n\r\n\t// @method contains(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle contains the given one.\r\n\t// @alternative\r\n\t// @method contains(point: Point): Boolean\r\n\t// Returns `true` if the rectangle contains the given point.\r\n\tcontains: function (obj) {\r\n\t\tvar min, max;\r\n\r\n\t\tif (typeof obj[0] === 'number' || obj instanceof Point) {\r\n\t\t\tobj = toPoint(obj);\r\n\t\t} else {\r\n\t\t\tobj = toBounds(obj);\r\n\t\t}\r\n\r\n\t\tif (obj instanceof Bounds) {\r\n\t\t\tmin = obj.min;\r\n\t\t\tmax = obj.max;\r\n\t\t} else {\r\n\t\t\tmin = max = obj;\r\n\t\t}\r\n\r\n\t\treturn (min.x >= this.min.x) &&\r\n\t\t       (max.x <= this.max.x) &&\r\n\t\t       (min.y >= this.min.y) &&\r\n\t\t       (max.y <= this.max.y);\r\n\t},\r\n\r\n\t// @method intersects(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle intersects the given bounds. Two bounds\r\n\t// intersect if they have at least one point in common.\r\n\tintersects: function (bounds) { // (Bounds) -> Boolean\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\tvar min = this.min,\r\n\t\t    max = this.max,\r\n\t\t    min2 = bounds.min,\r\n\t\t    max2 = bounds.max,\r\n\t\t    xIntersects = (max2.x >= min.x) && (min2.x <= max.x),\r\n\t\t    yIntersects = (max2.y >= min.y) && (min2.y <= max.y);\r\n\r\n\t\treturn xIntersects && yIntersects;\r\n\t},\r\n\r\n\t// @method overlaps(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle overlaps the given bounds. Two bounds\r\n\t// overlap if their intersection is an area.\r\n\toverlaps: function (bounds) { // (Bounds) -> Boolean\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\tvar min = this.min,\r\n\t\t    max = this.max,\r\n\t\t    min2 = bounds.min,\r\n\t\t    max2 = bounds.max,\r\n\t\t    xOverlaps = (max2.x > min.x) && (min2.x < max.x),\r\n\t\t    yOverlaps = (max2.y > min.y) && (min2.y < max.y);\r\n\r\n\t\treturn xOverlaps && yOverlaps;\r\n\t},\r\n\r\n\t// @method isValid(): Boolean\r\n\t// Returns `true` if the bounds are properly initialized.\r\n\tisValid: function () {\r\n\t\treturn !!(this.min && this.max);\r\n\t},\r\n\r\n\r\n\t// @method pad(bufferRatio: Number): Bounds\r\n\t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n\t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n\t// Negative values will retract the bounds.\r\n\tpad: function (bufferRatio) {\r\n\t\tvar min = this.min,\r\n\t\tmax = this.max,\r\n\t\theightBuffer = Math.abs(min.x - max.x) * bufferRatio,\r\n\t\twidthBuffer = Math.abs(min.y - max.y) * bufferRatio;\r\n\r\n\r\n\t\treturn toBounds(\r\n\t\t\ttoPoint(min.x - heightBuffer, min.y - widthBuffer),\r\n\t\t\ttoPoint(max.x + heightBuffer, max.y + widthBuffer));\r\n\t},\r\n\r\n\r\n\t// @method equals(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle is equivalent to the given bounds.\r\n\tequals: function (bounds) {\r\n\t\tif (!bounds) { return false; }\r\n\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\treturn this.min.equals(bounds.getTopLeft()) &&\r\n\t\t\tthis.max.equals(bounds.getBottomRight());\r\n\t},\r\n};\r\n\r\n\r\n// @factory L.bounds(corner1: Point, corner2: Point)\r\n// Creates a Bounds object from two corners coordinate pairs.\r\n// @alternative\r\n// @factory L.bounds(points: Point[])\r\n// Creates a Bounds object from the given array of points.\r\nexport function toBounds(a, b) {\r\n\tif (!a || a instanceof Bounds) {\r\n\t\treturn a;\r\n\t}\r\n\treturn new Bounds(a, b);\r\n}\r\n", "import {LatLng, toLatLng} from './LatLng';\r\n\r\n/*\r\n * @class LatLngBounds\r\n * @aka L.LatLngBounds\r\n *\r\n * Represents a rectangular geographical area on a map.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var corner1 = L.latLng(40.712, -74.227),\r\n * corner2 = L.latLng(40.774, -74.125),\r\n * bounds = L.latLngBounds(corner1, corner2);\r\n * ```\r\n *\r\n * 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\n *\r\n * ```js\r\n * map.fitBounds([\r\n * \t[40.712, -74.227],\r\n * \t[40.774, -74.125]\r\n * ]);\r\n * ```\r\n *\r\n * 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\n *\r\n * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\r\n\tif (!corner1) { return; }\r\n\r\n\tvar latlngs = corner2 ? [corner1, corner2] : corner1;\r\n\r\n\tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n\t\tthis.extend(latlngs[i]);\r\n\t}\r\n}\r\n\r\nLatLngBounds.prototype = {\r\n\r\n\t// @method extend(latlng: LatLng): this\r\n\t// Extend the bounds to contain the given point\r\n\r\n\t// @alternative\r\n\t// @method extend(otherBounds: LatLngBounds): this\r\n\t// Extend the bounds to contain the given bounds\r\n\textend: function (obj) {\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2, ne2;\r\n\r\n\t\tif (obj instanceof LatLng) {\r\n\t\t\tsw2 = obj;\r\n\t\t\tne2 = obj;\r\n\r\n\t\t} else if (obj instanceof LatLngBounds) {\r\n\t\t\tsw2 = obj._southWest;\r\n\t\t\tne2 = obj._northEast;\r\n\r\n\t\t\tif (!sw2 || !ne2) { return this; }\r\n\r\n\t\t} else {\r\n\t\t\treturn obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;\r\n\t\t}\r\n\r\n\t\tif (!sw && !ne) {\r\n\t\t\tthis._southWest = new LatLng(sw2.lat, sw2.lng);\r\n\t\t\tthis._northEast = new LatLng(ne2.lat, ne2.lng);\r\n\t\t} else {\r\n\t\t\tsw.lat = Math.min(sw2.lat, sw.lat);\r\n\t\t\tsw.lng = Math.min(sw2.lng, sw.lng);\r\n\t\t\tne.lat = Math.max(ne2.lat, ne.lat);\r\n\t\t\tne.lng = Math.max(ne2.lng, ne.lng);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method pad(bufferRatio: Number): LatLngBounds\r\n\t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n\t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n\t// Negative values will retract the bounds.\r\n\tpad: function (bufferRatio) {\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\r\n\t\t    widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\r\n\r\n\t\treturn new LatLngBounds(\r\n\t\t        new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\r\n\t\t        new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\r\n\t},\r\n\r\n\t// @method getCenter(): LatLng\r\n\t// Returns the center point of the bounds.\r\n\tgetCenter: function () {\r\n\t\treturn new LatLng(\r\n\t\t        (this._southWest.lat + this._northEast.lat) / 2,\r\n\t\t        (this._southWest.lng + this._northEast.lng) / 2);\r\n\t},\r\n\r\n\t// @method getSouthWest(): LatLng\r\n\t// Returns the south-west point of the bounds.\r\n\tgetSouthWest: function () {\r\n\t\treturn this._southWest;\r\n\t},\r\n\r\n\t// @method getNorthEast(): LatLng\r\n\t// Returns the north-east point of the bounds.\r\n\tgetNorthEast: function () {\r\n\t\treturn this._northEast;\r\n\t},\r\n\r\n\t// @method getNorthWest(): LatLng\r\n\t// Returns the north-west point of the bounds.\r\n\tgetNorthWest: function () {\r\n\t\treturn new LatLng(this.getNorth(), this.getWest());\r\n\t},\r\n\r\n\t// @method getSouthEast(): LatLng\r\n\t// Returns the south-east point of the bounds.\r\n\tgetSouthEast: function () {\r\n\t\treturn new LatLng(this.getSouth(), this.getEast());\r\n\t},\r\n\r\n\t// @method getWest(): Number\r\n\t// Returns the west longitude of the bounds\r\n\tgetWest: function () {\r\n\t\treturn this._southWest.lng;\r\n\t},\r\n\r\n\t// @method getSouth(): Number\r\n\t// Returns the south latitude of the bounds\r\n\tgetSouth: function () {\r\n\t\treturn this._southWest.lat;\r\n\t},\r\n\r\n\t// @method getEast(): Number\r\n\t// Returns the east longitude of the bounds\r\n\tgetEast: function () {\r\n\t\treturn this._northEast.lng;\r\n\t},\r\n\r\n\t// @method getNorth(): Number\r\n\t// Returns the north latitude of the bounds\r\n\tgetNorth: function () {\r\n\t\treturn this._northEast.lat;\r\n\t},\r\n\r\n\t// @method contains(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle contains the given one.\r\n\r\n\t// @alternative\r\n\t// @method contains (latlng: LatLng): Boolean\r\n\t// Returns `true` if the rectangle contains the given point.\r\n\tcontains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean\r\n\t\tif (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {\r\n\t\t\tobj = toLatLng(obj);\r\n\t\t} else {\r\n\t\t\tobj = toLatLngBounds(obj);\r\n\t\t}\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2, ne2;\r\n\r\n\t\tif (obj instanceof LatLngBounds) {\r\n\t\t\tsw2 = obj.getSouthWest();\r\n\t\t\tne2 = obj.getNorthEast();\r\n\t\t} else {\r\n\t\t\tsw2 = ne2 = obj;\r\n\t\t}\r\n\r\n\t\treturn (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\r\n\t\t       (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\r\n\t},\r\n\r\n\t// @method intersects(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.\r\n\tintersects: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2 = bounds.getSouthWest(),\r\n\t\t    ne2 = bounds.getNorthEast(),\r\n\r\n\t\t    latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\r\n\t\t    lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\r\n\r\n\t\treturn latIntersects && lngIntersects;\r\n\t},\r\n\r\n\t// @method overlaps(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.\r\n\toverlaps: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2 = bounds.getSouthWest(),\r\n\t\t    ne2 = bounds.getNorthEast(),\r\n\r\n\t\t    latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\r\n\t\t    lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\r\n\r\n\t\treturn latOverlaps && lngOverlaps;\r\n\t},\r\n\r\n\t// @method toBBoxString(): String\r\n\t// 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\n\ttoBBoxString: function () {\r\n\t\treturn [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\r\n\t},\r\n\r\n\t// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean\r\n\t// 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\n\tequals: function (bounds, maxMargin) {\r\n\t\tif (!bounds) { return false; }\r\n\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\treturn this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\r\n\t\t       this._northEast.equals(bounds.getNorthEast(), maxMargin);\r\n\t},\r\n\r\n\t// @method isValid(): Boolean\r\n\t// Returns `true` if the bounds are properly initialized.\r\n\tisValid: function () {\r\n\t\treturn !!(this._southWest && this._northEast);\r\n\t}\r\n};\r\n\r\n// TODO International date line?\r\n\r\n// @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)\r\n// Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.\r\n\r\n// @alternative\r\n// @factory L.latLngBounds(latlngs: LatLng[])\r\n// 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\nexport function toLatLngBounds(a, b) {\r\n\tif (a instanceof LatLngBounds) {\r\n\t\treturn a;\r\n\t}\r\n\treturn new LatLngBounds(a, b);\r\n}\r\n", "import * as Util from '../core/Util';\r\nimport {Earth} from './crs/CRS.Earth';\r\nimport {toLatLngBounds} from './LatLngBounds';\r\n\r\n/* @class LatLng\r\n * @aka L.LatLng\r\n *\r\n * Represents a geographical point with a certain latitude and longitude.\r\n *\r\n * @example\r\n *\r\n * ```\r\n * var latlng = L.latLng(50.5, 30.5);\r\n * ```\r\n *\r\n * 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\n *\r\n * ```\r\n * map.panTo([50, 30]);\r\n * map.panTo({lon: 30, lat: 50});\r\n * map.panTo({lat: 50, lng: 30});\r\n * map.panTo(L.latLng(50, 30));\r\n * ```\r\n *\r\n * Note that `LatLng` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function LatLng(lat, lng, alt) {\r\n\tif (isNaN(lat) || isNaN(lng)) {\r\n\t\tthrow new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\r\n\t}\r\n\r\n\t// @property lat: Number\r\n\t// Latitude in degrees\r\n\tthis.lat = +lat;\r\n\r\n\t// @property lng: Number\r\n\t// Longitude in degrees\r\n\tthis.lng = +lng;\r\n\r\n\t// @property alt: Number\r\n\t// Altitude in meters (optional)\r\n\tif (alt !== undefined) {\r\n\t\tthis.alt = +alt;\r\n\t}\r\n}\r\n\r\nLatLng.prototype = {\r\n\t// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean\r\n\t// 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\n\tequals: function (obj, maxMargin) {\r\n\t\tif (!obj) { return false; }\r\n\r\n\t\tobj = toLatLng(obj);\r\n\r\n\t\tvar margin = Math.max(\r\n\t\t        Math.abs(this.lat - obj.lat),\r\n\t\t        Math.abs(this.lng - obj.lng));\r\n\r\n\t\treturn margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point (for debugging purposes).\r\n\ttoString: function (precision) {\r\n\t\treturn 'LatLng(' +\r\n\t\t        Util.formatNum(this.lat, precision) + ', ' +\r\n\t\t        Util.formatNum(this.lng, precision) + ')';\r\n\t},\r\n\r\n\t// @method distanceTo(otherLatLng: LatLng): Number\r\n\t// 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\n\tdistanceTo: function (other) {\r\n\t\treturn Earth.distance(this, toLatLng(other));\r\n\t},\r\n\r\n\t// @method wrap(): LatLng\r\n\t// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.\r\n\twrap: function () {\r\n\t\treturn Earth.wrapLatLng(this);\r\n\t},\r\n\r\n\t// @method toBounds(sizeInMeters: Number): LatLngBounds\r\n\t// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.\r\n\ttoBounds: function (sizeInMeters) {\r\n\t\tvar latAccuracy = 180 * sizeInMeters / 40075017,\r\n\t\t    lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);\r\n\r\n\t\treturn toLatLngBounds(\r\n\t\t        [this.lat - latAccuracy, this.lng - lngAccuracy],\r\n\t\t        [this.lat + latAccuracy, this.lng + lngAccuracy]);\r\n\t},\r\n\r\n\tclone: function () {\r\n\t\treturn new LatLng(this.lat, this.lng, this.alt);\r\n\t}\r\n};\r\n\r\n\r\n\r\n// @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng\r\n// Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).\r\n\r\n// @alternative\r\n// @factory L.latLng(coords: Array): LatLng\r\n// Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.\r\n\r\n// @alternative\r\n// @factory L.latLng(coords: Object): LatLng\r\n// Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.\r\n\r\nexport function toLatLng(a, b, c) {\r\n\tif (a instanceof LatLng) {\r\n\t\treturn a;\r\n\t}\r\n\tif (Util.isArray(a) && typeof a[0] !== 'object') {\r\n\t\tif (a.length === 3) {\r\n\t\t\treturn new LatLng(a[0], a[1], a[2]);\r\n\t\t}\r\n\t\tif (a.length === 2) {\r\n\t\t\treturn new LatLng(a[0], a[1]);\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\tif (a === undefined || a === null) {\r\n\t\treturn a;\r\n\t}\r\n\tif (typeof a === 'object' && 'lat' in a) {\r\n\t\treturn new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\r\n\t}\r\n\tif (b === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\treturn new LatLng(a, b, c);\r\n}\r\n", "\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {LatLng} from '../LatLng';\r\nimport {LatLngBounds} from '../LatLngBounds';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.Base\r\n * Object that defines coordinate reference systems for projecting\r\n * geographical points into pixel (screen) coordinates and back (and to\r\n * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See\r\n * [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system).\r\n *\r\n * Leaflet defines the most usual CRSs by default. If you want to use a\r\n * CRS not defined by default, take a look at the\r\n * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin.\r\n *\r\n * Note that the CRS instances do not inherit from Leaflet's `Class` object,\r\n * and can't be instantiated. Also, new classes can't inherit from them,\r\n * and methods can't be added to them with the `include` function.\r\n */\r\n\r\nexport var CRS = {\r\n\t// @method latLngToPoint(latlng: LatLng, zoom: Number): Point\r\n\t// Projects geographical coordinates into pixel coordinates for a given zoom.\r\n\tlatLngToPoint: function (latlng, zoom) {\r\n\t\tvar projectedPoint = this.projection.project(latlng),\r\n\t\t    scale = this.scale(zoom);\r\n\r\n\t\treturn this.transformation._transform(projectedPoint, scale);\r\n\t},\r\n\r\n\t// @method pointToLatLng(point: Point, zoom: Number): LatLng\r\n\t// The inverse of `latLngToPoint`. Projects pixel coordinates on a given\r\n\t// zoom into geographical coordinates.\r\n\tpointToLatLng: function (point, zoom) {\r\n\t\tvar scale = this.scale(zoom),\r\n\t\t    untransformedPoint = this.transformation.untransform(point, scale);\r\n\r\n\t\treturn this.projection.unproject(untransformedPoint);\r\n\t},\r\n\r\n\t// @method project(latlng: LatLng): Point\r\n\t// Projects geographical coordinates into coordinates in units accepted for\r\n\t// this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).\r\n\tproject: function (latlng) {\r\n\t\treturn this.projection.project(latlng);\r\n\t},\r\n\r\n\t// @method unproject(point: Point): LatLng\r\n\t// Given a projected coordinate returns the corresponding LatLng.\r\n\t// The inverse of `project`.\r\n\tunproject: function (point) {\r\n\t\treturn this.projection.unproject(point);\r\n\t},\r\n\r\n\t// @method scale(zoom: Number): Number\r\n\t// Returns the scale used when transforming projected coordinates into\r\n\t// pixel coordinates for a particular zoom. For example, it returns\r\n\t// `256 * 2^zoom` for Mercator-based CRS.\r\n\tscale: function (zoom) {\r\n\t\treturn 256 * Math.pow(2, zoom);\r\n\t},\r\n\r\n\t// @method zoom(scale: Number): Number\r\n\t// Inverse of `scale()`, returns the zoom level corresponding to a scale\r\n\t// factor of `scale`.\r\n\tzoom: function (scale) {\r\n\t\treturn Math.log(scale / 256) / Math.LN2;\r\n\t},\r\n\r\n\t// @method getProjectedBounds(zoom: Number): Bounds\r\n\t// Returns the projection's bounds scaled and transformed for the provided `zoom`.\r\n\tgetProjectedBounds: function (zoom) {\r\n\t\tif (this.infinite) { return null; }\r\n\r\n\t\tvar b = this.projection.bounds,\r\n\t\t    s = this.scale(zoom),\r\n\t\t    min = this.transformation.transform(b.min, s),\r\n\t\t    max = this.transformation.transform(b.max, s);\r\n\r\n\t\treturn new Bounds(min, max);\r\n\t},\r\n\r\n\t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n\t// Returns the distance between two geographical coordinates.\r\n\r\n\t// @property code: String\r\n\t// Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)\r\n\t//\r\n\t// @property wrapLng: Number[]\r\n\t// An array of two numbers defining whether the longitude (horizontal) coordinate\r\n\t// axis wraps around a given range and how. Defaults to `[-180, 180]` in most\r\n\t// geographical CRSs. If `undefined`, the longitude axis does not wrap around.\r\n\t//\r\n\t// @property wrapLat: Number[]\r\n\t// Like `wrapLng`, but for the latitude (vertical) axis.\r\n\r\n\t// wrapLng: [min, max],\r\n\t// wrapLat: [min, max],\r\n\r\n\t// @property infinite: Boolean\r\n\t// If true, the coordinate space will be unbounded (infinite in both axes)\r\n\tinfinite: false,\r\n\r\n\t// @method wrapLatLng(latlng: LatLng): LatLng\r\n\t// Returns a `LatLng` where lat and lng has been wrapped according to the\r\n\t// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.\r\n\twrapLatLng: function (latlng) {\r\n\t\tvar lng = this.wrapLng ? Util.wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,\r\n\t\t    lat = this.wrapLat ? Util.wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,\r\n\t\t    alt = latlng.alt;\r\n\r\n\t\treturn new LatLng(lat, lng, alt);\r\n\t},\r\n\r\n\t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n\t// Returns a `LatLngBounds` with the same size as the given one, ensuring\r\n\t// that its center is within the CRS's bounds.\r\n\t// Only accepts actual `L.LatLngBounds` instances, not arrays.\r\n\twrapLatLngBounds: function (bounds) {\r\n\t\tvar center = bounds.getCenter(),\r\n\t\t    newCenter = this.wrapLatLng(center),\r\n\t\t    latShift = center.lat - newCenter.lat,\r\n\t\t    lngShift = center.lng - newCenter.lng;\r\n\r\n\t\tif (latShift === 0 && lngShift === 0) {\r\n\t\t\treturn bounds;\r\n\t\t}\r\n\r\n\t\tvar sw = bounds.getSouthWest(),\r\n\t\t    ne = bounds.getNorthEast(),\r\n\t\t    newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift),\r\n\t\t    newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift);\r\n\r\n\t\treturn new LatLngBounds(newSw, newNe);\r\n\t}\r\n};\r\n", "import {CRS} from './CRS';\nimport * as Util from '../../core/Util';\n\n/*\n * @namespace CRS\n * @crs L.CRS.Earth\n *\n * Serves as the base for CRS that are global such that they cover the earth.\n * Can only be used as the base for other CRS and cannot be used directly,\n * since it does not have a `code`, `projection` or `transformation`. `distance()` returns\n * meters.\n */\n\nexport var Earth = Util.extend({}, CRS, {\n\twrapLng: [-180, 180],\n\n\t// Mean Earth Radius, as recommended for use by\n\t// the International Union of Geodesy and Geophysics,\n\t// see https://rosettacode.org/wiki/Haversine_formula\n\tR: 6371000,\n\n\t// distance between two geographical points using spherical law of cosines approximation\n\tdistance: function (latlng1, latlng2) {\n\t\tvar rad = Math.PI / 180,\n\t\t    lat1 = latlng1.lat * rad,\n\t\t    lat2 = latlng2.lat * rad,\n\t\t    sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),\n\t\t    sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),\n\t\t    a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,\n\t\t    c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\treturn this.R * c;\n\t}\n});\n", "import {LatLng} from '../LatLng';\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {Point} from '../../geometry/Point';\r\n\r\n/*\r\n * @namespace Projection\r\n * @projection L.Projection.SphericalMercator\r\n *\r\n * Spherical Mercator projection \u2014 the most common projection for online maps,\r\n * used by almost all free and commercial tile providers. Assumes that Earth is\r\n * a sphere. Used by the `EPSG:3857` CRS.\r\n */\r\n\r\nvar earthRadius = 6378137;\r\n\r\nexport var SphericalMercator = {\r\n\r\n\tR: earthRadius,\r\n\tMAX_LATITUDE: 85.0511287798,\r\n\r\n\tproject: function (latlng) {\r\n\t\tvar d = Math.PI / 180,\r\n\t\t    max = this.MAX_LATITUDE,\r\n\t\t    lat = Math.max(Math.min(max, latlng.lat), -max),\r\n\t\t    sin = Math.sin(lat * d);\r\n\r\n\t\treturn new Point(\r\n\t\t\tthis.R * latlng.lng * d,\r\n\t\t\tthis.R * Math.log((1 + sin) / (1 - sin)) / 2);\r\n\t},\r\n\r\n\tunproject: function (point) {\r\n\t\tvar d = 180 / Math.PI;\r\n\r\n\t\treturn new LatLng(\r\n\t\t\t(2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\r\n\t\t\tpoint.x * d / this.R);\r\n\t},\r\n\r\n\tbounds: (function () {\r\n\t\tvar d = earthRadius * Math.PI;\r\n\t\treturn new Bounds([-d, -d], [d, d]);\r\n\t})()\r\n};\r\n", "import {Point} from './Point';\r\nimport * as Util from '../core/Util';\r\n\r\n/*\r\n * @class Transformation\r\n * @aka L.Transformation\r\n *\r\n * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d`\r\n * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing\r\n * the reverse. Used by Leaflet in its projections code.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var transformation = L.transformation(2, 5, -1, 10),\r\n * \tp = L.point(1, 2),\r\n * \tp2 = transformation.transform(p), //  L.point(7, 8)\r\n * \tp3 = transformation.untransform(p2); //  L.point(1, 2)\r\n * ```\r\n */\r\n\r\n\r\n// factory new L.Transformation(a: Number, b: Number, c: Number, d: Number)\r\n// Creates a `Transformation` object with the given coefficients.\r\nexport function Transformation(a, b, c, d) {\r\n\tif (Util.isArray(a)) {\r\n\t\t// use array properties\r\n\t\tthis._a = a[0];\r\n\t\tthis._b = a[1];\r\n\t\tthis._c = a[2];\r\n\t\tthis._d = a[3];\r\n\t\treturn;\r\n\t}\r\n\tthis._a = a;\r\n\tthis._b = b;\r\n\tthis._c = c;\r\n\tthis._d = d;\r\n}\r\n\r\nTransformation.prototype = {\r\n\t// @method transform(point: Point, scale?: Number): Point\r\n\t// Returns a transformed point, optionally multiplied by the given scale.\r\n\t// Only accepts actual `L.Point` instances, not arrays.\r\n\ttransform: function (point, scale) { // (Point, Number) -> Point\r\n\t\treturn this._transform(point.clone(), scale);\r\n\t},\r\n\r\n\t// destructive transform (faster)\r\n\t_transform: function (point, scale) {\r\n\t\tscale = scale || 1;\r\n\t\tpoint.x = scale * (this._a * point.x + this._b);\r\n\t\tpoint.y = scale * (this._c * point.y + this._d);\r\n\t\treturn point;\r\n\t},\r\n\r\n\t// @method untransform(point: Point, scale?: Number): Point\r\n\t// Returns the reverse transformation of the given point, optionally divided\r\n\t// by the given scale. Only accepts actual `L.Point` instances, not arrays.\r\n\tuntransform: function (point, scale) {\r\n\t\tscale = scale || 1;\r\n\t\treturn new Point(\r\n\t\t        (point.x / scale - this._b) / this._a,\r\n\t\t        (point.y / scale - this._d) / this._c);\r\n\t}\r\n};\r\n\r\n// factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n\r\n// @factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n// Instantiates a Transformation object with the given coefficients.\r\n\r\n// @alternative\r\n// @factory L.transformation(coefficients: Array): Transformation\r\n// Expects an coefficients array of the form\r\n// `[a: Number, b: Number, c: Number, d: Number]`.\r\n\r\nexport function toTransformation(a, b, c, d) {\r\n\treturn new Transformation(a, b, c, d);\r\n}\r\n", "import {Earth} from './CRS.Earth';\r\nimport {SphericalMercator} from '../projection/Projection.SphericalMercator';\r\nimport {toTransformation} from '../../geometry/Transformation';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3857\r\n *\r\n * The most common CRS for online maps, used by almost all free and commercial\r\n * tile providers. Uses Spherical Mercator projection. Set in by default in\r\n * Map's `crs` option.\r\n */\r\n\r\nexport var EPSG3857 = Util.extend({}, Earth, {\r\n\tcode: 'EPSG:3857',\r\n\tprojection: SphericalMercator,\r\n\r\n\ttransformation: (function () {\r\n\t\tvar scale = 0.5 / (Math.PI * SphericalMercator.R);\r\n\t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n\t}())\r\n});\r\n\r\nexport var EPSG900913 = Util.extend({}, EPSG3857, {\r\n\tcode: 'EPSG:900913'\r\n});\r\n", "import Browser from '../../core/Browser';\n\n// @namespace SVG; @section\n// There are several static functions which can be called without instantiating L.SVG:\n\n// @function create(name: String): SVGElement\n// Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n// corresponding to the class name passed. For example, using 'line' will return\n// an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\nexport function svgCreate(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n// @function pointsToPath(rings: Point[], closed: Boolean): String\n// Generates a SVG path string for multiple rings, with each ring turning\n// into \"M..L..L..\" instructions\nexport function pointsToPath(rings, closed) {\n\tvar str = '',\n\ti, j, len, len2, points, p;\n\n\tfor (i = 0, len = rings.length; i < len; i++) {\n\t\tpoints = rings[i];\n\n\t\tfor (j = 0, len2 = points.length; j < len2; j++) {\n\t\t\tp = points[j];\n\t\t\tstr += (j ? 'L' : 'M') + p.x + ' ' + p.y;\n\t\t}\n\n\t\t// closes the ring for polygons; \"x\" is VML syntax\n\t\tstr += closed ? (Browser.svg ? 'z' : 'x') : '';\n\t}\n\n\t// SVG complains about empty path strings\n\treturn str || 'M0 0';\n}\n\n\n\n\n", "import * as Util from './Util';\r\nimport {svgCreate} from '../layer/vector/SVG.Util';\r\n\r\n/*\r\n * @namespace Browser\r\n * @aka L.Browser\r\n *\r\n * A namespace with static properties for browser/feature detection used by Leaflet internally.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * if (L.Browser.ielt9) {\r\n *   alert('Upgrade your browser, dude!');\r\n * }\r\n * ```\r\n */\r\n\r\nvar style = document.documentElement.style;\r\n\r\n// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\r\nvar ie = 'ActiveXObject' in window;\r\n\r\n// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\r\nvar ielt9 = ie && !document.addEventListener;\r\n\r\n// @property edge: Boolean; `true` for the Edge web browser.\r\nvar edge = 'msLaunchUri' in navigator && !('documentMode' in document);\r\n\r\n// @property webkit: Boolean;\r\n// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\r\nvar webkit = userAgentContains('webkit');\r\n\r\n// @property android: Boolean\r\n// **Deprecated.** `true` for any browser running on an Android platform.\r\nvar android = userAgentContains('android');\r\n\r\n// @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3.\r\nvar android23 = userAgentContains('android 2') || userAgentContains('android 3');\r\n\r\n/* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */\r\nvar webkitVer = parseInt(/WebKit\\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit\r\n// @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome)\r\nvar androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);\r\n\r\n// @property opera: Boolean; `true` for the Opera browser\r\nvar opera = !!window.opera;\r\n\r\n// @property chrome: Boolean; `true` for the Chrome browser.\r\nvar chrome = !edge && userAgentContains('chrome');\r\n\r\n// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\r\nvar gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\r\n\r\n// @property safari: Boolean; `true` for the Safari browser.\r\nvar safari = !chrome && userAgentContains('safari');\r\n\r\nvar phantom = userAgentContains('phantom');\r\n\r\n// @property opera12: Boolean\r\n// `true` for the Opera browser supporting CSS transforms (version 12 or later).\r\nvar opera12 = 'OTransition' in style;\r\n\r\n// @property win: Boolean; `true` when the browser is running in a Windows platform\r\nvar win = navigator.platform.indexOf('Win') === 0;\r\n\r\n// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\r\nvar ie3d = ie && ('transition' in style);\r\n\r\n// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\r\nvar webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\r\n\r\n// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\r\nvar gecko3d = 'MozPerspective' in style;\r\n\r\n// @property any3d: Boolean\r\n// `true` for all browsers supporting CSS transforms.\r\nvar any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\r\n\r\n// @property mobile: Boolean; `true` for all browsers running in a mobile device.\r\nvar mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\r\n\r\n// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\r\nvar mobileWebkit = mobile && webkit;\r\n\r\n// @property mobileWebkit3d: Boolean\r\n// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\r\nvar mobileWebkit3d = mobile && webkit3d;\r\n\r\n// @property msPointer: Boolean\r\n// `true` for browsers implementing the Microsoft touch events model (notably IE10).\r\nvar msPointer = !window.PointerEvent && window.MSPointerEvent;\r\n\r\n// @property pointer: Boolean\r\n// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\r\nvar pointer = !!(window.PointerEvent || msPointer);\r\n\r\n// @property touchNative: Boolean\r\n// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\r\n// **This does not necessarily mean** that the browser is running in a computer with\r\n// a touchscreen, it only means that the browser is capable of understanding\r\n// touch events.\r\nvar touchNative = 'ontouchstart' in window || !!window.TouchEvent;\r\n\r\n// @property touch: Boolean\r\n// `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events.\r\n// Note: pointer events will be preferred (if available), and processed for all `touch*` listeners.\r\nvar touch = !window.L_NO_TOUCH && (touchNative || pointer);\r\n\r\n// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\r\nvar mobileOpera = mobile && opera;\r\n\r\n// @property mobileGecko: Boolean\r\n// `true` for gecko-based browsers running in a mobile device.\r\nvar mobileGecko = mobile && gecko;\r\n\r\n// @property retina: Boolean\r\n// `true` for browsers on a high-resolution \"retina\" screen or on any screen when browser's display zoom is more than 100%.\r\nvar retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\r\n\r\n// @property passiveEvents: Boolean\r\n// `true` for browsers that support passive events.\r\nvar passiveEvents = (function () {\r\n\tvar supportsPassiveOption = false;\r\n\ttry {\r\n\t\tvar opts = Object.defineProperty({}, 'passive', {\r\n\t\t\tget: function () { // eslint-disable-line getter-return\r\n\t\t\t\tsupportsPassiveOption = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.addEventListener('testPassiveEventSupport', Util.falseFn, opts);\r\n\t\twindow.removeEventListener('testPassiveEventSupport', Util.falseFn, opts);\r\n\t} catch (e) {\r\n\t\t// Errors can safely be ignored since this is only a browser support test.\r\n\t}\r\n\treturn supportsPassiveOption;\r\n}());\r\n\r\n// @property canvas: Boolean\r\n// `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).\r\nvar canvas = (function () {\r\n\treturn !!document.createElement('canvas').getContext;\r\n}());\r\n\r\n// @property svg: Boolean\r\n// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\r\nvar svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);\r\n\r\nvar inlineSvg = !!svg && (function () {\r\n\tvar div = document.createElement('div');\r\n\tdiv.innerHTML = '<svg/>';\r\n\treturn (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';\r\n})();\r\n\r\n// @property vml: Boolean\r\n// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\r\nvar vml = !svg && (function () {\r\n\ttry {\r\n\t\tvar div = document.createElement('div');\r\n\t\tdiv.innerHTML = '<v:shape adj=\"1\"/>';\r\n\r\n\t\tvar shape = div.firstChild;\r\n\t\tshape.style.behavior = 'url(#default#VML)';\r\n\r\n\t\treturn shape && (typeof shape.adj === 'object');\r\n\r\n\t} catch (e) {\r\n\t\treturn false;\r\n\t}\r\n}());\r\n\r\n\r\n// @property mac: Boolean; `true` when the browser is running in a Mac platform\r\nvar mac = navigator.platform.indexOf('Mac') === 0;\r\n\r\n// @property mac: Boolean; `true` when the browser is running in a Linux platform\r\nvar linux = navigator.platform.indexOf('Linux') === 0;\r\n\r\nfunction userAgentContains(str) {\r\n\treturn navigator.userAgent.toLowerCase().indexOf(str) >= 0;\r\n}\r\n\r\n\r\nexport default {\r\n\tie: ie,\r\n\tielt9: ielt9,\r\n\tedge: edge,\r\n\twebkit: webkit,\r\n\tandroid: android,\r\n\tandroid23: android23,\r\n\tandroidStock: androidStock,\r\n\topera: opera,\r\n\tchrome: chrome,\r\n\tgecko: gecko,\r\n\tsafari: safari,\r\n\tphantom: phantom,\r\n\topera12: opera12,\r\n\twin: win,\r\n\tie3d: ie3d,\r\n\twebkit3d: webkit3d,\r\n\tgecko3d: gecko3d,\r\n\tany3d: any3d,\r\n\tmobile: mobile,\r\n\tmobileWebkit: mobileWebkit,\r\n\tmobileWebkit3d: mobileWebkit3d,\r\n\tmsPointer: msPointer,\r\n\tpointer: pointer,\r\n\ttouch: touch,\r\n\ttouchNative: touchNative,\r\n\tmobileOpera: mobileOpera,\r\n\tmobileGecko: mobileGecko,\r\n\tretina: retina,\r\n\tpassiveEvents: passiveEvents,\r\n\tcanvas: canvas,\r\n\tsvg: svg,\r\n\tvml: vml,\r\n\tinlineSvg: inlineSvg,\r\n\tmac: mac,\r\n\tlinux: linux\r\n};\r\n", "import * as DomEvent from './DomEvent';\nimport Browser from '../core/Browser';\nimport {falseFn} from '../core/Util';\n\n/*\n * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.\n */\n\nvar POINTER_DOWN =   Browser.msPointer ? 'MSPointerDown'   : 'pointerdown';\nvar POINTER_MOVE =   Browser.msPointer ? 'MSPointerMove'   : 'pointermove';\nvar POINTER_UP =     Browser.msPointer ? 'MSPointerUp'     : 'pointerup';\nvar POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';\nvar pEvent = {\n\ttouchstart  : POINTER_DOWN,\n\ttouchmove   : POINTER_MOVE,\n\ttouchend    : POINTER_UP,\n\ttouchcancel : POINTER_CANCEL\n};\nvar handle = {\n\ttouchstart  : _onPointerStart,\n\ttouchmove   : _handlePointer,\n\ttouchend    : _handlePointer,\n\ttouchcancel : _handlePointer\n};\nvar _pointers = {};\nvar _pointerDocListener = false;\n\n// Provides a touch events wrapper for (ms)pointer events.\n// ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890\n\nexport function addPointerListener(obj, type, handler) {\n\tif (type === 'touchstart') {\n\t\t_addPointerDocListener();\n\t}\n\tif (!handle[type]) {\n\t\tconsole.warn('wrong event specified:', type);\n\t\treturn falseFn;\n\t}\n\thandler = handle[type].bind(this, handler);\n\tobj.addEventListener(pEvent[type], handler, false);\n\treturn handler;\n}\n\nexport function removePointerListener(obj, type, handler) {\n\tif (!pEvent[type]) {\n\t\tconsole.warn('wrong event specified:', type);\n\t\treturn;\n\t}\n\tobj.removeEventListener(pEvent[type], handler, false);\n}\n\nfunction _globalPointerDown(e) {\n\t_pointers[e.pointerId] = e;\n}\n\nfunction _globalPointerMove(e) {\n\tif (_pointers[e.pointerId]) {\n\t\t_pointers[e.pointerId] = e;\n\t}\n}\n\nfunction _globalPointerUp(e) {\n\tdelete _pointers[e.pointerId];\n}\n\nfunction _addPointerDocListener() {\n\t// need to keep track of what pointers and how many are active to provide e.touches emulation\n\tif (!_pointerDocListener) {\n\t\t// we listen document as any drags that end by moving the touch off the screen get fired there\n\t\tdocument.addEventListener(POINTER_DOWN, _globalPointerDown, true);\n\t\tdocument.addEventListener(POINTER_MOVE, _globalPointerMove, true);\n\t\tdocument.addEventListener(POINTER_UP, _globalPointerUp, true);\n\t\tdocument.addEventListener(POINTER_CANCEL, _globalPointerUp, true);\n\n\t\t_pointerDocListener = true;\n\t}\n}\n\nfunction _handlePointer(handler, e) {\n\tif (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; }\n\n\te.touches = [];\n\tfor (var i in _pointers) {\n\t\te.touches.push(_pointers[i]);\n\t}\n\te.changedTouches = [e];\n\n\thandler(e);\n}\n\nfunction _onPointerStart(handler, e) {\n\t// IE10 specific: MsTouch needs preventDefault. See #2000\n\tif (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {\n\t\tDomEvent.preventDefault(e);\n\t}\n\t_handlePointer(handler, e);\n}\n", "import * as DomEvent from './DomEvent';\r\n\r\n/*\r\n * Extends the event handling code with double tap support for mobile browsers.\r\n *\r\n * Note: currently most browsers fire native dblclick, with only a few exceptions\r\n * (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386)\r\n */\r\n\r\nfunction makeDblclick(event) {\r\n\t// in modern browsers `type` cannot be just overridden:\r\n\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only\r\n\tvar newEvent = {},\r\n\t    prop, i;\r\n\tfor (i in event) {\r\n\t\tprop = event[i];\r\n\t\tnewEvent[i] = prop && prop.bind ? prop.bind(event) : prop;\r\n\t}\r\n\tevent = newEvent;\r\n\tnewEvent.type = 'dblclick';\r\n\tnewEvent.detail = 2;\r\n\tnewEvent.isTrusted = false;\r\n\tnewEvent._simulated = true; // for debug purposes\r\n\treturn newEvent;\r\n}\r\n\r\nvar delay = 200;\r\nexport function addDoubleTapListener(obj, handler) {\r\n\t// Most browsers handle double tap natively\r\n\tobj.addEventListener('dblclick', handler);\r\n\r\n\t// On some platforms the browser doesn't fire native dblclicks for touch events.\r\n\t// It seems that in all such cases `detail` property of `click` event is always `1`.\r\n\t// So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed.\r\n\tvar last = 0,\r\n\t    detail;\r\n\tfunction simDblclick(e) {\r\n\t\tif (e.detail !== 1) {\r\n\t\t\tdetail = e.detail; // keep in sync to avoid false dblclick in some cases\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (e.pointerType === 'mouse' ||\r\n\t\t\t(e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) {\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// When clicking on an <input>, the browser generates a click on its\r\n\t\t// <label> (and vice versa) triggering two clicks in quick succession.\r\n\t\t// This ignores clicks on elements which are a label with a 'for'\r\n\t\t// attribute (or children of such a label), but not children of\r\n\t\t// a <input>.\r\n\t\tvar path = DomEvent.getPropagationPath(e);\r\n\t\tif (path.some(function (el) {\r\n\t\t\treturn el instanceof HTMLLabelElement && el.attributes.for;\r\n\t\t}) &&\r\n\t\t\t!path.some(function (el) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\tel instanceof HTMLInputElement ||\r\n\t\t\t\t\tel instanceof HTMLSelectElement\r\n\t\t\t\t);\r\n\t\t\t})\r\n\t\t) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar now = Date.now();\r\n\t\tif (now - last <= delay) {\r\n\t\t\tdetail++;\r\n\t\t\tif (detail === 2) {\r\n\t\t\t\thandler(makeDblclick(e));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tdetail = 1;\r\n\t\t}\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tobj.addEventListener('click', simDblclick);\r\n\r\n\treturn {\r\n\t\tdblclick: handler,\r\n\t\tsimDblclick: simDblclick\r\n\t};\r\n}\r\n\r\nexport function removeDoubleTapListener(obj, handlers) {\r\n\tobj.removeEventListener('dblclick', handlers.dblclick);\r\n\tobj.removeEventListener('click', handlers.simDblclick);\r\n}\r\n", "import * as DomEvent from './DomEvent';\r\nimport * as Util from '../core/Util';\r\nimport {Point} from '../geometry/Point';\r\nimport Browser from '../core/Browser';\r\n\r\n/*\r\n * @namespace DomUtil\r\n *\r\n * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)\r\n * tree, used by Leaflet internally.\r\n *\r\n * Most functions expecting or returning a `HTMLElement` also work for\r\n * SVG elements. The only difference is that classes refer to CSS classes\r\n * in HTML and SVG classes in SVG.\r\n */\r\n\r\n\r\n// @property TRANSFORM: String\r\n// Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit).\r\nexport var TRANSFORM = testProp(\r\n\t['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\r\n\r\n// webkitTransition comes first because some browser versions that drop vendor prefix don't do\r\n// the same for the transitionend event, in particular the Android 4.1 stock browser\r\n\r\n// @property TRANSITION: String\r\n// Vendor-prefixed transition style name.\r\nexport var TRANSITION = testProp(\r\n\t['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\r\n\r\n// @property TRANSITION_END: String\r\n// Vendor-prefixed transitionend event name.\r\nexport var TRANSITION_END =\r\n\tTRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';\r\n\r\n\r\n// @function get(id: String|HTMLElement): HTMLElement\r\n// Returns an element given its DOM id, or returns the element itself\r\n// if it was passed directly.\r\nexport function get(id) {\r\n\treturn typeof id === 'string' ? document.getElementById(id) : id;\r\n}\r\n\r\n// @function getStyle(el: HTMLElement, styleAttrib: String): String\r\n// Returns the value for a certain style attribute on an element,\r\n// including computed values or values set through CSS.\r\nexport function getStyle(el, style) {\r\n\tvar value = el.style[style] || (el.currentStyle && el.currentStyle[style]);\r\n\r\n\tif ((!value || value === 'auto') && document.defaultView) {\r\n\t\tvar css = document.defaultView.getComputedStyle(el, null);\r\n\t\tvalue = css ? css[style] : null;\r\n\t}\r\n\treturn value === 'auto' ? null : value;\r\n}\r\n\r\n// @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement\r\n// Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.\r\nexport function create(tagName, className, container) {\r\n\tvar el = document.createElement(tagName);\r\n\tel.className = className || '';\r\n\r\n\tif (container) {\r\n\t\tcontainer.appendChild(el);\r\n\t}\r\n\treturn el;\r\n}\r\n\r\n// @function remove(el: HTMLElement)\r\n// Removes `el` from its parent element\r\nexport function remove(el) {\r\n\tvar parent = el.parentNode;\r\n\tif (parent) {\r\n\t\tparent.removeChild(el);\r\n\t}\r\n}\r\n\r\n// @function empty(el: HTMLElement)\r\n// Removes all of `el`'s children elements from `el`\r\nexport function empty(el) {\r\n\twhile (el.firstChild) {\r\n\t\tel.removeChild(el.firstChild);\r\n\t}\r\n}\r\n\r\n// @function toFront(el: HTMLElement)\r\n// Makes `el` the last child of its parent, so it renders in front of the other children.\r\nexport function toFront(el) {\r\n\tvar parent = el.parentNode;\r\n\tif (parent && parent.lastChild !== el) {\r\n\t\tparent.appendChild(el);\r\n\t}\r\n}\r\n\r\n// @function toBack(el: HTMLElement)\r\n// Makes `el` the first child of its parent, so it renders behind the other children.\r\nexport function toBack(el) {\r\n\tvar parent = el.parentNode;\r\n\tif (parent && parent.firstChild !== el) {\r\n\t\tparent.insertBefore(el, parent.firstChild);\r\n\t}\r\n}\r\n\r\n// @function hasClass(el: HTMLElement, name: String): Boolean\r\n// Returns `true` if the element's class attribute contains `name`.\r\nexport function hasClass(el, name) {\r\n\tif (el.classList !== undefined) {\r\n\t\treturn el.classList.contains(name);\r\n\t}\r\n\tvar className = getClass(el);\r\n\treturn className.length > 0 && new RegExp('(^|\\\\s)' + name + '(\\\\s|$)').test(className);\r\n}\r\n\r\n// @function addClass(el: HTMLElement, name: String)\r\n// Adds `name` to the element's class attribute.\r\nexport function addClass(el, name) {\r\n\tif (el.classList !== undefined) {\r\n\t\tvar classes = Util.splitWords(name);\r\n\t\tfor (var i = 0, len = classes.length; i < len; i++) {\r\n\t\t\tel.classList.add(classes[i]);\r\n\t\t}\r\n\t} else if (!hasClass(el, name)) {\r\n\t\tvar className = getClass(el);\r\n\t\tsetClass(el, (className ? className + ' ' : '') + name);\r\n\t}\r\n}\r\n\r\n// @function removeClass(el: HTMLElement, name: String)\r\n// Removes `name` from the element's class attribute.\r\nexport function removeClass(el, name) {\r\n\tif (el.classList !== undefined) {\r\n\t\tel.classList.remove(name);\r\n\t} else {\r\n\t\tsetClass(el, Util.trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));\r\n\t}\r\n}\r\n\r\n// @function setClass(el: HTMLElement, name: String)\r\n// Sets the element's class.\r\nexport function setClass(el, name) {\r\n\tif (el.className.baseVal === undefined) {\r\n\t\tel.className = name;\r\n\t} else {\r\n\t\t// in case of SVG element\r\n\t\tel.className.baseVal = name;\r\n\t}\r\n}\r\n\r\n// @function getClass(el: HTMLElement): String\r\n// Returns the element's class.\r\nexport function getClass(el) {\r\n\t// Check if the element is an SVGElementInstance and use the correspondingElement instead\r\n\t// (Required for linked SVG elements in IE11.)\r\n\tif (el.correspondingElement) {\r\n\t\tel = el.correspondingElement;\r\n\t}\r\n\treturn el.className.baseVal === undefined ? el.className : el.className.baseVal;\r\n}\r\n\r\n// @function setOpacity(el: HTMLElement, opacity: Number)\r\n// Set the opacity of an element (including old IE support).\r\n// `opacity` must be a number from `0` to `1`.\r\nexport function setOpacity(el, value) {\r\n\tif ('opacity' in el.style) {\r\n\t\tel.style.opacity = value;\r\n\t} else if ('filter' in el.style) {\r\n\t\t_setOpacityIE(el, value);\r\n\t}\r\n}\r\n\r\nfunction _setOpacityIE(el, value) {\r\n\tvar filter = false,\r\n\t    filterName = 'DXImageTransform.Microsoft.Alpha';\r\n\r\n\t// filters collection throws an error if we try to retrieve a filter that doesn't exist\r\n\ttry {\r\n\t\tfilter = el.filters.item(filterName);\r\n\t} catch (e) {\r\n\t\t// don't set opacity to 1 if we haven't already set an opacity,\r\n\t\t// it isn't needed and breaks transparent pngs.\r\n\t\tif (value === 1) { return; }\r\n\t}\r\n\r\n\tvalue = Math.round(value * 100);\r\n\r\n\tif (filter) {\r\n\t\tfilter.Enabled = (value !== 100);\r\n\t\tfilter.Opacity = value;\r\n\t} else {\r\n\t\tel.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';\r\n\t}\r\n}\r\n\r\n// @function testProp(props: String[]): String|false\r\n// Goes through the array of style names and returns the first name\r\n// that is a valid style name for an element. If no such name is found,\r\n// it returns false. Useful for vendor-prefixed styles like `transform`.\r\nexport function testProp(props) {\r\n\tvar style = document.documentElement.style;\r\n\r\n\tfor (var i = 0; i < props.length; i++) {\r\n\t\tif (props[i] in style) {\r\n\t\t\treturn props[i];\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\n// @function setTransform(el: HTMLElement, offset: Point, scale?: Number)\r\n// Resets the 3D CSS transform of `el` so it is translated by `offset` pixels\r\n// and optionally scaled by `scale`. Does not have an effect if the\r\n// browser doesn't support 3D CSS transforms.\r\nexport function setTransform(el, offset, scale) {\r\n\tvar pos = offset || new Point(0, 0);\r\n\r\n\tel.style[TRANSFORM] =\r\n\t\t(Browser.ie3d ?\r\n\t\t\t'translate(' + pos.x + 'px,' + pos.y + 'px)' :\r\n\t\t\t'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +\r\n\t\t(scale ? ' scale(' + scale + ')' : '');\r\n}\r\n\r\n// @function setPosition(el: HTMLElement, position: Point)\r\n// Sets the position of `el` to coordinates specified by `position`,\r\n// using CSS translate or top/left positioning depending on the browser\r\n// (used by Leaflet internally to position its layers).\r\nexport function setPosition(el, point) {\r\n\r\n\t/*eslint-disable */\r\n\tel._leaflet_pos = point;\r\n\t/* eslint-enable */\r\n\r\n\tif (Browser.any3d) {\r\n\t\tsetTransform(el, point);\r\n\t} else {\r\n\t\tel.style.left = point.x + 'px';\r\n\t\tel.style.top = point.y + 'px';\r\n\t}\r\n}\r\n\r\n// @function getPosition(el: HTMLElement): Point\r\n// Returns the coordinates of an element previously positioned with setPosition.\r\nexport function getPosition(el) {\r\n\t// this method is only used for elements previously positioned using setPosition,\r\n\t// so it's safe to cache the position for performance\r\n\r\n\treturn el._leaflet_pos || new Point(0, 0);\r\n}\r\n\r\n// @function disableTextSelection()\r\n// Prevents the user from generating `selectstart` DOM events, usually generated\r\n// when the user drags the mouse through a page with text. Used internally\r\n// by Leaflet to override the behaviour of any click-and-drag interaction on\r\n// the map. Affects drag interactions on the whole document.\r\n\r\n// @function enableTextSelection()\r\n// Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).\r\nexport var disableTextSelection;\r\nexport var enableTextSelection;\r\nvar _userSelect;\r\nif ('onselectstart' in document) {\r\n\tdisableTextSelection = function () {\r\n\t\tDomEvent.on(window, 'selectstart', DomEvent.preventDefault);\r\n\t};\r\n\tenableTextSelection = function () {\r\n\t\tDomEvent.off(window, 'selectstart', DomEvent.preventDefault);\r\n\t};\r\n} else {\r\n\tvar userSelectProperty = testProp(\r\n\t\t['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);\r\n\r\n\tdisableTextSelection = function () {\r\n\t\tif (userSelectProperty) {\r\n\t\t\tvar style = document.documentElement.style;\r\n\t\t\t_userSelect = style[userSelectProperty];\r\n\t\t\tstyle[userSelectProperty] = 'none';\r\n\t\t}\r\n\t};\r\n\tenableTextSelection = function () {\r\n\t\tif (userSelectProperty) {\r\n\t\t\tdocument.documentElement.style[userSelectProperty] = _userSelect;\r\n\t\t\t_userSelect = undefined;\r\n\t\t}\r\n\t};\r\n}\r\n\r\n// @function disableImageDrag()\r\n// As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but\r\n// for `dragstart` DOM events, usually generated when the user drags an image.\r\nexport function disableImageDrag() {\r\n\tDomEvent.on(window, 'dragstart', DomEvent.preventDefault);\r\n}\r\n\r\n// @function enableImageDrag()\r\n// Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).\r\nexport function enableImageDrag() {\r\n\tDomEvent.off(window, 'dragstart', DomEvent.preventDefault);\r\n}\r\n\r\nvar _outlineElement, _outlineStyle;\r\n// @function preventOutline(el: HTMLElement)\r\n// Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)\r\n// of the element `el` invisible. Used internally by Leaflet to prevent\r\n// focusable elements from displaying an outline when the user performs a\r\n// drag interaction on them.\r\nexport function preventOutline(element) {\r\n\twhile (element.tabIndex === -1) {\r\n\t\telement = element.parentNode;\r\n\t}\r\n\tif (!element.style) { return; }\r\n\trestoreOutline();\r\n\t_outlineElement = element;\r\n\t_outlineStyle = element.style.outlineStyle;\r\n\telement.style.outlineStyle = 'none';\r\n\tDomEvent.on(window, 'keydown', restoreOutline);\r\n}\r\n\r\n// @function restoreOutline()\r\n// Cancels the effects of a previous [`L.DomUtil.preventOutline`]().\r\nexport function restoreOutline() {\r\n\tif (!_outlineElement) { return; }\r\n\t_outlineElement.style.outlineStyle = _outlineStyle;\r\n\t_outlineElement = undefined;\r\n\t_outlineStyle = undefined;\r\n\tDomEvent.off(window, 'keydown', restoreOutline);\r\n}\r\n\r\n// @function getSizedParentNode(el: HTMLElement): HTMLElement\r\n// Finds the closest parent node which size (width and height) is not null.\r\nexport function getSizedParentNode(element) {\r\n\tdo {\r\n\t\telement = element.parentNode;\r\n\t} while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body);\r\n\treturn element;\r\n}\r\n\r\n// @function getScale(el: HTMLElement): Object\r\n// Computes the CSS scale currently applied on the element.\r\n// Returns an object with `x` and `y` members as horizontal and vertical scales respectively,\r\n// and `boundingClientRect` as the result of [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\r\nexport function getScale(element) {\r\n\tvar rect = element.getBoundingClientRect(); // Read-only in old browsers.\r\n\r\n\treturn {\r\n\t\tx: rect.width / element.offsetWidth || 1,\r\n\t\ty: rect.height / element.offsetHeight || 1,\r\n\t\tboundingClientRect: rect\r\n\t};\r\n}\r\n", "import {Point} from '../geometry/Point';\r\nimport * as Util from '../core/Util';\r\nimport Browser from '../core/Browser';\r\nimport {addPointerListener, removePointerListener} from './DomEvent.Pointer';\r\nimport {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap';\r\nimport {getScale} from './DomUtil';\r\n\r\n/*\r\n * @namespace DomEvent\r\n * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.\r\n */\r\n\r\n// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\r\n\r\n// @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Adds a listener function (`fn`) to a particular DOM event type of the\r\n// element `el`. You can optionally specify the context of the listener\r\n// (object the `this` keyword will point to). You can also pass several\r\n// space-separated types (e.g. `'click dblclick'`).\r\n\r\n// @alternative\r\n// @function on(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\nexport function on(obj, types, fn, context) {\r\n\r\n\tif (types && typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\taddOne(obj, type, types[type], fn);\r\n\t\t}\r\n\t} else {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\taddOne(obj, types[i], fn, context);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\nvar eventsKey = '_leaflet_events';\r\n\r\n// @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Removes a previously added listener function.\r\n// Note that if you passed a custom context to on, you must pass the same\r\n// context to `off` in order to remove the listener.\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement, types: String): this\r\n// Removes all previously added listeners of given types.\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement): this\r\n// Removes all previously added listeners from given HTMLElement\r\nexport function off(obj, types, fn, context) {\r\n\r\n\tif (arguments.length === 1) {\r\n\t\tbatchRemove(obj);\r\n\t\tdelete obj[eventsKey];\r\n\r\n\t} else if (types && typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\tremoveOne(obj, type, types[type], fn);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tif (arguments.length === 2) {\r\n\t\t\tbatchRemove(obj, function (type) {\r\n\t\t\t\treturn Util.indexOf(types, type) !== -1;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tremoveOne(obj, types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\nfunction batchRemove(obj, filterFn) {\r\n\tfor (var id in obj[eventsKey]) {\r\n\t\tvar type = id.split(/\\d/)[0];\r\n\t\tif (!filterFn || filterFn(type)) {\r\n\t\t\tremoveOne(obj, type, null, null, id);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar mouseSubst = {\r\n\tmouseenter: 'mouseover',\r\n\tmouseleave: 'mouseout',\r\n\twheel: !('onwheel' in window) && 'mousewheel'\r\n};\r\n\r\nfunction addOne(obj, type, fn, context) {\r\n\tvar id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');\r\n\r\n\tif (obj[eventsKey] && obj[eventsKey][id]) { return this; }\r\n\r\n\tvar handler = function (e) {\r\n\t\treturn fn.call(context || obj, e || window.event);\r\n\t};\r\n\r\n\tvar originalHandler = handler;\r\n\r\n\tif (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\t// Needs DomEvent.Pointer.js\r\n\t\thandler = addPointerListener(obj, type, handler);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick')) {\r\n\t\thandler = addDoubleTapListener(obj, handler);\r\n\r\n\t} else if ('addEventListener' in obj) {\r\n\r\n\t\tif (type === 'touchstart' || type === 'touchmove' || type === 'wheel' ||  type === 'mousewheel') {\r\n\t\t\tobj.addEventListener(mouseSubst[type] || type, handler, Browser.passiveEvents ? {passive: false} : false);\r\n\r\n\t\t} else if (type === 'mouseenter' || type === 'mouseleave') {\r\n\t\t\thandler = function (e) {\r\n\t\t\t\te = e || window.event;\r\n\t\t\t\tif (isExternalTarget(obj, e)) {\r\n\t\t\t\t\toriginalHandler(e);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tobj.addEventListener(mouseSubst[type], handler, false);\r\n\r\n\t\t} else {\r\n\t\t\tobj.addEventListener(type, originalHandler, false);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\tobj.attachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey] = obj[eventsKey] || {};\r\n\tobj[eventsKey][id] = handler;\r\n}\r\n\r\nfunction removeOne(obj, type, fn, context, id) {\r\n\tid = id || type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');\r\n\tvar handler = obj[eventsKey] && obj[eventsKey][id];\r\n\r\n\tif (!handler) { return this; }\r\n\r\n\tif (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\tremovePointerListener(obj, type, handler);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick')) {\r\n\t\tremoveDoubleTapListener(obj, handler);\r\n\r\n\t} else if ('removeEventListener' in obj) {\r\n\r\n\t\tobj.removeEventListener(mouseSubst[type] || type, handler, false);\r\n\r\n\t} else {\r\n\t\tobj.detachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey][id] = null;\r\n}\r\n\r\n// @function stopPropagation(ev: DOMEvent): this\r\n// Stop the given event from propagation to parent elements. Used inside the listener functions:\r\n// ```js\r\n// L.DomEvent.on(div, 'click', function (ev) {\r\n// \tL.DomEvent.stopPropagation(ev);\r\n// });\r\n// ```\r\nexport function stopPropagation(e) {\r\n\r\n\tif (e.stopPropagation) {\r\n\t\te.stopPropagation();\r\n\t} else if (e.originalEvent) {  // In case of Leaflet event.\r\n\t\te.originalEvent._stopped = true;\r\n\t} else {\r\n\t\te.cancelBubble = true;\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\n// @function disableScrollPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants).\r\nexport function disableScrollPropagation(el) {\r\n\taddOne(el, 'wheel', stopPropagation);\r\n\treturn this;\r\n}\r\n\r\n// @function disableClickPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'click'`, `'dblclick'`, `'contextmenu'`,\r\n// `'mousedown'` and `'touchstart'` events (plus browser variants).\r\nexport function disableClickPropagation(el) {\r\n\ton(el, 'mousedown touchstart dblclick contextmenu', stopPropagation);\r\n\tel['_leaflet_disable_click'] = true;\r\n\treturn this;\r\n}\r\n\r\n// @function preventDefault(ev: DOMEvent): this\r\n// Prevents the default action of the DOM Event `ev` from happening (such as\r\n// following a link in the href of the a element, or doing a POST request\r\n// with page reload when a `<form>` is submitted).\r\n// Use it inside listener functions.\r\nexport function preventDefault(e) {\r\n\tif (e.preventDefault) {\r\n\t\te.preventDefault();\r\n\t} else {\r\n\t\te.returnValue = false;\r\n\t}\r\n\treturn this;\r\n}\r\n\r\n// @function stop(ev: DOMEvent): this\r\n// Does `stopPropagation` and `preventDefault` at the same time.\r\nexport function stop(e) {\r\n\tpreventDefault(e);\r\n\tstopPropagation(e);\r\n\treturn this;\r\n}\r\n\r\n// @function getPropagationPath(ev: DOMEvent): Array\r\n// Compatibility polyfill for [`Event.composedPath()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath).\r\n// Returns an array containing the `HTMLElement`s that the given DOM event\r\n// should propagate to (if not stopped).\r\nexport function getPropagationPath(ev) {\r\n\tif (ev.composedPath) {\r\n\t\treturn ev.composedPath();\r\n\t}\r\n\r\n\tvar path = [];\r\n\tvar el = ev.target;\r\n\r\n\twhile (el) {\r\n\t\tpath.push(el);\r\n\t\tel = el.parentNode;\r\n\t}\r\n\treturn path;\r\n}\r\n\r\n\r\n// @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point\r\n// Gets normalized mouse position from a DOM event relative to the\r\n// `container` (border excluded) or to the whole page if not specified.\r\nexport function getMousePosition(e, container) {\r\n\tif (!container) {\r\n\t\treturn new Point(e.clientX, e.clientY);\r\n\t}\r\n\r\n\tvar scale = getScale(container),\r\n\t    offset = scale.boundingClientRect; // left and top  values are in page scale (like the event clientX/Y)\r\n\r\n\treturn new Point(\r\n\t\t// offset.left/top values are in page scale (like clientX/Y),\r\n\t\t// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\r\n\t\t(e.clientX - offset.left) / scale.x - container.clientLeft,\r\n\t\t(e.clientY - offset.top) / scale.y - container.clientTop\r\n\t);\r\n}\r\n\r\n\r\n//  except , Safari and\r\n// We need double the scroll pixels (see #7403 and #4538) for all Browsers\r\n// except OSX (Mac) -> 3x, Chrome running on Linux 1x\r\n\r\nvar wheelPxFactor =\r\n\t(Browser.linux && Browser.chrome) ? window.devicePixelRatio :\r\n\tBrowser.mac ? window.devicePixelRatio * 3 :\r\n\twindow.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1;\r\n// @function getWheelDelta(ev: DOMEvent): Number\r\n// Gets normalized wheel delta from a wheel DOM event, in vertical\r\n// pixels scrolled (negative if scrolling down).\r\n// Events from pointing devices without precise scrolling are mapped to\r\n// a best guess of 60 pixels.\r\nexport function getWheelDelta(e) {\r\n\treturn (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta\r\n\t       (e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels\r\n\t       (e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\r\n\t       (e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\r\n\t       (e.deltaX || e.deltaZ) ? 0 :\t// Skip horizontal/depth wheel events\r\n\t       e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels\r\n\t       (e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines\r\n\t       e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages\r\n\t       0;\r\n}\r\n\r\n// check if element really left/entered the event target (for mouseenter/mouseleave)\r\nexport function isExternalTarget(el, e) {\r\n\r\n\tvar related = e.relatedTarget;\r\n\r\n\tif (!related) { return true; }\r\n\r\n\ttry {\r\n\t\twhile (related && (related !== el)) {\r\n\t\t\trelated = related.parentNode;\r\n\t\t}\r\n\t} catch (err) {\r\n\t\treturn false;\r\n\t}\r\n\treturn (related !== el);\r\n}\r\n\r\n// @function addListener(\u2026): this\r\n// Alias to [`L.DomEvent.on`](#domevent-on)\r\nexport {on as addListener};\r\n\r\n// @function removeListener(\u2026): this\r\n// Alias to [`L.DomEvent.off`](#domevent-off)\r\nexport {off as removeListener};\r\n", "import * as Util from '../core/Util';\nimport {Evented} from '../core/Events';\nimport * as DomUtil from '../dom/DomUtil';\n\n\n/*\n * @class PosAnimation\n * @aka L.PosAnimation\n * @inherits Evented\n * Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.\n *\n * @example\n * ```js\n * var myPositionMarker = L.marker([48.864716, 2.294694]).addTo(map);\n *\n * myPositionMarker.on(\"click\", function() {\n * \tvar pos = map.latLngToLayerPoint(myPositionMarker.getLatLng());\n * \tpos.y -= 25;\n * \tvar fx = new L.PosAnimation();\n *\n * \tfx.once('end',function() {\n * \t\tpos.y += 25;\n * \t\tfx.run(myPositionMarker._icon, pos, 0.8);\n * \t});\n *\n * \tfx.run(myPositionMarker._icon, pos, 0.3);\n * });\n *\n * ```\n *\n * @constructor L.PosAnimation()\n * Creates a `PosAnimation` object.\n *\n */\n\nexport var PosAnimation = Evented.extend({\n\n\t// @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)\n\t// Run an animation of a given element to a new position, optionally setting\n\t// duration in seconds (`0.25` by default) and easing linearity factor (3rd\n\t// argument of the [cubic bezier curve](https://cubic-bezier.com/#0,0,.5,1),\n\t// `0.5` by default).\n\trun: function (el, newPos, duration, easeLinearity) {\n\t\tthis.stop();\n\n\t\tthis._el = el;\n\t\tthis._inProgress = true;\n\t\tthis._duration = duration || 0.25;\n\t\tthis._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2);\n\n\t\tthis._startPos = DomUtil.getPosition(el);\n\t\tthis._offset = newPos.subtract(this._startPos);\n\t\tthis._startTime = +new Date();\n\n\t\t// @event start: Event\n\t\t// Fired when the animation starts\n\t\tthis.fire('start');\n\n\t\tthis._animate();\n\t},\n\n\t// @method stop()\n\t// Stops the animation (if currently running).\n\tstop: function () {\n\t\tif (!this._inProgress) { return; }\n\n\t\tthis._step(true);\n\t\tthis._complete();\n\t},\n\n\t_animate: function () {\n\t\t// animation loop\n\t\tthis._animId = Util.requestAnimFrame(this._animate, this);\n\t\tthis._step();\n\t},\n\n\t_step: function (round) {\n\t\tvar elapsed = (+new Date()) - this._startTime,\n\t\t    duration = this._duration * 1000;\n\n\t\tif (elapsed < duration) {\n\t\t\tthis._runFrame(this._easeOut(elapsed / duration), round);\n\t\t} else {\n\t\t\tthis._runFrame(1);\n\t\t\tthis._complete();\n\t\t}\n\t},\n\n\t_runFrame: function (progress, round) {\n\t\tvar pos = this._startPos.add(this._offset.multiplyBy(progress));\n\t\tif (round) {\n\t\t\tpos._round();\n\t\t}\n\t\tDomUtil.setPosition(this._el, pos);\n\n\t\t// @event step: Event\n\t\t// Fired continuously during the animation.\n\t\tthis.fire('step');\n\t},\n\n\t_complete: function () {\n\t\tUtil.cancelAnimFrame(this._animId);\n\n\t\tthis._inProgress = false;\n\t\t// @event end: Event\n\t\t// Fired when the animation ends.\n\t\tthis.fire('end');\n\t},\n\n\t_easeOut: function (t) {\n\t\treturn 1 - Math.pow(1 - t, this._easeOutPower);\n\t}\n});\n", "import * as Util from '../core/Util';\r\nimport {Evented} from '../core/Events';\r\nimport {EPSG3857} from '../geo/crs/CRS.EPSG3857';\r\nimport {Point, toPoint} from '../geometry/Point';\r\nimport {Bounds, toBounds} from '../geometry/Bounds';\r\nimport {LatLng, toLatLng} from '../geo/LatLng';\r\nimport {LatLngBounds, toLatLngBounds} from '../geo/LatLngBounds';\r\nimport Browser from '../core/Browser';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport {PosAnimation} from '../dom/PosAnimation';\r\n\r\n/*\r\n * @class Map\r\n * @aka L.Map\r\n * @inherits Evented\r\n *\r\n * The central class of the API \u2014 it is used to create a map on a page and manipulate it.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * // initialize the map on the \"map\" div with a given center and zoom\r\n * var map = L.map('map', {\r\n * \tcenter: [51.505, -0.09],\r\n * \tzoom: 13\r\n * });\r\n * ```\r\n *\r\n */\r\n\r\nexport var Map = Evented.extend({\r\n\r\n\toptions: {\r\n\t\t// @section Map State Options\r\n\t\t// @option crs: CRS = L.CRS.EPSG3857\r\n\t\t// The [Coordinate Reference System](#crs) to use. Don't change this if you're not\r\n\t\t// sure what it means.\r\n\t\tcrs: EPSG3857,\r\n\r\n\t\t// @option center: LatLng = undefined\r\n\t\t// Initial geographic center of the map\r\n\t\tcenter: undefined,\r\n\r\n\t\t// @option zoom: Number = undefined\r\n\t\t// Initial map zoom level\r\n\t\tzoom: undefined,\r\n\r\n\t\t// @option minZoom: Number = *\r\n\t\t// Minimum zoom level of the map.\r\n\t\t// If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r\n\t\t// the lowest of their `minZoom` options will be used instead.\r\n\t\tminZoom: undefined,\r\n\r\n\t\t// @option maxZoom: Number = *\r\n\t\t// Maximum zoom level of the map.\r\n\t\t// If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r\n\t\t// the highest of their `maxZoom` options will be used instead.\r\n\t\tmaxZoom: undefined,\r\n\r\n\t\t// @option layers: Layer[] = []\r\n\t\t// Array of layers that will be added to the map initially\r\n\t\tlayers: [],\r\n\r\n\t\t// @option maxBounds: LatLngBounds = null\r\n\t\t// When this option is set, the map restricts the view to the given\r\n\t\t// geographical bounds, bouncing the user back if the user tries to pan\r\n\t\t// outside the view. To set the restriction dynamically, use\r\n\t\t// [`setMaxBounds`](#map-setmaxbounds) method.\r\n\t\tmaxBounds: undefined,\r\n\r\n\t\t// @option renderer: Renderer = *\r\n\t\t// The default method for drawing vector layers on the map. `L.SVG`\r\n\t\t// or `L.Canvas` by default depending on browser support.\r\n\t\trenderer: undefined,\r\n\r\n\r\n\t\t// @section Animation Options\r\n\t\t// @option zoomAnimation: Boolean = true\r\n\t\t// Whether the map zoom animation is enabled. By default it's enabled\r\n\t\t// in all browsers that support CSS3 Transitions except Android.\r\n\t\tzoomAnimation: true,\r\n\r\n\t\t// @option zoomAnimationThreshold: Number = 4\r\n\t\t// Won't animate zoom if the zoom difference exceeds this value.\r\n\t\tzoomAnimationThreshold: 4,\r\n\r\n\t\t// @option fadeAnimation: Boolean = true\r\n\t\t// Whether the tile fade animation is enabled. By default it's enabled\r\n\t\t// in all browsers that support CSS3 Transitions except Android.\r\n\t\tfadeAnimation: true,\r\n\r\n\t\t// @option markerZoomAnimation: Boolean = true\r\n\t\t// Whether markers animate their zoom with the zoom animation, if disabled\r\n\t\t// they will disappear for the length of the animation. By default it's\r\n\t\t// enabled in all browsers that support CSS3 Transitions except Android.\r\n\t\tmarkerZoomAnimation: true,\r\n\r\n\t\t// @option transform3DLimit: Number = 2^23\r\n\t\t// Defines the maximum size of a CSS translation transform. The default\r\n\t\t// value should not be changed unless a web browser positions layers in\r\n\t\t// the wrong place after doing a large `panBy`.\r\n\t\ttransform3DLimit: 8388608, // Precision limit of a 32-bit float\r\n\r\n\t\t// @section Interaction Options\r\n\t\t// @option zoomSnap: Number = 1\r\n\t\t// Forces the map's zoom level to always be a multiple of this, particularly\r\n\t\t// right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.\r\n\t\t// By default, the zoom level snaps to the nearest integer; lower values\r\n\t\t// (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0`\r\n\t\t// means the zoom level will not be snapped after `fitBounds` or a pinch-zoom.\r\n\t\tzoomSnap: 1,\r\n\r\n\t\t// @option zoomDelta: Number = 1\r\n\t\t// Controls how much the map's zoom level will change after a\r\n\t\t// [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+`\r\n\t\t// or `-` on the keyboard, or using the [zoom controls](#control-zoom).\r\n\t\t// Values smaller than `1` (e.g. `0.5`) allow for greater granularity.\r\n\t\tzoomDelta: 1,\r\n\r\n\t\t// @option trackResize: Boolean = true\r\n\t\t// Whether the map automatically handles browser window resize to update itself.\r\n\t\ttrackResize: true\r\n\t},\r\n\r\n\tinitialize: function (id, options) { // (HTMLElement or String, Object)\r\n\t\toptions = Util.setOptions(this, options);\r\n\r\n\t\t// Make sure to assign internal flags at the beginning,\r\n\t\t// to avoid inconsistent state in some edge cases.\r\n\t\tthis._handlers = [];\r\n\t\tthis._layers = {};\r\n\t\tthis._zoomBoundLayers = {};\r\n\t\tthis._sizeChanged = true;\r\n\r\n\t\tthis._initContainer(id);\r\n\t\tthis._initLayout();\r\n\r\n\t\t// hack for https://github.com/Leaflet/Leaflet/issues/1980\r\n\t\tthis._onResize = Util.bind(this._onResize, this);\r\n\r\n\t\tthis._initEvents();\r\n\r\n\t\tif (options.maxBounds) {\r\n\t\t\tthis.setMaxBounds(options.maxBounds);\r\n\t\t}\r\n\r\n\t\tif (options.zoom !== undefined) {\r\n\t\t\tthis._zoom = this._limitZoom(options.zoom);\r\n\t\t}\r\n\r\n\t\tif (options.center && options.zoom !== undefined) {\r\n\t\t\tthis.setView(toLatLng(options.center), options.zoom, {reset: true});\r\n\t\t}\r\n\r\n\t\tthis.callInitHooks();\r\n\r\n\t\t// don't animate on browsers without hardware-accelerated transitions or old Android/Opera\r\n\t\tthis._zoomAnimated = DomUtil.TRANSITION && Browser.any3d && !Browser.mobileOpera &&\r\n\t\t\t\tthis.options.zoomAnimation;\r\n\r\n\t\t// zoom transitions run with the same duration for all layers, so if one of transitionend events\r\n\t\t// happens after starting zoom animation (propagating to the map pane), we know that it ended globally\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tthis._createAnimProxy();\r\n\t\t\tDomEvent.on(this._proxy, DomUtil.TRANSITION_END, this._catchTransitionEnd, this);\r\n\t\t}\r\n\r\n\t\tthis._addLayers(this.options.layers);\r\n\t},\r\n\r\n\r\n\t// @section Methods for modifying map state\r\n\r\n\t// @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this\r\n\t// Sets the view of the map (geographical center and zoom) with the given\r\n\t// animation options.\r\n\tsetView: function (center, zoom, options) {\r\n\r\n\t\tzoom = zoom === undefined ? this._zoom : this._limitZoom(zoom);\r\n\t\tcenter = this._limitCenter(toLatLng(center), zoom, this.options.maxBounds);\r\n\t\toptions = options || {};\r\n\r\n\t\tthis._stop();\r\n\r\n\t\tif (this._loaded && !options.reset && options !== true) {\r\n\r\n\t\t\tif (options.animate !== undefined) {\r\n\t\t\t\toptions.zoom = Util.extend({animate: options.animate}, options.zoom);\r\n\t\t\t\toptions.pan = Util.extend({animate: options.animate, duration: options.duration}, options.pan);\r\n\t\t\t}\r\n\r\n\t\t\t// try animating pan or zoom\r\n\t\t\tvar moved = (this._zoom !== zoom) ?\r\n\t\t\t\tthis._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom, options.zoom) :\r\n\t\t\t\tthis._tryAnimatedPan(center, options.pan);\r\n\r\n\t\t\tif (moved) {\r\n\t\t\t\t// prevent resize handler call, the view will refresh after animation anyway\r\n\t\t\t\tclearTimeout(this._sizeTimer);\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// animation didn't start, just reset the map view\r\n\t\tthis._resetView(center, zoom, options.pan && options.pan.noMoveStart);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setZoom(zoom: Number, options?: Zoom/pan options): this\r\n\t// Sets the zoom of the map.\r\n\tsetZoom: function (zoom, options) {\r\n\t\tif (!this._loaded) {\r\n\t\t\tthis._zoom = zoom;\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\treturn this.setView(this.getCenter(), zoom, {zoom: options});\r\n\t},\r\n\r\n\t// @method zoomIn(delta?: Number, options?: Zoom options): this\r\n\t// Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r\n\tzoomIn: function (delta, options) {\r\n\t\tdelta = delta || (Browser.any3d ? this.options.zoomDelta : 1);\r\n\t\treturn this.setZoom(this._zoom + delta, options);\r\n\t},\r\n\r\n\t// @method zoomOut(delta?: Number, options?: Zoom options): this\r\n\t// Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r\n\tzoomOut: function (delta, options) {\r\n\t\tdelta = delta || (Browser.any3d ? this.options.zoomDelta : 1);\r\n\t\treturn this.setZoom(this._zoom - delta, options);\r\n\t},\r\n\r\n\t// @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this\r\n\t// Zooms the map while keeping a specified geographical point on the map\r\n\t// stationary (e.g. used internally for scroll zoom and double-click zoom).\r\n\t// @alternative\r\n\t// @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this\r\n\t// Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.\r\n\tsetZoomAround: function (latlng, zoom, options) {\r\n\t\tvar scale = this.getZoomScale(zoom),\r\n\t\t    viewHalf = this.getSize().divideBy(2),\r\n\t\t    containerPoint = latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng),\r\n\r\n\t\t    centerOffset = containerPoint.subtract(viewHalf).multiplyBy(1 - 1 / scale),\r\n\t\t    newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset));\r\n\r\n\t\treturn this.setView(newCenter, zoom, {zoom: options});\r\n\t},\r\n\r\n\t_getBoundsCenterZoom: function (bounds, options) {\r\n\r\n\t\toptions = options || {};\r\n\t\tbounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds);\r\n\r\n\t\tvar paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r\n\t\t    paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r\n\r\n\t\t    zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\r\n\r\n\t\tzoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;\r\n\r\n\t\tif (zoom === Infinity) {\r\n\t\t\treturn {\r\n\t\t\t\tcenter: bounds.getCenter(),\r\n\t\t\t\tzoom: zoom\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tvar paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),\r\n\r\n\t\t    swPoint = this.project(bounds.getSouthWest(), zoom),\r\n\t\t    nePoint = this.project(bounds.getNorthEast(), zoom),\r\n\t\t    center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);\r\n\r\n\t\treturn {\r\n\t\t\tcenter: center,\r\n\t\t\tzoom: zoom\r\n\t\t};\r\n\t},\r\n\r\n\t// @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this\r\n\t// Sets a map view that contains the given geographical bounds with the\r\n\t// maximum zoom level possible.\r\n\tfitBounds: function (bounds, options) {\r\n\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tif (!bounds.isValid()) {\r\n\t\t\tthrow new Error('Bounds are not valid.');\r\n\t\t}\r\n\r\n\t\tvar target = this._getBoundsCenterZoom(bounds, options);\r\n\t\treturn this.setView(target.center, target.zoom, options);\r\n\t},\r\n\r\n\t// @method fitWorld(options?: fitBounds options): this\r\n\t// Sets a map view that mostly contains the whole world with the maximum\r\n\t// zoom level possible.\r\n\tfitWorld: function (options) {\r\n\t\treturn this.fitBounds([[-90, -180], [90, 180]], options);\r\n\t},\r\n\r\n\t// @method panTo(latlng: LatLng, options?: Pan options): this\r\n\t// Pans the map to a given center.\r\n\tpanTo: function (center, options) { // (LatLng)\r\n\t\treturn this.setView(center, this._zoom, {pan: options});\r\n\t},\r\n\r\n\t// @method panBy(offset: Point, options?: Pan options): this\r\n\t// Pans the map by a given number of pixels (animated).\r\n\tpanBy: function (offset, options) {\r\n\t\toffset = toPoint(offset).round();\r\n\t\toptions = options || {};\r\n\r\n\t\tif (!offset.x && !offset.y) {\r\n\t\t\treturn this.fire('moveend');\r\n\t\t}\r\n\t\t// If we pan too far, Chrome gets issues with tiles\r\n\t\t// and makes them disappear or appear in the wrong place (slightly offset) #2602\r\n\t\tif (options.animate !== true && !this.getSize().contains(offset)) {\r\n\t\t\tthis._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom());\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!this._panAnim) {\r\n\t\t\tthis._panAnim = new PosAnimation();\r\n\r\n\t\t\tthis._panAnim.on({\r\n\t\t\t\t'step': this._onPanTransitionStep,\r\n\t\t\t\t'end': this._onPanTransitionEnd\r\n\t\t\t}, this);\r\n\t\t}\r\n\r\n\t\t// don't fire movestart if animating inertia\r\n\t\tif (!options.noMoveStart) {\r\n\t\t\tthis.fire('movestart');\r\n\t\t}\r\n\r\n\t\t// animate pan unless animate: false specified\r\n\t\tif (options.animate !== false) {\r\n\t\t\tDomUtil.addClass(this._mapPane, 'leaflet-pan-anim');\r\n\r\n\t\t\tvar newPos = this._getMapPanePos().subtract(offset).round();\r\n\t\t\tthis._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity);\r\n\t\t} else {\r\n\t\t\tthis._rawPanBy(offset);\r\n\t\t\tthis.fire('move').fire('moveend');\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this\r\n\t// Sets the view of the map (geographical center and zoom) performing a smooth\r\n\t// pan-zoom animation.\r\n\tflyTo: function (targetCenter, targetZoom, options) {\r\n\r\n\t\toptions = options || {};\r\n\t\tif (options.animate === false || !Browser.any3d) {\r\n\t\t\treturn this.setView(targetCenter, targetZoom, options);\r\n\t\t}\r\n\r\n\t\tthis._stop();\r\n\r\n\t\tvar from = this.project(this.getCenter()),\r\n\t\t    to = this.project(targetCenter),\r\n\t\t    size = this.getSize(),\r\n\t\t    startZoom = this._zoom;\r\n\r\n\t\ttargetCenter = toLatLng(targetCenter);\r\n\t\ttargetZoom = targetZoom === undefined ? startZoom : targetZoom;\r\n\r\n\t\tvar w0 = Math.max(size.x, size.y),\r\n\t\t    w1 = w0 * this.getZoomScale(startZoom, targetZoom),\r\n\t\t    u1 = (to.distanceTo(from)) || 1,\r\n\t\t    rho = 1.42,\r\n\t\t    rho2 = rho * rho;\r\n\r\n\t\tfunction r(i) {\r\n\t\t\tvar s1 = i ? -1 : 1,\r\n\t\t\t    s2 = i ? w1 : w0,\r\n\t\t\t    t1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1,\r\n\t\t\t    b1 = 2 * s2 * rho2 * u1,\r\n\t\t\t    b = t1 / b1,\r\n\t\t\t    sq = Math.sqrt(b * b + 1) - b;\r\n\r\n\t\t\t    // workaround for floating point precision bug when sq = 0, log = -Infinite,\r\n\t\t\t    // thus triggering an infinite loop in flyTo\r\n\t\t\t    var log = sq < 0.000000001 ? -18 : Math.log(sq);\r\n\r\n\t\t\treturn log;\r\n\t\t}\r\n\r\n\t\tfunction sinh(n) { return (Math.exp(n) - Math.exp(-n)) / 2; }\r\n\t\tfunction cosh(n) { return (Math.exp(n) + Math.exp(-n)) / 2; }\r\n\t\tfunction tanh(n) { return sinh(n) / cosh(n); }\r\n\r\n\t\tvar r0 = r(0);\r\n\r\n\t\tfunction w(s) { return w0 * (cosh(r0) / cosh(r0 + rho * s)); }\r\n\t\tfunction u(s) { return w0 * (cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2; }\r\n\r\n\t\tfunction easeOut(t) { return 1 - Math.pow(1 - t, 1.5); }\r\n\r\n\t\tvar start = Date.now(),\r\n\t\t    S = (r(1) - r0) / rho,\r\n\t\t    duration = options.duration ? 1000 * options.duration : 1000 * S * 0.8;\r\n\r\n\t\tfunction frame() {\r\n\t\t\tvar t = (Date.now() - start) / duration,\r\n\t\t\t    s = easeOut(t) * S;\r\n\r\n\t\t\tif (t <= 1) {\r\n\t\t\t\tthis._flyToFrame = Util.requestAnimFrame(frame, this);\r\n\r\n\t\t\t\tthis._move(\r\n\t\t\t\t\tthis.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom),\r\n\t\t\t\t\tthis.getScaleZoom(w0 / w(s), startZoom),\r\n\t\t\t\t\t{flyTo: true});\r\n\r\n\t\t\t} else {\r\n\t\t\t\tthis\r\n\t\t\t\t\t._move(targetCenter, targetZoom)\r\n\t\t\t\t\t._moveEnd(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._moveStart(true, options.noMoveStart);\r\n\r\n\t\tframe.call(this);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this\r\n\t// Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\r\n\t// but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\r\n\tflyToBounds: function (bounds, options) {\r\n\t\tvar target = this._getBoundsCenterZoom(bounds, options);\r\n\t\treturn this.flyTo(target.center, target.zoom, options);\r\n\t},\r\n\r\n\t// @method setMaxBounds(bounds: LatLngBounds): this\r\n\t// Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).\r\n\tsetMaxBounds: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tif (this.listens('moveend', this._panInsideMaxBounds)) {\r\n\t\t\tthis.off('moveend', this._panInsideMaxBounds);\r\n\t\t}\r\n\r\n\t\tif (!bounds.isValid()) {\r\n\t\t\tthis.options.maxBounds = null;\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tthis.options.maxBounds = bounds;\r\n\r\n\t\tif (this._loaded) {\r\n\t\t\tthis._panInsideMaxBounds();\r\n\t\t}\r\n\r\n\t\treturn this.on('moveend', this._panInsideMaxBounds);\r\n\t},\r\n\r\n\t// @method setMinZoom(zoom: Number): this\r\n\t// Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).\r\n\tsetMinZoom: function (zoom) {\r\n\t\tvar oldZoom = this.options.minZoom;\r\n\t\tthis.options.minZoom = zoom;\r\n\r\n\t\tif (this._loaded && oldZoom !== zoom) {\r\n\t\t\tthis.fire('zoomlevelschange');\r\n\r\n\t\t\tif (this.getZoom() < this.options.minZoom) {\r\n\t\t\t\treturn this.setZoom(zoom);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setMaxZoom(zoom: Number): this\r\n\t// Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).\r\n\tsetMaxZoom: function (zoom) {\r\n\t\tvar oldZoom = this.options.maxZoom;\r\n\t\tthis.options.maxZoom = zoom;\r\n\r\n\t\tif (this._loaded && oldZoom !== zoom) {\r\n\t\t\tthis.fire('zoomlevelschange');\r\n\r\n\t\t\tif (this.getZoom() > this.options.maxZoom) {\r\n\t\t\t\treturn this.setZoom(zoom);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this\r\n\t// 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\n\tpanInsideBounds: function (bounds, options) {\r\n\t\tthis._enforcingBounds = true;\r\n\t\tvar center = this.getCenter(),\r\n\t\t    newCenter = this._limitCenter(center, this._zoom, toLatLngBounds(bounds));\r\n\r\n\t\tif (!center.equals(newCenter)) {\r\n\t\t\tthis.panTo(newCenter, options);\r\n\t\t}\r\n\r\n\t\tthis._enforcingBounds = false;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method panInside(latlng: LatLng, options?: padding options): this\r\n\t// Pans the map the minimum amount to make the `latlng` visible. Use\r\n\t// padding options to fit the display to more restricted bounds.\r\n\t// If `latlng` is already within the (optionally padded) display bounds,\r\n\t// the map will not be panned.\r\n\tpanInside: function (latlng, options) {\r\n\t\toptions = options || {};\r\n\r\n\t\tvar paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r\n\t\t    paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r\n\t\t    pixelCenter = this.project(this.getCenter()),\r\n\t\t    pixelPoint = this.project(latlng),\r\n\t\t    pixelBounds = this.getPixelBounds(),\r\n\t\t    paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]),\r\n\t\t    paddedSize = paddedBounds.getSize();\r\n\r\n\t\tif (!paddedBounds.contains(pixelPoint)) {\r\n\t\t\tthis._enforcingBounds = true;\r\n\t\t\tvar centerOffset = pixelPoint.subtract(paddedBounds.getCenter());\r\n\t\t\tvar offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);\r\n\t\t\tpixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x;\r\n\t\t\tpixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y;\r\n\t\t\tthis.panTo(this.unproject(pixelCenter), options);\r\n\t\t\tthis._enforcingBounds = false;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method invalidateSize(options: Zoom/pan options): this\r\n\t// Checks if the map container size changed and updates the map if so \u2014\r\n\t// call it after you've changed the map size dynamically, also animating\r\n\t// pan by default. If `options.pan` is `false`, panning will not occur.\r\n\t// If `options.debounceMoveend` is `true`, it will delay `moveend` event so\r\n\t// that it doesn't happen often even if the method is called many\r\n\t// times in a row.\r\n\r\n\t// @alternative\r\n\t// @method invalidateSize(animate: Boolean): this\r\n\t// Checks if the map container size changed and updates the map if so \u2014\r\n\t// call it after you've changed the map size dynamically, also animating\r\n\t// pan by default.\r\n\tinvalidateSize: function (options) {\r\n\t\tif (!this._loaded) { return this; }\r\n\r\n\t\toptions = Util.extend({\r\n\t\t\tanimate: false,\r\n\t\t\tpan: true\r\n\t\t}, options === true ? {animate: true} : options);\r\n\r\n\t\tvar oldSize = this.getSize();\r\n\t\tthis._sizeChanged = true;\r\n\t\tthis._lastCenter = null;\r\n\r\n\t\tvar newSize = this.getSize(),\r\n\t\t    oldCenter = oldSize.divideBy(2).round(),\r\n\t\t    newCenter = newSize.divideBy(2).round(),\r\n\t\t    offset = oldCenter.subtract(newCenter);\r\n\r\n\t\tif (!offset.x && !offset.y) { return this; }\r\n\r\n\t\tif (options.animate && options.pan) {\r\n\t\t\tthis.panBy(offset);\r\n\r\n\t\t} else {\r\n\t\t\tif (options.pan) {\r\n\t\t\t\tthis._rawPanBy(offset);\r\n\t\t\t}\r\n\r\n\t\t\tthis.fire('move');\r\n\r\n\t\t\tif (options.debounceMoveend) {\r\n\t\t\t\tclearTimeout(this._sizeTimer);\r\n\t\t\t\tthis._sizeTimer = setTimeout(Util.bind(this.fire, this, 'moveend'), 200);\r\n\t\t\t} else {\r\n\t\t\t\tthis.fire('moveend');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// @section Map state change events\r\n\t\t// @event resize: ResizeEvent\r\n\t\t// Fired when the map is resized.\r\n\t\treturn this.fire('resize', {\r\n\t\t\toldSize: oldSize,\r\n\t\t\tnewSize: newSize\r\n\t\t});\r\n\t},\r\n\r\n\t// @section Methods for modifying map state\r\n\t// @method stop(): this\r\n\t// Stops the currently running `panTo` or `flyTo` animation, if any.\r\n\tstop: function () {\r\n\t\tthis.setZoom(this._limitZoom(this._zoom));\r\n\t\tif (!this.options.zoomSnap) {\r\n\t\t\tthis.fire('viewreset');\r\n\t\t}\r\n\t\treturn this._stop();\r\n\t},\r\n\r\n\t// @section Geolocation methods\r\n\t// @method locate(options?: Locate options): this\r\n\t// Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound)\r\n\t// event with location data on success or a [`locationerror`](#map-locationerror) event on failure,\r\n\t// and optionally sets the map view to the user's location with respect to\r\n\t// detection accuracy (or to the world view if geolocation failed).\r\n\t// Note that, if your page doesn't use HTTPS, this method will fail in\r\n\t// modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))\r\n\t// See `Locate options` for more details.\r\n\tlocate: function (options) {\r\n\r\n\t\toptions = this._locateOptions = Util.extend({\r\n\t\t\ttimeout: 10000,\r\n\t\t\twatch: false\r\n\t\t\t// setView: false\r\n\t\t\t// maxZoom: <Number>\r\n\t\t\t// maximumAge: 0\r\n\t\t\t// enableHighAccuracy: false\r\n\t\t}, options);\r\n\r\n\t\tif (!('geolocation' in navigator)) {\r\n\t\t\tthis._handleGeolocationError({\r\n\t\t\t\tcode: 0,\r\n\t\t\t\tmessage: 'Geolocation not supported.'\r\n\t\t\t});\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar onResponse = Util.bind(this._handleGeolocationResponse, this),\r\n\t\t    onError = Util.bind(this._handleGeolocationError, this);\r\n\r\n\t\tif (options.watch) {\r\n\t\t\tthis._locationWatchId =\r\n\t\t\t        navigator.geolocation.watchPosition(onResponse, onError, options);\r\n\t\t} else {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(onResponse, onError, options);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method stopLocate(): this\r\n\t// Stops watching location previously initiated by `map.locate({watch: true})`\r\n\t// and aborts resetting the map view if map.locate was called with\r\n\t// `{setView: true}`.\r\n\tstopLocate: function () {\r\n\t\tif (navigator.geolocation && navigator.geolocation.clearWatch) {\r\n\t\t\tnavigator.geolocation.clearWatch(this._locationWatchId);\r\n\t\t}\r\n\t\tif (this._locateOptions) {\r\n\t\t\tthis._locateOptions.setView = false;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_handleGeolocationError: function (error) {\r\n\t\tif (!this._container._leaflet_id) { return; }\r\n\r\n\t\tvar c = error.code,\r\n\t\t    message = error.message ||\r\n\t\t            (c === 1 ? 'permission denied' :\r\n\t\t            (c === 2 ? 'position unavailable' : 'timeout'));\r\n\r\n\t\tif (this._locateOptions.setView && !this._loaded) {\r\n\t\t\tthis.fitWorld();\r\n\t\t}\r\n\r\n\t\t// @section Location events\r\n\t\t// @event locationerror: ErrorEvent\r\n\t\t// Fired when geolocation (using the [`locate`](#map-locate) method) failed.\r\n\t\tthis.fire('locationerror', {\r\n\t\t\tcode: c,\r\n\t\t\tmessage: 'Geolocation error: ' + message + '.'\r\n\t\t});\r\n\t},\r\n\r\n\t_handleGeolocationResponse: function (pos) {\r\n\t\tif (!this._container._leaflet_id) { return; }\r\n\r\n\t\tvar lat = pos.coords.latitude,\r\n\t\t    lng = pos.coords.longitude,\r\n\t\t    latlng = new LatLng(lat, lng),\r\n\t\t    bounds = latlng.toBounds(pos.coords.accuracy * 2),\r\n\t\t    options = this._locateOptions;\r\n\r\n\t\tif (options.setView) {\r\n\t\t\tvar zoom = this.getBoundsZoom(bounds);\r\n\t\t\tthis.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\r\n\t\t}\r\n\r\n\t\tvar data = {\r\n\t\t\tlatlng: latlng,\r\n\t\t\tbounds: bounds,\r\n\t\t\ttimestamp: pos.timestamp\r\n\t\t};\r\n\r\n\t\tfor (var i in pos.coords) {\r\n\t\t\tif (typeof pos.coords[i] === 'number') {\r\n\t\t\t\tdata[i] = pos.coords[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// @event locationfound: LocationEvent\r\n\t\t// Fired when geolocation (using the [`locate`](#map-locate) method)\r\n\t\t// went successfully.\r\n\t\tthis.fire('locationfound', data);\r\n\t},\r\n\r\n\t// TODO Appropriate docs section?\r\n\t// @section Other Methods\r\n\t// @method addHandler(name: String, HandlerClass: Function): this\r\n\t// Adds a new `Handler` to the map, given its name and constructor function.\r\n\taddHandler: function (name, HandlerClass) {\r\n\t\tif (!HandlerClass) { return this; }\r\n\r\n\t\tvar handler = this[name] = new HandlerClass(this);\r\n\r\n\t\tthis._handlers.push(handler);\r\n\r\n\t\tif (this.options[name]) {\r\n\t\t\thandler.enable();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method remove(): this\r\n\t// Destroys the map and clears all related event listeners.\r\n\tremove: function () {\r\n\r\n\t\tthis._initEvents(true);\r\n\t\tif (this.options.maxBounds) { this.off('moveend', this._panInsideMaxBounds); }\r\n\r\n\t\tif (this._containerId !== this._container._leaflet_id) {\r\n\t\t\tthrow new Error('Map container is being reused by another instance');\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\t// throws error in IE6-8\r\n\t\t\tdelete this._container._leaflet_id;\r\n\t\t\tdelete this._containerId;\r\n\t\t} catch (e) {\r\n\t\t\t/*eslint-disable */\r\n\t\t\tthis._container._leaflet_id = undefined;\r\n\t\t\t/* eslint-enable */\r\n\t\t\tthis._containerId = undefined;\r\n\t\t}\r\n\r\n\t\tif (this._locationWatchId !== undefined) {\r\n\t\t\tthis.stopLocate();\r\n\t\t}\r\n\r\n\t\tthis._stop();\r\n\r\n\t\tDomUtil.remove(this._mapPane);\r\n\r\n\t\tif (this._clearControlPos) {\r\n\t\t\tthis._clearControlPos();\r\n\t\t}\r\n\t\tif (this._resizeRequest) {\r\n\t\t\tUtil.cancelAnimFrame(this._resizeRequest);\r\n\t\t\tthis._resizeRequest = null;\r\n\t\t}\r\n\r\n\t\tthis._clearHandlers();\r\n\r\n\t\tif (this._loaded) {\r\n\t\t\t// @section Map state change events\r\n\t\t\t// @event unload: Event\r\n\t\t\t// Fired when the map is destroyed with [remove](#map-remove) method.\r\n\t\t\tthis.fire('unload');\r\n\t\t}\r\n\r\n\t\tvar i;\r\n\t\tfor (i in this._layers) {\r\n\t\t\tthis._layers[i].remove();\r\n\t\t}\r\n\t\tfor (i in this._panes) {\r\n\t\t\tDomUtil.remove(this._panes[i]);\r\n\t\t}\r\n\r\n\t\tthis._layers = [];\r\n\t\tthis._panes = [];\r\n\t\tdelete this._mapPane;\r\n\t\tdelete this._renderer;\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @section Other Methods\r\n\t// @method createPane(name: String, container?: HTMLElement): HTMLElement\r\n\t// Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,\r\n\t// then returns it. The pane is created as a child of `container`, or\r\n\t// as a child of the main map pane if not set.\r\n\tcreatePane: function (name, container) {\r\n\t\tvar className = 'leaflet-pane' + (name ? ' leaflet-' + name.replace('Pane', '') + '-pane' : ''),\r\n\t\t    pane = DomUtil.create('div', className, container || this._mapPane);\r\n\r\n\t\tif (name) {\r\n\t\t\tthis._panes[name] = pane;\r\n\t\t}\r\n\t\treturn pane;\r\n\t},\r\n\r\n\t// @section Methods for Getting Map State\r\n\r\n\t// @method getCenter(): LatLng\r\n\t// Returns the geographical center of the map view\r\n\tgetCenter: function () {\r\n\t\tthis._checkIfLoaded();\r\n\r\n\t\tif (this._lastCenter && !this._moved()) {\r\n\t\t\treturn this._lastCenter.clone();\r\n\t\t}\r\n\t\treturn this.layerPointToLatLng(this._getCenterLayerPoint());\r\n\t},\r\n\r\n\t// @method getZoom(): Number\r\n\t// Returns the current zoom level of the map view\r\n\tgetZoom: function () {\r\n\t\treturn this._zoom;\r\n\t},\r\n\r\n\t// @method getBounds(): LatLngBounds\r\n\t// Returns the geographical bounds visible in the current map view\r\n\tgetBounds: function () {\r\n\t\tvar bounds = this.getPixelBounds(),\r\n\t\t    sw = this.unproject(bounds.getBottomLeft()),\r\n\t\t    ne = this.unproject(bounds.getTopRight());\r\n\r\n\t\treturn new LatLngBounds(sw, ne);\r\n\t},\r\n\r\n\t// @method getMinZoom(): Number\r\n\t// 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\n\tgetMinZoom: function () {\r\n\t\treturn this.options.minZoom === undefined ? this._layersMinZoom || 0 : this.options.minZoom;\r\n\t},\r\n\r\n\t// @method getMaxZoom(): Number\r\n\t// Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers).\r\n\tgetMaxZoom: function () {\r\n\t\treturn this.options.maxZoom === undefined ?\r\n\t\t\t(this._layersMaxZoom === undefined ? Infinity : this._layersMaxZoom) :\r\n\t\t\tthis.options.maxZoom;\r\n\t},\r\n\r\n\t// @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number\r\n\t// Returns the maximum zoom level on which the given bounds fit to the map\r\n\t// view in its entirety. If `inside` (optional) is set to `true`, the method\r\n\t// instead returns the minimum zoom level on which the map view fits into\r\n\t// the given bounds in its entirety.\r\n\tgetBoundsZoom: function (bounds, inside, padding) { // (LatLngBounds[, Boolean, Point]) -> Number\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\t\tpadding = toPoint(padding || [0, 0]);\r\n\r\n\t\tvar zoom = this.getZoom() || 0,\r\n\t\t    min = this.getMinZoom(),\r\n\t\t    max = this.getMaxZoom(),\r\n\t\t    nw = bounds.getNorthWest(),\r\n\t\t    se = bounds.getSouthEast(),\r\n\t\t    size = this.getSize().subtract(padding),\r\n\t\t    boundsSize = toBounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),\r\n\t\t    snap = Browser.any3d ? this.options.zoomSnap : 1,\r\n\t\t    scalex = size.x / boundsSize.x,\r\n\t\t    scaley = size.y / boundsSize.y,\r\n\t\t    scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\r\n\r\n\t\tzoom = this.getScaleZoom(scale, zoom);\r\n\r\n\t\tif (snap) {\r\n\t\t\tzoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\r\n\t\t\tzoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\r\n\t\t}\r\n\r\n\t\treturn Math.max(min, Math.min(max, zoom));\r\n\t},\r\n\r\n\t// @method getSize(): Point\r\n\t// Returns the current size of the map container (in pixels).\r\n\tgetSize: function () {\r\n\t\tif (!this._size || this._sizeChanged) {\r\n\t\t\tthis._size = new Point(\r\n\t\t\t\tthis._container.clientWidth || 0,\r\n\t\t\t\tthis._container.clientHeight || 0);\r\n\r\n\t\t\tthis._sizeChanged = false;\r\n\t\t}\r\n\t\treturn this._size.clone();\r\n\t},\r\n\r\n\t// @method getPixelBounds(): Bounds\r\n\t// Returns the bounds of the current map view in projected pixel\r\n\t// coordinates (sometimes useful in layer and overlay implementations).\r\n\tgetPixelBounds: function (center, zoom) {\r\n\t\tvar topLeftPoint = this._getTopLeftPoint(center, zoom);\r\n\t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\r\n\t},\r\n\r\n\t// TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to\r\n\t// the map pane? \"left point of the map layer\" can be confusing, specially\r\n\t// since there can be negative offsets.\r\n\t// @method getPixelOrigin(): Point\r\n\t// Returns the projected pixel coordinates of the top left point of\r\n\t// the map layer (useful in custom layer and overlay implementations).\r\n\tgetPixelOrigin: function () {\r\n\t\tthis._checkIfLoaded();\r\n\t\treturn this._pixelOrigin;\r\n\t},\r\n\r\n\t// @method getPixelWorldBounds(zoom?: Number): Bounds\r\n\t// Returns the world's bounds in pixel coordinates for zoom level `zoom`.\r\n\t// If `zoom` is omitted, the map's current zoom level is used.\r\n\tgetPixelWorldBounds: function (zoom) {\r\n\t\treturn this.options.crs.getProjectedBounds(zoom === undefined ? this.getZoom() : zoom);\r\n\t},\r\n\r\n\t// @section Other Methods\r\n\r\n\t// @method getPane(pane: String|HTMLElement): HTMLElement\r\n\t// Returns a [map pane](#map-pane), given its name or its HTML element (its identity).\r\n\tgetPane: function (pane) {\r\n\t\treturn typeof pane === 'string' ? this._panes[pane] : pane;\r\n\t},\r\n\r\n\t// @method getPanes(): Object\r\n\t// Returns a plain object containing the names of all [panes](#map-pane) as keys and\r\n\t// the panes as values.\r\n\tgetPanes: function () {\r\n\t\treturn this._panes;\r\n\t},\r\n\r\n\t// @method getContainer: HTMLElement\r\n\t// Returns the HTML element that contains the map.\r\n\tgetContainer: function () {\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\r\n\t// @section Conversion Methods\r\n\r\n\t// @method getZoomScale(toZoom: Number, fromZoom: Number): Number\r\n\t// Returns the scale factor to be applied to a map transition from zoom level\r\n\t// `fromZoom` to `toZoom`. Used internally to help with zoom animations.\r\n\tgetZoomScale: function (toZoom, fromZoom) {\r\n\t\t// TODO replace with universal implementation after refactoring projections\r\n\t\tvar crs = this.options.crs;\r\n\t\tfromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r\n\t\treturn crs.scale(toZoom) / crs.scale(fromZoom);\r\n\t},\r\n\r\n\t// @method getScaleZoom(scale: Number, fromZoom: Number): Number\r\n\t// Returns the zoom level that the map would end up at, if it is at `fromZoom`\r\n\t// level and everything is scaled by a factor of `scale`. Inverse of\r\n\t// [`getZoomScale`](#map-getZoomScale).\r\n\tgetScaleZoom: function (scale, fromZoom) {\r\n\t\tvar crs = this.options.crs;\r\n\t\tfromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r\n\t\tvar zoom = crs.zoom(scale * crs.scale(fromZoom));\r\n\t\treturn isNaN(zoom) ? Infinity : zoom;\r\n\t},\r\n\r\n\t// @method project(latlng: LatLng, zoom: Number): Point\r\n\t// Projects a geographical coordinate `LatLng` according to the projection\r\n\t// of the map's CRS, then scales it according to `zoom` and the CRS's\r\n\t// `Transformation`. The result is pixel coordinate relative to\r\n\t// the CRS origin.\r\n\tproject: function (latlng, zoom) {\r\n\t\tzoom = zoom === undefined ? this._zoom : zoom;\r\n\t\treturn this.options.crs.latLngToPoint(toLatLng(latlng), zoom);\r\n\t},\r\n\r\n\t// @method unproject(point: Point, zoom: Number): LatLng\r\n\t// Inverse of [`project`](#map-project).\r\n\tunproject: function (point, zoom) {\r\n\t\tzoom = zoom === undefined ? this._zoom : zoom;\r\n\t\treturn this.options.crs.pointToLatLng(toPoint(point), zoom);\r\n\t},\r\n\r\n\t// @method layerPointToLatLng(point: Point): LatLng\r\n\t// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r\n\t// returns the corresponding geographical coordinate (for the current zoom level).\r\n\tlayerPointToLatLng: function (point) {\r\n\t\tvar projectedPoint = toPoint(point).add(this.getPixelOrigin());\r\n\t\treturn this.unproject(projectedPoint);\r\n\t},\r\n\r\n\t// @method latLngToLayerPoint(latlng: LatLng): Point\r\n\t// Given a geographical coordinate, returns the corresponding pixel coordinate\r\n\t// relative to the [origin pixel](#map-getpixelorigin).\r\n\tlatLngToLayerPoint: function (latlng) {\r\n\t\tvar projectedPoint = this.project(toLatLng(latlng))._round();\r\n\t\treturn projectedPoint._subtract(this.getPixelOrigin());\r\n\t},\r\n\r\n\t// @method wrapLatLng(latlng: LatLng): LatLng\r\n\t// Returns a `LatLng` where `lat` and `lng` has been wrapped according to the\r\n\t// map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the\r\n\t// CRS's bounds.\r\n\t// By default this means longitude is wrapped around the dateline so its\r\n\t// value is between -180 and +180 degrees.\r\n\twrapLatLng: function (latlng) {\r\n\t\treturn this.options.crs.wrapLatLng(toLatLng(latlng));\r\n\t},\r\n\r\n\t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n\t// Returns a `LatLngBounds` with the same size as the given one, ensuring that\r\n\t// its center is within the CRS's bounds.\r\n\t// By default this means the center longitude is wrapped around the dateline so its\r\n\t// value is between -180 and +180 degrees, and the majority of the bounds\r\n\t// overlaps the CRS's bounds.\r\n\twrapLatLngBounds: function (latlng) {\r\n\t\treturn this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng));\r\n\t},\r\n\r\n\t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n\t// Returns the distance between two geographical coordinates according to\r\n\t// the map's CRS. By default this measures distance in meters.\r\n\tdistance: function (latlng1, latlng2) {\r\n\t\treturn this.options.crs.distance(toLatLng(latlng1), toLatLng(latlng2));\r\n\t},\r\n\r\n\t// @method containerPointToLayerPoint(point: Point): Point\r\n\t// Given a pixel coordinate relative to the map container, returns the corresponding\r\n\t// pixel coordinate relative to the [origin pixel](#map-getpixelorigin).\r\n\tcontainerPointToLayerPoint: function (point) { // (Point)\r\n\t\treturn toPoint(point).subtract(this._getMapPanePos());\r\n\t},\r\n\r\n\t// @method layerPointToContainerPoint(point: Point): Point\r\n\t// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r\n\t// returns the corresponding pixel coordinate relative to the map container.\r\n\tlayerPointToContainerPoint: function (point) { // (Point)\r\n\t\treturn toPoint(point).add(this._getMapPanePos());\r\n\t},\r\n\r\n\t// @method containerPointToLatLng(point: Point): LatLng\r\n\t// Given a pixel coordinate relative to the map container, returns\r\n\t// the corresponding geographical coordinate (for the current zoom level).\r\n\tcontainerPointToLatLng: function (point) {\r\n\t\tvar layerPoint = this.containerPointToLayerPoint(toPoint(point));\r\n\t\treturn this.layerPointToLatLng(layerPoint);\r\n\t},\r\n\r\n\t// @method latLngToContainerPoint(latlng: LatLng): Point\r\n\t// Given a geographical coordinate, returns the corresponding pixel coordinate\r\n\t// relative to the map container.\r\n\tlatLngToContainerPoint: function (latlng) {\r\n\t\treturn this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng)));\r\n\t},\r\n\r\n\t// @method mouseEventToContainerPoint(ev: MouseEvent): Point\r\n\t// Given a MouseEvent object, returns the pixel coordinate relative to the\r\n\t// map container where the event took place.\r\n\tmouseEventToContainerPoint: function (e) {\r\n\t\treturn DomEvent.getMousePosition(e, this._container);\r\n\t},\r\n\r\n\t// @method mouseEventToLayerPoint(ev: MouseEvent): Point\r\n\t// Given a MouseEvent object, returns the pixel coordinate relative to\r\n\t// the [origin pixel](#map-getpixelorigin) where the event took place.\r\n\tmouseEventToLayerPoint: function (e) {\r\n\t\treturn this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e));\r\n\t},\r\n\r\n\t// @method mouseEventToLatLng(ev: MouseEvent): LatLng\r\n\t// Given a MouseEvent object, returns geographical coordinate where the\r\n\t// event took place.\r\n\tmouseEventToLatLng: function (e) { // (MouseEvent)\r\n\t\treturn this.layerPointToLatLng(this.mouseEventToLayerPoint(e));\r\n\t},\r\n\r\n\r\n\t// map initialization methods\r\n\r\n\t_initContainer: function (id) {\r\n\t\tvar container = this._container = DomUtil.get(id);\r\n\r\n\t\tif (!container) {\r\n\t\t\tthrow new Error('Map container not found.');\r\n\t\t} else if (container._leaflet_id) {\r\n\t\t\tthrow new Error('Map container is already initialized.');\r\n\t\t}\r\n\r\n\t\tDomEvent.on(container, 'scroll', this._onScroll, this);\r\n\t\tthis._containerId = Util.stamp(container);\r\n\t},\r\n\r\n\t_initLayout: function () {\r\n\t\tvar container = this._container;\r\n\r\n\t\tthis._fadeAnimated = this.options.fadeAnimation && Browser.any3d;\r\n\r\n\t\tDomUtil.addClass(container, 'leaflet-container' +\r\n\t\t\t(Browser.touch ? ' leaflet-touch' : '') +\r\n\t\t\t(Browser.retina ? ' leaflet-retina' : '') +\r\n\t\t\t(Browser.ielt9 ? ' leaflet-oldie' : '') +\r\n\t\t\t(Browser.safari ? ' leaflet-safari' : '') +\r\n\t\t\t(this._fadeAnimated ? ' leaflet-fade-anim' : ''));\r\n\r\n\t\tvar position = DomUtil.getStyle(container, 'position');\r\n\r\n\t\tif (position !== 'absolute' && position !== 'relative' && position !== 'fixed' && position !== 'sticky') {\r\n\t\t\tcontainer.style.position = 'relative';\r\n\t\t}\r\n\r\n\t\tthis._initPanes();\r\n\r\n\t\tif (this._initControlPos) {\r\n\t\t\tthis._initControlPos();\r\n\t\t}\r\n\t},\r\n\r\n\t_initPanes: function () {\r\n\t\tvar panes = this._panes = {};\r\n\t\tthis._paneRenderers = {};\r\n\r\n\t\t// @section\r\n\t\t//\r\n\t\t// Panes are DOM elements used to control the ordering of layers on the map. You\r\n\t\t// can access panes with [`map.getPane`](#map-getpane) or\r\n\t\t// [`map.getPanes`](#map-getpanes) methods. New panes can be created with the\r\n\t\t// [`map.createPane`](#map-createpane) method.\r\n\t\t//\r\n\t\t// Every map has the following default panes that differ only in zIndex.\r\n\t\t//\r\n\t\t// @pane mapPane: HTMLElement = 'auto'\r\n\t\t// Pane that contains all other map panes\r\n\r\n\t\tthis._mapPane = this.createPane('mapPane', this._container);\r\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\r\n\r\n\t\t// @pane tilePane: HTMLElement = 200\r\n\t\t// Pane for `GridLayer`s and `TileLayer`s\r\n\t\tthis.createPane('tilePane');\r\n\t\t// @pane overlayPane: HTMLElement = 400\r\n\t\t// Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s\r\n\t\tthis.createPane('overlayPane');\r\n\t\t// @pane shadowPane: HTMLElement = 500\r\n\t\t// Pane for overlay shadows (e.g. `Marker` shadows)\r\n\t\tthis.createPane('shadowPane');\r\n\t\t// @pane markerPane: HTMLElement = 600\r\n\t\t// Pane for `Icon`s of `Marker`s\r\n\t\tthis.createPane('markerPane');\r\n\t\t// @pane tooltipPane: HTMLElement = 650\r\n\t\t// Pane for `Tooltip`s.\r\n\t\tthis.createPane('tooltipPane');\r\n\t\t// @pane popupPane: HTMLElement = 700\r\n\t\t// Pane for `Popup`s.\r\n\t\tthis.createPane('popupPane');\r\n\r\n\t\tif (!this.options.markerZoomAnimation) {\r\n\t\t\tDomUtil.addClass(panes.markerPane, 'leaflet-zoom-hide');\r\n\t\t\tDomUtil.addClass(panes.shadowPane, 'leaflet-zoom-hide');\r\n\t\t}\r\n\t},\r\n\r\n\r\n\t// private methods that modify map state\r\n\r\n\t// @section Map state change events\r\n\t_resetView: function (center, zoom, noMoveStart) {\r\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\r\n\r\n\t\tvar loading = !this._loaded;\r\n\t\tthis._loaded = true;\r\n\t\tzoom = this._limitZoom(zoom);\r\n\r\n\t\tthis.fire('viewprereset');\r\n\r\n\t\tvar zoomChanged = this._zoom !== zoom;\r\n\t\tthis\r\n\t\t\t._moveStart(zoomChanged, noMoveStart)\r\n\t\t\t._move(center, zoom)\r\n\t\t\t._moveEnd(zoomChanged);\r\n\r\n\t\t// @event viewreset: Event\r\n\t\t// Fired when the map needs to redraw its content (this usually happens\r\n\t\t// on map zoom or load). Very useful for creating custom overlays.\r\n\t\tthis.fire('viewreset');\r\n\r\n\t\t// @event load: Event\r\n\t\t// Fired when the map is initialized (when its center and zoom are set\r\n\t\t// for the first time).\r\n\t\tif (loading) {\r\n\t\t\tthis.fire('load');\r\n\t\t}\r\n\t},\r\n\r\n\t_moveStart: function (zoomChanged, noMoveStart) {\r\n\t\t// @event zoomstart: Event\r\n\t\t// Fired when the map zoom is about to change (e.g. before zoom animation).\r\n\t\t// @event movestart: Event\r\n\t\t// Fired when the view of the map starts changing (e.g. user starts dragging the map).\r\n\t\tif (zoomChanged) {\r\n\t\t\tthis.fire('zoomstart');\r\n\t\t}\r\n\t\tif (!noMoveStart) {\r\n\t\t\tthis.fire('movestart');\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_move: function (center, zoom, data, supressEvent) {\r\n\t\tif (zoom === undefined) {\r\n\t\t\tzoom = this._zoom;\r\n\t\t}\r\n\t\tvar zoomChanged = this._zoom !== zoom;\r\n\r\n\t\tthis._zoom = zoom;\r\n\t\tthis._lastCenter = center;\r\n\t\tthis._pixelOrigin = this._getNewPixelOrigin(center);\r\n\r\n\t\tif (!supressEvent) {\r\n\t\t\t// @event zoom: Event\r\n\t\t\t// Fired repeatedly during any change in zoom level,\r\n\t\t\t// including zoom and fly animations.\r\n\t\t\tif (zoomChanged || (data && data.pinch)) {\t// Always fire 'zoom' if pinching because #3530\r\n\t\t\t\tthis.fire('zoom', data);\r\n\t\t\t}\r\n\r\n\t\t\t// @event move: Event\r\n\t\t\t// Fired repeatedly during any movement of the map,\r\n\t\t\t// including pan and fly animations.\r\n\t\t\tthis.fire('move', data);\r\n\t\t} else if (data && data.pinch) {\t// Always fire 'zoom' if pinching because #3530\r\n\t\t\tthis.fire('zoom', data);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_moveEnd: function (zoomChanged) {\r\n\t\t// @event zoomend: Event\r\n\t\t// Fired when the map zoom changed, after any animations.\r\n\t\tif (zoomChanged) {\r\n\t\t\tthis.fire('zoomend');\r\n\t\t}\r\n\r\n\t\t// @event moveend: Event\r\n\t\t// Fired when the center of the map stops changing\r\n\t\t// (e.g. user stopped dragging the map or after non-centered zoom).\r\n\t\treturn this.fire('moveend');\r\n\t},\r\n\r\n\t_stop: function () {\r\n\t\tUtil.cancelAnimFrame(this._flyToFrame);\r\n\t\tif (this._panAnim) {\r\n\t\t\tthis._panAnim.stop();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_rawPanBy: function (offset) {\r\n\t\tDomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(offset));\r\n\t},\r\n\r\n\t_getZoomSpan: function () {\r\n\t\treturn this.getMaxZoom() - this.getMinZoom();\r\n\t},\r\n\r\n\t_panInsideMaxBounds: function () {\r\n\t\tif (!this._enforcingBounds) {\r\n\t\t\tthis.panInsideBounds(this.options.maxBounds);\r\n\t\t}\r\n\t},\r\n\r\n\t_checkIfLoaded: function () {\r\n\t\tif (!this._loaded) {\r\n\t\t\tthrow new Error('Set map center and zoom first.');\r\n\t\t}\r\n\t},\r\n\r\n\t// DOM event handling\r\n\r\n\t// @section Interaction events\r\n\t_initEvents: function (remove) {\r\n\t\tthis._targets = {};\r\n\t\tthis._targets[Util.stamp(this._container)] = this;\r\n\r\n\t\tvar onOff = remove ? DomEvent.off : DomEvent.on;\r\n\r\n\t\t// @event click: MouseEvent\r\n\t\t// Fired when the user clicks (or taps) the map.\r\n\t\t// @event dblclick: MouseEvent\r\n\t\t// Fired when the user double-clicks (or double-taps) the map.\r\n\t\t// @event mousedown: MouseEvent\r\n\t\t// Fired when the user pushes the mouse button on the map.\r\n\t\t// @event mouseup: MouseEvent\r\n\t\t// Fired when the user releases the mouse button on the map.\r\n\t\t// @event mouseover: MouseEvent\r\n\t\t// Fired when the mouse enters the map.\r\n\t\t// @event mouseout: MouseEvent\r\n\t\t// Fired when the mouse leaves the map.\r\n\t\t// @event mousemove: MouseEvent\r\n\t\t// Fired while the mouse moves over the map.\r\n\t\t// @event contextmenu: MouseEvent\r\n\t\t// Fired when the user pushes the right mouse button on the map, prevents\r\n\t\t// default browser context menu from showing if there are listeners on\r\n\t\t// this event. Also fired on mobile when the user holds a single touch\r\n\t\t// for a second (also called long press).\r\n\t\t// @event keypress: KeyboardEvent\r\n\t\t// Fired when the user presses a key from the keyboard that produces a character value while the map is focused.\r\n\t\t// @event keydown: KeyboardEvent\r\n\t\t// Fired when the user presses a key from the keyboard while the map is focused. Unlike the `keypress` event,\r\n\t\t// the `keydown` event is fired for keys that produce a character value and for keys\r\n\t\t// that do not produce a character value.\r\n\t\t// @event keyup: KeyboardEvent\r\n\t\t// Fired when the user releases a key from the keyboard while the map is focused.\r\n\t\tonOff(this._container, 'click dblclick mousedown mouseup ' +\r\n\t\t\t'mouseover mouseout mousemove contextmenu keypress keydown keyup', this._handleDOMEvent, this);\r\n\r\n\t\tif (this.options.trackResize) {\r\n\t\t\tonOff(window, 'resize', this._onResize, this);\r\n\t\t}\r\n\r\n\t\tif (Browser.any3d && this.options.transform3DLimit) {\r\n\t\t\t(remove ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\r\n\t\t}\r\n\t},\r\n\r\n\t_onResize: function () {\r\n\t\tUtil.cancelAnimFrame(this._resizeRequest);\r\n\t\tthis._resizeRequest = Util.requestAnimFrame(\r\n\t\t        function () { this.invalidateSize({debounceMoveend: true}); }, this);\r\n\t},\r\n\r\n\t_onScroll: function () {\r\n\t\tthis._container.scrollTop  = 0;\r\n\t\tthis._container.scrollLeft = 0;\r\n\t},\r\n\r\n\t_onMoveEnd: function () {\r\n\t\tvar pos = this._getMapPanePos();\r\n\t\tif (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) {\r\n\t\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have\r\n\t\t\t// a pixel offset on very high values, see: https://jsfiddle.net/dg6r5hhb/\r\n\t\t\tthis._resetView(this.getCenter(), this.getZoom());\r\n\t\t}\r\n\t},\r\n\r\n\t_findEventTargets: function (e, type) {\r\n\t\tvar targets = [],\r\n\t\t    target,\r\n\t\t    isHover = type === 'mouseout' || type === 'mouseover',\r\n\t\t    src = e.target || e.srcElement,\r\n\t\t    dragging = false;\r\n\r\n\t\twhile (src) {\r\n\t\t\ttarget = this._targets[Util.stamp(src)];\r\n\t\t\tif (target && (type === 'click' || type === 'preclick') && this._draggableMoved(target)) {\r\n\t\t\t\t// Prevent firing click after you just dragged an object.\r\n\t\t\t\tdragging = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (target && target.listens(type, true)) {\r\n\t\t\t\tif (isHover && !DomEvent.isExternalTarget(src, e)) { break; }\r\n\t\t\t\ttargets.push(target);\r\n\t\t\t\tif (isHover) { break; }\r\n\t\t\t}\r\n\t\t\tif (src === this._container) { break; }\r\n\t\t\tsrc = src.parentNode;\r\n\t\t}\r\n\t\tif (!targets.length && !dragging && !isHover && this.listens(type, true)) {\r\n\t\t\ttargets = [this];\r\n\t\t}\r\n\t\treturn targets;\r\n\t},\r\n\r\n\t_isClickDisabled: function (el) {\r\n\t\twhile (el && el !== this._container) {\r\n\t\t\tif (el['_leaflet_disable_click']) { return true; }\r\n\t\t\tel = el.parentNode;\r\n\t\t}\r\n\t},\r\n\r\n\t_handleDOMEvent: function (e) {\r\n\t\tvar el = (e.target || e.srcElement);\r\n\t\tif (!this._loaded || el['_leaflet_disable_events'] || e.type === 'click' && this._isClickDisabled(el)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar type = e.type;\r\n\r\n\t\tif (type === 'mousedown') {\r\n\t\t\t// prevents outline when clicking on keyboard-focusable element\r\n\t\t\tDomUtil.preventOutline(el);\r\n\t\t}\r\n\r\n\t\tthis._fireDOMEvent(e, type);\r\n\t},\r\n\r\n\t_mouseEvents: ['click', 'dblclick', 'mouseover', 'mouseout', 'contextmenu'],\r\n\r\n\t_fireDOMEvent: function (e, type, canvasTargets) {\r\n\r\n\t\tif (e.type === 'click') {\r\n\t\t\t// Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\r\n\t\t\t// @event preclick: MouseEvent\r\n\t\t\t// Fired before mouse click on the map (sometimes useful when you\r\n\t\t\t// want something to happen on click before any existing click\r\n\t\t\t// handlers start running).\r\n\t\t\tvar synth = Util.extend({}, e);\r\n\t\t\tsynth.type = 'preclick';\r\n\t\t\tthis._fireDOMEvent(synth, synth.type, canvasTargets);\r\n\t\t}\r\n\r\n\t\t// Find the layer the event is propagating from and its parents.\r\n\t\tvar targets = this._findEventTargets(e, type);\r\n\r\n\t\tif (canvasTargets) {\r\n\t\t\tvar filtered = []; // pick only targets with listeners\r\n\t\t\tfor (var i = 0; i < canvasTargets.length; i++) {\r\n\t\t\t\tif (canvasTargets[i].listens(type, true)) {\r\n\t\t\t\t\tfiltered.push(canvasTargets[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttargets = filtered.concat(targets);\r\n\t\t}\r\n\r\n\t\tif (!targets.length) { return; }\r\n\r\n\t\tif (type === 'contextmenu') {\r\n\t\t\tDomEvent.preventDefault(e);\r\n\t\t}\r\n\r\n\t\tvar target = targets[0];\r\n\t\tvar data = {\r\n\t\t\toriginalEvent: e\r\n\t\t};\r\n\r\n\t\tif (e.type !== 'keypress' && e.type !== 'keydown' && e.type !== 'keyup') {\r\n\t\t\tvar isMarker = target.getLatLng && (!target._radius || target._radius <= 10);\r\n\t\t\tdata.containerPoint = isMarker ?\r\n\t\t\t\tthis.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);\r\n\t\t\tdata.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\r\n\t\t\tdata.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);\r\n\t\t}\r\n\r\n\t\tfor (i = 0; i < targets.length; i++) {\r\n\t\t\ttargets[i].fire(type, data, true);\r\n\t\t\tif (data.originalEvent._stopped ||\r\n\t\t\t\t(targets[i].options.bubblingMouseEvents === false && Util.indexOf(this._mouseEvents, type) !== -1)) { return; }\r\n\t\t}\r\n\t},\r\n\r\n\t_draggableMoved: function (obj) {\r\n\t\tobj = obj.dragging && obj.dragging.enabled() ? obj : this;\r\n\t\treturn (obj.dragging && obj.dragging.moved()) || (this.boxZoom && this.boxZoom.moved());\r\n\t},\r\n\r\n\t_clearHandlers: function () {\r\n\t\tfor (var i = 0, len = this._handlers.length; i < len; i++) {\r\n\t\t\tthis._handlers[i].disable();\r\n\t\t}\r\n\t},\r\n\r\n\t// @section Other Methods\r\n\r\n\t// @method whenReady(fn: Function, context?: Object): this\r\n\t// Runs the given function `fn` when the map gets initialized with\r\n\t// a view (center and zoom) and at least one layer, or immediately\r\n\t// if it's already initialized, optionally passing a function context.\r\n\twhenReady: function (callback, context) {\r\n\t\tif (this._loaded) {\r\n\t\t\tcallback.call(context || this, {target: this});\r\n\t\t} else {\r\n\t\t\tthis.on('load', callback, context);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\r\n\t// private methods for getting map state\r\n\r\n\t_getMapPanePos: function () {\r\n\t\treturn DomUtil.getPosition(this._mapPane) || new Point(0, 0);\r\n\t},\r\n\r\n\t_moved: function () {\r\n\t\tvar pos = this._getMapPanePos();\r\n\t\treturn pos && !pos.equals([0, 0]);\r\n\t},\r\n\r\n\t_getTopLeftPoint: function (center, zoom) {\r\n\t\tvar pixelOrigin = center && zoom !== undefined ?\r\n\t\t\tthis._getNewPixelOrigin(center, zoom) :\r\n\t\t\tthis.getPixelOrigin();\r\n\t\treturn pixelOrigin.subtract(this._getMapPanePos());\r\n\t},\r\n\r\n\t_getNewPixelOrigin: function (center, zoom) {\r\n\t\tvar viewHalf = this.getSize()._divideBy(2);\r\n\t\treturn this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos())._round();\r\n\t},\r\n\r\n\t_latLngToNewLayerPoint: function (latlng, zoom, center) {\r\n\t\tvar topLeft = this._getNewPixelOrigin(center, zoom);\r\n\t\treturn this.project(latlng, zoom)._subtract(topLeft);\r\n\t},\r\n\r\n\t_latLngBoundsToNewLayerBounds: function (latLngBounds, zoom, center) {\r\n\t\tvar topLeft = this._getNewPixelOrigin(center, zoom);\r\n\t\treturn toBounds([\r\n\t\t\tthis.project(latLngBounds.getSouthWest(), zoom)._subtract(topLeft),\r\n\t\t\tthis.project(latLngBounds.getNorthWest(), zoom)._subtract(topLeft),\r\n\t\t\tthis.project(latLngBounds.getSouthEast(), zoom)._subtract(topLeft),\r\n\t\t\tthis.project(latLngBounds.getNorthEast(), zoom)._subtract(topLeft)\r\n\t\t]);\r\n\t},\r\n\r\n\t// layer point of the current center\r\n\t_getCenterLayerPoint: function () {\r\n\t\treturn this.containerPointToLayerPoint(this.getSize()._divideBy(2));\r\n\t},\r\n\r\n\t// offset of the specified place to the current center in pixels\r\n\t_getCenterOffset: function (latlng) {\r\n\t\treturn this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint());\r\n\t},\r\n\r\n\t// adjust center for view to get inside bounds\r\n\t_limitCenter: function (center, zoom, bounds) {\r\n\r\n\t\tif (!bounds) { return center; }\r\n\r\n\t\tvar centerPoint = this.project(center, zoom),\r\n\t\t    viewHalf = this.getSize().divideBy(2),\r\n\t\t    viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\r\n\t\t    offset = this._getBoundsOffset(viewBounds, bounds, zoom);\r\n\r\n\t\t// If offset is less than a pixel, ignore.\r\n\t\t// This prevents unstable projections from getting into\r\n\t\t// an infinite loop of tiny offsets.\r\n\t\tif (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) {\r\n\t\t\treturn center;\r\n\t\t}\r\n\r\n\t\treturn this.unproject(centerPoint.add(offset), zoom);\r\n\t},\r\n\r\n\t// adjust offset for view to get inside bounds\r\n\t_limitOffset: function (offset, bounds) {\r\n\t\tif (!bounds) { return offset; }\r\n\r\n\t\tvar viewBounds = this.getPixelBounds(),\r\n\t\t    newBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));\r\n\r\n\t\treturn offset.add(this._getBoundsOffset(newBounds, bounds));\r\n\t},\r\n\r\n\t// returns offset needed for pxBounds to get inside maxBounds at a specified zoom\r\n\t_getBoundsOffset: function (pxBounds, maxBounds, zoom) {\r\n\t\tvar projectedMaxBounds = toBounds(\r\n\t\t        this.project(maxBounds.getNorthEast(), zoom),\r\n\t\t        this.project(maxBounds.getSouthWest(), zoom)\r\n\t\t    ),\r\n\t\t    minOffset = projectedMaxBounds.min.subtract(pxBounds.min),\r\n\t\t    maxOffset = projectedMaxBounds.max.subtract(pxBounds.max),\r\n\r\n\t\t    dx = this._rebound(minOffset.x, -maxOffset.x),\r\n\t\t    dy = this._rebound(minOffset.y, -maxOffset.y);\r\n\r\n\t\treturn new Point(dx, dy);\r\n\t},\r\n\r\n\t_rebound: function (left, right) {\r\n\t\treturn left + right > 0 ?\r\n\t\t\tMath.round(left - right) / 2 :\r\n\t\t\tMath.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));\r\n\t},\r\n\r\n\t_limitZoom: function (zoom) {\r\n\t\tvar min = this.getMinZoom(),\r\n\t\t    max = this.getMaxZoom(),\r\n\t\t    snap = Browser.any3d ? this.options.zoomSnap : 1;\r\n\t\tif (snap) {\r\n\t\t\tzoom = Math.round(zoom / snap) * snap;\r\n\t\t}\r\n\t\treturn Math.max(min, Math.min(max, zoom));\r\n\t},\r\n\r\n\t_onPanTransitionStep: function () {\r\n\t\tthis.fire('move');\r\n\t},\r\n\r\n\t_onPanTransitionEnd: function () {\r\n\t\tDomUtil.removeClass(this._mapPane, 'leaflet-pan-anim');\r\n\t\tthis.fire('moveend');\r\n\t},\r\n\r\n\t_tryAnimatedPan: function (center, options) {\r\n\t\t// difference between the new and current centers in pixels\r\n\t\tvar offset = this._getCenterOffset(center)._trunc();\r\n\r\n\t\t// don't animate too far unless animate: true specified in options\r\n\t\tif ((options && options.animate) !== true && !this.getSize().contains(offset)) { return false; }\r\n\r\n\t\tthis.panBy(offset, options);\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t_createAnimProxy: function () {\r\n\r\n\t\tvar proxy = this._proxy = DomUtil.create('div', 'leaflet-proxy leaflet-zoom-animated');\r\n\t\tthis._panes.mapPane.appendChild(proxy);\r\n\r\n\t\tthis.on('zoomanim', function (e) {\r\n\t\t\tvar prop = DomUtil.TRANSFORM,\r\n\t\t\t    transform = this._proxy.style[prop];\r\n\r\n\t\t\tDomUtil.setTransform(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1));\r\n\r\n\t\t\t// workaround for case when transform is the same and so transitionend event is not fired\r\n\t\t\tif (transform === this._proxy.style[prop] && this._animatingZoom) {\r\n\t\t\t\tthis._onZoomTransitionEnd();\r\n\t\t\t}\r\n\t\t}, this);\r\n\r\n\t\tthis.on('load moveend', this._animMoveEnd, this);\r\n\r\n\t\tthis._on('unload', this._destroyAnimProxy, this);\r\n\t},\r\n\r\n\t_destroyAnimProxy: function () {\r\n\t\tDomUtil.remove(this._proxy);\r\n\t\tthis.off('load moveend', this._animMoveEnd, this);\r\n\t\tdelete this._proxy;\r\n\t},\r\n\r\n\t_animMoveEnd: function () {\r\n\t\tvar c = this.getCenter(),\r\n\t\t    z = this.getZoom();\r\n\t\tDomUtil.setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1));\r\n\t},\r\n\r\n\t_catchTransitionEnd: function (e) {\r\n\t\tif (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) {\r\n\t\t\tthis._onZoomTransitionEnd();\r\n\t\t}\r\n\t},\r\n\r\n\t_nothingToAnimate: function () {\r\n\t\treturn !this._container.getElementsByClassName('leaflet-zoom-animated').length;\r\n\t},\r\n\r\n\t_tryAnimatedZoom: function (center, zoom, options) {\r\n\r\n\t\tif (this._animatingZoom) { return true; }\r\n\r\n\t\toptions = options || {};\r\n\r\n\t\t// don't animate if disabled, not supported or zoom difference is too large\r\n\t\tif (!this._zoomAnimated || options.animate === false || this._nothingToAnimate() ||\r\n\t\t        Math.abs(zoom - this._zoom) > this.options.zoomAnimationThreshold) { return false; }\r\n\r\n\t\t// offset is the pixel coords of the zoom origin relative to the current center\r\n\t\tvar scale = this.getZoomScale(zoom),\r\n\t\t    offset = this._getCenterOffset(center)._divideBy(1 - 1 / scale);\r\n\r\n\t\t// don't animate if the zoom origin isn't within one screen from the current center, unless forced\r\n\t\tif (options.animate !== true && !this.getSize().contains(offset)) { return false; }\r\n\r\n\t\tUtil.requestAnimFrame(function () {\r\n\t\t\tthis\r\n\t\t\t    ._moveStart(true, options.noMoveStart || false)\r\n\t\t\t    ._animateZoom(center, zoom, true);\r\n\t\t}, this);\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t_animateZoom: function (center, zoom, startAnim, noUpdate) {\r\n\t\tif (!this._mapPane) { return; }\r\n\r\n\t\tif (startAnim) {\r\n\t\t\tthis._animatingZoom = true;\r\n\r\n\t\t\t// remember what center/zoom to set after animation\r\n\t\t\tthis._animateToCenter = center;\r\n\t\t\tthis._animateToZoom = zoom;\r\n\r\n\t\t\tDomUtil.addClass(this._mapPane, 'leaflet-zoom-anim');\r\n\t\t}\r\n\r\n\t\t// @section Other Events\r\n\t\t// @event zoomanim: ZoomAnimEvent\r\n\t\t// Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.\r\n\t\tthis.fire('zoomanim', {\r\n\t\t\tcenter: center,\r\n\t\t\tzoom: zoom,\r\n\t\t\tnoUpdate: noUpdate\r\n\t\t});\r\n\r\n\t\tif (!this._tempFireZoomEvent) {\r\n\t\t\tthis._tempFireZoomEvent = this._zoom !== this._animateToZoom;\r\n\t\t}\r\n\r\n\t\tthis._move(this._animateToCenter, this._animateToZoom, undefined, true);\r\n\r\n\t\t// Work around webkit not firing 'transitionend', see https://github.com/Leaflet/Leaflet/issues/3689, 2693\r\n\t\tsetTimeout(Util.bind(this._onZoomTransitionEnd, this), 250);\r\n\t},\r\n\r\n\t_onZoomTransitionEnd: function () {\r\n\t\tif (!this._animatingZoom) { return; }\r\n\r\n\t\tif (this._mapPane) {\r\n\t\t\tDomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');\r\n\t\t}\r\n\r\n\t\tthis._animatingZoom = false;\r\n\r\n\t\tthis._move(this._animateToCenter, this._animateToZoom, undefined, true);\r\n\r\n\t\tif (this._tempFireZoomEvent) {\r\n\t\t\tthis.fire('zoom');\r\n\t\t}\r\n\t\tdelete this._tempFireZoomEvent;\r\n\r\n\t\tthis.fire('move');\r\n\r\n\t\tthis._moveEnd(true);\r\n\t}\r\n});\r\n\r\n// @section\r\n\r\n// @factory L.map(id: String, options?: Map options)\r\n// Instantiates a map object given the DOM ID of a `<div>` element\r\n// and optionally an object literal with `Map options`.\r\n//\r\n// @alternative\r\n// @factory L.map(el: HTMLElement, options?: Map options)\r\n// Instantiates a map object given an instance of a `<div>` HTML element\r\n// and optionally an object literal with `Map options`.\r\nexport function createMap(id, options) {\r\n\treturn new Map(id, options);\r\n}\r\n", "\r\nimport {Class} from '../core/Class';\r\nimport {Map} from '../map/Map';\r\nimport * as Util from '../core/Util';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class Control\r\n * @aka L.Control\r\n * @inherits Class\r\n *\r\n * L.Control is a base class for implementing map controls. Handles positioning.\r\n * All other controls extend from this class.\r\n */\r\n\r\nexport var Control = Class.extend({\r\n\t// @section\r\n\t// @aka Control Options\r\n\toptions: {\r\n\t\t// @option position: String = 'topright'\r\n\t\t// The position of the control (one of the map corners). Possible values are `'topleft'`,\r\n\t\t// `'topright'`, `'bottomleft'` or `'bottomright'`\r\n\t\tposition: 'topright'\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tUtil.setOptions(this, options);\r\n\t},\r\n\r\n\t/* @section\r\n\t * Classes extending L.Control will inherit the following methods:\r\n\t *\r\n\t * @method getPosition: string\r\n\t * Returns the position of the control.\r\n\t */\r\n\tgetPosition: function () {\r\n\t\treturn this.options.position;\r\n\t},\r\n\r\n\t// @method setPosition(position: string): this\r\n\t// Sets the position of the control.\r\n\tsetPosition: function (position) {\r\n\t\tvar map = this._map;\r\n\r\n\t\tif (map) {\r\n\t\t\tmap.removeControl(this);\r\n\t\t}\r\n\r\n\t\tthis.options.position = position;\r\n\r\n\t\tif (map) {\r\n\t\t\tmap.addControl(this);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getContainer: HTMLElement\r\n\t// Returns the HTMLElement that contains the control.\r\n\tgetContainer: function () {\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\t// @method addTo(map: Map): this\r\n\t// Adds the control to the given map.\r\n\taddTo: function (map) {\r\n\t\tthis.remove();\r\n\t\tthis._map = map;\r\n\r\n\t\tvar container = this._container = this.onAdd(map),\r\n\t\t    pos = this.getPosition(),\r\n\t\t    corner = map._controlCorners[pos];\r\n\r\n\t\tDomUtil.addClass(container, 'leaflet-control');\r\n\r\n\t\tif (pos.indexOf('bottom') !== -1) {\r\n\t\t\tcorner.insertBefore(container, corner.firstChild);\r\n\t\t} else {\r\n\t\t\tcorner.appendChild(container);\r\n\t\t}\r\n\r\n\t\tthis._map.on('unload', this.remove, this);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method remove: this\r\n\t// Removes the control from the map it is currently active on.\r\n\tremove: function () {\r\n\t\tif (!this._map) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tDomUtil.remove(this._container);\r\n\r\n\t\tif (this.onRemove) {\r\n\t\t\tthis.onRemove(this._map);\r\n\t\t}\r\n\r\n\t\tthis._map.off('unload', this.remove, this);\r\n\t\tthis._map = null;\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_refocusOnMap: function (e) {\r\n\t\t// if map exists and event is not a keyboard event\r\n\t\tif (this._map && e && e.screenX > 0 && e.screenY > 0) {\r\n\t\t\tthis._map.getContainer().focus();\r\n\t\t}\r\n\t}\r\n});\r\n\r\nexport var control = function (options) {\r\n\treturn new Control(options);\r\n};\r\n\r\n/* @section Extension methods\r\n * @uninheritable\r\n *\r\n * Every control should extend from `L.Control` and (re-)implement the following methods.\r\n *\r\n * @method onAdd(map: Map): HTMLElement\r\n * Should return the container DOM element for the control and add listeners on relevant map events. Called on [`control.addTo(map)`](#control-addTo).\r\n *\r\n * @method onRemove(map: Map)\r\n * 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\n */\r\n\r\n/* @namespace Map\r\n * @section Methods for Layers and Controls\r\n */\r\nMap.include({\r\n\t// @method addControl(control: Control): this\r\n\t// Adds the given control to the map\r\n\taddControl: function (control) {\r\n\t\tcontrol.addTo(this);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeControl(control: Control): this\r\n\t// Removes the given control from the map\r\n\tremoveControl: function (control) {\r\n\t\tcontrol.remove();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_initControlPos: function () {\r\n\t\tvar corners = this._controlCorners = {},\r\n\t\t    l = 'leaflet-',\r\n\t\t    container = this._controlContainer =\r\n\t\t            DomUtil.create('div', l + 'control-container', this._container);\r\n\r\n\t\tfunction createCorner(vSide, hSide) {\r\n\t\t\tvar className = l + vSide + ' ' + l + hSide;\r\n\r\n\t\t\tcorners[vSide + hSide] = DomUtil.create('div', className, container);\r\n\t\t}\r\n\r\n\t\tcreateCorner('top', 'left');\r\n\t\tcreateCorner('top', 'right');\r\n\t\tcreateCorner('bottom', 'left');\r\n\t\tcreateCorner('bottom', 'right');\r\n\t},\r\n\r\n\t_clearControlPos: function () {\r\n\t\tfor (var i in this._controlCorners) {\r\n\t\t\tDomUtil.remove(this._controlCorners[i]);\r\n\t\t}\r\n\t\tDomUtil.remove(this._controlContainer);\r\n\t\tdelete this._controlCorners;\r\n\t\tdelete this._controlContainer;\r\n\t}\r\n});\r\n", "\r\nimport {Control} from './Control';\r\nimport * as Util from '../core/Util';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class Control.Layers\r\n * @aka L.Control.Layers\r\n * @inherits Control\r\n *\r\n * The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](https://leafletjs.com/examples/layers-control/)). Extends `Control`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var baseLayers = {\r\n * \t\"Mapbox\": mapbox,\r\n * \t\"OpenStreetMap\": osm\r\n * };\r\n *\r\n * var overlays = {\r\n * \t\"Marker\": marker,\r\n * \t\"Roads\": roadsLayer\r\n * };\r\n *\r\n * L.control.layers(baseLayers, overlays).addTo(map);\r\n * ```\r\n *\r\n * The `baseLayers` and `overlays` parameters are object literals with layer names as keys and `Layer` objects as values:\r\n *\r\n * ```js\r\n * {\r\n *     \"<someName1>\": layer1,\r\n *     \"<someName2>\": layer2\r\n * }\r\n * ```\r\n *\r\n * The layer names can contain HTML, which allows you to add additional styling to the items:\r\n *\r\n * ```js\r\n * {\"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>\": myLayer}\r\n * ```\r\n */\r\n\r\nexport var Layers = Control.extend({\r\n\t// @section\r\n\t// @aka Control.Layers options\r\n\toptions: {\r\n\t\t// @option collapsed: Boolean = true\r\n\t\t// If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation.\r\n\t\tcollapsed: true,\r\n\t\tposition: 'topright',\r\n\r\n\t\t// @option autoZIndex: Boolean = true\r\n\t\t// 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\n\t\tautoZIndex: true,\r\n\r\n\t\t// @option hideSingleBase: Boolean = false\r\n\t\t// If `true`, the base layers in the control will be hidden when there is only one.\r\n\t\thideSingleBase: false,\r\n\r\n\t\t// @option sortLayers: Boolean = false\r\n\t\t// Whether to sort the layers. When `false`, layers will keep the order\r\n\t\t// in which they were added to the control.\r\n\t\tsortLayers: false,\r\n\r\n\t\t// @option sortFunction: Function = *\r\n\t\t// A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\r\n\t\t// that will be used for sorting the layers, when `sortLayers` is `true`.\r\n\t\t// The function receives both the `L.Layer` instances and their names, as in\r\n\t\t// `sortFunction(layerA, layerB, nameA, nameB)`.\r\n\t\t// By default, it sorts layers alphabetically by their name.\r\n\t\tsortFunction: function (layerA, layerB, nameA, nameB) {\r\n\t\t\treturn nameA < nameB ? -1 : (nameB < nameA ? 1 : 0);\r\n\t\t}\r\n\t},\r\n\r\n\tinitialize: function (baseLayers, overlays, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._layerControlInputs = [];\r\n\t\tthis._layers = [];\r\n\t\tthis._lastZIndex = 0;\r\n\t\tthis._handlingClick = false;\r\n\t\tthis._preventClick = false;\r\n\r\n\t\tfor (var i in baseLayers) {\r\n\t\t\tthis._addLayer(baseLayers[i], i);\r\n\t\t}\r\n\r\n\t\tfor (i in overlays) {\r\n\t\t\tthis._addLayer(overlays[i], i, true);\r\n\t\t}\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis._initLayout();\r\n\t\tthis._update();\r\n\r\n\t\tthis._map = map;\r\n\t\tmap.on('zoomend', this._checkDisabledLayers, this);\r\n\r\n\t\tfor (var i = 0; i < this._layers.length; i++) {\r\n\t\t\tthis._layers[i].layer.on('add remove', this._onLayerChange, this);\r\n\t\t}\r\n\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\taddTo: function (map) {\r\n\t\tControl.prototype.addTo.call(this, map);\r\n\t\t// Trigger expand after Layers Control has been inserted into DOM so that is now has an actual height.\r\n\t\treturn this._expandIfNotCollapsed();\r\n\t},\r\n\r\n\tonRemove: function () {\r\n\t\tthis._map.off('zoomend', this._checkDisabledLayers, this);\r\n\r\n\t\tfor (var i = 0; i < this._layers.length; i++) {\r\n\t\t\tthis._layers[i].layer.off('add remove', this._onLayerChange, this);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method addBaseLayer(layer: Layer, name: String): this\r\n\t// Adds a base layer (radio button entry) with the given name to the control.\r\n\taddBaseLayer: function (layer, name) {\r\n\t\tthis._addLayer(layer, name);\r\n\t\treturn (this._map) ? this._update() : this;\r\n\t},\r\n\r\n\t// @method addOverlay(layer: Layer, name: String): this\r\n\t// Adds an overlay (checkbox entry) with the given name to the control.\r\n\taddOverlay: function (layer, name) {\r\n\t\tthis._addLayer(layer, name, true);\r\n\t\treturn (this._map) ? this._update() : this;\r\n\t},\r\n\r\n\t// @method removeLayer(layer: Layer): this\r\n\t// Remove the given layer from the control.\r\n\tremoveLayer: function (layer) {\r\n\t\tlayer.off('add remove', this._onLayerChange, this);\r\n\r\n\t\tvar obj = this._getLayer(Util.stamp(layer));\r\n\t\tif (obj) {\r\n\t\t\tthis._layers.splice(this._layers.indexOf(obj), 1);\r\n\t\t}\r\n\t\treturn (this._map) ? this._update() : this;\r\n\t},\r\n\r\n\t// @method expand(): this\r\n\t// Expand the control container if collapsed.\r\n\texpand: function () {\r\n\t\tDomUtil.addClass(this._container, 'leaflet-control-layers-expanded');\r\n\t\tthis._section.style.height = null;\r\n\t\tvar acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50);\r\n\t\tif (acceptableHeight < this._section.clientHeight) {\r\n\t\t\tDomUtil.addClass(this._section, 'leaflet-control-layers-scrollbar');\r\n\t\t\tthis._section.style.height = acceptableHeight + 'px';\r\n\t\t} else {\r\n\t\t\tDomUtil.removeClass(this._section, 'leaflet-control-layers-scrollbar');\r\n\t\t}\r\n\t\tthis._checkDisabledLayers();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method collapse(): this\r\n\t// Collapse the control container if expanded.\r\n\tcollapse: function () {\r\n\t\tDomUtil.removeClass(this._container, 'leaflet-control-layers-expanded');\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_initLayout: function () {\r\n\t\tvar className = 'leaflet-control-layers',\r\n\t\t    container = this._container = DomUtil.create('div', className),\r\n\t\t    collapsed = this.options.collapsed;\r\n\r\n\t\t// makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released\r\n\t\tcontainer.setAttribute('aria-haspopup', true);\r\n\r\n\t\tDomEvent.disableClickPropagation(container);\r\n\t\tDomEvent.disableScrollPropagation(container);\r\n\r\n\t\tvar section = this._section = DomUtil.create('section', className + '-list');\r\n\r\n\t\tif (collapsed) {\r\n\t\t\tthis._map.on('click', this.collapse, this);\r\n\r\n\t\t\tDomEvent.on(container, {\r\n\t\t\t\tmouseenter: this._expandSafely,\r\n\t\t\t\tmouseleave: this.collapse\r\n\t\t\t}, this);\r\n\t\t}\r\n\r\n\t\tvar link = this._layersLink = DomUtil.create('a', className + '-toggle', container);\r\n\t\tlink.href = '#';\r\n\t\tlink.title = 'Layers';\r\n\t\tlink.setAttribute('role', 'button');\r\n\r\n\t\tDomEvent.on(link, {\r\n\t\t\tkeydown: function (e) {\r\n\t\t\t\tif (e.keyCode === 13) {\r\n\t\t\t\t\tthis._expandSafely();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// Certain screen readers intercept the key event and instead send a click event\r\n\t\t\tclick: function (e) {\r\n\t\t\t\tDomEvent.preventDefault(e);\r\n\t\t\t\tthis._expandSafely();\r\n\t\t\t}\r\n\t\t}, this);\r\n\r\n\t\tif (!collapsed) {\r\n\t\t\tthis.expand();\r\n\t\t}\r\n\r\n\t\tthis._baseLayersList = DomUtil.create('div', className + '-base', section);\r\n\t\tthis._separator = DomUtil.create('div', className + '-separator', section);\r\n\t\tthis._overlaysList = DomUtil.create('div', className + '-overlays', section);\r\n\r\n\t\tcontainer.appendChild(section);\r\n\t},\r\n\r\n\t_getLayer: function (id) {\r\n\t\tfor (var i = 0; i < this._layers.length; i++) {\r\n\r\n\t\t\tif (this._layers[i] && Util.stamp(this._layers[i].layer) === id) {\r\n\t\t\t\treturn this._layers[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_addLayer: function (layer, name, overlay) {\r\n\t\tif (this._map) {\r\n\t\t\tlayer.on('add remove', this._onLayerChange, this);\r\n\t\t}\r\n\r\n\t\tthis._layers.push({\r\n\t\t\tlayer: layer,\r\n\t\t\tname: name,\r\n\t\t\toverlay: overlay\r\n\t\t});\r\n\r\n\t\tif (this.options.sortLayers) {\r\n\t\t\tthis._layers.sort(Util.bind(function (a, b) {\r\n\t\t\t\treturn this.options.sortFunction(a.layer, b.layer, a.name, b.name);\r\n\t\t\t}, this));\r\n\t\t}\r\n\r\n\t\tif (this.options.autoZIndex && layer.setZIndex) {\r\n\t\t\tthis._lastZIndex++;\r\n\t\t\tlayer.setZIndex(this._lastZIndex);\r\n\t\t}\r\n\r\n\t\tthis._expandIfNotCollapsed();\r\n\t},\r\n\r\n\t_update: function () {\r\n\t\tif (!this._container) { return this; }\r\n\r\n\t\tDomUtil.empty(this._baseLayersList);\r\n\t\tDomUtil.empty(this._overlaysList);\r\n\r\n\t\tthis._layerControlInputs = [];\r\n\t\tvar baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0;\r\n\r\n\t\tfor (i = 0; i < this._layers.length; i++) {\r\n\t\t\tobj = this._layers[i];\r\n\t\t\tthis._addItem(obj);\r\n\t\t\toverlaysPresent = overlaysPresent || obj.overlay;\r\n\t\t\tbaseLayersPresent = baseLayersPresent || !obj.overlay;\r\n\t\t\tbaseLayersCount += !obj.overlay ? 1 : 0;\r\n\t\t}\r\n\r\n\t\t// Hide base layers section if there's only one layer.\r\n\t\tif (this.options.hideSingleBase) {\r\n\t\t\tbaseLayersPresent = baseLayersPresent && baseLayersCount > 1;\r\n\t\t\tthis._baseLayersList.style.display = baseLayersPresent ? '' : 'none';\r\n\t\t}\r\n\r\n\t\tthis._separator.style.display = overlaysPresent && baseLayersPresent ? '' : 'none';\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_onLayerChange: function (e) {\r\n\t\tif (!this._handlingClick) {\r\n\t\t\tthis._update();\r\n\t\t}\r\n\r\n\t\tvar obj = this._getLayer(Util.stamp(e.target));\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Layer events\r\n\t\t// @event baselayerchange: LayersControlEvent\r\n\t\t// Fired when the base layer is changed through the [layers control](#control-layers).\r\n\t\t// @event overlayadd: LayersControlEvent\r\n\t\t// Fired when an overlay is selected through the [layers control](#control-layers).\r\n\t\t// @event overlayremove: LayersControlEvent\r\n\t\t// Fired when an overlay is deselected through the [layers control](#control-layers).\r\n\t\t// @namespace Control.Layers\r\n\t\tvar type = obj.overlay ?\r\n\t\t\t(e.type === 'add' ? 'overlayadd' : 'overlayremove') :\r\n\t\t\t(e.type === 'add' ? 'baselayerchange' : null);\r\n\r\n\t\tif (type) {\r\n\t\t\tthis._map.fire(type, obj);\r\n\t\t}\r\n\t},\r\n\r\n\t// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079)\r\n\t_createRadioElement: function (name, checked) {\r\n\r\n\t\tvar radioHtml = '<input type=\"radio\" class=\"leaflet-control-layers-selector\" name=\"' +\r\n\t\t\t\tname + '\"' + (checked ? ' checked=\"checked\"' : '') + '/>';\r\n\r\n\t\tvar radioFragment = document.createElement('div');\r\n\t\tradioFragment.innerHTML = radioHtml;\r\n\r\n\t\treturn radioFragment.firstChild;\r\n\t},\r\n\r\n\t_addItem: function (obj) {\r\n\t\tvar label = document.createElement('label'),\r\n\t\t    checked = this._map.hasLayer(obj.layer),\r\n\t\t    input;\r\n\r\n\t\tif (obj.overlay) {\r\n\t\t\tinput = document.createElement('input');\r\n\t\t\tinput.type = 'checkbox';\r\n\t\t\tinput.className = 'leaflet-control-layers-selector';\r\n\t\t\tinput.defaultChecked = checked;\r\n\t\t} else {\r\n\t\t\tinput = this._createRadioElement('leaflet-base-layers_' + Util.stamp(this), checked);\r\n\t\t}\r\n\r\n\t\tthis._layerControlInputs.push(input);\r\n\t\tinput.layerId = Util.stamp(obj.layer);\r\n\r\n\t\tDomEvent.on(input, 'click', this._onInputClick, this);\r\n\r\n\t\tvar name = document.createElement('span');\r\n\t\tname.innerHTML = ' ' + obj.name;\r\n\r\n\t\t// Helps from preventing layer control flicker when checkboxes are disabled\r\n\t\t// https://github.com/Leaflet/Leaflet/issues/2771\r\n\t\tvar holder = document.createElement('span');\r\n\r\n\t\tlabel.appendChild(holder);\r\n\t\tholder.appendChild(input);\r\n\t\tholder.appendChild(name);\r\n\r\n\t\tvar container = obj.overlay ? this._overlaysList : this._baseLayersList;\r\n\t\tcontainer.appendChild(label);\r\n\r\n\t\tthis._checkDisabledLayers();\r\n\t\treturn label;\r\n\t},\r\n\r\n\t_onInputClick: function () {\r\n\t\t// expanding the control on mobile with a click can cause adding a layer - we don't want this\r\n\t\tif (this._preventClick) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar inputs = this._layerControlInputs,\r\n\t\t    input, layer;\r\n\t\tvar addedLayers = [],\r\n\t\t    removedLayers = [];\r\n\r\n\t\tthis._handlingClick = true;\r\n\r\n\t\tfor (var i = inputs.length - 1; i >= 0; i--) {\r\n\t\t\tinput = inputs[i];\r\n\t\t\tlayer = this._getLayer(input.layerId).layer;\r\n\r\n\t\t\tif (input.checked) {\r\n\t\t\t\taddedLayers.push(layer);\r\n\t\t\t} else if (!input.checked) {\r\n\t\t\t\tremovedLayers.push(layer);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Bugfix issue 2318: Should remove all old layers before readding new ones\r\n\t\tfor (i = 0; i < removedLayers.length; i++) {\r\n\t\t\tif (this._map.hasLayer(removedLayers[i])) {\r\n\t\t\t\tthis._map.removeLayer(removedLayers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (i = 0; i < addedLayers.length; i++) {\r\n\t\t\tif (!this._map.hasLayer(addedLayers[i])) {\r\n\t\t\t\tthis._map.addLayer(addedLayers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._handlingClick = false;\r\n\r\n\t\tthis._refocusOnMap();\r\n\t},\r\n\r\n\t_checkDisabledLayers: function () {\r\n\t\tvar inputs = this._layerControlInputs,\r\n\t\t    input,\r\n\t\t    layer,\r\n\t\t    zoom = this._map.getZoom();\r\n\r\n\t\tfor (var i = inputs.length - 1; i >= 0; i--) {\r\n\t\t\tinput = inputs[i];\r\n\t\t\tlayer = this._getLayer(input.layerId).layer;\r\n\t\t\tinput.disabled = (layer.options.minZoom !== undefined && zoom < layer.options.minZoom) ||\r\n\t\t\t                 (layer.options.maxZoom !== undefined && zoom > layer.options.maxZoom);\r\n\r\n\t\t}\r\n\t},\r\n\r\n\t_expandIfNotCollapsed: function () {\r\n\t\tif (this._map && !this.options.collapsed) {\r\n\t\t\tthis.expand();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_expandSafely: function () {\r\n\t\tvar section = this._section;\r\n\t\tthis._preventClick = true;\r\n\t\tDomEvent.on(section, 'click', DomEvent.preventDefault);\r\n\t\tthis.expand();\r\n\t\tvar that = this;\r\n\t\tsetTimeout(function () {\r\n\t\t\tDomEvent.off(section, 'click', DomEvent.preventDefault);\r\n\t\t\tthat._preventClick = false;\r\n\t\t});\r\n\t}\r\n\r\n});\r\n\r\n\r\n// @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)\r\n// 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\nexport var layers = function (baseLayers, overlays, options) {\r\n\treturn new Layers(baseLayers, overlays, options);\r\n};\r\n", "\r\nimport {Control} from './Control';\r\nimport {Map} from '../map/Map';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport * as DomEvent from '../dom/DomEvent';\r\n\r\n/*\r\n * @class Control.Zoom\r\n * @aka L.Control.Zoom\r\n * @inherits Control\r\n *\r\n * 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\n */\r\n\r\nexport var Zoom = Control.extend({\r\n\t// @section\r\n\t// @aka Control.Zoom options\r\n\toptions: {\r\n\t\tposition: 'topleft',\r\n\r\n\t\t// @option zoomInText: String = '<span aria-hidden=\"true\">+</span>'\r\n\t\t// The text set on the 'zoom in' button.\r\n\t\tzoomInText: '<span aria-hidden=\"true\">+</span>',\r\n\r\n\t\t// @option zoomInTitle: String = 'Zoom in'\r\n\t\t// The title set on the 'zoom in' button.\r\n\t\tzoomInTitle: 'Zoom in',\r\n\r\n\t\t// @option zoomOutText: String = '<span aria-hidden=\"true\">&#x2212;</span>'\r\n\t\t// The text set on the 'zoom out' button.\r\n\t\tzoomOutText: '<span aria-hidden=\"true\">&#x2212;</span>',\r\n\r\n\t\t// @option zoomOutTitle: String = 'Zoom out'\r\n\t\t// The title set on the 'zoom out' button.\r\n\t\tzoomOutTitle: 'Zoom out'\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tvar zoomName = 'leaflet-control-zoom',\r\n\t\t    container = DomUtil.create('div', zoomName + ' leaflet-bar'),\r\n\t\t    options = this.options;\r\n\r\n\t\tthis._zoomInButton  = this._createButton(options.zoomInText, options.zoomInTitle,\r\n\t\t        zoomName + '-in',  container, this._zoomIn);\r\n\t\tthis._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle,\r\n\t\t        zoomName + '-out', container, this._zoomOut);\r\n\r\n\t\tthis._updateDisabled();\r\n\t\tmap.on('zoomend zoomlevelschange', this._updateDisabled, this);\r\n\r\n\t\treturn container;\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tmap.off('zoomend zoomlevelschange', this._updateDisabled, this);\r\n\t},\r\n\r\n\tdisable: function () {\r\n\t\tthis._disabled = true;\r\n\t\tthis._updateDisabled();\r\n\t\treturn this;\r\n\t},\r\n\r\n\tenable: function () {\r\n\t\tthis._disabled = false;\r\n\t\tthis._updateDisabled();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_zoomIn: function (e) {\r\n\t\tif (!this._disabled && this._map._zoom < this._map.getMaxZoom()) {\r\n\t\t\tthis._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r\n\t\t}\r\n\t},\r\n\r\n\t_zoomOut: function (e) {\r\n\t\tif (!this._disabled && this._map._zoom > this._map.getMinZoom()) {\r\n\t\t\tthis._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r\n\t\t}\r\n\t},\r\n\r\n\t_createButton: function (html, title, className, container, fn) {\r\n\t\tvar link = DomUtil.create('a', className, container);\r\n\t\tlink.innerHTML = html;\r\n\t\tlink.href = '#';\r\n\t\tlink.title = title;\r\n\r\n\t\t/*\r\n\t\t * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\r\n\t\t */\r\n\t\tlink.setAttribute('role', 'button');\r\n\t\tlink.setAttribute('aria-label', title);\r\n\r\n\t\tDomEvent.disableClickPropagation(link);\r\n\t\tDomEvent.on(link, 'click', DomEvent.stop);\r\n\t\tDomEvent.on(link, 'click', fn, this);\r\n\t\tDomEvent.on(link, 'click', this._refocusOnMap, this);\r\n\r\n\t\treturn link;\r\n\t},\r\n\r\n\t_updateDisabled: function () {\r\n\t\tvar map = this._map,\r\n\t\t    className = 'leaflet-disabled';\r\n\r\n\t\tDomUtil.removeClass(this._zoomInButton, className);\r\n\t\tDomUtil.removeClass(this._zoomOutButton, className);\r\n\t\tthis._zoomInButton.setAttribute('aria-disabled', 'false');\r\n\t\tthis._zoomOutButton.setAttribute('aria-disabled', 'false');\r\n\r\n\t\tif (this._disabled || map._zoom === map.getMinZoom()) {\r\n\t\t\tDomUtil.addClass(this._zoomOutButton, className);\r\n\t\t\tthis._zoomOutButton.setAttribute('aria-disabled', 'true');\r\n\t\t}\r\n\t\tif (this._disabled || map._zoom === map.getMaxZoom()) {\r\n\t\t\tDomUtil.addClass(this._zoomInButton, className);\r\n\t\t\tthis._zoomInButton.setAttribute('aria-disabled', 'true');\r\n\t\t}\r\n\t}\r\n});\r\n\r\n// @namespace Map\r\n// @section Control options\r\n// @option zoomControl: Boolean = true\r\n// Whether a [zoom control](#control-zoom) is added to the map by default.\r\nMap.mergeOptions({\r\n\tzoomControl: true\r\n});\r\n\r\nMap.addInitHook(function () {\r\n\tif (this.options.zoomControl) {\r\n\t\t// @section Controls\r\n\t\t// @property zoomControl: Control.Zoom\r\n\t\t// The default zoom control (only available if the\r\n\t\t// [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map).\r\n\t\tthis.zoomControl = new Zoom();\r\n\t\tthis.addControl(this.zoomControl);\r\n\t}\r\n});\r\n\r\n// @namespace Control.Zoom\r\n// @factory L.control.zoom(options: Control.Zoom options)\r\n// Creates a zoom control\r\nexport var zoom = function (options) {\r\n\treturn new Zoom(options);\r\n};\r\n", "\nimport {Control} from './Control';\nimport * as DomUtil from '../dom/DomUtil';\n\n/*\n * @class Control.Scale\n * @aka L.Control.Scale\n * @inherits Control\n *\n * 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`.\n *\n * @example\n *\n * ```js\n * L.control.scale().addTo(map);\n * ```\n */\n\nexport var Scale = Control.extend({\n\t// @section\n\t// @aka Control.Scale options\n\toptions: {\n\t\tposition: 'bottomleft',\n\n\t\t// @option maxWidth: Number = 100\n\t\t// Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).\n\t\tmaxWidth: 100,\n\n\t\t// @option metric: Boolean = True\n\t\t// Whether to show the metric scale line (m/km).\n\t\tmetric: true,\n\n\t\t// @option imperial: Boolean = True\n\t\t// Whether to show the imperial scale line (mi/ft).\n\t\timperial: true\n\n\t\t// @option updateWhenIdle: Boolean = false\n\t\t// If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).\n\t},\n\n\tonAdd: function (map) {\n\t\tvar className = 'leaflet-control-scale',\n\t\t    container = DomUtil.create('div', className),\n\t\t    options = this.options;\n\n\t\tthis._addScales(options, className + '-line', container);\n\n\t\tmap.on(options.updateWhenIdle ? 'moveend' : 'move', this._update, this);\n\t\tmap.whenReady(this._update, this);\n\n\t\treturn container;\n\t},\n\n\tonRemove: function (map) {\n\t\tmap.off(this.options.updateWhenIdle ? 'moveend' : 'move', this._update, this);\n\t},\n\n\t_addScales: function (options, className, container) {\n\t\tif (options.metric) {\n\t\t\tthis._mScale = DomUtil.create('div', className, container);\n\t\t}\n\t\tif (options.imperial) {\n\t\t\tthis._iScale = DomUtil.create('div', className, container);\n\t\t}\n\t},\n\n\t_update: function () {\n\t\tvar map = this._map,\n\t\t    y = map.getSize().y / 2;\n\n\t\tvar maxMeters = map.distance(\n\t\t\tmap.containerPointToLatLng([0, y]),\n\t\t\tmap.containerPointToLatLng([this.options.maxWidth, y]));\n\n\t\tthis._updateScales(maxMeters);\n\t},\n\n\t_updateScales: function (maxMeters) {\n\t\tif (this.options.metric && maxMeters) {\n\t\t\tthis._updateMetric(maxMeters);\n\t\t}\n\t\tif (this.options.imperial && maxMeters) {\n\t\t\tthis._updateImperial(maxMeters);\n\t\t}\n\t},\n\n\t_updateMetric: function (maxMeters) {\n\t\tvar meters = this._getRoundNum(maxMeters),\n\t\t    label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km';\n\n\t\tthis._updateScale(this._mScale, label, meters / maxMeters);\n\t},\n\n\t_updateImperial: function (maxMeters) {\n\t\tvar maxFeet = maxMeters * 3.2808399,\n\t\t    maxMiles, miles, feet;\n\n\t\tif (maxFeet > 5280) {\n\t\t\tmaxMiles = maxFeet / 5280;\n\t\t\tmiles = this._getRoundNum(maxMiles);\n\t\t\tthis._updateScale(this._iScale, miles + ' mi', miles / maxMiles);\n\n\t\t} else {\n\t\t\tfeet = this._getRoundNum(maxFeet);\n\t\t\tthis._updateScale(this._iScale, feet + ' ft', feet / maxFeet);\n\t\t}\n\t},\n\n\t_updateScale: function (scale, text, ratio) {\n\t\tscale.style.width = Math.round(this.options.maxWidth * ratio) + 'px';\n\t\tscale.innerHTML = text;\n\t},\n\n\t_getRoundNum: function (num) {\n\t\tvar pow10 = Math.pow(10, (Math.floor(num) + '').length - 1),\n\t\t    d = num / pow10;\n\n\t\td = d >= 10 ? 10 :\n\t\t    d >= 5 ? 5 :\n\t\t    d >= 3 ? 3 :\n\t\t    d >= 2 ? 2 : 1;\n\n\t\treturn pow10 * d;\n\t}\n});\n\n\n// @factory L.control.scale(options?: Control.Scale options)\n// Creates an scale control with the given options.\nexport var scale = function (options) {\n\treturn new Scale(options);\n};\n", "\r\nimport {Control} from './Control';\r\nimport {Map} from '../map/Map';\r\nimport * as Util from '../core/Util';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport Browser from '../core/Browser';\r\n\r\nvar ukrainianFlag = '<svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" class=\"leaflet-attribution-flag\"><path fill=\"#4C7BE1\" d=\"M0 0h12v4H0z\"/><path fill=\"#FFD500\" d=\"M0 4h12v3H0z\"/><path fill=\"#E0BC00\" d=\"M0 7h12v1H0z\"/></svg>';\r\n\r\n\r\n/*\r\n * @class Control.Attribution\r\n * @aka L.Control.Attribution\r\n * @inherits Control\r\n *\r\n * 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\n */\r\n\r\nexport var Attribution = Control.extend({\r\n\t// @section\r\n\t// @aka Control.Attribution options\r\n\toptions: {\r\n\t\tposition: 'bottomright',\r\n\r\n\t\t// @option prefix: String|false = 'Leaflet'\r\n\t\t// The HTML text shown before the attributions. Pass `false` to disable.\r\n\t\tprefix: '<a href=\"https://leafletjs.com\" title=\"A JavaScript library for interactive maps\">' + (Browser.inlineSvg ? ukrainianFlag + ' ' : '') + 'Leaflet</a>'\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._attributions = {};\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tmap.attributionControl = this;\r\n\t\tthis._container = DomUtil.create('div', 'leaflet-control-attribution');\r\n\t\tDomEvent.disableClickPropagation(this._container);\r\n\r\n\t\t// TODO ugly, refactor\r\n\t\tfor (var i in map._layers) {\r\n\t\t\tif (map._layers[i].getAttribution) {\r\n\t\t\t\tthis.addAttribution(map._layers[i].getAttribution());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._update();\r\n\r\n\t\tmap.on('layeradd', this._addAttribution, this);\r\n\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tmap.off('layeradd', this._addAttribution, this);\r\n\t},\r\n\r\n\t_addAttribution: function (ev) {\r\n\t\tif (ev.layer.getAttribution) {\r\n\t\t\tthis.addAttribution(ev.layer.getAttribution());\r\n\t\t\tev.layer.once('remove', function () {\r\n\t\t\t\tthis.removeAttribution(ev.layer.getAttribution());\r\n\t\t\t}, this);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method setPrefix(prefix: String|false): this\r\n\t// The HTML text shown before the attributions. Pass `false` to disable.\r\n\tsetPrefix: function (prefix) {\r\n\t\tthis.options.prefix = prefix;\r\n\t\tthis._update();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method addAttribution(text: String): this\r\n\t// Adds an attribution text (e.g. `'&copy; OpenStreetMap contributors'`).\r\n\taddAttribution: function (text) {\r\n\t\tif (!text) { return this; }\r\n\r\n\t\tif (!this._attributions[text]) {\r\n\t\t\tthis._attributions[text] = 0;\r\n\t\t}\r\n\t\tthis._attributions[text]++;\r\n\r\n\t\tthis._update();\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeAttribution(text: String): this\r\n\t// Removes an attribution text.\r\n\tremoveAttribution: function (text) {\r\n\t\tif (!text) { return this; }\r\n\r\n\t\tif (this._attributions[text]) {\r\n\t\t\tthis._attributions[text]--;\r\n\t\t\tthis._update();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_update: function () {\r\n\t\tif (!this._map) { return; }\r\n\r\n\t\tvar attribs = [];\r\n\r\n\t\tfor (var i in this._attributions) {\r\n\t\t\tif (this._attributions[i]) {\r\n\t\t\t\tattribs.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar prefixAndAttribs = [];\r\n\r\n\t\tif (this.options.prefix) {\r\n\t\t\tprefixAndAttribs.push(this.options.prefix);\r\n\t\t}\r\n\t\tif (attribs.length) {\r\n\t\t\tprefixAndAttribs.push(attribs.join(', '));\r\n\t\t}\r\n\r\n\t\tthis._container.innerHTML = prefixAndAttribs.join(' <span aria-hidden=\"true\">|</span> ');\r\n\t}\r\n});\r\n\r\n// @namespace Map\r\n// @section Control options\r\n// @option attributionControl: Boolean = true\r\n// Whether a [attribution control](#control-attribution) is added to the map by default.\r\nMap.mergeOptions({\r\n\tattributionControl: true\r\n});\r\n\r\nMap.addInitHook(function () {\r\n\tif (this.options.attributionControl) {\r\n\t\tnew Attribution().addTo(this);\r\n\t}\r\n});\r\n\r\n// @namespace Control.Attribution\r\n// @factory L.control.attribution(options: Control.Attribution options)\r\n// Creates an attribution control.\r\nexport var attribution = function (options) {\r\n\treturn new Attribution(options);\r\n};\r\n", "import {Control, control} from './Control';\nimport {Layers, layers} from './Control.Layers';\nimport {Zoom, zoom} from './Control.Zoom';\nimport {Scale, scale} from './Control.Scale';\nimport {Attribution, attribution} from './Control.Attribution';\n\nControl.Layers = Layers;\nControl.Zoom = Zoom;\nControl.Scale = Scale;\nControl.Attribution = Attribution;\n\ncontrol.layers = layers;\ncontrol.zoom = zoom;\ncontrol.scale = scale;\ncontrol.attribution = attribution;\n\nexport {Control, control};\n", "import {Class} from './Class';\n\n/*\n\tL.Handler is a base class for handler classes that are used internally to inject\n\tinteraction features like dragging to classes like Map and Marker.\n*/\n\n// @class Handler\n// @aka L.Handler\n// Abstract class for map interaction handlers\n\nexport var Handler = Class.extend({\n\tinitialize: function (map) {\n\t\tthis._map = map;\n\t},\n\n\t// @method enable(): this\n\t// Enables the handler\n\tenable: function () {\n\t\tif (this._enabled) { return this; }\n\n\t\tthis._enabled = true;\n\t\tthis.addHooks();\n\t\treturn this;\n\t},\n\n\t// @method disable(): this\n\t// Disables the handler\n\tdisable: function () {\n\t\tif (!this._enabled) { return this; }\n\n\t\tthis._enabled = false;\n\t\tthis.removeHooks();\n\t\treturn this;\n\t},\n\n\t// @method enabled(): Boolean\n\t// Returns `true` if the handler is enabled\n\tenabled: function () {\n\t\treturn !!this._enabled;\n\t}\n\n\t// @section Extension methods\n\t// Classes inheriting from `Handler` must implement the two following methods:\n\t// @method addHooks()\n\t// Called when the handler is enabled, should add event hooks.\n\t// @method removeHooks()\n\t// Called when the handler is disabled, should remove the event hooks added previously.\n});\n\n// @section There is static function which can be called without instantiating L.Handler:\n// @function addTo(map: Map, name: String): this\n// Adds a new Handler to the given map with the given name.\nHandler.addTo = function (map, name) {\n\tmap.addHandler(name, this);\n\treturn this;\n};\n", "import Browser from './Browser';\nexport {Browser};\n\nexport {Class} from './Class';\n\nimport {Evented} from './Events';\nimport {Events} from './Events';\nexport {Evented};\nexport var Mixin = {Events: Events};\n\nexport {Handler} from './Handler';\n\nimport * as Util from './Util';\nexport {Util};\nexport {extend, bind, stamp, setOptions} from './Util';\n", "import {Evented} from '../core/Events';\r\nimport Browser from '../core/Browser';\r\nimport * as DomEvent from './DomEvent';\r\nimport * as DomUtil from './DomUtil';\r\nimport * as Util from '../core/Util';\r\nimport {Point} from '../geometry/Point';\r\n\r\n/*\r\n * @class Draggable\r\n * @aka L.Draggable\r\n * @inherits Evented\r\n *\r\n * A class for making DOM elements draggable (including touch support).\r\n * Used internally for map and marker dragging. Only works for elements\r\n * that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).\r\n *\r\n * @example\r\n * ```js\r\n * var draggable = new L.Draggable(elementToDrag);\r\n * draggable.enable();\r\n * ```\r\n */\r\n\r\nvar START = Browser.touch ? 'touchstart mousedown' : 'mousedown';\r\n\r\nexport var Draggable = Evented.extend({\r\n\r\n\toptions: {\r\n\t\t// @section\r\n\t\t// @aka Draggable options\r\n\t\t// @option clickTolerance: Number = 3\r\n\t\t// The max number of pixels a user can shift the mouse pointer during a click\r\n\t\t// for it to be considered a valid click (as opposed to a mouse drag).\r\n\t\tclickTolerance: 3\r\n\t},\r\n\r\n\t// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)\r\n\t// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).\r\n\tinitialize: function (element, dragStartTarget, preventOutline, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._element = element;\r\n\t\tthis._dragStartTarget = dragStartTarget || element;\r\n\t\tthis._preventOutline = preventOutline;\r\n\t},\r\n\r\n\t// @method enable()\r\n\t// Enables the dragging ability\r\n\tenable: function () {\r\n\t\tif (this._enabled) { return; }\r\n\r\n\t\tDomEvent.on(this._dragStartTarget, START, this._onDown, this);\r\n\r\n\t\tthis._enabled = true;\r\n\t},\r\n\r\n\t// @method disable()\r\n\t// Disables the dragging ability\r\n\tdisable: function () {\r\n\t\tif (!this._enabled) { return; }\r\n\r\n\t\t// If we're currently dragging this draggable,\r\n\t\t// disabling it counts as first ending the drag.\r\n\t\tif (Draggable._dragging === this) {\r\n\t\t\tthis.finishDrag(true);\r\n\t\t}\r\n\r\n\t\tDomEvent.off(this._dragStartTarget, START, this._onDown, this);\r\n\r\n\t\tthis._enabled = false;\r\n\t\tthis._moved = false;\r\n\t},\r\n\r\n\t_onDown: function (e) {\r\n\t\t// Ignore the event if disabled; this happens in IE11\r\n\t\t// under some circumstances, see #3666.\r\n\t\tif (!this._enabled) { return; }\r\n\r\n\t\tthis._moved = false;\r\n\r\n\t\tif (DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; }\r\n\r\n\t\tif (e.touches && e.touches.length !== 1) {\r\n\t\t\t// Finish dragging to avoid conflict with touchZoom\r\n\t\t\tif (Draggable._dragging === this) {\r\n\t\t\t\tthis.finishDrag();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }\r\n\t\tDraggable._dragging = this;  // Prevent dragging multiple objects at once.\r\n\r\n\t\tif (this._preventOutline) {\r\n\t\t\tDomUtil.preventOutline(this._element);\r\n\t\t}\r\n\r\n\t\tDomUtil.disableImageDrag();\r\n\t\tDomUtil.disableTextSelection();\r\n\r\n\t\tif (this._moving) { return; }\r\n\r\n\t\t// @event down: Event\r\n\t\t// Fired when a drag is about to start.\r\n\t\tthis.fire('down');\r\n\r\n\t\tvar first = e.touches ? e.touches[0] : e,\r\n\t\t    sizedParent = DomUtil.getSizedParentNode(this._element);\r\n\r\n\t\tthis._startPoint = new Point(first.clientX, first.clientY);\r\n\t\tthis._startPos = DomUtil.getPosition(this._element);\r\n\r\n\t\t// Cache the scale, so that we can continuously compensate for it during drag (_onMove).\r\n\t\tthis._parentScale = DomUtil.getScale(sizedParent);\r\n\r\n\t\tvar mouseevent = e.type === 'mousedown';\r\n\t\tDomEvent.on(document, mouseevent ? 'mousemove' : 'touchmove', this._onMove, this);\r\n\t\tDomEvent.on(document, mouseevent ? 'mouseup' : 'touchend touchcancel', this._onUp, this);\r\n\t},\r\n\r\n\t_onMove: function (e) {\r\n\t\t// Ignore the event if disabled; this happens in IE11\r\n\t\t// under some circumstances, see #3666.\r\n\t\tif (!this._enabled) { return; }\r\n\r\n\t\tif (e.touches && e.touches.length > 1) {\r\n\t\t\tthis._moved = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar first = (e.touches && e.touches.length === 1 ? e.touches[0] : e),\r\n\t\t    offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint);\r\n\r\n\t\tif (!offset.x && !offset.y) { return; }\r\n\t\tif (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { return; }\r\n\r\n\t\t// We assume that the parent container's position, border and scale do not change for the duration of the drag.\r\n\t\t// Therefore there is no need to account for the position and border (they are eliminated by the subtraction)\r\n\t\t// and we can use the cached value for the scale.\r\n\t\toffset.x /= this._parentScale.x;\r\n\t\toffset.y /= this._parentScale.y;\r\n\r\n\t\tDomEvent.preventDefault(e);\r\n\r\n\t\tif (!this._moved) {\r\n\t\t\t// @event dragstart: Event\r\n\t\t\t// Fired when a drag starts\r\n\t\t\tthis.fire('dragstart');\r\n\r\n\t\t\tthis._moved = true;\r\n\r\n\t\t\tDomUtil.addClass(document.body, 'leaflet-dragging');\r\n\r\n\t\t\tthis._lastTarget = e.target || e.srcElement;\r\n\t\t\t// IE and Edge do not give the <use> element, so fetch it\r\n\t\t\t// if necessary\r\n\t\t\tif (window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance) {\r\n\t\t\t\tthis._lastTarget = this._lastTarget.correspondingUseElement;\r\n\t\t\t}\r\n\t\t\tDomUtil.addClass(this._lastTarget, 'leaflet-drag-target');\r\n\t\t}\r\n\r\n\t\tthis._newPos = this._startPos.add(offset);\r\n\t\tthis._moving = true;\r\n\r\n\t\tthis._lastEvent = e;\r\n\t\tthis._updatePosition();\r\n\t},\r\n\r\n\t_updatePosition: function () {\r\n\t\tvar e = {originalEvent: this._lastEvent};\r\n\r\n\t\t// @event predrag: Event\r\n\t\t// Fired continuously during dragging *before* each corresponding\r\n\t\t// update of the element's position.\r\n\t\tthis.fire('predrag', e);\r\n\t\tDomUtil.setPosition(this._element, this._newPos);\r\n\r\n\t\t// @event drag: Event\r\n\t\t// Fired continuously during dragging.\r\n\t\tthis.fire('drag', e);\r\n\t},\r\n\r\n\t_onUp: function () {\r\n\t\t// Ignore the event if disabled; this happens in IE11\r\n\t\t// under some circumstances, see #3666.\r\n\t\tif (!this._enabled) { return; }\r\n\t\tthis.finishDrag();\r\n\t},\r\n\r\n\tfinishDrag: function (noInertia) {\r\n\t\tDomUtil.removeClass(document.body, 'leaflet-dragging');\r\n\r\n\t\tif (this._lastTarget) {\r\n\t\t\tDomUtil.removeClass(this._lastTarget, 'leaflet-drag-target');\r\n\t\t\tthis._lastTarget = null;\r\n\t\t}\r\n\r\n\t\tDomEvent.off(document, 'mousemove touchmove', this._onMove, this);\r\n\t\tDomEvent.off(document, 'mouseup touchend touchcancel', this._onUp, this);\r\n\r\n\t\tDomUtil.enableImageDrag();\r\n\t\tDomUtil.enableTextSelection();\r\n\r\n\t\tvar fireDragend = this._moved && this._moving;\r\n\r\n\t\tthis._moving = false;\r\n\t\tDraggable._dragging = false;\r\n\r\n\t\tif (fireDragend) {\r\n\t\t\t// @event dragend: DragEndEvent\r\n\t\t\t// Fired when the drag ends.\r\n\t\t\tthis.fire('dragend', {\r\n\t\t\t\tnoInertia: noInertia,\r\n\t\t\t\tdistance: this._newPos.distanceTo(this._startPos)\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n});\r\n", "import * as LineUtil from './LineUtil';\r\nimport {toLatLng} from '../geo/LatLng';\r\nimport {toPoint} from './Point';\r\nimport {toLatLngBounds} from '../geo/LatLngBounds';\r\n/*\r\n * @namespace PolyUtil\r\n * Various utility functions for polygon geometries.\r\n */\r\n\r\n/* @function clipPolygon(points: Point[], bounds: Bounds, round?: Boolean): Point[]\r\n * 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\n * Used by Leaflet to only show polygon points that are on the screen or near, increasing\r\n * performance. Note that polygon points needs different algorithm for clipping\r\n * than polyline, so there's a separate method for it.\r\n */\r\nexport function clipPolygon(points, bounds, round) {\r\n\tvar clippedPoints,\r\n\t    edges = [1, 4, 2, 8],\r\n\t    i, j, k,\r\n\t    a, b,\r\n\t    len, edge, p;\r\n\r\n\tfor (i = 0, len = points.length; i < len; i++) {\r\n\t\tpoints[i]._code = LineUtil._getBitCode(points[i], bounds);\r\n\t}\r\n\r\n\t// for each edge (left, bottom, right, top)\r\n\tfor (k = 0; k < 4; k++) {\r\n\t\tedge = edges[k];\r\n\t\tclippedPoints = [];\r\n\r\n\t\tfor (i = 0, len = points.length, j = len - 1; i < len; j = i++) {\r\n\t\t\ta = points[i];\r\n\t\t\tb = points[j];\r\n\r\n\t\t\t// if a is inside the clip window\r\n\t\t\tif (!(a._code & edge)) {\r\n\t\t\t\t// if b is outside the clip window (a->b goes out of screen)\r\n\t\t\t\tif (b._code & edge) {\r\n\t\t\t\t\tp = LineUtil._getEdgeIntersection(b, a, edge, bounds, round);\r\n\t\t\t\t\tp._code = LineUtil._getBitCode(p, bounds);\r\n\t\t\t\t\tclippedPoints.push(p);\r\n\t\t\t\t}\r\n\t\t\t\tclippedPoints.push(a);\r\n\r\n\t\t\t// else if b is inside the clip window (a->b enters the screen)\r\n\t\t\t} else if (!(b._code & edge)) {\r\n\t\t\t\tp = LineUtil._getEdgeIntersection(b, a, edge, bounds, round);\r\n\t\t\t\tp._code = LineUtil._getBitCode(p, bounds);\r\n\t\t\t\tclippedPoints.push(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpoints = clippedPoints;\r\n\t}\r\n\r\n\treturn points;\r\n}\r\n\r\n/* @function polygonCenter(latlngs: LatLng[], crs: CRS): LatLng\r\n * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polygon.\r\n */\r\nexport function polygonCenter(latlngs, crs) {\r\n\tvar i, j, p1, p2, f, area, x, y, center;\r\n\r\n\tif (!latlngs || latlngs.length === 0) {\r\n\t\tthrow new Error('latlngs not passed');\r\n\t}\r\n\r\n\tif (!LineUtil.isFlat(latlngs)) {\r\n\t\tconsole.warn('latlngs are not flat! Only the first ring will be used');\r\n\t\tlatlngs = latlngs[0];\r\n\t}\r\n\r\n\tvar centroidLatLng = toLatLng([0, 0]);\r\n\r\n\tvar bounds = toLatLngBounds(latlngs);\r\n\tvar areaBounds = bounds.getNorthWest().distanceTo(bounds.getSouthWest()) * bounds.getNorthEast().distanceTo(bounds.getNorthWest());\r\n\t// tests showed that below 1700 rounding errors are happening\r\n\tif (areaBounds < 1700) {\r\n\t\t// getting a inexact center, to move the latlngs near to [0, 0] to prevent rounding errors\r\n\t\tcentroidLatLng = centroid(latlngs);\r\n\t}\r\n\r\n\tvar len = latlngs.length;\r\n\tvar points = [];\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tvar latlng = toLatLng(latlngs[i]);\r\n\t\tpoints.push(crs.project(toLatLng([latlng.lat - centroidLatLng.lat, latlng.lng - centroidLatLng.lng])));\r\n\t}\r\n\r\n\tarea = x = y = 0;\r\n\r\n\t// polygon centroid algorithm;\r\n\tfor (i = 0, j = len - 1; i < len; j = i++) {\r\n\t\tp1 = points[i];\r\n\t\tp2 = points[j];\r\n\r\n\t\tf = p1.y * p2.x - p2.y * p1.x;\r\n\t\tx += (p1.x + p2.x) * f;\r\n\t\ty += (p1.y + p2.y) * f;\r\n\t\tarea += f * 3;\r\n\t}\r\n\r\n\tif (area === 0) {\r\n\t\t// Polygon is so small that all points are on same pixel.\r\n\t\tcenter = points[0];\r\n\t} else {\r\n\t\tcenter = [x / area, y / area];\r\n\t}\r\n\r\n\tvar latlngCenter = crs.unproject(toPoint(center));\r\n\treturn toLatLng([latlngCenter.lat + centroidLatLng.lat, latlngCenter.lng + centroidLatLng.lng]);\r\n}\r\n\r\n/* @function centroid(latlngs: LatLng[]): LatLng\r\n * Returns the 'center of mass' of the passed LatLngs.\r\n */\r\nexport function centroid(coords) {\r\n\tvar latSum = 0;\r\n\tvar lngSum = 0;\r\n\tvar len = 0;\r\n\tfor (var i = 0; i < coords.length; i++) {\r\n\t\tvar latlng = toLatLng(coords[i]);\r\n\t\tlatSum += latlng.lat;\r\n\t\tlngSum += latlng.lng;\r\n\t\tlen++;\r\n\t}\r\n\treturn toLatLng([latSum / len, lngSum / len]);\r\n}\r\n", "import {Point, toPoint} from './Point';\r\nimport * as Util from '../core/Util';\r\nimport {toLatLng} from '../geo/LatLng';\r\nimport {centroid} from './PolyUtil';\r\nimport {toLatLngBounds} from '../geo/LatLngBounds';\r\n\r\n\r\n/*\r\n * @namespace LineUtil\r\n *\r\n * Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.\r\n */\r\n\r\n// Simplify polyline with vertex reduction and Douglas-Peucker simplification.\r\n// Improves rendering performance dramatically by lessening the number of points to draw.\r\n\r\n// @function simplify(points: Point[], tolerance: Number): Point[]\r\n// Dramatically reduces the number of points in a polyline while retaining\r\n// its shape and returns a new array of simplified points, using the\r\n// [Ramer-Douglas-Peucker algorithm](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm).\r\n// Used for a huge performance boost when processing/displaying Leaflet polylines for\r\n// each zoom level and also reducing visual noise. tolerance affects the amount of\r\n// simplification (lesser value means higher quality but slower and with more points).\r\n// Also released as a separated micro-library [Simplify.js](https://mourner.github.io/simplify-js/).\r\nexport function simplify(points, tolerance) {\r\n\tif (!tolerance || !points.length) {\r\n\t\treturn points.slice();\r\n\t}\r\n\r\n\tvar sqTolerance = tolerance * tolerance;\r\n\r\n\t    // stage 1: vertex reduction\r\n\t    points = _reducePoints(points, sqTolerance);\r\n\r\n\t    // stage 2: Douglas-Peucker simplification\r\n\t    points = _simplifyDP(points, sqTolerance);\r\n\r\n\treturn points;\r\n}\r\n\r\n// @function pointToSegmentDistance(p: Point, p1: Point, p2: Point): Number\r\n// Returns the distance between point `p` and segment `p1` to `p2`.\r\nexport function pointToSegmentDistance(p, p1, p2) {\r\n\treturn Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, true));\r\n}\r\n\r\n// @function closestPointOnSegment(p: Point, p1: Point, p2: Point): Number\r\n// Returns the closest point from a point `p` on a segment `p1` to `p2`.\r\nexport function closestPointOnSegment(p, p1, p2) {\r\n\treturn _sqClosestPointOnSegment(p, p1, p2);\r\n}\r\n\r\n// Ramer-Douglas-Peucker simplification, see https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm\r\nfunction _simplifyDP(points, sqTolerance) {\r\n\r\n\tvar len = points.length,\r\n\t    ArrayConstructor = typeof Uint8Array !== undefined + '' ? Uint8Array : Array,\r\n\t    markers = new ArrayConstructor(len);\r\n\r\n\t    markers[0] = markers[len - 1] = 1;\r\n\r\n\t_simplifyDPStep(points, markers, sqTolerance, 0, len - 1);\r\n\r\n\tvar i,\r\n\t    newPoints = [];\r\n\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tif (markers[i]) {\r\n\t\t\tnewPoints.push(points[i]);\r\n\t\t}\r\n\t}\r\n\r\n\treturn newPoints;\r\n}\r\n\r\nfunction _simplifyDPStep(points, markers, sqTolerance, first, last) {\r\n\r\n\tvar maxSqDist = 0,\r\n\tindex, i, sqDist;\r\n\r\n\tfor (i = first + 1; i <= last - 1; i++) {\r\n\t\tsqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], true);\r\n\r\n\t\tif (sqDist > maxSqDist) {\r\n\t\t\tindex = i;\r\n\t\t\tmaxSqDist = sqDist;\r\n\t\t}\r\n\t}\r\n\r\n\tif (maxSqDist > sqTolerance) {\r\n\t\tmarkers[index] = 1;\r\n\r\n\t\t_simplifyDPStep(points, markers, sqTolerance, first, index);\r\n\t\t_simplifyDPStep(points, markers, sqTolerance, index, last);\r\n\t}\r\n}\r\n\r\n// reduce points that are too close to each other to a single point\r\nfunction _reducePoints(points, sqTolerance) {\r\n\tvar reducedPoints = [points[0]];\r\n\r\n\tfor (var i = 1, prev = 0, len = points.length; i < len; i++) {\r\n\t\tif (_sqDist(points[i], points[prev]) > sqTolerance) {\r\n\t\t\treducedPoints.push(points[i]);\r\n\t\t\tprev = i;\r\n\t\t}\r\n\t}\r\n\tif (prev < len - 1) {\r\n\t\treducedPoints.push(points[len - 1]);\r\n\t}\r\n\treturn reducedPoints;\r\n}\r\n\r\nvar _lastCode;\r\n\r\n// @function clipSegment(a: Point, b: Point, bounds: Bounds, useLastCode?: Boolean, round?: Boolean): Point[]|Boolean\r\n// Clips the segment a to b by rectangular bounds with the\r\n// [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm)\r\n// (modifying the segment points directly!). Used by Leaflet to only show polyline\r\n// points that are on the screen or near, increasing performance.\r\nexport function clipSegment(a, b, bounds, useLastCode, round) {\r\n\tvar codeA = useLastCode ? _lastCode : _getBitCode(a, bounds),\r\n\t    codeB = _getBitCode(b, bounds),\r\n\r\n\t    codeOut, p, newCode;\r\n\r\n\t    // save 2nd code to avoid calculating it on the next segment\r\n\t    _lastCode = codeB;\r\n\r\n\twhile (true) {\r\n\t\t// if a,b is inside the clip window (trivial accept)\r\n\t\tif (!(codeA | codeB)) {\r\n\t\t\treturn [a, b];\r\n\t\t}\r\n\r\n\t\t// if a,b is outside the clip window (trivial reject)\r\n\t\tif (codeA & codeB) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// other cases\r\n\t\tcodeOut = codeA || codeB;\r\n\t\tp = _getEdgeIntersection(a, b, codeOut, bounds, round);\r\n\t\tnewCode = _getBitCode(p, bounds);\r\n\r\n\t\tif (codeOut === codeA) {\r\n\t\t\ta = p;\r\n\t\t\tcodeA = newCode;\r\n\t\t} else {\r\n\t\t\tb = p;\r\n\t\t\tcodeB = newCode;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport function _getEdgeIntersection(a, b, code, bounds, round) {\r\n\tvar dx = b.x - a.x,\r\n\t    dy = b.y - a.y,\r\n\t    min = bounds.min,\r\n\t    max = bounds.max,\r\n\t    x, y;\r\n\r\n\tif (code & 8) { // top\r\n\t\tx = a.x + dx * (max.y - a.y) / dy;\r\n\t\ty = max.y;\r\n\r\n\t} else if (code & 4) { // bottom\r\n\t\tx = a.x + dx * (min.y - a.y) / dy;\r\n\t\ty = min.y;\r\n\r\n\t} else if (code & 2) { // right\r\n\t\tx = max.x;\r\n\t\ty = a.y + dy * (max.x - a.x) / dx;\r\n\r\n\t} else if (code & 1) { // left\r\n\t\tx = min.x;\r\n\t\ty = a.y + dy * (min.x - a.x) / dx;\r\n\t}\r\n\r\n\treturn new Point(x, y, round);\r\n}\r\n\r\nexport function _getBitCode(p, bounds) {\r\n\tvar code = 0;\r\n\r\n\tif (p.x < bounds.min.x) { // left\r\n\t\tcode |= 1;\r\n\t} else if (p.x > bounds.max.x) { // right\r\n\t\tcode |= 2;\r\n\t}\r\n\r\n\tif (p.y < bounds.min.y) { // bottom\r\n\t\tcode |= 4;\r\n\t} else if (p.y > bounds.max.y) { // top\r\n\t\tcode |= 8;\r\n\t}\r\n\r\n\treturn code;\r\n}\r\n\r\n// square distance (to avoid unnecessary Math.sqrt calls)\r\nfunction _sqDist(p1, p2) {\r\n\tvar dx = p2.x - p1.x,\r\n\t    dy = p2.y - p1.y;\r\n\treturn dx * dx + dy * dy;\r\n}\r\n\r\n// return closest point on segment or distance to that point\r\nexport function _sqClosestPointOnSegment(p, p1, p2, sqDist) {\r\n\tvar x = p1.x,\r\n\t    y = p1.y,\r\n\t    dx = p2.x - x,\r\n\t    dy = p2.y - y,\r\n\t    dot = dx * dx + dy * dy,\r\n\t    t;\r\n\r\n\tif (dot > 0) {\r\n\t\tt = ((p.x - x) * dx + (p.y - y) * dy) / dot;\r\n\r\n\t\tif (t > 1) {\r\n\t\t\tx = p2.x;\r\n\t\t\ty = p2.y;\r\n\t\t} else if (t > 0) {\r\n\t\t\tx += dx * t;\r\n\t\t\ty += dy * t;\r\n\t\t}\r\n\t}\r\n\r\n\tdx = p.x - x;\r\n\tdy = p.y - y;\r\n\r\n\treturn sqDist ? dx * dx + dy * dy : new Point(x, y);\r\n}\r\n\r\n\r\n// @function isFlat(latlngs: LatLng[]): Boolean\r\n// Returns true if `latlngs` is a flat array, false is nested.\r\nexport function isFlat(latlngs) {\r\n\treturn !Util.isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');\r\n}\r\n\r\nexport function _flat(latlngs) {\r\n\tconsole.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');\r\n\treturn isFlat(latlngs);\r\n}\r\n\r\n/* @function polylineCenter(latlngs: LatLng[], crs: CRS): LatLng\r\n * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polyline.\r\n */\r\nexport function polylineCenter(latlngs, crs) {\r\n\tvar i, halfDist, segDist, dist, p1, p2, ratio, center;\r\n\r\n\tif (!latlngs || latlngs.length === 0) {\r\n\t\tthrow new Error('latlngs not passed');\r\n\t}\r\n\r\n\tif (!isFlat(latlngs)) {\r\n\t\tconsole.warn('latlngs are not flat! Only the first ring will be used');\r\n\t\tlatlngs = latlngs[0];\r\n\t}\r\n\r\n\tvar centroidLatLng = toLatLng([0, 0]);\r\n\r\n\tvar bounds = toLatLngBounds(latlngs);\r\n\tvar areaBounds = bounds.getNorthWest().distanceTo(bounds.getSouthWest()) * bounds.getNorthEast().distanceTo(bounds.getNorthWest());\r\n\t// tests showed that below 1700 rounding errors are happening\r\n\tif (areaBounds < 1700) {\r\n\t\t// getting a inexact center, to move the latlngs near to [0, 0] to prevent rounding errors\r\n\t\tcentroidLatLng = centroid(latlngs);\r\n\t}\r\n\r\n\tvar len = latlngs.length;\r\n\tvar points = [];\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tvar latlng = toLatLng(latlngs[i]);\r\n\t\tpoints.push(crs.project(toLatLng([latlng.lat - centroidLatLng.lat, latlng.lng - centroidLatLng.lng])));\r\n\t}\r\n\r\n\tfor (i = 0, halfDist = 0; i < len - 1; i++) {\r\n\t\thalfDist += points[i].distanceTo(points[i + 1]) / 2;\r\n\t}\r\n\r\n\t// The line is so small in the current view that all points are on the same pixel.\r\n\tif (halfDist === 0) {\r\n\t\tcenter = points[0];\r\n\t} else {\r\n\t\tfor (i = 0, dist = 0; i < len - 1; i++) {\r\n\t\t\tp1 = points[i];\r\n\t\t\tp2 = points[i + 1];\r\n\t\t\tsegDist = p1.distanceTo(p2);\r\n\t\t\tdist += segDist;\r\n\r\n\t\t\tif (dist > halfDist) {\r\n\t\t\t\tratio = (dist - halfDist) / segDist;\r\n\t\t\t\tcenter = [\r\n\t\t\t\t\tp2.x - ratio * (p2.x - p1.x),\r\n\t\t\t\t\tp2.y - ratio * (p2.y - p1.y)\r\n\t\t\t\t];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar latlngCenter = crs.unproject(toPoint(center));\r\n\treturn toLatLng([latlngCenter.lat + centroidLatLng.lat, latlngCenter.lng + centroidLatLng.lng]);\r\n}\r\n", "import {LatLng} from '../LatLng';\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {Point} from '../../geometry/Point';\r\n\r\n/*\r\n * @namespace Projection\r\n * @section\r\n * Leaflet comes with a set of already defined Projections out of the box:\r\n *\r\n * @projection L.Projection.LonLat\r\n *\r\n * Equirectangular, or Plate Carree projection \u2014 the most simple projection,\r\n * mostly used by GIS enthusiasts. Directly maps `x` as longitude, and `y` as\r\n * latitude. Also suitable for flat worlds, e.g. game maps. Used by the\r\n * `EPSG:4326` and `Simple` CRS.\r\n */\r\n\r\nexport var LonLat = {\r\n\tproject: function (latlng) {\r\n\t\treturn new Point(latlng.lng, latlng.lat);\r\n\t},\r\n\r\n\tunproject: function (point) {\r\n\t\treturn new LatLng(point.y, point.x);\r\n\t},\r\n\r\n\tbounds: new Bounds([-180, -90], [180, 90])\r\n};\r\n", "import {LatLng} from '../LatLng';\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {Point} from '../../geometry/Point';\r\n\r\n/*\r\n * @namespace Projection\r\n * @projection L.Projection.Mercator\r\n *\r\n * Elliptical Mercator projection \u2014 more complex than Spherical Mercator. Assumes that Earth is an ellipsoid. Used by the EPSG:3395 CRS.\r\n */\r\n\r\nexport var Mercator = {\r\n\tR: 6378137,\r\n\tR_MINOR: 6356752.314245179,\r\n\r\n\tbounds: new Bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),\r\n\r\n\tproject: function (latlng) {\r\n\t\tvar d = Math.PI / 180,\r\n\t\t    r = this.R,\r\n\t\t    y = latlng.lat * d,\r\n\t\t    tmp = this.R_MINOR / r,\r\n\t\t    e = Math.sqrt(1 - tmp * tmp),\r\n\t\t    con = e * Math.sin(y);\r\n\r\n\t\tvar ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\r\n\t\ty = -r * Math.log(Math.max(ts, 1E-10));\r\n\r\n\t\treturn new Point(latlng.lng * d * r, y);\r\n\t},\r\n\r\n\tunproject: function (point) {\r\n\t\tvar d = 180 / Math.PI,\r\n\t\t    r = this.R,\r\n\t\t    tmp = this.R_MINOR / r,\r\n\t\t    e = Math.sqrt(1 - tmp * tmp),\r\n\t\t    ts = Math.exp(-point.y / r),\r\n\t\t    phi = Math.PI / 2 - 2 * Math.atan(ts);\r\n\r\n\t\tfor (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\r\n\t\t\tcon = e * Math.sin(phi);\r\n\t\t\tcon = Math.pow((1 - con) / (1 + con), e / 2);\r\n\t\t\tdphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\r\n\t\t\tphi += dphi;\r\n\t\t}\r\n\r\n\t\treturn new LatLng(phi * d, point.x * d / r);\r\n\t}\r\n};\r\n", "/*\n * @class Projection\n\n * An object with methods for projecting geographical coordinates of the world onto\n * a flat surface (and back). See [Map projection](https://en.wikipedia.org/wiki/Map_projection).\n\n * @property bounds: Bounds\n * The bounds (specified in CRS units) where the projection is valid\n\n * @method project(latlng: LatLng): Point\n * Projects geographical coordinates into a 2D point.\n * Only accepts actual `L.LatLng` instances, not arrays.\n\n * @method unproject(point: Point): LatLng\n * The inverse of `project`. Projects a 2D point into a geographical location.\n * Only accepts actual `L.Point` instances, not arrays.\n\n * Note that the projection instances do not inherit from Leaflet's `Class` object,\n * and can't be instantiated. Also, new classes can't inherit from them,\n * and methods can't be added to them with the `include` function.\n\n */\n\nexport {LonLat} from './Projection.LonLat';\nexport {Mercator} from './Projection.Mercator';\nexport {SphericalMercator} from './Projection.SphericalMercator';\n", "import {Earth} from './CRS.Earth';\r\nimport {Mercator} from '../projection/Projection.Mercator';\r\nimport {toTransformation} from '../../geometry/Transformation';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3395\r\n *\r\n * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.\r\n */\r\nexport var EPSG3395 = Util.extend({}, Earth, {\r\n\tcode: 'EPSG:3395',\r\n\tprojection: Mercator,\r\n\r\n\ttransformation: (function () {\r\n\t\tvar scale = 0.5 / (Math.PI * Mercator.R);\r\n\t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n\t}())\r\n});\r\n", "import {Earth} from './CRS.Earth';\r\nimport {LonLat} from '../projection/Projection.LonLat';\r\nimport {toTransformation} from '../../geometry/Transformation';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG4326\r\n *\r\n * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.\r\n *\r\n * 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\n * which is a breaking change from 0.7.x behaviour.  If you are using a `TileLayer`\r\n * with this CRS, ensure that there are two 256x256 pixel tiles covering the\r\n * whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),\r\n * or (-180,-90) for `TileLayer`s with [the `tms` option](#tilelayer-tms) set.\r\n */\r\n\r\nexport var EPSG4326 = Util.extend({}, Earth, {\r\n\tcode: 'EPSG:4326',\r\n\tprojection: LonLat,\r\n\ttransformation: toTransformation(1 / 180, 1, -1 / 180, 0.5)\r\n});\r\n", "import {CRS} from './CRS';\nimport {LonLat} from '../projection/Projection.LonLat';\nimport {toTransformation} from '../../geometry/Transformation';\nimport * as Util from '../../core/Util';\n\n/*\n * @namespace CRS\n * @crs L.CRS.Simple\n *\n * A simple CRS that maps longitude and latitude into `x` and `y` directly.\n * May be used for maps of flat surfaces (e.g. game maps). Note that the `y`\n * axis should still be inverted (going from bottom to top). `distance()` returns\n * simple euclidean distance.\n */\n\nexport var Simple = Util.extend({}, CRS, {\n\tprojection: LonLat,\n\ttransformation: toTransformation(1, 0, -1, 0),\n\n\tscale: function (zoom) {\n\t\treturn Math.pow(2, zoom);\n\t},\n\n\tzoom: function (scale) {\n\t\treturn Math.log(scale) / Math.LN2;\n\t},\n\n\tdistance: function (latlng1, latlng2) {\n\t\tvar dx = latlng2.lng - latlng1.lng,\n\t\t    dy = latlng2.lat - latlng1.lat;\n\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t},\n\n\tinfinite: true\n});\n", "import {CRS} from './CRS';\nimport {Earth} from './CRS.Earth';\nimport {EPSG3395} from './CRS.EPSG3395';\nimport {EPSG3857, EPSG900913} from './CRS.EPSG3857';\nimport {EPSG4326} from './CRS.EPSG4326';\nimport {Simple} from './CRS.Simple';\n\nCRS.Earth = Earth;\nCRS.EPSG3395 = EPSG3395;\nCRS.EPSG3857 = EPSG3857;\nCRS.EPSG900913 = EPSG900913;\nCRS.EPSG4326 = EPSG4326;\nCRS.Simple = Simple;\n\nexport {CRS};\n", "import {Evented} from '../core/Events';\nimport {Map} from '../map/Map';\nimport * as Util from '../core/Util';\n\n/*\n * @class Layer\n * @inherits Evented\n * @aka L.Layer\n * @aka ILayer\n *\n * A set of methods from the Layer base class that all Leaflet layers use.\n * Inherits all methods, options and events from `L.Evented`.\n *\n * @example\n *\n * ```js\n * var layer = L.marker(latlng).addTo(map);\n * layer.addTo(map);\n * layer.remove();\n * ```\n *\n * @event add: Event\n * Fired after the layer is added to a map\n *\n * @event remove: Event\n * Fired after the layer is removed from a map\n */\n\n\nexport var Layer = Evented.extend({\n\n\t// Classes extending `L.Layer` will inherit the following options:\n\toptions: {\n\t\t// @option pane: String = 'overlayPane'\n\t\t// 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.\n\t\tpane: 'overlayPane',\n\n\t\t// @option attribution: String = null\n\t\t// String to be shown in the attribution control, e.g. \"\u00A9 OpenStreetMap contributors\". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.\n\t\tattribution: null,\n\n\t\tbubblingMouseEvents: true\n\t},\n\n\t/* @section\n\t * Classes extending `L.Layer` will inherit the following methods:\n\t *\n\t * @method addTo(map: Map|LayerGroup): this\n\t * Adds the layer to the given map or layer group.\n\t */\n\taddTo: function (map) {\n\t\tmap.addLayer(this);\n\t\treturn this;\n\t},\n\n\t// @method remove: this\n\t// Removes the layer from the map it is currently active on.\n\tremove: function () {\n\t\treturn this.removeFrom(this._map || this._mapToAdd);\n\t},\n\n\t// @method removeFrom(map: Map): this\n\t// Removes the layer from the given map\n\t//\n\t// @alternative\n\t// @method removeFrom(group: LayerGroup): this\n\t// Removes the layer from the given `LayerGroup`\n\tremoveFrom: function (obj) {\n\t\tif (obj) {\n\t\t\tobj.removeLayer(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method getPane(name? : String): HTMLElement\n\t// Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer.\n\tgetPane: function (name) {\n\t\treturn this._map.getPane(name ? (this.options[name] || name) : this.options.pane);\n\t},\n\n\taddInteractiveTarget: function (targetEl) {\n\t\tthis._map._targets[Util.stamp(targetEl)] = this;\n\t\treturn this;\n\t},\n\n\tremoveInteractiveTarget: function (targetEl) {\n\t\tdelete this._map._targets[Util.stamp(targetEl)];\n\t\treturn this;\n\t},\n\n\t// @method getAttribution: String\n\t// Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).\n\tgetAttribution: function () {\n\t\treturn this.options.attribution;\n\t},\n\n\t_layerAdd: function (e) {\n\t\tvar map = e.target;\n\n\t\t// check in case layer gets added and then removed before the map is ready\n\t\tif (!map.hasLayer(this)) { return; }\n\n\t\tthis._map = map;\n\t\tthis._zoomAnimated = map._zoomAnimated;\n\n\t\tif (this.getEvents) {\n\t\t\tvar events = this.getEvents();\n\t\t\tmap.on(events, this);\n\t\t\tthis.once('remove', function () {\n\t\t\t\tmap.off(events, this);\n\t\t\t}, this);\n\t\t}\n\n\t\tthis.onAdd(map);\n\n\t\tthis.fire('add');\n\t\tmap.fire('layeradd', {layer: this});\n\t}\n});\n\n/* @section Extension methods\n * @uninheritable\n *\n * Every layer should extend from `L.Layer` and (re-)implement the following methods.\n *\n * @method onAdd(map: Map): this\n * 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).\n *\n * @method onRemove(map: Map): this\n * 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).\n *\n * @method getEvents(): Object\n * 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.\n *\n * @method getAttribution(): String\n * This optional method should return a string containing HTML to be shown on the `Attribution control` whenever the layer is visible.\n *\n * @method beforeAdd(map: Map): this\n * 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.\n */\n\n\n/* @namespace Map\n * @section Layer events\n *\n * @event layeradd: LayerEvent\n * Fired when a new layer is added to the map.\n *\n * @event layerremove: LayerEvent\n * Fired when some layer is removed from the map\n *\n * @section Methods for Layers and Controls\n */\nMap.include({\n\t// @method addLayer(layer: Layer): this\n\t// Adds the given layer to the map\n\taddLayer: function (layer) {\n\t\tif (!layer._layerAdd) {\n\t\t\tthrow new Error('The provided object is not a Layer.');\n\t\t}\n\n\t\tvar id = Util.stamp(layer);\n\t\tif (this._layers[id]) { return this; }\n\t\tthis._layers[id] = layer;\n\n\t\tlayer._mapToAdd = this;\n\n\t\tif (layer.beforeAdd) {\n\t\t\tlayer.beforeAdd(this);\n\t\t}\n\n\t\tthis.whenReady(layer._layerAdd, layer);\n\n\t\treturn this;\n\t},\n\n\t// @method removeLayer(layer: Layer): this\n\t// Removes the given layer from the map.\n\tremoveLayer: function (layer) {\n\t\tvar id = Util.stamp(layer);\n\n\t\tif (!this._layers[id]) { return this; }\n\n\t\tif (this._loaded) {\n\t\t\tlayer.onRemove(this);\n\t\t}\n\n\t\tdelete this._layers[id];\n\n\t\tif (this._loaded) {\n\t\t\tthis.fire('layerremove', {layer: layer});\n\t\t\tlayer.fire('remove');\n\t\t}\n\n\t\tlayer._map = layer._mapToAdd = null;\n\n\t\treturn this;\n\t},\n\n\t// @method hasLayer(layer: Layer): Boolean\n\t// Returns `true` if the given layer is currently added to the map\n\thasLayer: function (layer) {\n\t\treturn Util.stamp(layer) in this._layers;\n\t},\n\n\t/* @method eachLayer(fn: Function, context?: Object): this\n\t * Iterates over the layers of the map, optionally specifying context of the iterator function.\n\t * ```\n\t * map.eachLayer(function(layer){\n\t *     layer.bindPopup('Hello');\n\t * });\n\t * ```\n\t */\n\teachLayer: function (method, context) {\n\t\tfor (var i in this._layers) {\n\t\t\tmethod.call(context, this._layers[i]);\n\t\t}\n\t\treturn this;\n\t},\n\n\t_addLayers: function (layers) {\n\t\tlayers = layers ? (Util.isArray(layers) ? layers : [layers]) : [];\n\n\t\tfor (var i = 0, len = layers.length; i < len; i++) {\n\t\t\tthis.addLayer(layers[i]);\n\t\t}\n\t},\n\n\t_addZoomLimit: function (layer) {\n\t\tif (!isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {\n\t\t\tthis._zoomBoundLayers[Util.stamp(layer)] = layer;\n\t\t\tthis._updateZoomLevels();\n\t\t}\n\t},\n\n\t_removeZoomLimit: function (layer) {\n\t\tvar id = Util.stamp(layer);\n\n\t\tif (this._zoomBoundLayers[id]) {\n\t\t\tdelete this._zoomBoundLayers[id];\n\t\t\tthis._updateZoomLevels();\n\t\t}\n\t},\n\n\t_updateZoomLevels: function () {\n\t\tvar minZoom = Infinity,\n\t\t    maxZoom = -Infinity,\n\t\t    oldZoomSpan = this._getZoomSpan();\n\n\t\tfor (var i in this._zoomBoundLayers) {\n\t\t\tvar options = this._zoomBoundLayers[i].options;\n\n\t\t\tminZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom);\n\t\t\tmaxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom);\n\t\t}\n\n\t\tthis._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom;\n\t\tthis._layersMinZoom = minZoom === Infinity ? undefined : minZoom;\n\n\t\t// @section Map state change events\n\t\t// @event zoomlevelschange: Event\n\t\t// Fired when the number of zoomlevels on the map is changed due\n\t\t// to adding or removing a layer.\n\t\tif (oldZoomSpan !== this._getZoomSpan()) {\n\t\t\tthis.fire('zoomlevelschange');\n\t\t}\n\n\t\tif (this.options.maxZoom === undefined && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) {\n\t\t\tthis.setZoom(this._layersMaxZoom);\n\t\t}\n\t\tif (this.options.minZoom === undefined && this._layersMinZoom && this.getZoom() < this._layersMinZoom) {\n\t\t\tthis.setZoom(this._layersMinZoom);\n\t\t}\n\t}\n});\n", "\r\nimport {Layer} from './Layer';\r\nimport * as Util from '../core/Util';\r\n\r\n/*\r\n * @class LayerGroup\r\n * @aka L.LayerGroup\r\n * @inherits Interactive layer\r\n *\r\n * Used to group several layers and handle them as one. If you add it to the map,\r\n * any layers added or removed from the group will be added/removed on the map as\r\n * well. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.layerGroup([marker1, marker2])\r\n * \t.addLayer(polyline)\r\n * \t.addTo(map);\r\n * ```\r\n */\r\n\r\nexport var LayerGroup = Layer.extend({\r\n\r\n\tinitialize: function (layers, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._layers = {};\r\n\r\n\t\tvar i, len;\r\n\r\n\t\tif (layers) {\r\n\t\t\tfor (i = 0, len = layers.length; i < len; i++) {\r\n\t\t\t\tthis.addLayer(layers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// @method addLayer(layer: Layer): this\r\n\t// Adds the given layer to the group.\r\n\taddLayer: function (layer) {\r\n\t\tvar id = this.getLayerId(layer);\r\n\r\n\t\tthis._layers[id] = layer;\r\n\r\n\t\tif (this._map) {\r\n\t\t\tthis._map.addLayer(layer);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeLayer(layer: Layer): this\r\n\t// Removes the given layer from the group.\r\n\t// @alternative\r\n\t// @method removeLayer(id: Number): this\r\n\t// Removes the layer with the given internal ID from the group.\r\n\tremoveLayer: function (layer) {\r\n\t\tvar id = layer in this._layers ? layer : this.getLayerId(layer);\r\n\r\n\t\tif (this._map && this._layers[id]) {\r\n\t\t\tthis._map.removeLayer(this._layers[id]);\r\n\t\t}\r\n\r\n\t\tdelete this._layers[id];\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method hasLayer(layer: Layer): Boolean\r\n\t// Returns `true` if the given layer is currently added to the group.\r\n\t// @alternative\r\n\t// @method hasLayer(id: Number): Boolean\r\n\t// Returns `true` if the given internal ID is currently added to the group.\r\n\thasLayer: function (layer) {\r\n\t\tvar layerId = typeof layer === 'number' ? layer : this.getLayerId(layer);\r\n\t\treturn layerId in this._layers;\r\n\t},\r\n\r\n\t// @method clearLayers(): this\r\n\t// Removes all the layers from the group.\r\n\tclearLayers: function () {\r\n\t\treturn this.eachLayer(this.removeLayer, this);\r\n\t},\r\n\r\n\t// @method invoke(methodName: String, \u2026): this\r\n\t// Calls `methodName` on every layer contained in this group, passing any\r\n\t// additional parameters. Has no effect if the layers contained do not\r\n\t// implement `methodName`.\r\n\tinvoke: function (methodName) {\r\n\t\tvar args = Array.prototype.slice.call(arguments, 1),\r\n\t\t    i, layer;\r\n\r\n\t\tfor (i in this._layers) {\r\n\t\t\tlayer = this._layers[i];\r\n\r\n\t\t\tif (layer[methodName]) {\r\n\t\t\t\tlayer[methodName].apply(layer, args);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis.eachLayer(map.addLayer, map);\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tthis.eachLayer(map.removeLayer, map);\r\n\t},\r\n\r\n\t// @method eachLayer(fn: Function, context?: Object): this\r\n\t// Iterates over the layers of the group, optionally specifying context of the iterator function.\r\n\t// ```js\r\n\t// group.eachLayer(function (layer) {\r\n\t// \tlayer.bindPopup('Hello');\r\n\t// });\r\n\t// ```\r\n\teachLayer: function (method, context) {\r\n\t\tfor (var i in this._layers) {\r\n\t\t\tmethod.call(context, this._layers[i]);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getLayer(id: Number): Layer\r\n\t// Returns the layer with the given internal ID.\r\n\tgetLayer: function (id) {\r\n\t\treturn this._layers[id];\r\n\t},\r\n\r\n\t// @method getLayers(): Layer[]\r\n\t// Returns an array of all the layers added to the group.\r\n\tgetLayers: function () {\r\n\t\tvar layers = [];\r\n\t\tthis.eachLayer(layers.push, layers);\r\n\t\treturn layers;\r\n\t},\r\n\r\n\t// @method setZIndex(zIndex: Number): this\r\n\t// Calls `setZIndex` on every layer contained in this group, passing the z-index.\r\n\tsetZIndex: function (zIndex) {\r\n\t\treturn this.invoke('setZIndex', zIndex);\r\n\t},\r\n\r\n\t// @method getLayerId(layer: Layer): Number\r\n\t// Returns the internal ID for a layer\r\n\tgetLayerId: function (layer) {\r\n\t\treturn Util.stamp(layer);\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.layerGroup(layers?: Layer[], options?: Object)\r\n// Create a layer group, optionally given an initial set of layers and an `options` object.\r\nexport var layerGroup = function (layers, options) {\r\n\treturn new LayerGroup(layers, options);\r\n};\r\n", "import {LayerGroup} from './LayerGroup';\r\nimport {LatLngBounds} from '../geo/LatLngBounds';\r\n\r\n/*\r\n * @class FeatureGroup\r\n * @aka L.FeatureGroup\r\n * @inherits LayerGroup\r\n *\r\n * Extended `LayerGroup` that makes it easier to do the same thing to all its member layers:\r\n *  * [`bindPopup`](#layer-bindpopup) binds a popup to all of the layers at once (likewise with [`bindTooltip`](#layer-bindtooltip))\r\n *  * Events are propagated to the `FeatureGroup`, so if the group has an event\r\n * handler, it will handle events from any of the layers. This includes mouse events\r\n * and custom events.\r\n *  * Has `layeradd` and `layerremove` events\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.featureGroup([marker1, marker2, polyline])\r\n * \t.bindPopup('Hello world!')\r\n * \t.on('click', function() { alert('Clicked on a member of the group!'); })\r\n * \t.addTo(map);\r\n * ```\r\n */\r\n\r\nexport var FeatureGroup = LayerGroup.extend({\r\n\r\n\taddLayer: function (layer) {\r\n\t\tif (this.hasLayer(layer)) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tlayer.addEventParent(this);\r\n\r\n\t\tLayerGroup.prototype.addLayer.call(this, layer);\r\n\r\n\t\t// @event layeradd: LayerEvent\r\n\t\t// Fired when a layer is added to this `FeatureGroup`\r\n\t\treturn this.fire('layeradd', {layer: layer});\r\n\t},\r\n\r\n\tremoveLayer: function (layer) {\r\n\t\tif (!this.hasLayer(layer)) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tif (layer in this._layers) {\r\n\t\t\tlayer = this._layers[layer];\r\n\t\t}\r\n\r\n\t\tlayer.removeEventParent(this);\r\n\r\n\t\tLayerGroup.prototype.removeLayer.call(this, layer);\r\n\r\n\t\t// @event layerremove: LayerEvent\r\n\t\t// Fired when a layer is removed from this `FeatureGroup`\r\n\t\treturn this.fire('layerremove', {layer: layer});\r\n\t},\r\n\r\n\t// @method setStyle(style: Path options): this\r\n\t// Sets the given path options to each layer of the group that has a `setStyle` method.\r\n\tsetStyle: function (style) {\r\n\t\treturn this.invoke('setStyle', style);\r\n\t},\r\n\r\n\t// @method bringToFront(): this\r\n\t// Brings the layer group to the top of all other layers\r\n\tbringToFront: function () {\r\n\t\treturn this.invoke('bringToFront');\r\n\t},\r\n\r\n\t// @method bringToBack(): this\r\n\t// Brings the layer group to the back of all other layers\r\n\tbringToBack: function () {\r\n\t\treturn this.invoke('bringToBack');\r\n\t},\r\n\r\n\t// @method getBounds(): LatLngBounds\r\n\t// Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).\r\n\tgetBounds: function () {\r\n\t\tvar bounds = new LatLngBounds();\r\n\r\n\t\tfor (var id in this._layers) {\r\n\t\t\tvar layer = this._layers[id];\r\n\t\t\tbounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng());\r\n\t\t}\r\n\t\treturn bounds;\r\n\t}\r\n});\r\n\r\n// @factory L.featureGroup(layers?: Layer[], options?: Object)\r\n// Create a feature group, optionally given an initial set of layers and an `options` object.\r\nexport var featureGroup = function (layers, options) {\r\n\treturn new FeatureGroup(layers, options);\r\n};\r\n", "import {Class} from '../../core/Class';\r\nimport {setOptions} from '../../core/Util';\r\nimport {toPoint as point} from '../../geometry/Point';\r\nimport Browser from '../../core/Browser';\r\n\r\n/*\r\n * @class Icon\r\n * @aka L.Icon\r\n *\r\n * Represents an icon to provide when creating a marker.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var myIcon = L.icon({\r\n *     iconUrl: 'my-icon.png',\r\n *     iconRetinaUrl: 'my-icon@2x.png',\r\n *     iconSize: [38, 95],\r\n *     iconAnchor: [22, 94],\r\n *     popupAnchor: [-3, -76],\r\n *     shadowUrl: 'my-icon-shadow.png',\r\n *     shadowRetinaUrl: 'my-icon-shadow@2x.png',\r\n *     shadowSize: [68, 95],\r\n *     shadowAnchor: [22, 94]\r\n * });\r\n *\r\n * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);\r\n * ```\r\n *\r\n * `L.Icon.Default` extends `L.Icon` and is the blue icon Leaflet uses for markers by default.\r\n *\r\n */\r\n\r\nexport var Icon = Class.extend({\r\n\r\n\t/* @section\r\n\t * @aka Icon options\r\n\t *\r\n\t * @option iconUrl: String = null\r\n\t * **(required)** The URL to the icon image (absolute or relative to your script path).\r\n\t *\r\n\t * @option iconRetinaUrl: String = null\r\n\t * The URL to a retina sized version of the icon image (absolute or relative to your\r\n\t * script path). Used for Retina screen devices.\r\n\t *\r\n\t * @option iconSize: Point = null\r\n\t * Size of the icon image in pixels.\r\n\t *\r\n\t * @option iconAnchor: Point = null\r\n\t * The coordinates of the \"tip\" of the icon (relative to its top left corner). The icon\r\n\t * will be aligned so that this point is at the marker's geographical location. Centered\r\n\t * by default if size is specified, also can be set in CSS with negative margins.\r\n\t *\r\n\t * @option popupAnchor: Point = [0, 0]\r\n\t * The coordinates of the point from which popups will \"open\", relative to the icon anchor.\r\n\t *\r\n\t * @option tooltipAnchor: Point = [0, 0]\r\n\t * The coordinates of the point from which tooltips will \"open\", relative to the icon anchor.\r\n\t *\r\n\t * @option shadowUrl: String = null\r\n\t * The URL to the icon shadow image. If not specified, no shadow image will be created.\r\n\t *\r\n\t * @option shadowRetinaUrl: String = null\r\n\t *\r\n\t * @option shadowSize: Point = null\r\n\t * Size of the shadow image in pixels.\r\n\t *\r\n\t * @option shadowAnchor: Point = null\r\n\t * The coordinates of the \"tip\" of the shadow (relative to its top left corner) (the same\r\n\t * as iconAnchor if not specified).\r\n\t *\r\n\t * @option className: String = ''\r\n\t * A custom class name to assign to both icon and shadow images. Empty by default.\r\n\t */\r\n\r\n\toptions: {\r\n\t\tpopupAnchor: [0, 0],\r\n\t\ttooltipAnchor: [0, 0],\r\n\r\n\t\t// @option crossOrigin: Boolean|String = false\r\n\t\t// Whether the crossOrigin attribute will be added to the tiles.\r\n\t\t// 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\n\t\t// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r\n\t\tcrossOrigin: false\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tsetOptions(this, options);\r\n\t},\r\n\r\n\t// @method createIcon(oldIcon?: HTMLElement): HTMLElement\r\n\t// Called internally when the icon has to be shown, returns a `<img>` HTML element\r\n\t// styled according to the options.\r\n\tcreateIcon: function (oldIcon) {\r\n\t\treturn this._createIcon('icon', oldIcon);\r\n\t},\r\n\r\n\t// @method createShadow(oldIcon?: HTMLElement): HTMLElement\r\n\t// As `createIcon`, but for the shadow beneath it.\r\n\tcreateShadow: function (oldIcon) {\r\n\t\treturn this._createIcon('shadow', oldIcon);\r\n\t},\r\n\r\n\t_createIcon: function (name, oldIcon) {\r\n\t\tvar src = this._getIconUrl(name);\r\n\r\n\t\tif (!src) {\r\n\t\t\tif (name === 'icon') {\r\n\t\t\t\tthrow new Error('iconUrl not set in Icon options (see the docs).');\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tvar img = this._createImg(src, oldIcon && oldIcon.tagName === 'IMG' ? oldIcon : null);\r\n\t\tthis._setIconStyles(img, name);\r\n\r\n\t\tif (this.options.crossOrigin || this.options.crossOrigin === '') {\r\n\t\t\timg.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r\n\t\t}\r\n\r\n\t\treturn img;\r\n\t},\r\n\r\n\t_setIconStyles: function (img, name) {\r\n\t\tvar options = this.options;\r\n\t\tvar sizeOption = options[name + 'Size'];\r\n\r\n\t\tif (typeof sizeOption === 'number') {\r\n\t\t\tsizeOption = [sizeOption, sizeOption];\r\n\t\t}\r\n\r\n\t\tvar size = point(sizeOption),\r\n\t\t    anchor = point(name === 'shadow' && options.shadowAnchor || options.iconAnchor ||\r\n\t\t            size && size.divideBy(2, true));\r\n\r\n\t\timg.className = 'leaflet-marker-' + name + ' ' + (options.className || '');\r\n\r\n\t\tif (anchor) {\r\n\t\t\timg.style.marginLeft = (-anchor.x) + 'px';\r\n\t\t\timg.style.marginTop  = (-anchor.y) + 'px';\r\n\t\t}\r\n\r\n\t\tif (size) {\r\n\t\t\timg.style.width  = size.x + 'px';\r\n\t\t\timg.style.height = size.y + 'px';\r\n\t\t}\r\n\t},\r\n\r\n\t_createImg: function (src, el) {\r\n\t\tel = el || document.createElement('img');\r\n\t\tel.src = src;\r\n\t\treturn el;\r\n\t},\r\n\r\n\t_getIconUrl: function (name) {\r\n\t\treturn Browser.retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.icon(options: Icon options)\r\n// Creates an icon instance with the given options.\r\nexport function icon(options) {\r\n\treturn new Icon(options);\r\n}\r\n", "import {Icon} from './Icon';\nimport * as DomUtil from '../../dom/DomUtil';\n\n/*\n * @miniclass Icon.Default (Icon)\n * @aka L.Icon.Default\n * @section\n *\n * A trivial subclass of `Icon`, represents the icon to use in `Marker`s when\n * no icon is specified. Points to the blue marker image distributed with Leaflet\n * releases.\n *\n * In order to customize the default icon, just change the properties of `L.Icon.Default.prototype.options`\n * (which is a set of `Icon options`).\n *\n * If you want to _completely_ replace the default icon, override the\n * `L.Marker.prototype.options.icon` with your own icon instead.\n */\n\nexport var IconDefault = Icon.extend({\n\n\toptions: {\n\t\ticonUrl:       'marker-icon.png',\n\t\ticonRetinaUrl: 'marker-icon-2x.png',\n\t\tshadowUrl:     'marker-shadow.png',\n\t\ticonSize:    [25, 41],\n\t\ticonAnchor:  [12, 41],\n\t\tpopupAnchor: [1, -34],\n\t\ttooltipAnchor: [16, -28],\n\t\tshadowSize:  [41, 41]\n\t},\n\n\t_getIconUrl: function (name) {\n\t\tif (typeof IconDefault.imagePath !== 'string') {\t// Deprecated, backwards-compatibility only\n\t\t\tIconDefault.imagePath = this._detectIconPath();\n\t\t}\n\n\t\t// @option imagePath: String\n\t\t// `Icon.Default` will try to auto-detect the location of the\n\t\t// blue icon images. If you are placing these images in a non-standard\n\t\t// way, set this option to point to the right path.\n\t\treturn (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name);\n\t},\n\n\t_stripUrl: function (path) {\t// separate function to use in tests\n\t\tvar strip = function (str, re, idx) {\n\t\t\tvar match = re.exec(str);\n\t\t\treturn match && match[idx];\n\t\t};\n\t\tpath = strip(path, /^url\\((['\"])?(.+)\\1\\)$/, 2);\n\t\treturn path && strip(path, /^(.*)marker-icon\\.png$/, 1);\n\t},\n\n\t_detectIconPath: function () {\n\t\tvar el = DomUtil.create('div',  'leaflet-default-icon-path', document.body);\n\t\tvar path = DomUtil.getStyle(el, 'background-image') ||\n\t\t           DomUtil.getStyle(el, 'backgroundImage');\t// IE8\n\n\t\tdocument.body.removeChild(el);\n\t\tpath = this._stripUrl(path);\n\t\tif (path) { return path; }\n\t\tvar link = document.querySelector('link[href$=\"leaflet.css\"]');\n\t\tif (!link) { return ''; }\n\t\treturn link.href.substring(0, link.href.length - 'leaflet.css'.length - 1);\n\t}\n});\n", "import {Handler} from '../../core/Handler';\nimport * as DomUtil from '../../dom/DomUtil';\nimport {Draggable} from '../../dom/Draggable';\nimport {toBounds} from '../../geometry/Bounds';\nimport {toPoint} from '../../geometry/Point';\nimport {requestAnimFrame, cancelAnimFrame} from '../../core/Util';\n\n/*\n * L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable.\n */\n\n\n/* @namespace Marker\n * @section Interaction handlers\n *\n * 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:\n *\n * ```js\n * marker.dragging.disable();\n * ```\n *\n * @property dragging: Handler\n * Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set [`marker.options.draggable`](#marker-draggable)).\n */\n\nexport var MarkerDrag = Handler.extend({\n\tinitialize: function (marker) {\n\t\tthis._marker = marker;\n\t},\n\n\taddHooks: function () {\n\t\tvar icon = this._marker._icon;\n\n\t\tif (!this._draggable) {\n\t\t\tthis._draggable = new Draggable(icon, icon, true);\n\t\t}\n\n\t\tthis._draggable.on({\n\t\t\tdragstart: this._onDragStart,\n\t\t\tpredrag: this._onPreDrag,\n\t\t\tdrag: this._onDrag,\n\t\t\tdragend: this._onDragEnd\n\t\t}, this).enable();\n\n\t\tDomUtil.addClass(icon, 'leaflet-marker-draggable');\n\t},\n\n\tremoveHooks: function () {\n\t\tthis._draggable.off({\n\t\t\tdragstart: this._onDragStart,\n\t\t\tpredrag: this._onPreDrag,\n\t\t\tdrag: this._onDrag,\n\t\t\tdragend: this._onDragEnd\n\t\t}, this).disable();\n\n\t\tif (this._marker._icon) {\n\t\t\tDomUtil.removeClass(this._marker._icon, 'leaflet-marker-draggable');\n\t\t}\n\t},\n\n\tmoved: function () {\n\t\treturn this._draggable && this._draggable._moved;\n\t},\n\n\t_adjustPan: function (e) {\n\t\tvar marker = this._marker,\n\t\t    map = marker._map,\n\t\t    speed = this._marker.options.autoPanSpeed,\n\t\t    padding = this._marker.options.autoPanPadding,\n\t\t    iconPos = DomUtil.getPosition(marker._icon),\n\t\t    bounds = map.getPixelBounds(),\n\t\t    origin = map.getPixelOrigin();\n\n\t\tvar panBounds = toBounds(\n\t\t\tbounds.min._subtract(origin).add(padding),\n\t\t\tbounds.max._subtract(origin).subtract(padding)\n\t\t);\n\n\t\tif (!panBounds.contains(iconPos)) {\n\t\t\t// Compute incremental movement\n\t\t\tvar movement = toPoint(\n\t\t\t\t(Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -\n\t\t\t\t(Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),\n\n\t\t\t\t(Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -\n\t\t\t\t(Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)\n\t\t\t).multiplyBy(speed);\n\n\t\t\tmap.panBy(movement, {animate: false});\n\n\t\t\tthis._draggable._newPos._add(movement);\n\t\t\tthis._draggable._startPos._add(movement);\n\n\t\t\tDomUtil.setPosition(marker._icon, this._draggable._newPos);\n\t\t\tthis._onDrag(e);\n\n\t\t\tthis._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));\n\t\t}\n\t},\n\n\t_onDragStart: function () {\n\t\t// @section Dragging events\n\t\t// @event dragstart: Event\n\t\t// Fired when the user starts dragging the marker.\n\n\t\t// @event movestart: Event\n\t\t// Fired when the marker starts moving (because of dragging).\n\n\t\tthis._oldLatLng = this._marker.getLatLng();\n\n\t\t// When using ES6 imports it could not be set when `Popup` was not imported as well\n\t\tthis._marker.closePopup && this._marker.closePopup();\n\n\t\tthis._marker\n\t\t\t.fire('movestart')\n\t\t\t.fire('dragstart');\n\t},\n\n\t_onPreDrag: function (e) {\n\t\tif (this._marker.options.autoPan) {\n\t\t\tcancelAnimFrame(this._panRequest);\n\t\t\tthis._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));\n\t\t}\n\t},\n\n\t_onDrag: function (e) {\n\t\tvar marker = this._marker,\n\t\t    shadow = marker._shadow,\n\t\t    iconPos = DomUtil.getPosition(marker._icon),\n\t\t    latlng = marker._map.layerPointToLatLng(iconPos);\n\n\t\t// update shadow position\n\t\tif (shadow) {\n\t\t\tDomUtil.setPosition(shadow, iconPos);\n\t\t}\n\n\t\tmarker._latlng = latlng;\n\t\te.latlng = latlng;\n\t\te.oldLatLng = this._oldLatLng;\n\n\t\t// @event drag: Event\n\t\t// Fired repeatedly while the user drags the marker.\n\t\tmarker\n\t\t    .fire('move', e)\n\t\t    .fire('drag', e);\n\t},\n\n\t_onDragEnd: function (e) {\n\t\t// @event dragend: DragEndEvent\n\t\t// Fired when the user stops dragging the marker.\n\n\t\t cancelAnimFrame(this._panRequest);\n\n\t\t// @event moveend: Event\n\t\t// Fired when the marker stops moving (because of dragging).\n\t\tdelete this._oldLatLng;\n\t\tthis._marker\n\t\t    .fire('moveend')\n\t\t    .fire('dragend', e);\n\t}\n});\n", "import {Layer} from '../Layer';\r\nimport {IconDefault} from './Icon.Default';\r\nimport * as Util from '../../core/Util';\r\nimport {toLatLng as latLng} from '../../geo/LatLng';\r\nimport {toPoint as point} from '../../geometry/Point';\r\nimport * as DomUtil from '../../dom/DomUtil';\r\nimport * as DomEvent from '../../dom/DomEvent';\r\nimport {MarkerDrag} from './Marker.Drag';\r\n\r\n/*\r\n * @class Marker\r\n * @inherits Interactive layer\r\n * @aka L.Marker\r\n * L.Marker is used to display clickable/draggable icons on the map. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.marker([50.5, 30.5]).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var Marker = Layer.extend({\r\n\r\n\t// @section\r\n\t// @aka Marker options\r\n\toptions: {\r\n\t\t// @option icon: Icon = *\r\n\t\t// Icon instance to use for rendering the marker.\r\n\t\t// See [Icon documentation](#L.Icon) for details on how to customize the marker icon.\r\n\t\t// If not specified, a common instance of `L.Icon.Default` is used.\r\n\t\ticon: new IconDefault(),\r\n\r\n\t\t// Option inherited from \"Interactive layer\" abstract class\r\n\t\tinteractive: true,\r\n\r\n\t\t// @option keyboard: Boolean = true\r\n\t\t// Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.\r\n\t\tkeyboard: true,\r\n\r\n\t\t// @option title: String = ''\r\n\t\t// Text for the browser tooltip that appear on marker hover (no tooltip by default).\r\n\t\t// [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).\r\n\t\ttitle: '',\r\n\r\n\t\t// @option alt: String = 'Marker'\r\n\t\t// Text for the `alt` attribute of the icon image.\r\n\t\t// [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).\r\n\t\talt: 'Marker',\r\n\r\n\t\t// @option zIndexOffset: Number = 0\r\n\t\t// 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\n\t\tzIndexOffset: 0,\r\n\r\n\t\t// @option opacity: Number = 1.0\r\n\t\t// The opacity of the marker.\r\n\t\topacity: 1,\r\n\r\n\t\t// @option riseOnHover: Boolean = false\r\n\t\t// If `true`, the marker will get on top of others when you hover the mouse over it.\r\n\t\triseOnHover: false,\r\n\r\n\t\t// @option riseOffset: Number = 250\r\n\t\t// The z-index offset used for the `riseOnHover` feature.\r\n\t\triseOffset: 250,\r\n\r\n\t\t// @option pane: String = 'markerPane'\r\n\t\t// `Map pane` where the markers icon will be added.\r\n\t\tpane: 'markerPane',\r\n\r\n\t\t// @option shadowPane: String = 'shadowPane'\r\n\t\t// `Map pane` where the markers shadow will be added.\r\n\t\tshadowPane: 'shadowPane',\r\n\r\n\t\t// @option bubblingMouseEvents: Boolean = false\r\n\t\t// When `true`, a mouse event on this marker will trigger the same event on the map\r\n\t\t// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).\r\n\t\tbubblingMouseEvents: false,\r\n\r\n\t\t// @option autoPanOnFocus: Boolean = true\r\n\t\t// When `true`, the map will pan whenever the marker is focused (via\r\n\t\t// e.g. pressing `tab` on the keyboard) to ensure the marker is\r\n\t\t// visible within the map's bounds\r\n\t\tautoPanOnFocus: true,\r\n\r\n\t\t// @section Draggable marker options\r\n\t\t// @option draggable: Boolean = false\r\n\t\t// Whether the marker is draggable with mouse/touch or not.\r\n\t\tdraggable: false,\r\n\r\n\t\t// @option autoPan: Boolean = false\r\n\t\t// Whether to pan the map when dragging this marker near its edge or not.\r\n\t\tautoPan: false,\r\n\r\n\t\t// @option autoPanPadding: Point = Point(50, 50)\r\n\t\t// Distance (in pixels to the left/right and to the top/bottom) of the\r\n\t\t// map edge to start panning the map.\r\n\t\tautoPanPadding: [50, 50],\r\n\r\n\t\t// @option autoPanSpeed: Number = 10\r\n\t\t// Number of pixels the map should pan by.\r\n\t\tautoPanSpeed: 10\r\n\t},\r\n\r\n\t/* @section\r\n\t *\r\n\t * 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\n\t */\r\n\r\n\tinitialize: function (latlng, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\t\tthis._latlng = latLng(latlng);\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation;\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tmap.on('zoomanim', this._animateZoom, this);\r\n\t\t}\r\n\r\n\t\tthis._initIcon();\r\n\t\tthis.update();\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tif (this.dragging && this.dragging.enabled()) {\r\n\t\t\tthis.options.draggable = true;\r\n\t\t\tthis.dragging.removeHooks();\r\n\t\t}\r\n\t\tdelete this.dragging;\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tmap.off('zoomanim', this._animateZoom, this);\r\n\t\t}\r\n\r\n\t\tthis._removeIcon();\r\n\t\tthis._removeShadow();\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\treturn {\r\n\t\t\tzoom: this.update,\r\n\t\t\tviewreset: this.update\r\n\t\t};\r\n\t},\r\n\r\n\t// @method getLatLng: LatLng\r\n\t// Returns the current geographical position of the marker.\r\n\tgetLatLng: function () {\r\n\t\treturn this._latlng;\r\n\t},\r\n\r\n\t// @method setLatLng(latlng: LatLng): this\r\n\t// Changes the marker position to the given point.\r\n\tsetLatLng: function (latlng) {\r\n\t\tvar oldLatLng = this._latlng;\r\n\t\tthis._latlng = latLng(latlng);\r\n\t\tthis.update();\r\n\r\n\t\t// @event move: Event\r\n\t\t// 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\n\t\treturn this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});\r\n\t},\r\n\r\n\t// @method setZIndexOffset(offset: Number): this\r\n\t// Changes the [zIndex offset](#marker-zindexoffset) of the marker.\r\n\tsetZIndexOffset: function (offset) {\r\n\t\tthis.options.zIndexOffset = offset;\r\n\t\treturn this.update();\r\n\t},\r\n\r\n\t// @method getIcon: Icon\r\n\t// Returns the current icon used by the marker\r\n\tgetIcon: function () {\r\n\t\treturn this.options.icon;\r\n\t},\r\n\r\n\t// @method setIcon(icon: Icon): this\r\n\t// Changes the marker icon.\r\n\tsetIcon: function (icon) {\r\n\r\n\t\tthis.options.icon = icon;\r\n\r\n\t\tif (this._map) {\r\n\t\t\tthis._initIcon();\r\n\t\t\tthis.update();\r\n\t\t}\r\n\r\n\t\tif (this._popup) {\r\n\t\t\tthis.bindPopup(this._popup, this._popup.options);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\tgetElement: function () {\r\n\t\treturn this._icon;\r\n\t},\r\n\r\n\tupdate: function () {\r\n\r\n\t\tif (this._icon && this._map) {\r\n\t\t\tvar pos = this._map.latLngToLayerPoint(this._latlng).round();\r\n\t\t\tthis._setPos(pos);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_initIcon: function () {\r\n\t\tvar options = this.options,\r\n\t\t    classToAdd = 'leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');\r\n\r\n\t\tvar icon = options.icon.createIcon(this._icon),\r\n\t\t    addIcon = false;\r\n\r\n\t\t// if we're not reusing the icon, remove the old one and init new one\r\n\t\tif (icon !== this._icon) {\r\n\t\t\tif (this._icon) {\r\n\t\t\t\tthis._removeIcon();\r\n\t\t\t}\r\n\t\t\taddIcon = true;\r\n\r\n\t\t\tif (options.title) {\r\n\t\t\t\ticon.title = options.title;\r\n\t\t\t}\r\n\r\n\t\t\tif (icon.tagName === 'IMG') {\r\n\t\t\t\ticon.alt = options.alt || '';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tDomUtil.addClass(icon, classToAdd);\r\n\r\n\t\tif (options.keyboard) {\r\n\t\t\ticon.tabIndex = '0';\r\n\t\t\ticon.setAttribute('role', 'button');\r\n\t\t}\r\n\r\n\t\tthis._icon = icon;\r\n\r\n\t\tif (options.riseOnHover) {\r\n\t\t\tthis.on({\r\n\t\t\t\tmouseover: this._bringToFront,\r\n\t\t\t\tmouseout: this._resetZIndex\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.options.autoPanOnFocus) {\r\n\t\t\tDomEvent.on(icon, 'focus', this._panOnFocus, this);\r\n\t\t}\r\n\r\n\t\tvar newShadow = options.icon.createShadow(this._shadow),\r\n\t\t    addShadow = false;\r\n\r\n\t\tif (newShadow !== this._shadow) {\r\n\t\t\tthis._removeShadow();\r\n\t\t\taddShadow = true;\r\n\t\t}\r\n\r\n\t\tif (newShadow) {\r\n\t\t\tDomUtil.addClass(newShadow, classToAdd);\r\n\t\t\tnewShadow.alt = '';\r\n\t\t}\r\n\t\tthis._shadow = newShadow;\r\n\r\n\r\n\t\tif (options.opacity < 1) {\r\n\t\t\tthis._updateOpacity();\r\n\t\t}\r\n\r\n\r\n\t\tif (addIcon) {\r\n\t\t\tthis.getPane().appendChild(this._icon);\r\n\t\t}\r\n\t\tthis._initInteraction();\r\n\t\tif (newShadow && addShadow) {\r\n\t\t\tthis.getPane(options.shadowPane).appendChild(this._shadow);\r\n\t\t}\r\n\t},\r\n\r\n\t_removeIcon: function () {\r\n\t\tif (this.options.riseOnHover) {\r\n\t\t\tthis.off({\r\n\t\t\t\tmouseover: this._bringToFront,\r\n\t\t\t\tmouseout: this._resetZIndex\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.options.autoPanOnFocus) {\r\n\t\t\tDomEvent.off(this._icon, 'focus', this._panOnFocus, this);\r\n\t\t}\r\n\r\n\t\tDomUtil.remove(this._icon);\r\n\t\tthis.removeInteractiveTarget(this._icon);\r\n\r\n\t\tthis._icon = null;\r\n\t},\r\n\r\n\t_removeShadow: function () {\r\n\t\tif (this._shadow) {\r\n\t\t\tDomUtil.remove(this._shadow);\r\n\t\t}\r\n\t\tthis._shadow = null;\r\n\t},\r\n\r\n\t_setPos: function (pos) {\r\n\r\n\t\tif (this._icon) {\r\n\t\t\tDomUtil.setPosition(this._icon, pos);\r\n\t\t}\r\n\r\n\t\tif (this._shadow) {\r\n\t\t\tDomUtil.setPosition(this._shadow, pos);\r\n\t\t}\r\n\r\n\t\tthis._zIndex = pos.y + this.options.zIndexOffset;\r\n\r\n\t\tthis._resetZIndex();\r\n\t},\r\n\r\n\t_updateZIndex: function (offset) {\r\n\t\tif (this._icon) {\r\n\t\t\tthis._icon.style.zIndex = this._zIndex + offset;\r\n\t\t}\r\n\t},\r\n\r\n\t_animateZoom: function (opt) {\r\n\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round();\r\n\r\n\t\tthis._setPos(pos);\r\n\t},\r\n\r\n\t_initInteraction: function () {\r\n\r\n\t\tif (!this.options.interactive) { return; }\r\n\r\n\t\tDomUtil.addClass(this._icon, 'leaflet-interactive');\r\n\r\n\t\tthis.addInteractiveTarget(this._icon);\r\n\r\n\t\tif (MarkerDrag) {\r\n\t\t\tvar draggable = this.options.draggable;\r\n\t\t\tif (this.dragging) {\r\n\t\t\t\tdraggable = this.dragging.enabled();\r\n\t\t\t\tthis.dragging.disable();\r\n\t\t\t}\r\n\r\n\t\t\tthis.dragging = new MarkerDrag(this);\r\n\r\n\t\t\tif (draggable) {\r\n\t\t\t\tthis.dragging.enable();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// @method setOpacity(opacity: Number): this\r\n\t// Changes the opacity of the marker.\r\n\tsetOpacity: function (opacity) {\r\n\t\tthis.options.opacity = opacity;\r\n\t\tif (this._map) {\r\n\t\t\tthis._updateOpacity();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_updateOpacity: function () {\r\n\t\tvar opacity = this.options.opacity;\r\n\r\n\t\tif (this._icon) {\r\n\t\t\tDomUtil.setOpacity(this._icon, opacity);\r\n\t\t}\r\n\r\n\t\tif (this._shadow) {\r\n\t\t\tDomUtil.setOpacity(this._shadow, opacity);\r\n\t\t}\r\n\t},\r\n\r\n\t_bringToFront: function () {\r\n\t\tthis._updateZIndex(this.options.riseOffset);\r\n\t},\r\n\r\n\t_resetZIndex: function () {\r\n\t\tthis._updateZIndex(0);\r\n\t},\r\n\r\n\t_panOnFocus: function () {\r\n\t\tvar map = this._map;\r\n\t\tif (!map) { return; }\r\n\r\n\t\tvar iconOpts = this.options.icon.options;\r\n\t\tvar size = iconOpts.iconSize ? point(iconOpts.iconSize) : point(0, 0);\r\n\t\tvar anchor = iconOpts.iconAnchor ? point(iconOpts.iconAnchor) : point(0, 0);\r\n\r\n\t\tmap.panInside(this._latlng, {\r\n\t\t\tpaddingTopLeft: anchor,\r\n\t\t\tpaddingBottomRight: size.subtract(anchor)\r\n\t\t});\r\n\t},\r\n\r\n\t_getPopupAnchor: function () {\r\n\t\treturn this.options.icon.options.popupAnchor;\r\n\t},\r\n\r\n\t_getTooltipAnchor: function () {\r\n\t\treturn this.options.icon.options.tooltipAnchor;\r\n\t}\r\n});\r\n\r\n\r\n// factory L.marker(latlng: LatLng, options? : Marker options)\r\n\r\n// @factory L.marker(latlng: LatLng, options? : Marker options)\r\n// Instantiates a Marker object given a geographical point and optionally an options object.\r\nexport function marker(latlng, options) {\r\n\treturn new Marker(latlng, options);\r\n}\r\n", "import {Layer} from '../Layer';\nimport * as Util from '../../core/Util';\n\n/*\n * @class Path\n * @aka L.Path\n * @inherits Interactive layer\n *\n * An abstract class that contains options and constants shared between vector\n * overlays (Polygon, Polyline, Circle). Do not use it directly. Extends `Layer`.\n */\n\nexport var Path = Layer.extend({\n\n\t// @section\n\t// @aka Path options\n\toptions: {\n\t\t// @option stroke: Boolean = true\n\t\t// Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.\n\t\tstroke: true,\n\n\t\t// @option color: String = '#3388ff'\n\t\t// Stroke color\n\t\tcolor: '#3388ff',\n\n\t\t// @option weight: Number = 3\n\t\t// Stroke width in pixels\n\t\tweight: 3,\n\n\t\t// @option opacity: Number = 1.0\n\t\t// Stroke opacity\n\t\topacity: 1,\n\n\t\t// @option lineCap: String= 'round'\n\t\t// A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.\n\t\tlineCap: 'round',\n\n\t\t// @option lineJoin: String = 'round'\n\t\t// A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.\n\t\tlineJoin: 'round',\n\n\t\t// @option dashArray: String = null\n\t\t// 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).\n\t\tdashArray: null,\n\n\t\t// @option dashOffset: String = null\n\t\t// 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).\n\t\tdashOffset: null,\n\n\t\t// @option fill: Boolean = depends\n\t\t// Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.\n\t\tfill: false,\n\n\t\t// @option fillColor: String = *\n\t\t// Fill color. Defaults to the value of the [`color`](#path-color) option\n\t\tfillColor: null,\n\n\t\t// @option fillOpacity: Number = 0.2\n\t\t// Fill opacity.\n\t\tfillOpacity: 0.2,\n\n\t\t// @option fillRule: String = 'evenodd'\n\t\t// A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.\n\t\tfillRule: 'evenodd',\n\n\t\t// className: '',\n\n\t\t// Option inherited from \"Interactive layer\" abstract class\n\t\tinteractive: true,\n\n\t\t// @option bubblingMouseEvents: Boolean = true\n\t\t// When `true`, a mouse event on this path will trigger the same event on the map\n\t\t// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).\n\t\tbubblingMouseEvents: true\n\t},\n\n\tbeforeAdd: function (map) {\n\t\t// Renderer is set here because we need to call renderer.getEvents\n\t\t// before this.getEvents.\n\t\tthis._renderer = map.getRenderer(this);\n\t},\n\n\tonAdd: function () {\n\t\tthis._renderer._initPath(this);\n\t\tthis._reset();\n\t\tthis._renderer._addPath(this);\n\t},\n\n\tonRemove: function () {\n\t\tthis._renderer._removePath(this);\n\t},\n\n\t// @method redraw(): this\n\t// Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.\n\tredraw: function () {\n\t\tif (this._map) {\n\t\t\tthis._renderer._updatePath(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method setStyle(style: Path options): this\n\t// Changes the appearance of a Path based on the options in the `Path options` object.\n\tsetStyle: function (style) {\n\t\tUtil.setOptions(this, style);\n\t\tif (this._renderer) {\n\t\t\tthis._renderer._updateStyle(this);\n\t\t\tif (this.options.stroke && style && Object.prototype.hasOwnProperty.call(style, 'weight')) {\n\t\t\t\tthis._updateBounds();\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method bringToFront(): this\n\t// Brings the layer to the top of all path layers.\n\tbringToFront: function () {\n\t\tif (this._renderer) {\n\t\t\tthis._renderer._bringToFront(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method bringToBack(): this\n\t// Brings the layer to the bottom of all path layers.\n\tbringToBack: function () {\n\t\tif (this._renderer) {\n\t\t\tthis._renderer._bringToBack(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\tgetElement: function () {\n\t\treturn this._path;\n\t},\n\n\t_reset: function () {\n\t\t// defined in child classes\n\t\tthis._project();\n\t\tthis._update();\n\t},\n\n\t_clickTolerance: function () {\n\t\t// used when doing hit detection for Canvas layers\n\t\treturn (this.options.stroke ? this.options.weight / 2 : 0) +\n\t\t  (this._renderer.options.tolerance || 0);\n\t}\n});\n", "import {Path} from './Path';\nimport * as Util from '../../core/Util';\nimport {toLatLng} from '../../geo/LatLng';\nimport {Bounds} from '../../geometry/Bounds';\n\n\n/*\n * @class CircleMarker\n * @aka L.CircleMarker\n * @inherits Path\n *\n * A circle of a fixed size with radius specified in pixels. Extends `Path`.\n */\n\nexport var CircleMarker = Path.extend({\n\n\t// @section\n\t// @aka CircleMarker options\n\toptions: {\n\t\tfill: true,\n\n\t\t// @option radius: Number = 10\n\t\t// Radius of the circle marker, in pixels\n\t\tradius: 10\n\t},\n\n\tinitialize: function (latlng, options) {\n\t\tUtil.setOptions(this, options);\n\t\tthis._latlng = toLatLng(latlng);\n\t\tthis._radius = this.options.radius;\n\t},\n\n\t// @method setLatLng(latLng: LatLng): this\n\t// Sets the position of a circle marker to a new location.\n\tsetLatLng: function (latlng) {\n\t\tvar oldLatLng = this._latlng;\n\t\tthis._latlng = toLatLng(latlng);\n\t\tthis.redraw();\n\n\t\t// @event move: Event\n\t\t// Fired when the marker is moved via [`setLatLng`](#circlemarker-setlatlng). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.\n\t\treturn this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});\n\t},\n\n\t// @method getLatLng(): LatLng\n\t// Returns the current geographical position of the circle marker\n\tgetLatLng: function () {\n\t\treturn this._latlng;\n\t},\n\n\t// @method setRadius(radius: Number): this\n\t// Sets the radius of a circle marker. Units are in pixels.\n\tsetRadius: function (radius) {\n\t\tthis.options.radius = this._radius = radius;\n\t\treturn this.redraw();\n\t},\n\n\t// @method getRadius(): Number\n\t// Returns the current radius of the circle\n\tgetRadius: function () {\n\t\treturn this._radius;\n\t},\n\n\tsetStyle : function (options) {\n\t\tvar radius = options && options.radius || this._radius;\n\t\tPath.prototype.setStyle.call(this, options);\n\t\tthis.setRadius(radius);\n\t\treturn this;\n\t},\n\n\t_project: function () {\n\t\tthis._point = this._map.latLngToLayerPoint(this._latlng);\n\t\tthis._updateBounds();\n\t},\n\n\t_updateBounds: function () {\n\t\tvar r = this._radius,\n\t\t    r2 = this._radiusY || r,\n\t\t    w = this._clickTolerance(),\n\t\t    p = [r + w, r2 + w];\n\t\tthis._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p));\n\t},\n\n\t_update: function () {\n\t\tif (this._map) {\n\t\t\tthis._updatePath();\n\t\t}\n\t},\n\n\t_updatePath: function () {\n\t\tthis._renderer._updateCircle(this);\n\t},\n\n\t_empty: function () {\n\t\treturn this._radius && !this._renderer._bounds.intersects(this._pxBounds);\n\t},\n\n\t// Needed by the `Canvas` renderer for interactivity\n\t_containsPoint: function (p) {\n\t\treturn p.distanceTo(this._point) <= this._radius + this._clickTolerance();\n\t}\n});\n\n\n// @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options)\n// Instantiates a circle marker object given a geographical point, and an optional options object.\nexport function circleMarker(latlng, options) {\n\treturn new CircleMarker(latlng, options);\n}\n", "import {CircleMarker} from './CircleMarker';\nimport {Path} from './Path';\nimport * as Util from '../../core/Util';\nimport {toLatLng} from '../../geo/LatLng';\nimport {LatLngBounds} from '../../geo/LatLngBounds';\nimport {Earth} from '../../geo/crs/CRS.Earth';\n\n\n/*\n * @class Circle\n * @aka L.Circle\n * @inherits CircleMarker\n *\n * A class for drawing circle overlays on a map. Extends `CircleMarker`.\n *\n * It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).\n *\n * @example\n *\n * ```js\n * L.circle([50.5, 30.5], {radius: 200}).addTo(map);\n * ```\n */\n\nexport var Circle = CircleMarker.extend({\n\n\tinitialize: function (latlng, options, legacyOptions) {\n\t\tif (typeof options === 'number') {\n\t\t\t// Backwards compatibility with 0.7.x factory (latlng, radius, options?)\n\t\t\toptions = Util.extend({}, legacyOptions, {radius: options});\n\t\t}\n\t\tUtil.setOptions(this, options);\n\t\tthis._latlng = toLatLng(latlng);\n\n\t\tif (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); }\n\n\t\t// @section\n\t\t// @aka Circle options\n\t\t// @option radius: Number; Radius of the circle, in meters.\n\t\tthis._mRadius = this.options.radius;\n\t},\n\n\t// @method setRadius(radius: Number): this\n\t// Sets the radius of a circle. Units are in meters.\n\tsetRadius: function (radius) {\n\t\tthis._mRadius = radius;\n\t\treturn this.redraw();\n\t},\n\n\t// @method getRadius(): Number\n\t// Returns the current radius of a circle. Units are in meters.\n\tgetRadius: function () {\n\t\treturn this._mRadius;\n\t},\n\n\t// @method getBounds(): LatLngBounds\n\t// Returns the `LatLngBounds` of the path.\n\tgetBounds: function () {\n\t\tvar half = [this._radius, this._radiusY || this._radius];\n\n\t\treturn new LatLngBounds(\n\t\t\tthis._map.layerPointToLatLng(this._point.subtract(half)),\n\t\t\tthis._map.layerPointToLatLng(this._point.add(half)));\n\t},\n\n\tsetStyle: Path.prototype.setStyle,\n\n\t_project: function () {\n\n\t\tvar lng = this._latlng.lng,\n\t\t    lat = this._latlng.lat,\n\t\t    map = this._map,\n\t\t    crs = map.options.crs;\n\n\t\tif (crs.distance === Earth.distance) {\n\t\t\tvar d = Math.PI / 180,\n\t\t\t    latR = (this._mRadius / Earth.R) / d,\n\t\t\t    top = map.project([lat + latR, lng]),\n\t\t\t    bottom = map.project([lat - latR, lng]),\n\t\t\t    p = top.add(bottom).divideBy(2),\n\t\t\t    lat2 = map.unproject(p).lat,\n\t\t\t    lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) /\n\t\t\t            (Math.cos(lat * d) * Math.cos(lat2 * d))) / d;\n\n\t\t\tif (isNaN(lngR) || lngR === 0) {\n\t\t\t\tlngR = latR / Math.cos(Math.PI / 180 * lat); // Fallback for edge case, #2425\n\t\t\t}\n\n\t\t\tthis._point = p.subtract(map.getPixelOrigin());\n\t\t\tthis._radius = isNaN(lngR) ? 0 : p.x - map.project([lat2, lng - lngR]).x;\n\t\t\tthis._radiusY = p.y - top.y;\n\n\t\t} else {\n\t\t\tvar latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0]));\n\n\t\t\tthis._point = map.latLngToLayerPoint(this._latlng);\n\t\t\tthis._radius = this._point.x - map.latLngToLayerPoint(latlng2).x;\n\t\t}\n\n\t\tthis._updateBounds();\n\t}\n});\n\n// @factory L.circle(latlng: LatLng, options?: Circle options)\n// Instantiates a circle object given a geographical point, and an options object\n// which contains the circle radius.\n// @alternative\n// @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options)\n// Obsolete way of instantiating a circle, for compatibility with 0.7.x code.\n// Do not use in new applications or plugins.\nexport function circle(latlng, options, legacyOptions) {\n\treturn new Circle(latlng, options, legacyOptions);\n}\n", "import {Path} from './Path';\nimport * as Util from '../../core/Util';\nimport * as LineUtil from '../../geometry/LineUtil';\nimport {LatLng, toLatLng} from '../../geo/LatLng';\nimport {LatLngBounds} from '../../geo/LatLngBounds';\nimport {Bounds} from '../../geometry/Bounds';\nimport {Point} from '../../geometry/Point';\n\n/*\n * @class Polyline\n * @aka L.Polyline\n * @inherits Path\n *\n * A class for drawing polyline overlays on a map. Extends `Path`.\n *\n * @example\n *\n * ```js\n * // create a red polyline from an array of LatLng points\n * var latlngs = [\n * \t[45.51, -122.68],\n * \t[37.77, -122.43],\n * \t[34.04, -118.2]\n * ];\n *\n * var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);\n *\n * // zoom the map to the polyline\n * map.fitBounds(polyline.getBounds());\n * ```\n *\n * You can also pass a multi-dimensional array to represent a `MultiPolyline` shape:\n *\n * ```js\n * // create a red polyline from an array of arrays of LatLng points\n * var latlngs = [\n * \t[[45.51, -122.68],\n * \t [37.77, -122.43],\n * \t [34.04, -118.2]],\n * \t[[40.78, -73.91],\n * \t [41.83, -87.62],\n * \t [32.76, -96.72]]\n * ];\n * ```\n */\n\n\nexport var Polyline = Path.extend({\n\n\t// @section\n\t// @aka Polyline options\n\toptions: {\n\t\t// @option smoothFactor: Number = 1.0\n\t\t// How much to simplify the polyline on each zoom level. More means\n\t\t// better performance and smoother look, and less means more accurate representation.\n\t\tsmoothFactor: 1.0,\n\n\t\t// @option noClip: Boolean = false\n\t\t// Disable polyline clipping.\n\t\tnoClip: false\n\t},\n\n\tinitialize: function (latlngs, options) {\n\t\tUtil.setOptions(this, options);\n\t\tthis._setLatLngs(latlngs);\n\t},\n\n\t// @method getLatLngs(): LatLng[]\n\t// Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.\n\tgetLatLngs: function () {\n\t\treturn this._latlngs;\n\t},\n\n\t// @method setLatLngs(latlngs: LatLng[]): this\n\t// Replaces all the points in the polyline with the given array of geographical points.\n\tsetLatLngs: function (latlngs) {\n\t\tthis._setLatLngs(latlngs);\n\t\treturn this.redraw();\n\t},\n\n\t// @method isEmpty(): Boolean\n\t// Returns `true` if the Polyline has no LatLngs.\n\tisEmpty: function () {\n\t\treturn !this._latlngs.length;\n\t},\n\n\t// @method closestLayerPoint(p: Point): Point\n\t// Returns the point closest to `p` on the Polyline.\n\tclosestLayerPoint: function (p) {\n\t\tvar minDistance = Infinity,\n\t\t    minPoint = null,\n\t\t    closest = LineUtil._sqClosestPointOnSegment,\n\t\t    p1, p2;\n\n\t\tfor (var j = 0, jLen = this._parts.length; j < jLen; j++) {\n\t\t\tvar points = this._parts[j];\n\n\t\t\tfor (var i = 1, len = points.length; i < len; i++) {\n\t\t\t\tp1 = points[i - 1];\n\t\t\t\tp2 = points[i];\n\n\t\t\t\tvar sqDist = closest(p, p1, p2, true);\n\n\t\t\t\tif (sqDist < minDistance) {\n\t\t\t\t\tminDistance = sqDist;\n\t\t\t\t\tminPoint = closest(p, p1, p2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (minPoint) {\n\t\t\tminPoint.distance = Math.sqrt(minDistance);\n\t\t}\n\t\treturn minPoint;\n\t},\n\n\t// @method getCenter(): LatLng\n\t// Returns the center ([centroid](https://en.wikipedia.org/wiki/Centroid)) of the polyline.\n\tgetCenter: function () {\n\t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n\t\tif (!this._map) {\n\t\t\tthrow new Error('Must add layer to map before using getCenter()');\n\t\t}\n\t\treturn LineUtil.polylineCenter(this._defaultShape(), this._map.options.crs);\n\t},\n\n\t// @method getBounds(): LatLngBounds\n\t// Returns the `LatLngBounds` of the path.\n\tgetBounds: function () {\n\t\treturn this._bounds;\n\t},\n\n\t// @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this\n\t// Adds a given point to the polyline. By default, adds to the first ring of\n\t// the polyline in case of a multi-polyline, but can be overridden by passing\n\t// a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)).\n\taddLatLng: function (latlng, latlngs) {\n\t\tlatlngs = latlngs || this._defaultShape();\n\t\tlatlng = toLatLng(latlng);\n\t\tlatlngs.push(latlng);\n\t\tthis._bounds.extend(latlng);\n\t\treturn this.redraw();\n\t},\n\n\t_setLatLngs: function (latlngs) {\n\t\tthis._bounds = new LatLngBounds();\n\t\tthis._latlngs = this._convertLatLngs(latlngs);\n\t},\n\n\t_defaultShape: function () {\n\t\treturn LineUtil.isFlat(this._latlngs) ? this._latlngs : this._latlngs[0];\n\t},\n\n\t// recursively convert latlngs input into actual LatLng instances; calculate bounds along the way\n\t_convertLatLngs: function (latlngs) {\n\t\tvar result = [],\n\t\t    flat = LineUtil.isFlat(latlngs);\n\n\t\tfor (var i = 0, len = latlngs.length; i < len; i++) {\n\t\t\tif (flat) {\n\t\t\t\tresult[i] = toLatLng(latlngs[i]);\n\t\t\t\tthis._bounds.extend(result[i]);\n\t\t\t} else {\n\t\t\t\tresult[i] = this._convertLatLngs(latlngs[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\t_project: function () {\n\t\tvar pxBounds = new Bounds();\n\t\tthis._rings = [];\n\t\tthis._projectLatlngs(this._latlngs, this._rings, pxBounds);\n\n\t\tif (this._bounds.isValid() && pxBounds.isValid()) {\n\t\t\tthis._rawPxBounds = pxBounds;\n\t\t\tthis._updateBounds();\n\t\t}\n\t},\n\n\t_updateBounds: function () {\n\t\tvar w = this._clickTolerance(),\n\t\t    p = new Point(w, w);\n\n\t\tif (!this._rawPxBounds) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._pxBounds = new Bounds([\n\t\t\tthis._rawPxBounds.min.subtract(p),\n\t\t\tthis._rawPxBounds.max.add(p)\n\t\t]);\n\t},\n\n\t// recursively turns latlngs into a set of rings with projected coordinates\n\t_projectLatlngs: function (latlngs, result, projectedBounds) {\n\t\tvar flat = latlngs[0] instanceof LatLng,\n\t\t    len = latlngs.length,\n\t\t    i, ring;\n\n\t\tif (flat) {\n\t\t\tring = [];\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tring[i] = this._map.latLngToLayerPoint(latlngs[i]);\n\t\t\t\tprojectedBounds.extend(ring[i]);\n\t\t\t}\n\t\t\tresult.push(ring);\n\t\t} else {\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tthis._projectLatlngs(latlngs[i], result, projectedBounds);\n\t\t\t}\n\t\t}\n\t},\n\n\t// clip polyline by renderer bounds so that we have less to render for performance\n\t_clipPoints: function () {\n\t\tvar bounds = this._renderer._bounds;\n\n\t\tthis._parts = [];\n\t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.options.noClip) {\n\t\t\tthis._parts = this._rings;\n\t\t\treturn;\n\t\t}\n\n\t\tvar parts = this._parts,\n\t\t    i, j, k, len, len2, segment, points;\n\n\t\tfor (i = 0, k = 0, len = this._rings.length; i < len; i++) {\n\t\t\tpoints = this._rings[i];\n\n\t\t\tfor (j = 0, len2 = points.length; j < len2 - 1; j++) {\n\t\t\t\tsegment = LineUtil.clipSegment(points[j], points[j + 1], bounds, j, true);\n\n\t\t\t\tif (!segment) { continue; }\n\n\t\t\t\tparts[k] = parts[k] || [];\n\t\t\t\tparts[k].push(segment[0]);\n\n\t\t\t\t// if segment goes out of screen, or it's the last one, it's the end of the line part\n\t\t\t\tif ((segment[1] !== points[j + 1]) || (j === len2 - 2)) {\n\t\t\t\t\tparts[k].push(segment[1]);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// simplify each clipped part of the polyline for performance\n\t_simplifyPoints: function () {\n\t\tvar parts = this._parts,\n\t\t    tolerance = this.options.smoothFactor;\n\n\t\tfor (var i = 0, len = parts.length; i < len; i++) {\n\t\t\tparts[i] = LineUtil.simplify(parts[i], tolerance);\n\t\t}\n\t},\n\n\t_update: function () {\n\t\tif (!this._map) { return; }\n\n\t\tthis._clipPoints();\n\t\tthis._simplifyPoints();\n\t\tthis._updatePath();\n\t},\n\n\t_updatePath: function () {\n\t\tthis._renderer._updatePoly(this);\n\t},\n\n\t// Needed by the `Canvas` renderer for interactivity\n\t_containsPoint: function (p, closed) {\n\t\tvar i, j, k, len, len2, part,\n\t\t    w = this._clickTolerance();\n\n\t\tif (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }\n\n\t\t// hit detection for polylines\n\t\tfor (i = 0, len = this._parts.length; i < len; i++) {\n\t\t\tpart = this._parts[i];\n\n\t\t\tfor (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {\n\t\t\t\tif (!closed && (j === 0)) { continue; }\n\n\t\t\t\tif (LineUtil.pointToSegmentDistance(p, part[k], part[j]) <= w) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n});\n\n// @factory L.polyline(latlngs: LatLng[], options?: Polyline options)\n// Instantiates a polyline object given an array of geographical points and\n// optionally an options object. You can create a `Polyline` object with\n// multiple separate lines (`MultiPolyline`) by passing an array of arrays\n// of geographic points.\nexport function polyline(latlngs, options) {\n\treturn new Polyline(latlngs, options);\n}\n\n// Retrocompat. Allow plugins to support Leaflet versions before and after 1.1.\nPolyline._flat = LineUtil._flat;\n", "import {Polyline} from './Polyline';\nimport {LatLng} from '../../geo/LatLng';\nimport * as LineUtil from '../../geometry/LineUtil';\nimport {Point} from '../../geometry/Point';\nimport {Bounds} from '../../geometry/Bounds';\nimport * as PolyUtil from '../../geometry/PolyUtil';\n\n/*\n * @class Polygon\n * @aka L.Polygon\n * @inherits Polyline\n *\n * A class for drawing polygon overlays on a map. Extends `Polyline`.\n *\n * Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one \u2014 it's better to filter out such points.\n *\n *\n * @example\n *\n * ```js\n * // create a red polygon from an array of LatLng points\n * var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];\n *\n * var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);\n *\n * // zoom the map to the polygon\n * map.fitBounds(polygon.getBounds());\n * ```\n *\n * 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:\n *\n * ```js\n * var latlngs = [\n *   [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n *   [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n * ];\n * ```\n *\n * Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.\n *\n * ```js\n * var latlngs = [\n *   [ // first polygon\n *     [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n *     [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n *   ],\n *   [ // second polygon\n *     [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]\n *   ]\n * ];\n * ```\n */\n\nexport var Polygon = Polyline.extend({\n\n\toptions: {\n\t\tfill: true\n\t},\n\n\tisEmpty: function () {\n\t\treturn !this._latlngs.length || !this._latlngs[0].length;\n\t},\n\n\t// @method getCenter(): LatLng\n\t// Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon.\n\tgetCenter: function () {\n\t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n\t\tif (!this._map) {\n\t\t\tthrow new Error('Must add layer to map before using getCenter()');\n\t\t}\n\t\treturn PolyUtil.polygonCenter(this._defaultShape(), this._map.options.crs);\n\t},\n\n\t_convertLatLngs: function (latlngs) {\n\t\tvar result = Polyline.prototype._convertLatLngs.call(this, latlngs),\n\t\t    len = result.length;\n\n\t\t// remove last point if it equals first one\n\t\tif (len >= 2 && result[0] instanceof LatLng && result[0].equals(result[len - 1])) {\n\t\t\tresult.pop();\n\t\t}\n\t\treturn result;\n\t},\n\n\t_setLatLngs: function (latlngs) {\n\t\tPolyline.prototype._setLatLngs.call(this, latlngs);\n\t\tif (LineUtil.isFlat(this._latlngs)) {\n\t\t\tthis._latlngs = [this._latlngs];\n\t\t}\n\t},\n\n\t_defaultShape: function () {\n\t\treturn LineUtil.isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];\n\t},\n\n\t_clipPoints: function () {\n\t\t// polygons need a different clipping algorithm so we redefine that\n\n\t\tvar bounds = this._renderer._bounds,\n\t\t    w = this.options.weight,\n\t\t    p = new Point(w, w);\n\n\t\t// increase clip padding by stroke width to avoid stroke on clip edges\n\t\tbounds = new Bounds(bounds.min.subtract(p), bounds.max.add(p));\n\n\t\tthis._parts = [];\n\t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.options.noClip) {\n\t\t\tthis._parts = this._rings;\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var i = 0, len = this._rings.length, clipped; i < len; i++) {\n\t\t\tclipped = PolyUtil.clipPolygon(this._rings[i], bounds, true);\n\t\t\tif (clipped.length) {\n\t\t\t\tthis._parts.push(clipped);\n\t\t\t}\n\t\t}\n\t},\n\n\t_updatePath: function () {\n\t\tthis._renderer._updatePoly(this, true);\n\t},\n\n\t// Needed by the `Canvas` renderer for interactivity\n\t_containsPoint: function (p) {\n\t\tvar inside = false,\n\t\t    part, p1, p2, i, j, k, len, len2;\n\n\t\tif (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }\n\n\t\t// ray casting algorithm for detecting if point is in polygon\n\t\tfor (i = 0, len = this._parts.length; i < len; i++) {\n\t\t\tpart = this._parts[i];\n\n\t\t\tfor (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {\n\t\t\t\tp1 = part[j];\n\t\t\t\tp2 = part[k];\n\n\t\t\t\tif (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {\n\t\t\t\t\tinside = !inside;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// also check if it's on polygon stroke\n\t\treturn inside || Polyline.prototype._containsPoint.call(this, p, true);\n\t}\n\n});\n\n\n// @factory L.polygon(latlngs: LatLng[], options?: Polyline options)\nexport function polygon(latlngs, options) {\n\treturn new Polygon(latlngs, options);\n}\n", "import {LayerGroup} from './LayerGroup';\r\nimport {FeatureGroup} from './FeatureGroup';\r\nimport * as Util from '../core/Util';\r\nimport {Marker} from './marker/Marker';\r\nimport {Circle} from './vector/Circle';\r\nimport {CircleMarker} from './vector/CircleMarker';\r\nimport {Polyline} from './vector/Polyline';\r\nimport {Polygon} from './vector/Polygon';\r\nimport {LatLng} from '../geo/LatLng';\r\nimport * as LineUtil from '../geometry/LineUtil';\r\nimport {toLatLng} from '../geo/LatLng';\r\n\r\n\r\n/*\r\n * @class GeoJSON\r\n * @aka L.GeoJSON\r\n * @inherits FeatureGroup\r\n *\r\n * Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse\r\n * GeoJSON data and display it on the map. Extends `FeatureGroup`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.geoJSON(data, {\r\n * \tstyle: function (feature) {\r\n * \t\treturn {color: feature.properties.color};\r\n * \t}\r\n * }).bindPopup(function (layer) {\r\n * \treturn layer.feature.properties.description;\r\n * }).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var GeoJSON = FeatureGroup.extend({\r\n\r\n\t/* @section\r\n\t * @aka GeoJSON options\r\n\t *\r\n\t * @option pointToLayer: Function = *\r\n\t * A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally\r\n\t * called when data is added, passing the GeoJSON point feature and its `LatLng`.\r\n\t * The default is to spawn a default `Marker`:\r\n\t * ```js\r\n\t * function(geoJsonPoint, latlng) {\r\n\t * \treturn L.marker(latlng);\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @option style: Function = *\r\n\t * A `Function` defining the `Path options` for styling GeoJSON lines and polygons,\r\n\t * called internally when data is added.\r\n\t * The default value is to not override any defaults:\r\n\t * ```js\r\n\t * function (geoJsonFeature) {\r\n\t * \treturn {}\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @option onEachFeature: Function = *\r\n\t * A `Function` that will be called once for each created `Feature`, after it has\r\n\t * been created and styled. Useful for attaching events and popups to features.\r\n\t * The default is to do nothing with the newly created layers:\r\n\t * ```js\r\n\t * function (feature, layer) {}\r\n\t * ```\r\n\t *\r\n\t * @option filter: Function = *\r\n\t * A `Function` that will be used to decide whether to include a feature or not.\r\n\t * The default is to include all features:\r\n\t * ```js\r\n\t * function (geoJsonFeature) {\r\n\t * \treturn true;\r\n\t * }\r\n\t * ```\r\n\t * Note: dynamically changing the `filter` option will have effect only on newly\r\n\t * added data. It will _not_ re-evaluate already included features.\r\n\t *\r\n\t * @option coordsToLatLng: Function = *\r\n\t * A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.\r\n\t * The default is the `coordsToLatLng` static method.\r\n\t *\r\n\t * @option markersInheritOptions: Boolean = false\r\n\t * Whether default Markers for \"Point\" type Features inherit from group options.\r\n\t */\r\n\r\n\tinitialize: function (geojson, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._layers = {};\r\n\r\n\t\tif (geojson) {\r\n\t\t\tthis.addData(geojson);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method addData( <GeoJSON> data ): this\r\n\t// Adds a GeoJSON object to the layer.\r\n\taddData: function (geojson) {\r\n\t\tvar features = Util.isArray(geojson) ? geojson : geojson.features,\r\n\t\t    i, len, feature;\r\n\r\n\t\tif (features) {\r\n\t\t\tfor (i = 0, len = features.length; i < len; i++) {\r\n\t\t\t\t// only add this if geometry or geometries are set and not null\r\n\t\t\t\tfeature = features[i];\r\n\t\t\t\tif (feature.geometries || feature.geometry || feature.features || feature.coordinates) {\r\n\t\t\t\t\tthis.addData(feature);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar options = this.options;\r\n\r\n\t\tif (options.filter && !options.filter(geojson)) { return this; }\r\n\r\n\t\tvar layer = geometryToLayer(geojson, options);\r\n\t\tif (!layer) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tlayer.feature = asFeature(geojson);\r\n\r\n\t\tlayer.defaultOptions = layer.options;\r\n\t\tthis.resetStyle(layer);\r\n\r\n\t\tif (options.onEachFeature) {\r\n\t\t\toptions.onEachFeature(geojson, layer);\r\n\t\t}\r\n\r\n\t\treturn this.addLayer(layer);\r\n\t},\r\n\r\n\t// @method resetStyle( <Path> layer? ): this\r\n\t// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.\r\n\t// If `layer` is omitted, the style of all features in the current layer is reset.\r\n\tresetStyle: function (layer) {\r\n\t\tif (layer === undefined) {\r\n\t\t\treturn this.eachLayer(this.resetStyle, this);\r\n\t\t}\r\n\t\t// reset any custom styles\r\n\t\tlayer.options = Util.extend({}, layer.defaultOptions);\r\n\t\tthis._setLayerStyle(layer, this.options.style);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setStyle( <Function> style ): this\r\n\t// Changes styles of GeoJSON vector layers with the given style function.\r\n\tsetStyle: function (style) {\r\n\t\treturn this.eachLayer(function (layer) {\r\n\t\t\tthis._setLayerStyle(layer, style);\r\n\t\t}, this);\r\n\t},\r\n\r\n\t_setLayerStyle: function (layer, style) {\r\n\t\tif (layer.setStyle) {\r\n\t\t\tif (typeof style === 'function') {\r\n\t\t\t\tstyle = style(layer.feature);\r\n\t\t\t}\r\n\t\t\tlayer.setStyle(style);\r\n\t\t}\r\n\t}\r\n});\r\n\r\n// @section\r\n// There are several static functions which can be called without instantiating L.GeoJSON:\r\n\r\n// @function geometryToLayer(featureData: Object, options?: GeoJSON options): Layer\r\n// Creates a `Layer` from a given GeoJSON feature. Can use a custom\r\n// [`pointToLayer`](#geojson-pointtolayer) and/or [`coordsToLatLng`](#geojson-coordstolatlng)\r\n// functions if provided as options.\r\nexport function geometryToLayer(geojson, options) {\r\n\r\n\tvar geometry = geojson.type === 'Feature' ? geojson.geometry : geojson,\r\n\t    coords = geometry ? geometry.coordinates : null,\r\n\t    layers = [],\r\n\t    pointToLayer = options && options.pointToLayer,\r\n\t    _coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng,\r\n\t    latlng, latlngs, i, len;\r\n\r\n\tif (!coords && !geometry) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tswitch (geometry.type) {\r\n\tcase 'Point':\r\n\t\tlatlng = _coordsToLatLng(coords);\r\n\t\treturn _pointToLayer(pointToLayer, geojson, latlng, options);\r\n\r\n\tcase 'MultiPoint':\r\n\t\tfor (i = 0, len = coords.length; i < len; i++) {\r\n\t\t\tlatlng = _coordsToLatLng(coords[i]);\r\n\t\t\tlayers.push(_pointToLayer(pointToLayer, geojson, latlng, options));\r\n\t\t}\r\n\t\treturn new FeatureGroup(layers);\r\n\r\n\tcase 'LineString':\r\n\tcase 'MultiLineString':\r\n\t\tlatlngs = coordsToLatLngs(coords, geometry.type === 'LineString' ? 0 : 1, _coordsToLatLng);\r\n\t\treturn new Polyline(latlngs, options);\r\n\r\n\tcase 'Polygon':\r\n\tcase 'MultiPolygon':\r\n\t\tlatlngs = coordsToLatLngs(coords, geometry.type === 'Polygon' ? 1 : 2, _coordsToLatLng);\r\n\t\treturn new Polygon(latlngs, options);\r\n\r\n\tcase 'GeometryCollection':\r\n\t\tfor (i = 0, len = geometry.geometries.length; i < len; i++) {\r\n\t\t\tvar geoLayer = geometryToLayer({\r\n\t\t\t\tgeometry: geometry.geometries[i],\r\n\t\t\t\ttype: 'Feature',\r\n\t\t\t\tproperties: geojson.properties\r\n\t\t\t}, options);\r\n\r\n\t\t\tif (geoLayer) {\r\n\t\t\t\tlayers.push(geoLayer);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new FeatureGroup(layers);\r\n\r\n\tcase 'FeatureCollection':\r\n\t\tfor (i = 0, len = geometry.features.length; i < len; i++) {\r\n\t\t\tvar featureLayer = geometryToLayer(geometry.features[i], options);\r\n\r\n\t\t\tif (featureLayer) {\r\n\t\t\t\tlayers.push(featureLayer);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new FeatureGroup(layers);\r\n\r\n\tdefault:\r\n\t\tthrow new Error('Invalid GeoJSON object.');\r\n\t}\r\n}\r\n\r\nfunction _pointToLayer(pointToLayerFn, geojson, latlng, options) {\r\n\treturn pointToLayerFn ?\r\n\t\tpointToLayerFn(geojson, latlng) :\r\n\t\tnew Marker(latlng, options && options.markersInheritOptions && options);\r\n}\r\n\r\n// @function coordsToLatLng(coords: Array): LatLng\r\n// Creates a `LatLng` object from an array of 2 numbers (longitude, latitude)\r\n// or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.\r\nexport function coordsToLatLng(coords) {\r\n\treturn new LatLng(coords[1], coords[0], coords[2]);\r\n}\r\n\r\n// @function coordsToLatLngs(coords: Array, levelsDeep?: Number, coordsToLatLng?: Function): Array\r\n// Creates a multidimensional array of `LatLng`s from a GeoJSON coordinates array.\r\n// `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\n// Can use a custom [`coordsToLatLng`](#geojson-coordstolatlng) function.\r\nexport function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {\r\n\tvar latlngs = [];\r\n\r\n\tfor (var i = 0, len = coords.length, latlng; i < len; i++) {\r\n\t\tlatlng = levelsDeep ?\r\n\t\t\tcoordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :\r\n\t\t\t(_coordsToLatLng || coordsToLatLng)(coords[i]);\r\n\r\n\t\tlatlngs.push(latlng);\r\n\t}\r\n\r\n\treturn latlngs;\r\n}\r\n\r\n// @function latLngToCoords(latlng: LatLng, precision?: Number|false): Array\r\n// Reverse of [`coordsToLatLng`](#geojson-coordstolatlng)\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function.\r\nexport function latLngToCoords(latlng, precision) {\r\n\tlatlng = toLatLng(latlng);\r\n\treturn latlng.alt !== undefined ?\r\n\t\t[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :\r\n\t\t[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];\r\n}\r\n\r\n// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean, precision?: Number|false): Array\r\n// Reverse of [`coordsToLatLngs`](#geojson-coordstolatlngs)\r\n// `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\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function.\r\nexport function latLngsToCoords(latlngs, levelsDeep, closed, precision) {\r\n\tvar coords = [];\r\n\r\n\tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n\t\t// Check for flat arrays required to ensure unbalanced arrays are correctly converted in recursion\r\n\t\tcoords.push(levelsDeep ?\r\n\t\t\tlatLngsToCoords(latlngs[i], LineUtil.isFlat(latlngs[i]) ? 0 : levelsDeep - 1, closed, precision) :\r\n\t\t\tlatLngToCoords(latlngs[i], precision));\r\n\t}\r\n\r\n\tif (!levelsDeep && closed && coords.length > 0) {\r\n\t\tcoords.push(coords[0].slice());\r\n\t}\r\n\r\n\treturn coords;\r\n}\r\n\r\nexport function getFeature(layer, newGeometry) {\r\n\treturn layer.feature ?\r\n\t\tUtil.extend({}, layer.feature, {geometry: newGeometry}) :\r\n\t\tasFeature(newGeometry);\r\n}\r\n\r\n// @function asFeature(geojson: Object): Object\r\n// Normalize GeoJSON geometries/features into GeoJSON features.\r\nexport function asFeature(geojson) {\r\n\tif (geojson.type === 'Feature' || geojson.type === 'FeatureCollection') {\r\n\t\treturn geojson;\r\n\t}\r\n\r\n\treturn {\r\n\t\ttype: 'Feature',\r\n\t\tproperties: {},\r\n\t\tgeometry: geojson\r\n\t};\r\n}\r\n\r\nvar PointToGeoJSON = {\r\n\ttoGeoJSON: function (precision) {\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: 'Point',\r\n\t\t\tcoordinates: latLngToCoords(this.getLatLng(), precision)\r\n\t\t});\r\n\t}\r\n};\r\n\r\n// @namespace Marker\r\n// @section Other methods\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature).\r\nMarker.include(PointToGeoJSON);\r\n\r\n// @namespace CircleMarker\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature).\r\nCircle.include(PointToGeoJSON);\r\nCircleMarker.include(PointToGeoJSON);\r\n\r\n\r\n// @namespace Polyline\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).\r\nPolyline.include({\r\n\ttoGeoJSON: function (precision) {\r\n\t\tvar multi = !LineUtil.isFlat(this._latlngs);\r\n\r\n\t\tvar coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision);\r\n\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: (multi ? 'Multi' : '') + 'LineString',\r\n\t\t\tcoordinates: coords\r\n\t\t});\r\n\t}\r\n});\r\n\r\n// @namespace Polygon\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).\r\nPolygon.include({\r\n\ttoGeoJSON: function (precision) {\r\n\t\tvar holes = !LineUtil.isFlat(this._latlngs),\r\n\t\t    multi = holes && !LineUtil.isFlat(this._latlngs[0]);\r\n\r\n\t\tvar coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision);\r\n\r\n\t\tif (!holes) {\r\n\t\t\tcoords = [coords];\r\n\t\t}\r\n\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: (multi ? 'Multi' : '') + 'Polygon',\r\n\t\t\tcoordinates: coords\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n// @namespace LayerGroup\r\nLayerGroup.include({\r\n\ttoMultiPoint: function (precision) {\r\n\t\tvar coords = [];\r\n\r\n\t\tthis.eachLayer(function (layer) {\r\n\t\t\tcoords.push(layer.toGeoJSON(precision).geometry.coordinates);\r\n\t\t});\r\n\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: 'MultiPoint',\r\n\t\t\tcoordinates: coords\r\n\t\t});\r\n\t},\r\n\r\n\t// @method toGeoJSON(precision?: Number|false): Object\r\n\t// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n\t// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).\r\n\ttoGeoJSON: function (precision) {\r\n\r\n\t\tvar type = this.feature && this.feature.geometry && this.feature.geometry.type;\r\n\r\n\t\tif (type === 'MultiPoint') {\r\n\t\t\treturn this.toMultiPoint(precision);\r\n\t\t}\r\n\r\n\t\tvar isGeometryCollection = type === 'GeometryCollection',\r\n\t\t    jsons = [];\r\n\r\n\t\tthis.eachLayer(function (layer) {\r\n\t\t\tif (layer.toGeoJSON) {\r\n\t\t\t\tvar json = layer.toGeoJSON(precision);\r\n\t\t\t\tif (isGeometryCollection) {\r\n\t\t\t\t\tjsons.push(json.geometry);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar feature = asFeature(json);\r\n\t\t\t\t\t// Squash nested feature collections\r\n\t\t\t\t\tif (feature.type === 'FeatureCollection') {\r\n\t\t\t\t\t\tjsons.push.apply(jsons, feature.features);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tjsons.push(feature);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (isGeometryCollection) {\r\n\t\t\treturn getFeature(this, {\r\n\t\t\t\tgeometries: jsons,\r\n\t\t\t\ttype: 'GeometryCollection'\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttype: 'FeatureCollection',\r\n\t\t\tfeatures: jsons\r\n\t\t};\r\n\t}\r\n});\r\n\r\n// @namespace GeoJSON\r\n// @factory L.geoJSON(geojson?: Object, options?: GeoJSON options)\r\n// Creates a GeoJSON layer. Optionally accepts an object in\r\n// [GeoJSON format](https://tools.ietf.org/html/rfc7946) to display on the map\r\n// (you can alternatively add it later with `addData` method) and an `options` object.\r\nexport function geoJSON(geojson, options) {\r\n\treturn new GeoJSON(geojson, options);\r\n}\r\n\r\n// Backward compatibility.\r\nexport var geoJson = geoJSON;\r\n", "import {Layer} from './Layer';\r\nimport * as Util from '../core/Util';\r\nimport {toLatLngBounds} from '../geo/LatLngBounds';\r\nimport {Bounds} from '../geometry/Bounds';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class ImageOverlay\r\n * @aka L.ImageOverlay\r\n * @inherits Interactive layer\r\n *\r\n * Used to load and display a single image over specific bounds of the map. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var imageUrl = 'https://maps.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',\r\n * \timageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];\r\n * L.imageOverlay(imageUrl, imageBounds).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var ImageOverlay = Layer.extend({\r\n\r\n\t// @section\r\n\t// @aka ImageOverlay options\r\n\toptions: {\r\n\t\t// @option opacity: Number = 1.0\r\n\t\t// The opacity of the image overlay.\r\n\t\topacity: 1,\r\n\r\n\t\t// @option alt: String = ''\r\n\t\t// Text for the `alt` attribute of the image (useful for accessibility).\r\n\t\talt: '',\r\n\r\n\t\t// @option interactive: Boolean = false\r\n\t\t// If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered.\r\n\t\tinteractive: false,\r\n\r\n\t\t// @option crossOrigin: Boolean|String = false\r\n\t\t// Whether the crossOrigin attribute will be added to the image.\r\n\t\t// 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\n\t\t// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r\n\t\tcrossOrigin: false,\r\n\r\n\t\t// @option errorOverlayUrl: String = ''\r\n\t\t// URL to the overlay image to show in place of the overlay that failed to load.\r\n\t\terrorOverlayUrl: '',\r\n\r\n\t\t// @option zIndex: Number = 1\r\n\t\t// The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer.\r\n\t\tzIndex: 1,\r\n\r\n\t\t// @option className: String = ''\r\n\t\t// A custom class name to assign to the image. Empty by default.\r\n\t\tclassName: ''\r\n\t},\r\n\r\n\tinitialize: function (url, bounds, options) { // (String, LatLngBounds, Object)\r\n\t\tthis._url = url;\r\n\t\tthis._bounds = toLatLngBounds(bounds);\r\n\r\n\t\tUtil.setOptions(this, options);\r\n\t},\r\n\r\n\tonAdd: function () {\r\n\t\tif (!this._image) {\r\n\t\t\tthis._initImage();\r\n\r\n\t\t\tif (this.options.opacity < 1) {\r\n\t\t\t\tthis._updateOpacity();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.options.interactive) {\r\n\t\t\tDomUtil.addClass(this._image, 'leaflet-interactive');\r\n\t\t\tthis.addInteractiveTarget(this._image);\r\n\t\t}\r\n\r\n\t\tthis.getPane().appendChild(this._image);\r\n\t\tthis._reset();\r\n\t},\r\n\r\n\tonRemove: function () {\r\n\t\tDomUtil.remove(this._image);\r\n\t\tif (this.options.interactive) {\r\n\t\t\tthis.removeInteractiveTarget(this._image);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method setOpacity(opacity: Number): this\r\n\t// Sets the opacity of the overlay.\r\n\tsetOpacity: function (opacity) {\r\n\t\tthis.options.opacity = opacity;\r\n\r\n\t\tif (this._image) {\r\n\t\t\tthis._updateOpacity();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tsetStyle: function (styleOpts) {\r\n\t\tif (styleOpts.opacity) {\r\n\t\t\tthis.setOpacity(styleOpts.opacity);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method bringToFront(): this\r\n\t// Brings the layer to the top of all overlays.\r\n\tbringToFront: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toFront(this._image);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method bringToBack(): this\r\n\t// Brings the layer to the bottom of all overlays.\r\n\tbringToBack: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toBack(this._image);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setUrl(url: String): this\r\n\t// Changes the URL of the image.\r\n\tsetUrl: function (url) {\r\n\t\tthis._url = url;\r\n\r\n\t\tif (this._image) {\r\n\t\t\tthis._image.src = url;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setBounds(bounds: LatLngBounds): this\r\n\t// Update the bounds that this ImageOverlay covers\r\n\tsetBounds: function (bounds) {\r\n\t\tthis._bounds = toLatLngBounds(bounds);\r\n\r\n\t\tif (this._map) {\r\n\t\t\tthis._reset();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\tvar events = {\r\n\t\t\tzoom: this._reset,\r\n\t\t\tviewreset: this._reset\r\n\t\t};\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tevents.zoomanim = this._animateZoom;\r\n\t\t}\r\n\r\n\t\treturn events;\r\n\t},\r\n\r\n\t// @method setZIndex(value: Number): this\r\n\t// Changes the [zIndex](#imageoverlay-zindex) of the image overlay.\r\n\tsetZIndex: function (value) {\r\n\t\tthis.options.zIndex = value;\r\n\t\tthis._updateZIndex();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getBounds(): LatLngBounds\r\n\t// Get the bounds that this ImageOverlay covers\r\n\tgetBounds: function () {\r\n\t\treturn this._bounds;\r\n\t},\r\n\r\n\t// @method getElement(): HTMLElement\r\n\t// Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement)\r\n\t// used by this overlay.\r\n\tgetElement: function () {\r\n\t\treturn this._image;\r\n\t},\r\n\r\n\t_initImage: function () {\r\n\t\tvar wasElementSupplied = this._url.tagName === 'IMG';\r\n\t\tvar img = this._image = wasElementSupplied ? this._url : DomUtil.create('img');\r\n\r\n\t\tDomUtil.addClass(img, 'leaflet-image-layer');\r\n\t\tif (this._zoomAnimated) { DomUtil.addClass(img, 'leaflet-zoom-animated'); }\r\n\t\tif (this.options.className) { DomUtil.addClass(img, this.options.className); }\r\n\r\n\t\timg.onselectstart = Util.falseFn;\r\n\t\timg.onmousemove = Util.falseFn;\r\n\r\n\t\t// @event load: Event\r\n\t\t// Fired when the ImageOverlay layer has loaded its image\r\n\t\timg.onload = Util.bind(this.fire, this, 'load');\r\n\t\timg.onerror = Util.bind(this._overlayOnError, this, 'error');\r\n\r\n\t\tif (this.options.crossOrigin || this.options.crossOrigin === '') {\r\n\t\t\timg.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r\n\t\t}\r\n\r\n\t\tif (this.options.zIndex) {\r\n\t\t\tthis._updateZIndex();\r\n\t\t}\r\n\r\n\t\tif (wasElementSupplied) {\r\n\t\t\tthis._url = img.src;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\timg.src = this._url;\r\n\t\timg.alt = this.options.alt;\r\n\t},\r\n\r\n\t_animateZoom: function (e) {\r\n\t\tvar scale = this._map.getZoomScale(e.zoom),\r\n\t\t    offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min;\r\n\r\n\t\tDomUtil.setTransform(this._image, offset, scale);\r\n\t},\r\n\r\n\t_reset: function () {\r\n\t\tvar image = this._image,\r\n\t\t    bounds = new Bounds(\r\n\t\t        this._map.latLngToLayerPoint(this._bounds.getNorthWest()),\r\n\t\t        this._map.latLngToLayerPoint(this._bounds.getSouthEast())),\r\n\t\t    size = bounds.getSize();\r\n\r\n\t\tDomUtil.setPosition(image, bounds.min);\r\n\r\n\t\timage.style.width  = size.x + 'px';\r\n\t\timage.style.height = size.y + 'px';\r\n\t},\r\n\r\n\t_updateOpacity: function () {\r\n\t\tDomUtil.setOpacity(this._image, this.options.opacity);\r\n\t},\r\n\r\n\t_updateZIndex: function () {\r\n\t\tif (this._image && this.options.zIndex !== undefined && this.options.zIndex !== null) {\r\n\t\t\tthis._image.style.zIndex = this.options.zIndex;\r\n\t\t}\r\n\t},\r\n\r\n\t_overlayOnError: function () {\r\n\t\t// @event error: Event\r\n\t\t// Fired when the ImageOverlay layer fails to load its image\r\n\t\tthis.fire('error');\r\n\r\n\t\tvar errorUrl = this.options.errorOverlayUrl;\r\n\t\tif (errorUrl && this._url !== errorUrl) {\r\n\t\t\tthis._url = errorUrl;\r\n\t\t\tthis._image.src = errorUrl;\r\n\t\t}\r\n\t},\r\n\r\n\t// @method getCenter(): LatLng\r\n\t// Returns the center of the ImageOverlay.\r\n\tgetCenter: function () {\r\n\t\treturn this._bounds.getCenter();\r\n\t}\r\n});\r\n\r\n// @factory L.imageOverlay(imageUrl: String, bounds: LatLngBounds, options?: ImageOverlay options)\r\n// Instantiates an image overlay object given the URL of the image and the\r\n// geographical bounds it is tied to.\r\nexport var imageOverlay = function (url, bounds, options) {\r\n\treturn new ImageOverlay(url, bounds, options);\r\n};\r\n", "import {ImageOverlay} from './ImageOverlay';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport * as Util from '../core/Util';\r\n\r\n/*\r\n * @class VideoOverlay\r\n * @aka L.VideoOverlay\r\n * @inherits ImageOverlay\r\n *\r\n * Used to load and display a video player over specific bounds of the map. Extends `ImageOverlay`.\r\n *\r\n * A video overlay uses the [`<video>`](https://developer.mozilla.org/docs/Web/HTML/Element/video)\r\n * HTML5 element.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',\r\n * \tvideoBounds = [[ 32, -130], [ 13, -100]];\r\n * L.videoOverlay(videoUrl, videoBounds ).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var VideoOverlay = ImageOverlay.extend({\r\n\r\n\t// @section\r\n\t// @aka VideoOverlay options\r\n\toptions: {\r\n\t\t// @option autoplay: Boolean = true\r\n\t\t// Whether the video starts playing automatically when loaded.\r\n\t\t// On some browsers autoplay will only work with `muted: true`\r\n\t\tautoplay: true,\r\n\r\n\t\t// @option loop: Boolean = true\r\n\t\t// Whether the video will loop back to the beginning when played.\r\n\t\tloop: true,\r\n\r\n\t\t// @option keepAspectRatio: Boolean = true\r\n\t\t// Whether the video will save aspect ratio after the projection.\r\n\t\t// Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit)\r\n\t\tkeepAspectRatio: true,\r\n\r\n\t\t// @option muted: Boolean = false\r\n\t\t// Whether the video starts on mute when loaded.\r\n\t\tmuted: false,\r\n\r\n\t\t// @option playsInline: Boolean = true\r\n\t\t// Mobile browsers will play the video right where it is instead of open it up in fullscreen mode.\r\n\t\tplaysInline: true\r\n\t},\r\n\r\n\t_initImage: function () {\r\n\t\tvar wasElementSupplied = this._url.tagName === 'VIDEO';\r\n\t\tvar vid = this._image = wasElementSupplied ? this._url : DomUtil.create('video');\r\n\r\n\t\tDomUtil.addClass(vid, 'leaflet-image-layer');\r\n\t\tif (this._zoomAnimated) { DomUtil.addClass(vid, 'leaflet-zoom-animated'); }\r\n\t\tif (this.options.className) { DomUtil.addClass(vid, this.options.className); }\r\n\r\n\t\tvid.onselectstart = Util.falseFn;\r\n\t\tvid.onmousemove = Util.falseFn;\r\n\r\n\t\t// @event load: Event\r\n\t\t// Fired when the video has finished loading the first frame\r\n\t\tvid.onloadeddata = Util.bind(this.fire, this, 'load');\r\n\r\n\t\tif (wasElementSupplied) {\r\n\t\t\tvar sourceElements = vid.getElementsByTagName('source');\r\n\t\t\tvar sources = [];\r\n\t\t\tfor (var j = 0; j < sourceElements.length; j++) {\r\n\t\t\t\tsources.push(sourceElements[j].src);\r\n\t\t\t}\r\n\r\n\t\t\tthis._url = (sourceElements.length > 0) ? sources : [vid.src];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!Util.isArray(this._url)) { this._url = [this._url]; }\r\n\r\n\t\tif (!this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(vid.style, 'objectFit')) {\r\n\t\t\tvid.style['objectFit'] = 'fill';\r\n\t\t}\r\n\t\tvid.autoplay = !!this.options.autoplay;\r\n\t\tvid.loop = !!this.options.loop;\r\n\t\tvid.muted = !!this.options.muted;\r\n\t\tvid.playsInline = !!this.options.playsInline;\r\n\t\tfor (var i = 0; i < this._url.length; i++) {\r\n\t\t\tvar source = DomUtil.create('source');\r\n\t\t\tsource.src = this._url[i];\r\n\t\t\tvid.appendChild(source);\r\n\t\t}\r\n\t}\r\n\r\n\t// @method getElement(): HTMLVideoElement\r\n\t// Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement)\r\n\t// used by this overlay.\r\n});\r\n\r\n\r\n// @factory L.videoOverlay(video: String|Array|HTMLVideoElement, bounds: LatLngBounds, options?: VideoOverlay options)\r\n// Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the\r\n// geographical bounds it is tied to.\r\n\r\nexport function videoOverlay(video, bounds, options) {\r\n\treturn new VideoOverlay(video, bounds, options);\r\n}\r\n", "import {ImageOverlay} from './ImageOverlay';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as Util from '../core/Util';\n\n/*\n * @class SVGOverlay\n * @aka L.SVGOverlay\n * @inherits ImageOverlay\n *\n * Used to load, display and provide DOM access to an SVG file over specific bounds of the map. Extends `ImageOverlay`.\n *\n * An SVG overlay uses the [`<svg>`](https://developer.mozilla.org/docs/Web/SVG/Element/svg) element.\n *\n * @example\n *\n * ```js\n * var svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n * svgElement.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n * svgElement.setAttribute('viewBox', \"0 0 200 200\");\n * 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\"/>';\n * var svgElementBounds = [ [ 32, -130 ], [ 13, -100 ] ];\n * L.svgOverlay(svgElement, svgElementBounds).addTo(map);\n * ```\n */\n\nexport var SVGOverlay = ImageOverlay.extend({\n\t_initImage: function () {\n\t\tvar el = this._image = this._url;\n\n\t\tDomUtil.addClass(el, 'leaflet-image-layer');\n\t\tif (this._zoomAnimated) { DomUtil.addClass(el, 'leaflet-zoom-animated'); }\n\t\tif (this.options.className) { DomUtil.addClass(el, this.options.className); }\n\n\t\tel.onselectstart = Util.falseFn;\n\t\tel.onmousemove = Util.falseFn;\n\t}\n\n\t// @method getElement(): SVGElement\n\t// Returns the instance of [`SVGElement`](https://developer.mozilla.org/docs/Web/API/SVGElement)\n\t// used by this overlay.\n});\n\n\n// @factory L.svgOverlay(svg: String|SVGElement, bounds: LatLngBounds, options?: SVGOverlay options)\n// Instantiates an image overlay object given an SVG element and the geographical bounds it is tied to.\n// A viewBox attribute is required on the SVG element to zoom in and out properly.\n\nexport function svgOverlay(el, bounds, options) {\n\treturn new SVGOverlay(el, bounds, options);\n}\n", "import {Map} from '../map/Map';\r\nimport {Layer} from './Layer';\r\nimport {FeatureGroup} from './FeatureGroup';\r\nimport * as Util from '../core/Util';\r\nimport {toLatLng, LatLng} from '../geo/LatLng';\r\nimport {toPoint} from '../geometry/Point';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class DivOverlay\r\n * @inherits Interactive layer\r\n * @aka L.DivOverlay\r\n * Base model for L.Popup and L.Tooltip. Inherit from it for custom overlays like plugins.\r\n */\r\n\r\n// @namespace DivOverlay\r\nexport var DivOverlay = Layer.extend({\r\n\r\n\t// @section\r\n\t// @aka DivOverlay options\r\n\toptions: {\r\n\t\t// @option interactive: Boolean = false\r\n\t\t// If true, the popup/tooltip will listen to the mouse events.\r\n\t\tinteractive: false,\r\n\r\n\t\t// @option offset: Point = Point(0, 0)\r\n\t\t// The offset of the overlay position.\r\n\t\toffset: [0, 0],\r\n\r\n\t\t// @option className: String = ''\r\n\t\t// A custom CSS class name to assign to the overlay.\r\n\t\tclassName: '',\r\n\r\n\t\t// @option pane: String = undefined\r\n\t\t// `Map pane` where the overlay will be added.\r\n\t\tpane: undefined,\r\n\r\n\t\t// @option content: String|HTMLElement|Function = ''\r\n\t\t// Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be\r\n\t\t// passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay.\r\n\t\tcontent: ''\r\n\t},\r\n\r\n\tinitialize: function (options, source) {\r\n\t\tif (options && (options instanceof LatLng || Util.isArray(options))) {\r\n\t\t\tthis._latlng = toLatLng(options);\r\n\t\t\tUtil.setOptions(this, source);\r\n\t\t} else {\r\n\t\t\tUtil.setOptions(this, options);\r\n\t\t\tthis._source = source;\r\n\t\t}\r\n\t\tif (this.options.content) {\r\n\t\t\tthis._content = this.options.content;\r\n\t\t}\r\n\t},\r\n\r\n\t// @method openOn(map: Map): this\r\n\t// Adds the overlay to the map.\r\n\t// Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`.\r\n\topenOn: function (map) {\r\n\t\tmap = arguments.length ? map : this._source._map; // experimental, not the part of public api\r\n\t\tif (!map.hasLayer(this)) {\r\n\t\t\tmap.addLayer(this);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method close(): this\r\n\t// Closes the overlay.\r\n\t// Alternative to `map.closePopup(popup)`/`.closeTooltip(tooltip)`\r\n\t// and `layer.closePopup()`/`.closeTooltip()`.\r\n\tclose: function () {\r\n\t\tif (this._map) {\r\n\t\t\tthis._map.removeLayer(this);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method toggle(layer?: Layer): this\r\n\t// Opens or closes the overlay bound to layer depending on its current state.\r\n\t// Argument may be omitted only for overlay bound to layer.\r\n\t// Alternative to `layer.togglePopup()`/`.toggleTooltip()`.\r\n\ttoggle: function (layer) {\r\n\t\tif (this._map) {\r\n\t\t\tthis.close();\r\n\t\t} else {\r\n\t\t\tif (arguments.length) {\r\n\t\t\t\tthis._source = layer;\r\n\t\t\t} else {\r\n\t\t\t\tlayer = this._source;\r\n\t\t\t}\r\n\t\t\tthis._prepareOpen();\r\n\r\n\t\t\t// open the overlay on the map\r\n\t\t\tthis.openOn(layer._map);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis._zoomAnimated = map._zoomAnimated;\r\n\r\n\t\tif (!this._container) {\r\n\t\t\tthis._initLayout();\r\n\t\t}\r\n\r\n\t\tif (map._fadeAnimated) {\r\n\t\t\tDomUtil.setOpacity(this._container, 0);\r\n\t\t}\r\n\r\n\t\tclearTimeout(this._removeTimeout);\r\n\t\tthis.getPane().appendChild(this._container);\r\n\t\tthis.update();\r\n\r\n\t\tif (map._fadeAnimated) {\r\n\t\t\tDomUtil.setOpacity(this._container, 1);\r\n\t\t}\r\n\r\n\t\tthis.bringToFront();\r\n\r\n\t\tif (this.options.interactive) {\r\n\t\t\tDomUtil.addClass(this._container, 'leaflet-interactive');\r\n\t\t\tthis.addInteractiveTarget(this._container);\r\n\t\t}\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tif (map._fadeAnimated) {\r\n\t\t\tDomUtil.setOpacity(this._container, 0);\r\n\t\t\tthis._removeTimeout = setTimeout(Util.bind(DomUtil.remove, undefined, this._container), 200);\r\n\t\t} else {\r\n\t\t\tDomUtil.remove(this._container);\r\n\t\t}\r\n\r\n\t\tif (this.options.interactive) {\r\n\t\t\tDomUtil.removeClass(this._container, 'leaflet-interactive');\r\n\t\t\tthis.removeInteractiveTarget(this._container);\r\n\t\t}\r\n\t},\r\n\r\n\t// @namespace DivOverlay\r\n\t// @method getLatLng: LatLng\r\n\t// Returns the geographical point of the overlay.\r\n\tgetLatLng: function () {\r\n\t\treturn this._latlng;\r\n\t},\r\n\r\n\t// @method setLatLng(latlng: LatLng): this\r\n\t// Sets the geographical point where the overlay will open.\r\n\tsetLatLng: function (latlng) {\r\n\t\tthis._latlng = toLatLng(latlng);\r\n\t\tif (this._map) {\r\n\t\t\tthis._updatePosition();\r\n\t\t\tthis._adjustPan();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getContent: String|HTMLElement\r\n\t// Returns the content of the overlay.\r\n\tgetContent: function () {\r\n\t\treturn this._content;\r\n\t},\r\n\r\n\t// @method setContent(htmlContent: String|HTMLElement|Function): this\r\n\t// Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function.\r\n\t// The function should return a `String` or `HTMLElement` to be used in the overlay.\r\n\tsetContent: function (content) {\r\n\t\tthis._content = content;\r\n\t\tthis.update();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getElement: String|HTMLElement\r\n\t// Returns the HTML container of the overlay.\r\n\tgetElement: function () {\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\t// @method update: null\r\n\t// Updates the overlay content, layout and position. Useful for updating the overlay after something inside changed, e.g. image loaded.\r\n\tupdate: function () {\r\n\t\tif (!this._map) { return; }\r\n\r\n\t\tthis._container.style.visibility = 'hidden';\r\n\r\n\t\tthis._updateContent();\r\n\t\tthis._updateLayout();\r\n\t\tthis._updatePosition();\r\n\r\n\t\tthis._container.style.visibility = '';\r\n\r\n\t\tthis._adjustPan();\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\tvar events = {\r\n\t\t\tzoom: this._updatePosition,\r\n\t\t\tviewreset: this._updatePosition\r\n\t\t};\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tevents.zoomanim = this._animateZoom;\r\n\t\t}\r\n\t\treturn events;\r\n\t},\r\n\r\n\t// @method isOpen: Boolean\r\n\t// Returns `true` when the overlay is visible on the map.\r\n\tisOpen: function () {\r\n\t\treturn !!this._map && this._map.hasLayer(this);\r\n\t},\r\n\r\n\t// @method bringToFront: this\r\n\t// Brings this overlay in front of other overlays (in the same map pane).\r\n\tbringToFront: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toFront(this._container);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method bringToBack: this\r\n\t// Brings this overlay to the back of other overlays (in the same map pane).\r\n\tbringToBack: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toBack(this._container);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// prepare bound overlay to open: update latlng pos / content source (for FeatureGroup)\r\n\t_prepareOpen: function (latlng) {\r\n\t\tvar source = this._source;\r\n\t\tif (!source._map) { return false; }\r\n\r\n\t\tif (source instanceof FeatureGroup) {\r\n\t\t\tsource = null;\r\n\t\t\tvar layers = this._source._layers;\r\n\t\t\tfor (var id in layers) {\r\n\t\t\t\tif (layers[id]._map) {\r\n\t\t\t\t\tsource = layers[id];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!source) { return false; } // Unable to get source layer.\r\n\r\n\t\t\t// set overlay source to this layer\r\n\t\t\tthis._source = source;\r\n\t\t}\r\n\r\n\t\tif (!latlng) {\r\n\t\t\tif (source.getCenter) {\r\n\t\t\t\tlatlng = source.getCenter();\r\n\t\t\t} else if (source.getLatLng) {\r\n\t\t\t\tlatlng = source.getLatLng();\r\n\t\t\t} else if (source.getBounds) {\r\n\t\t\t\tlatlng = source.getBounds().getCenter();\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Unable to get source layer LatLng.');\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.setLatLng(latlng);\r\n\r\n\t\tif (this._map) {\r\n\t\t\t// update the overlay (content, layout, etc...)\r\n\t\t\tthis.update();\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t_updateContent: function () {\r\n\t\tif (!this._content) { return; }\r\n\r\n\t\tvar node = this._contentNode;\r\n\t\tvar content = (typeof this._content === 'function') ? this._content(this._source || this) : this._content;\r\n\r\n\t\tif (typeof content === 'string') {\r\n\t\t\tnode.innerHTML = content;\r\n\t\t} else {\r\n\t\t\twhile (node.hasChildNodes()) {\r\n\t\t\t\tnode.removeChild(node.firstChild);\r\n\t\t\t}\r\n\t\t\tnode.appendChild(content);\r\n\t\t}\r\n\r\n\t\t// @namespace DivOverlay\r\n\t\t// @section DivOverlay events\r\n\t\t// @event contentupdate: Event\r\n\t\t// Fired when the content of the overlay is updated\r\n\t\tthis.fire('contentupdate');\r\n\t},\r\n\r\n\t_updatePosition: function () {\r\n\t\tif (!this._map) { return; }\r\n\r\n\t\tvar pos = this._map.latLngToLayerPoint(this._latlng),\r\n\t\t    offset = toPoint(this.options.offset),\r\n\t\t    anchor = this._getAnchor();\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tDomUtil.setPosition(this._container, pos.add(anchor));\r\n\t\t} else {\r\n\t\t\toffset = offset.add(pos).add(anchor);\r\n\t\t}\r\n\r\n\t\tvar bottom = this._containerBottom = -offset.y,\r\n\t\t    left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;\r\n\r\n\t\t// bottom position the overlay in case the height of the overlay changes (images loading etc)\r\n\t\tthis._container.style.bottom = bottom + 'px';\r\n\t\tthis._container.style.left = left + 'px';\r\n\t},\r\n\r\n\t_getAnchor: function () {\r\n\t\treturn [0, 0];\r\n\t}\r\n\r\n});\r\n\r\nMap.include({\r\n\t_initOverlay: function (OverlayClass, content, latlng, options) {\r\n\t\tvar overlay = content;\r\n\t\tif (!(overlay instanceof OverlayClass)) {\r\n\t\t\toverlay = new OverlayClass(options).setContent(content);\r\n\t\t}\r\n\t\tif (latlng) {\r\n\t\t\toverlay.setLatLng(latlng);\r\n\t\t}\r\n\t\treturn overlay;\r\n\t}\r\n});\r\n\r\n\r\nLayer.include({\r\n\t_initOverlay: function (OverlayClass, old, content, options) {\r\n\t\tvar overlay = content;\r\n\t\tif (overlay instanceof OverlayClass) {\r\n\t\t\tUtil.setOptions(overlay, options);\r\n\t\t\toverlay._source = this;\r\n\t\t} else {\r\n\t\t\toverlay = (old && !options) ? old : new OverlayClass(options, this);\r\n\t\t\toverlay.setContent(content);\r\n\t\t}\r\n\t\treturn overlay;\r\n\t}\r\n});\r\n", "import {DivOverlay} from './DivOverlay';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport {Point, toPoint} from '../geometry/Point';\r\nimport {Map} from '../map/Map';\r\nimport {Layer} from './Layer';\r\nimport {Path} from './vector/Path';\r\nimport {FeatureGroup} from './FeatureGroup';\r\n\r\n/*\r\n * @class Popup\r\n * @inherits DivOverlay\r\n * @aka L.Popup\r\n * Used to open popups in certain places of the map. Use [Map.openPopup](#map-openpopup) to\r\n * open popups while making sure that only one popup is open at one time\r\n * (recommended for usability), or use [Map.addLayer](#map-addlayer) to open as many as you want.\r\n *\r\n * @example\r\n *\r\n * If you want to just bind a popup to marker click and then open it, it's really easy:\r\n *\r\n * ```js\r\n * marker.bindPopup(popupContent).openPopup();\r\n * ```\r\n * Path overlays like polylines also have a `bindPopup` method.\r\n *\r\n * A popup can be also standalone:\r\n *\r\n * ```js\r\n * var popup = L.popup()\r\n * \t.setLatLng(latlng)\r\n * \t.setContent('<p>Hello world!<br />This is a nice popup.</p>')\r\n * \t.openOn(map);\r\n * ```\r\n * or\r\n * ```js\r\n * var popup = L.popup(latlng, {content: '<p>Hello world!<br />This is a nice popup.</p>')\r\n * \t.openOn(map);\r\n * ```\r\n */\r\n\r\n\r\n// @namespace Popup\r\nexport var Popup = DivOverlay.extend({\r\n\r\n\t// @section\r\n\t// @aka Popup options\r\n\toptions: {\r\n\t\t// @option pane: String = 'popupPane'\r\n\t\t// `Map pane` where the popup will be added.\r\n\t\tpane: 'popupPane',\r\n\r\n\t\t// @option offset: Point = Point(0, 7)\r\n\t\t// The offset of the popup position.\r\n\t\toffset: [0, 7],\r\n\r\n\t\t// @option maxWidth: Number = 300\r\n\t\t// Max width of the popup, in pixels.\r\n\t\tmaxWidth: 300,\r\n\r\n\t\t// @option minWidth: Number = 50\r\n\t\t// Min width of the popup, in pixels.\r\n\t\tminWidth: 50,\r\n\r\n\t\t// @option maxHeight: Number = null\r\n\t\t// If set, creates a scrollable container of the given height\r\n\t\t// inside a popup if its content exceeds it.\r\n\t\t// The scrollable container can be styled using the\r\n\t\t// `leaflet-popup-scrolled` CSS class selector.\r\n\t\tmaxHeight: null,\r\n\r\n\t\t// @option autoPan: Boolean = true\r\n\t\t// Set it to `false` if you don't want the map to do panning animation\r\n\t\t// to fit the opened popup.\r\n\t\tautoPan: true,\r\n\r\n\t\t// @option autoPanPaddingTopLeft: Point = null\r\n\t\t// The margin between the popup and the top left corner of the map\r\n\t\t// view after autopanning was performed.\r\n\t\tautoPanPaddingTopLeft: null,\r\n\r\n\t\t// @option autoPanPaddingBottomRight: Point = null\r\n\t\t// The margin between the popup and the bottom right corner of the map\r\n\t\t// view after autopanning was performed.\r\n\t\tautoPanPaddingBottomRight: null,\r\n\r\n\t\t// @option autoPanPadding: Point = Point(5, 5)\r\n\t\t// Equivalent of setting both top left and bottom right autopan padding to the same value.\r\n\t\tautoPanPadding: [5, 5],\r\n\r\n\t\t// @option keepInView: Boolean = false\r\n\t\t// Set it to `true` if you want to prevent users from panning the popup\r\n\t\t// off of the screen while it is open.\r\n\t\tkeepInView: false,\r\n\r\n\t\t// @option closeButton: Boolean = true\r\n\t\t// Controls the presence of a close button in the popup.\r\n\t\tcloseButton: true,\r\n\r\n\t\t// @option autoClose: Boolean = true\r\n\t\t// Set it to `false` if you want to override the default behavior of\r\n\t\t// the popup closing when another popup is opened.\r\n\t\tautoClose: true,\r\n\r\n\t\t// @option closeOnEscapeKey: Boolean = true\r\n\t\t// Set it to `false` if you want to override the default behavior of\r\n\t\t// the ESC key for closing of the popup.\r\n\t\tcloseOnEscapeKey: true,\r\n\r\n\t\t// @option closeOnClick: Boolean = *\r\n\t\t// Set it if you want to override the default behavior of the popup closing when user clicks\r\n\t\t// on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option.\r\n\r\n\t\t// @option className: String = ''\r\n\t\t// A custom CSS class name to assign to the popup.\r\n\t\tclassName: ''\r\n\t},\r\n\r\n\t// @namespace Popup\r\n\t// @method openOn(map: Map): this\r\n\t// Alternative to `map.openPopup(popup)`.\r\n\t// Adds the popup to the map and closes the previous one.\r\n\topenOn: function (map) {\r\n\t\tmap = arguments.length ? map : this._source._map; // experimental, not the part of public api\r\n\r\n\t\tif (!map.hasLayer(this) && map._popup && map._popup.options.autoClose) {\r\n\t\t\tmap.removeLayer(map._popup);\r\n\t\t}\r\n\t\tmap._popup = this;\r\n\r\n\t\treturn DivOverlay.prototype.openOn.call(this, map);\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tDivOverlay.prototype.onAdd.call(this, map);\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Popup events\r\n\t\t// @event popupopen: PopupEvent\r\n\t\t// Fired when a popup is opened in the map\r\n\t\tmap.fire('popupopen', {popup: this});\r\n\r\n\t\tif (this._source) {\r\n\t\t\t// @namespace Layer\r\n\t\t\t// @section Popup events\r\n\t\t\t// @event popupopen: PopupEvent\r\n\t\t\t// Fired when a popup bound to this layer is opened\r\n\t\t\tthis._source.fire('popupopen', {popup: this}, true);\r\n\t\t\t// For non-path layers, we toggle the popup when clicking\r\n\t\t\t// again the layer, so prevent the map to reopen it.\r\n\t\t\tif (!(this._source instanceof Path)) {\r\n\t\t\t\tthis._source.on('preclick', DomEvent.stopPropagation);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tDivOverlay.prototype.onRemove.call(this, map);\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Popup events\r\n\t\t// @event popupclose: PopupEvent\r\n\t\t// Fired when a popup in the map is closed\r\n\t\tmap.fire('popupclose', {popup: this});\r\n\r\n\t\tif (this._source) {\r\n\t\t\t// @namespace Layer\r\n\t\t\t// @section Popup events\r\n\t\t\t// @event popupclose: PopupEvent\r\n\t\t\t// Fired when a popup bound to this layer is closed\r\n\t\t\tthis._source.fire('popupclose', {popup: this}, true);\r\n\t\t\tif (!(this._source instanceof Path)) {\r\n\t\t\t\tthis._source.off('preclick', DomEvent.stopPropagation);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\tvar events = DivOverlay.prototype.getEvents.call(this);\r\n\r\n\t\tif (this.options.closeOnClick !== undefined ? this.options.closeOnClick : this._map.options.closePopupOnClick) {\r\n\t\t\tevents.preclick = this.close;\r\n\t\t}\r\n\r\n\t\tif (this.options.keepInView) {\r\n\t\t\tevents.moveend = this._adjustPan;\r\n\t\t}\r\n\r\n\t\treturn events;\r\n\t},\r\n\r\n\t_initLayout: function () {\r\n\t\tvar prefix = 'leaflet-popup',\r\n\t\t    container = this._container = DomUtil.create('div',\r\n\t\t\tprefix + ' ' + (this.options.className || '') +\r\n\t\t\t' leaflet-zoom-animated');\r\n\r\n\t\tvar wrapper = this._wrapper = DomUtil.create('div', prefix + '-content-wrapper', container);\r\n\t\tthis._contentNode = DomUtil.create('div', prefix + '-content', wrapper);\r\n\r\n\t\tDomEvent.disableClickPropagation(container);\r\n\t\tDomEvent.disableScrollPropagation(this._contentNode);\r\n\t\tDomEvent.on(container, 'contextmenu', DomEvent.stopPropagation);\r\n\r\n\t\tthis._tipContainer = DomUtil.create('div', prefix + '-tip-container', container);\r\n\t\tthis._tip = DomUtil.create('div', prefix + '-tip', this._tipContainer);\r\n\r\n\t\tif (this.options.closeButton) {\r\n\t\t\tvar closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container);\r\n\t\t\tcloseButton.setAttribute('role', 'button'); // overrides the implicit role=link of <a> elements #7399\r\n\t\t\tcloseButton.setAttribute('aria-label', 'Close popup');\r\n\t\t\tcloseButton.href = '#close';\r\n\t\t\tcloseButton.innerHTML = '<span aria-hidden=\"true\">&#215;</span>';\r\n\r\n\t\t\tDomEvent.on(closeButton, 'click', function (ev) {\r\n\t\t\t\tDomEvent.preventDefault(ev);\r\n\t\t\t\tthis.close();\r\n\t\t\t}, this);\r\n\t\t}\r\n\t},\r\n\r\n\t_updateLayout: function () {\r\n\t\tvar container = this._contentNode,\r\n\t\t    style = container.style;\r\n\r\n\t\tstyle.width = '';\r\n\t\tstyle.whiteSpace = 'nowrap';\r\n\r\n\t\tvar width = container.offsetWidth;\r\n\t\twidth = Math.min(width, this.options.maxWidth);\r\n\t\twidth = Math.max(width, this.options.minWidth);\r\n\r\n\t\tstyle.width = (width + 1) + 'px';\r\n\t\tstyle.whiteSpace = '';\r\n\r\n\t\tstyle.height = '';\r\n\r\n\t\tvar height = container.offsetHeight,\r\n\t\t    maxHeight = this.options.maxHeight,\r\n\t\t    scrolledClass = 'leaflet-popup-scrolled';\r\n\r\n\t\tif (maxHeight && height > maxHeight) {\r\n\t\t\tstyle.height = maxHeight + 'px';\r\n\t\t\tDomUtil.addClass(container, scrolledClass);\r\n\t\t} else {\r\n\t\t\tDomUtil.removeClass(container, scrolledClass);\r\n\t\t}\r\n\r\n\t\tthis._containerWidth = this._container.offsetWidth;\r\n\t},\r\n\r\n\t_animateZoom: function (e) {\r\n\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),\r\n\t\t    anchor = this._getAnchor();\r\n\t\tDomUtil.setPosition(this._container, pos.add(anchor));\r\n\t},\r\n\r\n\t_adjustPan: function () {\r\n\t\tif (!this.options.autoPan) { return; }\r\n\t\tif (this._map._panAnim) { this._map._panAnim.stop(); }\r\n\r\n\t\t// We can endlessly recurse if keepInView is set and the view resets.\r\n\t\t// Let's guard against that by exiting early if we're responding to our own autopan.\r\n\t\tif (this._autopanning) {\r\n\t\t\tthis._autopanning = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar map = this._map,\r\n\t\t    marginBottom = parseInt(DomUtil.getStyle(this._container, 'marginBottom'), 10) || 0,\r\n\t\t    containerHeight = this._container.offsetHeight + marginBottom,\r\n\t\t    containerWidth = this._containerWidth,\r\n\t\t    layerPos = new Point(this._containerLeft, -containerHeight - this._containerBottom);\r\n\r\n\t\tlayerPos._add(DomUtil.getPosition(this._container));\r\n\r\n\t\tvar containerPos = map.layerPointToContainerPoint(layerPos),\r\n\t\t    padding = toPoint(this.options.autoPanPadding),\r\n\t\t    paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding),\r\n\t\t    paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding),\r\n\t\t    size = map.getSize(),\r\n\t\t    dx = 0,\r\n\t\t    dy = 0;\r\n\r\n\t\tif (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\r\n\t\t\tdx = containerPos.x + containerWidth - size.x + paddingBR.x;\r\n\t\t}\r\n\t\tif (containerPos.x - dx - paddingTL.x < 0) { // left\r\n\t\t\tdx = containerPos.x - paddingTL.x;\r\n\t\t}\r\n\t\tif (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\r\n\t\t\tdy = containerPos.y + containerHeight - size.y + paddingBR.y;\r\n\t\t}\r\n\t\tif (containerPos.y - dy - paddingTL.y < 0) { // top\r\n\t\t\tdy = containerPos.y - paddingTL.y;\r\n\t\t}\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Popup events\r\n\t\t// @event autopanstart: Event\r\n\t\t// Fired when the map starts autopanning when opening a popup.\r\n\t\tif (dx || dy) {\r\n\t\t\t// Track that we're autopanning, as this function will be re-ran on moveend\r\n\t\t\tif (this.options.keepInView) {\r\n\t\t\t\tthis._autopanning = true;\r\n\t\t\t}\r\n\r\n\t\t\tmap\r\n\t\t\t    .fire('autopanstart')\r\n\t\t\t    .panBy([dx, dy]);\r\n\t\t}\r\n\t},\r\n\r\n\t_getAnchor: function () {\r\n\t\t// Where should we anchor the popup on the source layer?\r\n\t\treturn toPoint(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]);\r\n\t}\r\n\r\n});\r\n\r\n// @namespace Popup\r\n// @factory L.popup(options?: Popup options, source?: Layer)\r\n// 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\n// @alternative\r\n// @factory L.popup(latlng: LatLng, options?: Popup options)\r\n// Instantiates a `Popup` object given `latlng` where the popup will open and an optional `options` object that describes its appearance and location.\r\nexport var popup = function (options, source) {\r\n\treturn new Popup(options, source);\r\n};\r\n\r\n\r\n/* @namespace Map\r\n * @section Interaction Options\r\n * @option closePopupOnClick: Boolean = true\r\n * Set it to `false` if you don't want popups to close when user clicks the map.\r\n */\r\nMap.mergeOptions({\r\n\tclosePopupOnClick: true\r\n});\r\n\r\n\r\n// @namespace Map\r\n// @section Methods for Layers and Controls\r\nMap.include({\r\n\t// @method openPopup(popup: Popup): this\r\n\t// Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).\r\n\t// @alternative\r\n\t// @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this\r\n\t// Creates a popup with the specified content and options and opens it in the given point on a map.\r\n\topenPopup: function (popup, latlng, options) {\r\n\t\tthis._initOverlay(Popup, popup, latlng, options)\r\n\t\t  .openOn(this);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method closePopup(popup?: Popup): this\r\n\t// Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one).\r\n\tclosePopup: function (popup) {\r\n\t\tpopup = arguments.length ? popup : this._popup;\r\n\t\tif (popup) {\r\n\t\t\tpopup.close();\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n/*\r\n * @namespace Layer\r\n * @section Popup methods example\r\n *\r\n * All layers share a set of methods convenient for binding popups to it.\r\n *\r\n * ```js\r\n * var layer = L.Polygon(latlngs).bindPopup('Hi There!').addTo(map);\r\n * layer.openPopup();\r\n * layer.closePopup();\r\n * ```\r\n *\r\n * 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\n */\r\n\r\n// @section Popup methods\r\nLayer.include({\r\n\r\n\t// @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this\r\n\t// Binds a popup to the layer with the passed `content` and sets up the\r\n\t// necessary event listeners. If a `Function` is passed it will receive\r\n\t// the layer as the first argument and should return a `String` or `HTMLElement`.\r\n\tbindPopup: function (content, options) {\r\n\t\tthis._popup = this._initOverlay(Popup, this._popup, content, options);\r\n\t\tif (!this._popupHandlersAdded) {\r\n\t\t\tthis.on({\r\n\t\t\t\tclick: this._openPopup,\r\n\t\t\t\tkeypress: this._onKeyPress,\r\n\t\t\t\tremove: this.closePopup,\r\n\t\t\t\tmove: this._movePopup\r\n\t\t\t});\r\n\t\t\tthis._popupHandlersAdded = true;\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method unbindPopup(): this\r\n\t// Removes the popup previously bound with `bindPopup`.\r\n\tunbindPopup: function () {\r\n\t\tif (this._popup) {\r\n\t\t\tthis.off({\r\n\t\t\t\tclick: this._openPopup,\r\n\t\t\t\tkeypress: this._onKeyPress,\r\n\t\t\t\tremove: this.closePopup,\r\n\t\t\t\tmove: this._movePopup\r\n\t\t\t});\r\n\t\t\tthis._popupHandlersAdded = false;\r\n\t\t\tthis._popup = null;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method openPopup(latlng?: LatLng): this\r\n\t// Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.\r\n\topenPopup: function (latlng) {\r\n\t\tif (this._popup) {\r\n\t\t\tif (!(this instanceof FeatureGroup)) {\r\n\t\t\t\tthis._popup._source = this;\r\n\t\t\t}\r\n\t\t\tif (this._popup._prepareOpen(latlng || this._latlng)) {\r\n\t\t\t\t// open the popup on the map\r\n\t\t\t\tthis._popup.openOn(this._map);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method closePopup(): this\r\n\t// Closes the popup bound to this layer if it is open.\r\n\tclosePopup: function () {\r\n\t\tif (this._popup) {\r\n\t\t\tthis._popup.close();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method togglePopup(): this\r\n\t// Opens or closes the popup bound to this layer depending on its current state.\r\n\ttogglePopup: function () {\r\n\t\tif (this._popup) {\r\n\t\t\tthis._popup.toggle(this);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method isPopupOpen(): boolean\r\n\t// Returns `true` if the popup bound to this layer is currently open.\r\n\tisPopupOpen: function () {\r\n\t\treturn (this._popup ? this._popup.isOpen() : false);\r\n\t},\r\n\r\n\t// @method setPopupContent(content: String|HTMLElement|Popup): this\r\n\t// Sets the content of the popup bound to this layer.\r\n\tsetPopupContent: function (content) {\r\n\t\tif (this._popup) {\r\n\t\t\tthis._popup.setContent(content);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getPopup(): Popup\r\n\t// Returns the popup bound to this layer.\r\n\tgetPopup: function () {\r\n\t\treturn this._popup;\r\n\t},\r\n\r\n\t_openPopup: function (e) {\r\n\t\tif (!this._popup || !this._map) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// prevent map click\r\n\t\tDomEvent.stop(e);\r\n\r\n\t\tvar target = e.layer || e.target;\r\n\t\tif (this._popup._source === target && !(target instanceof Path)) {\r\n\t\t\t// treat it like a marker and figure out\r\n\t\t\t// if we should toggle it open/closed\r\n\t\t\tif (this._map.hasLayer(this._popup)) {\r\n\t\t\t\tthis.closePopup();\r\n\t\t\t} else {\r\n\t\t\t\tthis.openPopup(e.latlng);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._popup._source = target;\r\n\t\tthis.openPopup(e.latlng);\r\n\t},\r\n\r\n\t_movePopup: function (e) {\r\n\t\tthis._popup.setLatLng(e.latlng);\r\n\t},\r\n\r\n\t_onKeyPress: function (e) {\r\n\t\tif (e.originalEvent.keyCode === 13) {\r\n\t\t\tthis._openPopup(e);\r\n\t\t}\r\n\t}\r\n});\r\n", "import {DivOverlay} from './DivOverlay';\nimport {toPoint} from '../geometry/Point';\nimport {Map} from '../map/Map';\nimport {Layer} from './Layer';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\nimport * as Util from '../core/Util';\nimport {FeatureGroup} from './FeatureGroup';\n\n/*\n * @class Tooltip\n * @inherits DivOverlay\n * @aka L.Tooltip\n * Used to display small texts on top of map layers.\n *\n * @example\n * If you want to just bind a tooltip to marker:\n *\n * ```js\n * marker.bindTooltip(\"my tooltip text\").openTooltip();\n * ```\n * Path overlays like polylines also have a `bindTooltip` method.\n *\n * A tooltip can be also standalone:\n *\n * ```js\n * var tooltip = L.tooltip()\n * \t.setLatLng(latlng)\n * \t.setContent('Hello world!<br />This is a nice tooltip.')\n * \t.addTo(map);\n * ```\n * or\n * ```js\n * var tooltip = L.tooltip(latlng, {content: 'Hello world!<br />This is a nice tooltip.'})\n * \t.addTo(map);\n * ```\n *\n *\n * Note about tooltip offset. Leaflet takes two options in consideration\n * for computing tooltip offsetting:\n * - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.\n *   Add a positive x offset to move the tooltip to the right, and a positive y offset to\n *   move it to the bottom. Negatives will move to the left and top.\n * - the `tooltipAnchor` Icon option: this will only be considered for Marker. You\n *   should adapt this value if you use a custom icon.\n */\n\n\n// @namespace Tooltip\nexport var Tooltip = DivOverlay.extend({\n\n\t// @section\n\t// @aka Tooltip options\n\toptions: {\n\t\t// @option pane: String = 'tooltipPane'\n\t\t// `Map pane` where the tooltip will be added.\n\t\tpane: 'tooltipPane',\n\n\t\t// @option offset: Point = Point(0, 0)\n\t\t// Optional offset of the tooltip position.\n\t\toffset: [0, 0],\n\n\t\t// @option direction: String = 'auto'\n\t\t// Direction where to open the tooltip. Possible values are: `right`, `left`,\n\t\t// `top`, `bottom`, `center`, `auto`.\n\t\t// `auto` will dynamically switch between `right` and `left` according to the tooltip\n\t\t// position on the map.\n\t\tdirection: 'auto',\n\n\t\t// @option permanent: Boolean = false\n\t\t// Whether to open the tooltip permanently or only on mouseover.\n\t\tpermanent: false,\n\n\t\t// @option sticky: Boolean = false\n\t\t// If true, the tooltip will follow the mouse instead of being fixed at the feature center.\n\t\tsticky: false,\n\n\t\t// @option opacity: Number = 0.9\n\t\t// Tooltip container opacity.\n\t\topacity: 0.9\n\t},\n\n\tonAdd: function (map) {\n\t\tDivOverlay.prototype.onAdd.call(this, map);\n\t\tthis.setOpacity(this.options.opacity);\n\n\t\t// @namespace Map\n\t\t// @section Tooltip events\n\t\t// @event tooltipopen: TooltipEvent\n\t\t// Fired when a tooltip is opened in the map.\n\t\tmap.fire('tooltipopen', {tooltip: this});\n\n\t\tif (this._source) {\n\t\t\tthis.addEventParent(this._source);\n\n\t\t\t// @namespace Layer\n\t\t\t// @section Tooltip events\n\t\t\t// @event tooltipopen: TooltipEvent\n\t\t\t// Fired when a tooltip bound to this layer is opened.\n\t\t\tthis._source.fire('tooltipopen', {tooltip: this}, true);\n\t\t}\n\t},\n\n\tonRemove: function (map) {\n\t\tDivOverlay.prototype.onRemove.call(this, map);\n\n\t\t// @namespace Map\n\t\t// @section Tooltip events\n\t\t// @event tooltipclose: TooltipEvent\n\t\t// Fired when a tooltip in the map is closed.\n\t\tmap.fire('tooltipclose', {tooltip: this});\n\n\t\tif (this._source) {\n\t\t\tthis.removeEventParent(this._source);\n\n\t\t\t// @namespace Layer\n\t\t\t// @section Tooltip events\n\t\t\t// @event tooltipclose: TooltipEvent\n\t\t\t// Fired when a tooltip bound to this layer is closed.\n\t\t\tthis._source.fire('tooltipclose', {tooltip: this}, true);\n\t\t}\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = DivOverlay.prototype.getEvents.call(this);\n\n\t\tif (!this.options.permanent) {\n\t\t\tevents.preclick = this.close;\n\t\t}\n\n\t\treturn events;\n\t},\n\n\t_initLayout: function () {\n\t\tvar prefix = 'leaflet-tooltip',\n\t\t    className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');\n\n\t\tthis._contentNode = this._container = DomUtil.create('div', className);\n\n\t\tthis._container.setAttribute('role', 'tooltip');\n\t\tthis._container.setAttribute('id', 'leaflet-tooltip-' + Util.stamp(this));\n\t},\n\n\t_updateLayout: function () {},\n\n\t_adjustPan: function () {},\n\n\t_setPosition: function (pos) {\n\t\tvar subX, subY,\n\t\t    map = this._map,\n\t\t    container = this._container,\n\t\t    centerPoint = map.latLngToContainerPoint(map.getCenter()),\n\t\t    tooltipPoint = map.layerPointToContainerPoint(pos),\n\t\t    direction = this.options.direction,\n\t\t    tooltipWidth = container.offsetWidth,\n\t\t    tooltipHeight = container.offsetHeight,\n\t\t    offset = toPoint(this.options.offset),\n\t\t    anchor = this._getAnchor();\n\n\t\tif (direction === 'top') {\n\t\t\tsubX = tooltipWidth / 2;\n\t\t\tsubY = tooltipHeight;\n\t\t} else if (direction === 'bottom') {\n\t\t\tsubX = tooltipWidth / 2;\n\t\t\tsubY = 0;\n\t\t} else if (direction === 'center') {\n\t\t\tsubX = tooltipWidth / 2;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else if (direction === 'right') {\n\t\t\tsubX = 0;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else if (direction === 'left') {\n\t\t\tsubX = tooltipWidth;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else if (tooltipPoint.x < centerPoint.x) {\n\t\t\tdirection = 'right';\n\t\t\tsubX = 0;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else {\n\t\t\tdirection = 'left';\n\t\t\tsubX = tooltipWidth + (offset.x + anchor.x) * 2;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t}\n\n\t\tpos = pos.subtract(toPoint(subX, subY, true)).add(offset).add(anchor);\n\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-right');\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-left');\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-top');\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-bottom');\n\t\tDomUtil.addClass(container, 'leaflet-tooltip-' + direction);\n\t\tDomUtil.setPosition(container, pos);\n\t},\n\n\t_updatePosition: function () {\n\t\tvar pos = this._map.latLngToLayerPoint(this._latlng);\n\t\tthis._setPosition(pos);\n\t},\n\n\tsetOpacity: function (opacity) {\n\t\tthis.options.opacity = opacity;\n\n\t\tif (this._container) {\n\t\t\tDomUtil.setOpacity(this._container, opacity);\n\t\t}\n\t},\n\n\t_animateZoom: function (e) {\n\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);\n\t\tthis._setPosition(pos);\n\t},\n\n\t_getAnchor: function () {\n\t\t// Where should we anchor the tooltip on the source layer?\n\t\treturn toPoint(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]);\n\t}\n\n});\n\n// @namespace Tooltip\n// @factory L.tooltip(options?: Tooltip options, source?: Layer)\n// 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.\n// @alternative\n// @factory L.tooltip(latlng: LatLng, options?: Tooltip options)\n// Instantiates a `Tooltip` object given `latlng` where the tooltip will open and an optional `options` object that describes its appearance and location.\nexport var tooltip = function (options, source) {\n\treturn new Tooltip(options, source);\n};\n\n// @namespace Map\n// @section Methods for Layers and Controls\nMap.include({\n\n\t// @method openTooltip(tooltip: Tooltip): this\n\t// Opens the specified tooltip.\n\t// @alternative\n\t// @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this\n\t// Creates a tooltip with the specified content and options and open it.\n\topenTooltip: function (tooltip, latlng, options) {\n\t\tthis._initOverlay(Tooltip, tooltip, latlng, options)\n\t\t  .openOn(this);\n\n\t\treturn this;\n\t},\n\n\t// @method closeTooltip(tooltip: Tooltip): this\n\t// Closes the tooltip given as parameter.\n\tcloseTooltip: function (tooltip) {\n\t\ttooltip.close();\n\t\treturn this;\n\t}\n\n});\n\n/*\n * @namespace Layer\n * @section Tooltip methods example\n *\n * All layers share a set of methods convenient for binding tooltips to it.\n *\n * ```js\n * var layer = L.Polygon(latlngs).bindTooltip('Hi There!').addTo(map);\n * layer.openTooltip();\n * layer.closeTooltip();\n * ```\n */\n\n// @section Tooltip methods\nLayer.include({\n\n\t// @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this\n\t// Binds a tooltip to the layer with the passed `content` and sets up the\n\t// necessary event listeners. If a `Function` is passed it will receive\n\t// the layer as the first argument and should return a `String` or `HTMLElement`.\n\tbindTooltip: function (content, options) {\n\n\t\tif (this._tooltip && this.isTooltipOpen()) {\n\t\t\tthis.unbindTooltip();\n\t\t}\n\n\t\tthis._tooltip = this._initOverlay(Tooltip, this._tooltip, content, options);\n\t\tthis._initTooltipInteractions();\n\n\t\tif (this._tooltip.options.permanent && this._map && this._map.hasLayer(this)) {\n\t\t\tthis.openTooltip();\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t// @method unbindTooltip(): this\n\t// Removes the tooltip previously bound with `bindTooltip`.\n\tunbindTooltip: function () {\n\t\tif (this._tooltip) {\n\t\t\tthis._initTooltipInteractions(true);\n\t\t\tthis.closeTooltip();\n\t\t\tthis._tooltip = null;\n\t\t}\n\t\treturn this;\n\t},\n\n\t_initTooltipInteractions: function (remove) {\n\t\tif (!remove && this._tooltipHandlersAdded) { return; }\n\t\tvar onOff = remove ? 'off' : 'on',\n\t\t    events = {\n\t\t\tremove: this.closeTooltip,\n\t\t\tmove: this._moveTooltip\n\t\t    };\n\t\tif (!this._tooltip.options.permanent) {\n\t\t\tevents.mouseover = this._openTooltip;\n\t\t\tevents.mouseout = this.closeTooltip;\n\t\t\tevents.click = this._openTooltip;\n\t\t\tif (this._map) {\n\t\t\t\tthis._addFocusListeners();\n\t\t\t} else {\n\t\t\t\tevents.add = this._addFocusListeners;\n\t\t\t}\n\t\t} else {\n\t\t\tevents.add = this._openTooltip;\n\t\t}\n\t\tif (this._tooltip.options.sticky) {\n\t\t\tevents.mousemove = this._moveTooltip;\n\t\t}\n\t\tthis[onOff](events);\n\t\tthis._tooltipHandlersAdded = !remove;\n\t},\n\n\t// @method openTooltip(latlng?: LatLng): this\n\t// Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed.\n\topenTooltip: function (latlng) {\n\t\tif (this._tooltip) {\n\t\t\tif (!(this instanceof FeatureGroup)) {\n\t\t\t\tthis._tooltip._source = this;\n\t\t\t}\n\t\t\tif (this._tooltip._prepareOpen(latlng)) {\n\t\t\t\t// open the tooltip on the map\n\t\t\t\tthis._tooltip.openOn(this._map);\n\n\t\t\t\tif (this.getElement) {\n\t\t\t\t\tthis._setAriaDescribedByOnLayer(this);\n\t\t\t\t} else if (this.eachLayer) {\n\t\t\t\t\tthis.eachLayer(this._setAriaDescribedByOnLayer, this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method closeTooltip(): this\n\t// Closes the tooltip bound to this layer if it is open.\n\tcloseTooltip: function () {\n\t\tif (this._tooltip) {\n\t\t\treturn this._tooltip.close();\n\t\t}\n\t},\n\n\t// @method toggleTooltip(): this\n\t// Opens or closes the tooltip bound to this layer depending on its current state.\n\ttoggleTooltip: function () {\n\t\tif (this._tooltip) {\n\t\t\tthis._tooltip.toggle(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method isTooltipOpen(): boolean\n\t// Returns `true` if the tooltip bound to this layer is currently open.\n\tisTooltipOpen: function () {\n\t\treturn this._tooltip.isOpen();\n\t},\n\n\t// @method setTooltipContent(content: String|HTMLElement|Tooltip): this\n\t// Sets the content of the tooltip bound to this layer.\n\tsetTooltipContent: function (content) {\n\t\tif (this._tooltip) {\n\t\t\tthis._tooltip.setContent(content);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method getTooltip(): Tooltip\n\t// Returns the tooltip bound to this layer.\n\tgetTooltip: function () {\n\t\treturn this._tooltip;\n\t},\n\n\t_addFocusListeners: function () {\n\t\tif (this.getElement) {\n\t\t\tthis._addFocusListenersOnLayer(this);\n\t\t} else if (this.eachLayer) {\n\t\t\tthis.eachLayer(this._addFocusListenersOnLayer, this);\n\t\t}\n\t},\n\n\t_addFocusListenersOnLayer: function (layer) {\n\t\tvar el = typeof layer.getElement === 'function' && layer.getElement();\n\t\tif (el) {\n\t\t\tDomEvent.on(el, 'focus', function () {\n\t\t\t\tthis._tooltip._source = layer;\n\t\t\t\tthis.openTooltip();\n\t\t\t}, this);\n\t\t\tDomEvent.on(el, 'blur', this.closeTooltip, this);\n\t\t}\n\t},\n\n\t_setAriaDescribedByOnLayer: function (layer) {\n\t\tvar el = typeof layer.getElement === 'function' && layer.getElement();\n\t\tif (el) {\n\t\t\tel.setAttribute('aria-describedby', this._tooltip._container.id);\n\t\t}\n\t},\n\n\n\t_openTooltip: function (e) {\n\t\tif (!this._tooltip || !this._map) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the map is moving, we will show the tooltip after it's done.\n\t\tif (this._map.dragging && this._map.dragging.moving() && !this._openOnceFlag) {\n\t\t\tthis._openOnceFlag = true;\n\t\t\tvar that = this;\n\t\t\tthis._map.once('moveend', function () {\n\t\t\t\tthat._openOnceFlag = false;\n\t\t\t\tthat._openTooltip(e);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tooltip._source = e.layer || e.target;\n\n\t\tthis.openTooltip(this._tooltip.options.sticky ? e.latlng : undefined);\n\t},\n\n\t_moveTooltip: function (e) {\n\t\tvar latlng = e.latlng, containerPoint, layerPoint;\n\t\tif (this._tooltip.options.sticky && e.originalEvent) {\n\t\t\tcontainerPoint = this._map.mouseEventToContainerPoint(e.originalEvent);\n\t\t\tlayerPoint = this._map.containerPointToLayerPoint(containerPoint);\n\t\t\tlatlng = this._map.layerPointToLatLng(layerPoint);\n\t\t}\n\t\tthis._tooltip.setLatLng(latlng);\n\t}\n});\n", "import {Icon} from './Icon';\nimport {toPoint as point} from '../../geometry/Point';\nimport {empty} from '../../dom/DomUtil';\n\n/*\n * @class DivIcon\n * @aka L.DivIcon\n * @inherits Icon\n *\n * Represents a lightweight icon for markers that uses a simple `<div>`\n * element instead of an image. Inherits from `Icon` but ignores the `iconUrl` and shadow options.\n *\n * @example\n * ```js\n * var myIcon = L.divIcon({className: 'my-div-icon'});\n * // you can set .my-div-icon styles in CSS\n *\n * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);\n * ```\n *\n * By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.\n */\n\nexport var DivIcon = Icon.extend({\n\toptions: {\n\t\t// @section\n\t\t// @aka DivIcon options\n\t\ticonSize: [12, 12], // also can be set through CSS\n\n\t\t// iconAnchor: (Point),\n\t\t// popupAnchor: (Point),\n\n\t\t// @option html: String|HTMLElement = ''\n\t\t// Custom HTML code to put inside the div element, empty by default. Alternatively,\n\t\t// an instance of `HTMLElement`.\n\t\thtml: false,\n\n\t\t// @option bgPos: Point = [0, 0]\n\t\t// Optional relative position of the background, in pixels\n\t\tbgPos: null,\n\n\t\tclassName: 'leaflet-div-icon'\n\t},\n\n\tcreateIcon: function (oldIcon) {\n\t\tvar div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'),\n\t\t    options = this.options;\n\n\t\tif (options.html instanceof Element) {\n\t\t\tempty(div);\n\t\t\tdiv.appendChild(options.html);\n\t\t} else {\n\t\t\tdiv.innerHTML = options.html !== false ? options.html : '';\n\t\t}\n\n\t\tif (options.bgPos) {\n\t\t\tvar bgPos = point(options.bgPos);\n\t\t\tdiv.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px';\n\t\t}\n\t\tthis._setIconStyles(div, 'icon');\n\n\t\treturn div;\n\t},\n\n\tcreateShadow: function () {\n\t\treturn null;\n\t}\n});\n\n// @factory L.divIcon(options: DivIcon options)\n// Creates a `DivIcon` instance with the given options.\nexport function divIcon(options) {\n\treturn new DivIcon(options);\n}\n", "import {Icon} from './Icon';\nexport {icon} from './Icon';\nimport {IconDefault} from './Icon.Default';\nIcon.Default = IconDefault;\nexport {Icon};\n\nexport {DivIcon, divIcon} from './DivIcon';\nexport {Marker, marker} from './Marker';\n", "import {Layer} from '../Layer';\nimport Browser from '../../core/Browser';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport {Point} from '../../geometry/Point';\nimport {Bounds} from '../../geometry/Bounds';\nimport {LatLngBounds, toLatLngBounds as latLngBounds} from '../../geo/LatLngBounds';\n\n/*\n * @class GridLayer\n * @inherits Layer\n * @aka L.GridLayer\n *\n * Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces `TileLayer.Canvas`.\n * 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.\n *\n *\n * @section Synchronous usage\n * @example\n *\n * 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.\n *\n * ```js\n * var CanvasLayer = L.GridLayer.extend({\n *     createTile: function(coords){\n *         // create a <canvas> element for drawing\n *         var tile = L.DomUtil.create('canvas', 'leaflet-tile');\n *\n *         // setup tile width and height according to the options\n *         var size = this.getTileSize();\n *         tile.width = size.x;\n *         tile.height = size.y;\n *\n *         // get a canvas context and draw something on it using coords.x, coords.y and coords.z\n *         var ctx = tile.getContext('2d');\n *\n *         // return the tile so it can be rendered on screen\n *         return tile;\n *     }\n * });\n * ```\n *\n * @section Asynchronous usage\n * @example\n *\n * 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.\n *\n * ```js\n * var CanvasLayer = L.GridLayer.extend({\n *     createTile: function(coords, done){\n *         var error;\n *\n *         // create a <canvas> element for drawing\n *         var tile = L.DomUtil.create('canvas', 'leaflet-tile');\n *\n *         // setup tile width and height according to the options\n *         var size = this.getTileSize();\n *         tile.width = size.x;\n *         tile.height = size.y;\n *\n *         // draw something asynchronously and pass the tile to the done() callback\n *         setTimeout(function() {\n *             done(error, tile);\n *         }, 1000);\n *\n *         return tile;\n *     }\n * });\n * ```\n *\n * @section\n */\n\n\nexport var GridLayer = Layer.extend({\n\n\t// @section\n\t// @aka GridLayer options\n\toptions: {\n\t\t// @option tileSize: Number|Point = 256\n\t\t// Width and height of tiles in the grid. Use a number if width and height are equal, or `L.point(width, height)` otherwise.\n\t\ttileSize: 256,\n\n\t\t// @option opacity: Number = 1.0\n\t\t// Opacity of the tiles. Can be used in the `createTile()` function.\n\t\topacity: 1,\n\n\t\t// @option updateWhenIdle: Boolean = (depends)\n\t\t// Load new tiles only when panning ends.\n\t\t// `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.\n\t\t// `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the\n\t\t// [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers.\n\t\tupdateWhenIdle: Browser.mobile,\n\n\t\t// @option updateWhenZooming: Boolean = true\n\t\t// 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.\n\t\tupdateWhenZooming: true,\n\n\t\t// @option updateInterval: Number = 200\n\t\t// Tiles will not update more than once every `updateInterval` milliseconds when panning.\n\t\tupdateInterval: 200,\n\n\t\t// @option zIndex: Number = 1\n\t\t// The explicit zIndex of the tile layer.\n\t\tzIndex: 1,\n\n\t\t// @option bounds: LatLngBounds = undefined\n\t\t// If set, tiles will only be loaded inside the set `LatLngBounds`.\n\t\tbounds: null,\n\n\t\t// @option minZoom: Number = 0\n\t\t// The minimum zoom level down to which this layer will be displayed (inclusive).\n\t\tminZoom: 0,\n\n\t\t// @option maxZoom: Number = undefined\n\t\t// The maximum zoom level up to which this layer will be displayed (inclusive).\n\t\tmaxZoom: undefined,\n\n\t\t// @option maxNativeZoom: Number = undefined\n\t\t// Maximum zoom number the tile source has available. If it is specified,\n\t\t// the tiles on all zoom levels higher than `maxNativeZoom` will be loaded\n\t\t// from `maxNativeZoom` level and auto-scaled.\n\t\tmaxNativeZoom: undefined,\n\n\t\t// @option minNativeZoom: Number = undefined\n\t\t// Minimum zoom number the tile source has available. If it is specified,\n\t\t// the tiles on all zoom levels lower than `minNativeZoom` will be loaded\n\t\t// from `minNativeZoom` level and auto-scaled.\n\t\tminNativeZoom: undefined,\n\n\t\t// @option noWrap: Boolean = false\n\t\t// Whether the layer is wrapped around the antimeridian. If `true`, the\n\t\t// GridLayer will only be displayed once at low zoom levels. Has no\n\t\t// effect when the [map CRS](#map-crs) doesn't wrap around. Can be used\n\t\t// in combination with [`bounds`](#gridlayer-bounds) to prevent requesting\n\t\t// tiles outside the CRS limits.\n\t\tnoWrap: false,\n\n\t\t// @option pane: String = 'tilePane'\n\t\t// `Map pane` where the grid layer will be added.\n\t\tpane: 'tilePane',\n\n\t\t// @option className: String = ''\n\t\t// A custom class name to assign to the tile layer. Empty by default.\n\t\tclassName: '',\n\n\t\t// @option keepBuffer: Number = 2\n\t\t// When panning the map, keep this many rows and columns of tiles before unloading them.\n\t\tkeepBuffer: 2\n\t},\n\n\tinitialize: function (options) {\n\t\tUtil.setOptions(this, options);\n\t},\n\n\tonAdd: function () {\n\t\tthis._initContainer();\n\n\t\tthis._levels = {};\n\t\tthis._tiles = {};\n\n\t\tthis._resetView(); // implicit _update() call\n\t},\n\n\tbeforeAdd: function (map) {\n\t\tmap._addZoomLimit(this);\n\t},\n\n\tonRemove: function (map) {\n\t\tthis._removeAllTiles();\n\t\tDomUtil.remove(this._container);\n\t\tmap._removeZoomLimit(this);\n\t\tthis._container = null;\n\t\tthis._tileZoom = undefined;\n\t},\n\n\t// @method bringToFront: this\n\t// Brings the tile layer to the top of all tile layers.\n\tbringToFront: function () {\n\t\tif (this._map) {\n\t\t\tDomUtil.toFront(this._container);\n\t\t\tthis._setAutoZIndex(Math.max);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method bringToBack: this\n\t// Brings the tile layer to the bottom of all tile layers.\n\tbringToBack: function () {\n\t\tif (this._map) {\n\t\t\tDomUtil.toBack(this._container);\n\t\t\tthis._setAutoZIndex(Math.min);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method getContainer: HTMLElement\n\t// Returns the HTML element that contains the tiles for this layer.\n\tgetContainer: function () {\n\t\treturn this._container;\n\t},\n\n\t// @method setOpacity(opacity: Number): this\n\t// Changes the [opacity](#gridlayer-opacity) of the grid layer.\n\tsetOpacity: function (opacity) {\n\t\tthis.options.opacity = opacity;\n\t\tthis._updateOpacity();\n\t\treturn this;\n\t},\n\n\t// @method setZIndex(zIndex: Number): this\n\t// Changes the [zIndex](#gridlayer-zindex) of the grid layer.\n\tsetZIndex: function (zIndex) {\n\t\tthis.options.zIndex = zIndex;\n\t\tthis._updateZIndex();\n\n\t\treturn this;\n\t},\n\n\t// @method isLoading: Boolean\n\t// Returns `true` if any tile in the grid layer has not finished loading.\n\tisLoading: function () {\n\t\treturn this._loading;\n\t},\n\n\t// @method redraw: this\n\t// Causes the layer to clear all the tiles and request them again.\n\tredraw: function () {\n\t\tif (this._map) {\n\t\t\tthis._removeAllTiles();\n\t\t\tvar tileZoom = this._clampZoom(this._map.getZoom());\n\t\t\tif (tileZoom !== this._tileZoom) {\n\t\t\t\tthis._tileZoom = tileZoom;\n\t\t\t\tthis._updateLevels();\n\t\t\t}\n\t\t\tthis._update();\n\t\t}\n\t\treturn this;\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = {\n\t\t\tviewprereset: this._invalidateAll,\n\t\t\tviewreset: this._resetView,\n\t\t\tzoom: this._resetView,\n\t\t\tmoveend: this._onMoveEnd\n\t\t};\n\n\t\tif (!this.options.updateWhenIdle) {\n\t\t\t// update tiles on move, but not more often than once per given interval\n\t\t\tif (!this._onMove) {\n\t\t\t\tthis._onMove = Util.throttle(this._onMoveEnd, this.options.updateInterval, this);\n\t\t\t}\n\n\t\t\tevents.move = this._onMove;\n\t\t}\n\n\t\tif (this._zoomAnimated) {\n\t\t\tevents.zoomanim = this._animateZoom;\n\t\t}\n\n\t\treturn events;\n\t},\n\n\t// @section Extension methods\n\t// Layers extending `GridLayer` shall reimplement the following method.\n\t// @method createTile(coords: Object, done?: Function): HTMLElement\n\t// Called only internally, must be overridden by classes extending `GridLayer`.\n\t// Returns the `HTMLElement` corresponding to the given `coords`. If the `done` callback\n\t// is specified, it must be called when the tile has finished loading and drawing.\n\tcreateTile: function () {\n\t\treturn document.createElement('div');\n\t},\n\n\t// @section\n\t// @method getTileSize: Point\n\t// Normalizes the [tileSize option](#gridlayer-tilesize) into a point. Used by the `createTile()` method.\n\tgetTileSize: function () {\n\t\tvar s = this.options.tileSize;\n\t\treturn s instanceof Point ? s : new Point(s, s);\n\t},\n\n\t_updateZIndex: function () {\n\t\tif (this._container && this.options.zIndex !== undefined && this.options.zIndex !== null) {\n\t\t\tthis._container.style.zIndex = this.options.zIndex;\n\t\t}\n\t},\n\n\t_setAutoZIndex: function (compare) {\n\t\t// go through all other layers of the same pane, set zIndex to max + 1 (front) or min - 1 (back)\n\n\t\tvar layers = this.getPane().children,\n\t\t    edgeZIndex = -compare(-Infinity, Infinity); // -Infinity for max, Infinity for min\n\n\t\tfor (var i = 0, len = layers.length, zIndex; i < len; i++) {\n\n\t\t\tzIndex = layers[i].style.zIndex;\n\n\t\t\tif (layers[i] !== this._container && zIndex) {\n\t\t\t\tedgeZIndex = compare(edgeZIndex, +zIndex);\n\t\t\t}\n\t\t}\n\n\t\tif (isFinite(edgeZIndex)) {\n\t\t\tthis.options.zIndex = edgeZIndex + compare(-1, 1);\n\t\t\tthis._updateZIndex();\n\t\t}\n\t},\n\n\t_updateOpacity: function () {\n\t\tif (!this._map) { return; }\n\n\t\t// IE doesn't inherit filter opacity properly, so we're forced to set it on tiles\n\t\tif (Browser.ielt9) { return; }\n\n\t\tDomUtil.setOpacity(this._container, this.options.opacity);\n\n\t\tvar now = +new Date(),\n\t\t    nextFrame = false,\n\t\t    willPrune = false;\n\n\t\tfor (var key in this._tiles) {\n\t\t\tvar tile = this._tiles[key];\n\t\t\tif (!tile.current || !tile.loaded) { continue; }\n\n\t\t\tvar fade = Math.min(1, (now - tile.loaded) / 200);\n\n\t\t\tDomUtil.setOpacity(tile.el, fade);\n\t\t\tif (fade < 1) {\n\t\t\t\tnextFrame = true;\n\t\t\t} else {\n\t\t\t\tif (tile.active) {\n\t\t\t\t\twillPrune = true;\n\t\t\t\t} else {\n\t\t\t\t\tthis._onOpaqueTile(tile);\n\t\t\t\t}\n\t\t\t\ttile.active = true;\n\t\t\t}\n\t\t}\n\n\t\tif (willPrune && !this._noPrune) { this._pruneTiles(); }\n\n\t\tif (nextFrame) {\n\t\t\tUtil.cancelAnimFrame(this._fadeFrame);\n\t\t\tthis._fadeFrame = Util.requestAnimFrame(this._updateOpacity, this);\n\t\t}\n\t},\n\n\t_onOpaqueTile: Util.falseFn,\n\n\t_initContainer: function () {\n\t\tif (this._container) { return; }\n\n\t\tthis._container = DomUtil.create('div', 'leaflet-layer ' + (this.options.className || ''));\n\t\tthis._updateZIndex();\n\n\t\tif (this.options.opacity < 1) {\n\t\t\tthis._updateOpacity();\n\t\t}\n\n\t\tthis.getPane().appendChild(this._container);\n\t},\n\n\t_updateLevels: function () {\n\n\t\tvar zoom = this._tileZoom,\n\t\t    maxZoom = this.options.maxZoom;\n\n\t\tif (zoom === undefined) { return undefined; }\n\n\t\tfor (var z in this._levels) {\n\t\t\tz = Number(z);\n\t\t\tif (this._levels[z].el.children.length || z === zoom) {\n\t\t\t\tthis._levels[z].el.style.zIndex = maxZoom - Math.abs(zoom - z);\n\t\t\t\tthis._onUpdateLevel(z);\n\t\t\t} else {\n\t\t\t\tDomUtil.remove(this._levels[z].el);\n\t\t\t\tthis._removeTilesAtZoom(z);\n\t\t\t\tthis._onRemoveLevel(z);\n\t\t\t\tdelete this._levels[z];\n\t\t\t}\n\t\t}\n\n\t\tvar level = this._levels[zoom],\n\t\t    map = this._map;\n\n\t\tif (!level) {\n\t\t\tlevel = this._levels[zoom] = {};\n\n\t\t\tlevel.el = DomUtil.create('div', 'leaflet-tile-container leaflet-zoom-animated', this._container);\n\t\t\tlevel.el.style.zIndex = maxZoom;\n\n\t\t\tlevel.origin = map.project(map.unproject(map.getPixelOrigin()), zoom).round();\n\t\t\tlevel.zoom = zoom;\n\n\t\t\tthis._setZoomTransform(level, map.getCenter(), map.getZoom());\n\n\t\t\t// force the browser to consider the newly added element for transition\n\t\t\tUtil.falseFn(level.el.offsetWidth);\n\n\t\t\tthis._onCreateLevel(level);\n\t\t}\n\n\t\tthis._level = level;\n\n\t\treturn level;\n\t},\n\n\t_onUpdateLevel: Util.falseFn,\n\n\t_onRemoveLevel: Util.falseFn,\n\n\t_onCreateLevel: Util.falseFn,\n\n\t_pruneTiles: function () {\n\t\tif (!this._map) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar key, tile;\n\n\t\tvar zoom = this._map.getZoom();\n\t\tif (zoom > this.options.maxZoom ||\n\t\t\tzoom < this.options.minZoom) {\n\t\t\tthis._removeAllTiles();\n\t\t\treturn;\n\t\t}\n\n\t\tfor (key in this._tiles) {\n\t\t\ttile = this._tiles[key];\n\t\t\ttile.retain = tile.current;\n\t\t}\n\n\t\tfor (key in this._tiles) {\n\t\t\ttile = this._tiles[key];\n\t\t\tif (tile.current && !tile.active) {\n\t\t\t\tvar coords = tile.coords;\n\t\t\t\tif (!this._retainParent(coords.x, coords.y, coords.z, coords.z - 5)) {\n\t\t\t\t\tthis._retainChildren(coords.x, coords.y, coords.z, coords.z + 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (key in this._tiles) {\n\t\t\tif (!this._tiles[key].retain) {\n\t\t\t\tthis._removeTile(key);\n\t\t\t}\n\t\t}\n\t},\n\n\t_removeTilesAtZoom: function (zoom) {\n\t\tfor (var key in this._tiles) {\n\t\t\tif (this._tiles[key].coords.z !== zoom) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._removeTile(key);\n\t\t}\n\t},\n\n\t_removeAllTiles: function () {\n\t\tfor (var key in this._tiles) {\n\t\t\tthis._removeTile(key);\n\t\t}\n\t},\n\n\t_invalidateAll: function () {\n\t\tfor (var z in this._levels) {\n\t\t\tDomUtil.remove(this._levels[z].el);\n\t\t\tthis._onRemoveLevel(Number(z));\n\t\t\tdelete this._levels[z];\n\t\t}\n\t\tthis._removeAllTiles();\n\n\t\tthis._tileZoom = undefined;\n\t},\n\n\t_retainParent: function (x, y, z, minZoom) {\n\t\tvar x2 = Math.floor(x / 2),\n\t\t    y2 = Math.floor(y / 2),\n\t\t    z2 = z - 1,\n\t\t    coords2 = new Point(+x2, +y2);\n\t\tcoords2.z = +z2;\n\n\t\tvar key = this._tileCoordsToKey(coords2),\n\t\t    tile = this._tiles[key];\n\n\t\tif (tile && tile.active) {\n\t\t\ttile.retain = true;\n\t\t\treturn true;\n\n\t\t} else if (tile && tile.loaded) {\n\t\t\ttile.retain = true;\n\t\t}\n\n\t\tif (z2 > minZoom) {\n\t\t\treturn this._retainParent(x2, y2, z2, minZoom);\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t_retainChildren: function (x, y, z, maxZoom) {\n\n\t\tfor (var i = 2 * x; i < 2 * x + 2; i++) {\n\t\t\tfor (var j = 2 * y; j < 2 * y + 2; j++) {\n\n\t\t\t\tvar coords = new Point(i, j);\n\t\t\t\tcoords.z = z + 1;\n\n\t\t\t\tvar key = this._tileCoordsToKey(coords),\n\t\t\t\t    tile = this._tiles[key];\n\n\t\t\t\tif (tile && tile.active) {\n\t\t\t\t\ttile.retain = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\t} else if (tile && tile.loaded) {\n\t\t\t\t\ttile.retain = true;\n\t\t\t\t}\n\n\t\t\t\tif (z + 1 < maxZoom) {\n\t\t\t\t\tthis._retainChildren(i, j, z + 1, maxZoom);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t_resetView: function (e) {\n\t\tvar animating = e && (e.pinch || e.flyTo);\n\t\tthis._setView(this._map.getCenter(), this._map.getZoom(), animating, animating);\n\t},\n\n\t_animateZoom: function (e) {\n\t\tthis._setView(e.center, e.zoom, true, e.noUpdate);\n\t},\n\n\t_clampZoom: function (zoom) {\n\t\tvar options = this.options;\n\n\t\tif (undefined !== options.minNativeZoom && zoom < options.minNativeZoom) {\n\t\t\treturn options.minNativeZoom;\n\t\t}\n\n\t\tif (undefined !== options.maxNativeZoom && options.maxNativeZoom < zoom) {\n\t\t\treturn options.maxNativeZoom;\n\t\t}\n\n\t\treturn zoom;\n\t},\n\n\t_setView: function (center, zoom, noPrune, noUpdate) {\n\t\tvar tileZoom = Math.round(zoom);\n\t\tif ((this.options.maxZoom !== undefined && tileZoom > this.options.maxZoom) ||\n\t\t    (this.options.minZoom !== undefined && tileZoom < this.options.minZoom)) {\n\t\t\ttileZoom = undefined;\n\t\t} else {\n\t\t\ttileZoom = this._clampZoom(tileZoom);\n\t\t}\n\n\t\tvar tileZoomChanged = this.options.updateWhenZooming && (tileZoom !== this._tileZoom);\n\n\t\tif (!noUpdate || tileZoomChanged) {\n\n\t\t\tthis._tileZoom = tileZoom;\n\n\t\t\tif (this._abortLoading) {\n\t\t\t\tthis._abortLoading();\n\t\t\t}\n\n\t\t\tthis._updateLevels();\n\t\t\tthis._resetGrid();\n\n\t\t\tif (tileZoom !== undefined) {\n\t\t\t\tthis._update(center);\n\t\t\t}\n\n\t\t\tif (!noPrune) {\n\t\t\t\tthis._pruneTiles();\n\t\t\t}\n\n\t\t\t// Flag to prevent _updateOpacity from pruning tiles during\n\t\t\t// a zoom anim or a pinch gesture\n\t\t\tthis._noPrune = !!noPrune;\n\t\t}\n\n\t\tthis._setZoomTransforms(center, zoom);\n\t},\n\n\t_setZoomTransforms: function (center, zoom) {\n\t\tfor (var i in this._levels) {\n\t\t\tthis._setZoomTransform(this._levels[i], center, zoom);\n\t\t}\n\t},\n\n\t_setZoomTransform: function (level, center, zoom) {\n\t\tvar scale = this._map.getZoomScale(zoom, level.zoom),\n\t\t    translate = level.origin.multiplyBy(scale)\n\t\t        .subtract(this._map._getNewPixelOrigin(center, zoom)).round();\n\n\t\tif (Browser.any3d) {\n\t\t\tDomUtil.setTransform(level.el, translate, scale);\n\t\t} else {\n\t\t\tDomUtil.setPosition(level.el, translate);\n\t\t}\n\t},\n\n\t_resetGrid: function () {\n\t\tvar map = this._map,\n\t\t    crs = map.options.crs,\n\t\t    tileSize = this._tileSize = this.getTileSize(),\n\t\t    tileZoom = this._tileZoom;\n\n\t\tvar bounds = this._map.getPixelWorldBounds(this._tileZoom);\n\t\tif (bounds) {\n\t\t\tthis._globalTileRange = this._pxBoundsToTileRange(bounds);\n\t\t}\n\n\t\tthis._wrapX = crs.wrapLng && !this.options.noWrap && [\n\t\t\tMath.floor(map.project([0, crs.wrapLng[0]], tileZoom).x / tileSize.x),\n\t\t\tMath.ceil(map.project([0, crs.wrapLng[1]], tileZoom).x / tileSize.y)\n\t\t];\n\t\tthis._wrapY = crs.wrapLat && !this.options.noWrap && [\n\t\t\tMath.floor(map.project([crs.wrapLat[0], 0], tileZoom).y / tileSize.x),\n\t\t\tMath.ceil(map.project([crs.wrapLat[1], 0], tileZoom).y / tileSize.y)\n\t\t];\n\t},\n\n\t_onMoveEnd: function () {\n\t\tif (!this._map || this._map._animatingZoom) { return; }\n\n\t\tthis._update();\n\t},\n\n\t_getTiledPixelBounds: function (center) {\n\t\tvar map = this._map,\n\t\t    mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(),\n\t\t    scale = map.getZoomScale(mapZoom, this._tileZoom),\n\t\t    pixelCenter = map.project(center, this._tileZoom).floor(),\n\t\t    halfSize = map.getSize().divideBy(scale * 2);\n\n\t\treturn new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));\n\t},\n\n\t// Private method to load tiles in the grid's active zoom level according to map bounds\n\t_update: function (center) {\n\t\tvar map = this._map;\n\t\tif (!map) { return; }\n\t\tvar zoom = this._clampZoom(map.getZoom());\n\n\t\tif (center === undefined) { center = map.getCenter(); }\n\t\tif (this._tileZoom === undefined) { return; }\t// if out of minzoom/maxzoom\n\n\t\tvar pixelBounds = this._getTiledPixelBounds(center),\n\t\t    tileRange = this._pxBoundsToTileRange(pixelBounds),\n\t\t    tileCenter = tileRange.getCenter(),\n\t\t    queue = [],\n\t\t    margin = this.options.keepBuffer,\n\t\t    noPruneRange = new Bounds(tileRange.getBottomLeft().subtract([margin, -margin]),\n\t\t                              tileRange.getTopRight().add([margin, -margin]));\n\n\t\t// Sanity check: panic if the tile range contains Infinity somewhere.\n\t\tif (!(isFinite(tileRange.min.x) &&\n\t\t      isFinite(tileRange.min.y) &&\n\t\t      isFinite(tileRange.max.x) &&\n\t\t      isFinite(tileRange.max.y))) { throw new Error('Attempted to load an infinite number of tiles'); }\n\n\t\tfor (var key in this._tiles) {\n\t\t\tvar c = this._tiles[key].coords;\n\t\t\tif (c.z !== this._tileZoom || !noPruneRange.contains(new Point(c.x, c.y))) {\n\t\t\t\tthis._tiles[key].current = false;\n\t\t\t}\n\t\t}\n\n\t\t// _update just loads more tiles. If the tile zoom level differs too much\n\t\t// from the map's, let _setView reset levels and prune old tiles.\n\t\tif (Math.abs(zoom - this._tileZoom) > 1) { this._setView(center, zoom); return; }\n\n\t\t// create a queue of coordinates to load tiles from\n\t\tfor (var j = tileRange.min.y; j <= tileRange.max.y; j++) {\n\t\t\tfor (var i = tileRange.min.x; i <= tileRange.max.x; i++) {\n\t\t\t\tvar coords = new Point(i, j);\n\t\t\t\tcoords.z = this._tileZoom;\n\n\t\t\t\tif (!this._isValidTile(coords)) { continue; }\n\n\t\t\t\tvar tile = this._tiles[this._tileCoordsToKey(coords)];\n\t\t\t\tif (tile) {\n\t\t\t\t\ttile.current = true;\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push(coords);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// sort tile queue to load tiles in order of their distance to center\n\t\tqueue.sort(function (a, b) {\n\t\t\treturn a.distanceTo(tileCenter) - b.distanceTo(tileCenter);\n\t\t});\n\n\t\tif (queue.length !== 0) {\n\t\t\t// if it's the first batch of tiles to load\n\t\t\tif (!this._loading) {\n\t\t\t\tthis._loading = true;\n\t\t\t\t// @event loading: Event\n\t\t\t\t// Fired when the grid layer starts loading tiles.\n\t\t\t\tthis.fire('loading');\n\t\t\t}\n\n\t\t\t// create DOM fragment to append tiles in one batch\n\t\t\tvar fragment = document.createDocumentFragment();\n\n\t\t\tfor (i = 0; i < queue.length; i++) {\n\t\t\t\tthis._addTile(queue[i], fragment);\n\t\t\t}\n\n\t\t\tthis._level.el.appendChild(fragment);\n\t\t}\n\t},\n\n\t_isValidTile: function (coords) {\n\t\tvar crs = this._map.options.crs;\n\n\t\tif (!crs.infinite) {\n\t\t\t// don't load tile if it's out of bounds and not wrapped\n\t\t\tvar bounds = this._globalTileRange;\n\t\t\tif ((!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||\n\t\t\t    (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))) { return false; }\n\t\t}\n\n\t\tif (!this.options.bounds) { return true; }\n\n\t\t// don't load tile if it doesn't intersect the bounds in options\n\t\tvar tileBounds = this._tileCoordsToBounds(coords);\n\t\treturn latLngBounds(this.options.bounds).overlaps(tileBounds);\n\t},\n\n\t_keyToBounds: function (key) {\n\t\treturn this._tileCoordsToBounds(this._keyToTileCoords(key));\n\t},\n\n\t_tileCoordsToNwSe: function (coords) {\n\t\tvar map = this._map,\n\t\t    tileSize = this.getTileSize(),\n\t\t    nwPoint = coords.scaleBy(tileSize),\n\t\t    sePoint = nwPoint.add(tileSize),\n\t\t    nw = map.unproject(nwPoint, coords.z),\n\t\t    se = map.unproject(sePoint, coords.z);\n\t\treturn [nw, se];\n\t},\n\n\t// converts tile coordinates to its geographical bounds\n\t_tileCoordsToBounds: function (coords) {\n\t\tvar bp = this._tileCoordsToNwSe(coords),\n\t\t    bounds = new LatLngBounds(bp[0], bp[1]);\n\n\t\tif (!this.options.noWrap) {\n\t\t\tbounds = this._map.wrapLatLngBounds(bounds);\n\t\t}\n\t\treturn bounds;\n\t},\n\t// converts tile coordinates to key for the tile cache\n\t_tileCoordsToKey: function (coords) {\n\t\treturn coords.x + ':' + coords.y + ':' + coords.z;\n\t},\n\n\t// converts tile cache key to coordinates\n\t_keyToTileCoords: function (key) {\n\t\tvar k = key.split(':'),\n\t\t    coords = new Point(+k[0], +k[1]);\n\t\tcoords.z = +k[2];\n\t\treturn coords;\n\t},\n\n\t_removeTile: function (key) {\n\t\tvar tile = this._tiles[key];\n\t\tif (!tile) { return; }\n\n\t\tDomUtil.remove(tile.el);\n\n\t\tdelete this._tiles[key];\n\n\t\t// @event tileunload: TileEvent\n\t\t// Fired when a tile is removed (e.g. when a tile goes off the screen).\n\t\tthis.fire('tileunload', {\n\t\t\ttile: tile.el,\n\t\t\tcoords: this._keyToTileCoords(key)\n\t\t});\n\t},\n\n\t_initTile: function (tile) {\n\t\tDomUtil.addClass(tile, 'leaflet-tile');\n\n\t\tvar tileSize = this.getTileSize();\n\t\ttile.style.width = tileSize.x + 'px';\n\t\ttile.style.height = tileSize.y + 'px';\n\n\t\ttile.onselectstart = Util.falseFn;\n\t\ttile.onmousemove = Util.falseFn;\n\n\t\t// update opacity on tiles in IE7-8 because of filter inheritance problems\n\t\tif (Browser.ielt9 && this.options.opacity < 1) {\n\t\t\tDomUtil.setOpacity(tile, this.options.opacity);\n\t\t}\n\t},\n\n\t_addTile: function (coords, container) {\n\t\tvar tilePos = this._getTilePos(coords),\n\t\t    key = this._tileCoordsToKey(coords);\n\n\t\tvar tile = this.createTile(this._wrapCoords(coords), Util.bind(this._tileReady, this, coords));\n\n\t\tthis._initTile(tile);\n\n\t\t// if createTile is defined with a second argument (\"done\" callback),\n\t\t// we know that tile is async and will be ready later; otherwise\n\t\tif (this.createTile.length < 2) {\n\t\t\t// mark tile as ready, but delay one frame for opacity animation to happen\n\t\t\tUtil.requestAnimFrame(Util.bind(this._tileReady, this, coords, null, tile));\n\t\t}\n\n\t\tDomUtil.setPosition(tile, tilePos);\n\n\t\t// save tile in cache\n\t\tthis._tiles[key] = {\n\t\t\tel: tile,\n\t\t\tcoords: coords,\n\t\t\tcurrent: true\n\t\t};\n\n\t\tcontainer.appendChild(tile);\n\t\t// @event tileloadstart: TileEvent\n\t\t// Fired when a tile is requested and starts loading.\n\t\tthis.fire('tileloadstart', {\n\t\t\ttile: tile,\n\t\t\tcoords: coords\n\t\t});\n\t},\n\n\t_tileReady: function (coords, err, tile) {\n\t\tif (err) {\n\t\t\t// @event tileerror: TileErrorEvent\n\t\t\t// Fired when there is an error loading a tile.\n\t\t\tthis.fire('tileerror', {\n\t\t\t\terror: err,\n\t\t\t\ttile: tile,\n\t\t\t\tcoords: coords\n\t\t\t});\n\t\t}\n\n\t\tvar key = this._tileCoordsToKey(coords);\n\n\t\ttile = this._tiles[key];\n\t\tif (!tile) { return; }\n\n\t\ttile.loaded = +new Date();\n\t\tif (this._map._fadeAnimated) {\n\t\t\tDomUtil.setOpacity(tile.el, 0);\n\t\t\tUtil.cancelAnimFrame(this._fadeFrame);\n\t\t\tthis._fadeFrame = Util.requestAnimFrame(this._updateOpacity, this);\n\t\t} else {\n\t\t\ttile.active = true;\n\t\t\tthis._pruneTiles();\n\t\t}\n\n\t\tif (!err) {\n\t\t\tDomUtil.addClass(tile.el, 'leaflet-tile-loaded');\n\n\t\t\t// @event tileload: TileEvent\n\t\t\t// Fired when a tile loads.\n\t\t\tthis.fire('tileload', {\n\t\t\t\ttile: tile.el,\n\t\t\t\tcoords: coords\n\t\t\t});\n\t\t}\n\n\t\tif (this._noTilesToLoad()) {\n\t\t\tthis._loading = false;\n\t\t\t// @event load: Event\n\t\t\t// Fired when the grid layer loaded all visible tiles.\n\t\t\tthis.fire('load');\n\n\t\t\tif (Browser.ielt9 || !this._map._fadeAnimated) {\n\t\t\t\tUtil.requestAnimFrame(this._pruneTiles, this);\n\t\t\t} else {\n\t\t\t\t// Wait a bit more than 0.2 secs (the duration of the tile fade-in)\n\t\t\t\t// to trigger a pruning.\n\t\t\t\tsetTimeout(Util.bind(this._pruneTiles, this), 250);\n\t\t\t}\n\t\t}\n\t},\n\n\t_getTilePos: function (coords) {\n\t\treturn coords.scaleBy(this.getTileSize()).subtract(this._level.origin);\n\t},\n\n\t_wrapCoords: function (coords) {\n\t\tvar newCoords = new Point(\n\t\t\tthis._wrapX ? Util.wrapNum(coords.x, this._wrapX) : coords.x,\n\t\t\tthis._wrapY ? Util.wrapNum(coords.y, this._wrapY) : coords.y);\n\t\tnewCoords.z = coords.z;\n\t\treturn newCoords;\n\t},\n\n\t_pxBoundsToTileRange: function (bounds) {\n\t\tvar tileSize = this.getTileSize();\n\t\treturn new Bounds(\n\t\t\tbounds.min.unscaleBy(tileSize).floor(),\n\t\t\tbounds.max.unscaleBy(tileSize).ceil().subtract([1, 1]));\n\t},\n\n\t_noTilesToLoad: function () {\n\t\tfor (var key in this._tiles) {\n\t\t\tif (!this._tiles[key].loaded) { return false; }\n\t\t}\n\t\treturn true;\n\t}\n});\n\n// @factory L.gridLayer(options?: GridLayer options)\n// Creates a new instance of GridLayer with the supplied options.\nexport function gridLayer(options) {\n\treturn new GridLayer(options);\n}\n", "import {GridLayer} from './GridLayer';\r\nimport Browser from '../../core/Browser';\r\nimport * as Util from '../../core/Util';\r\nimport * as DomEvent from '../../dom/DomEvent';\r\nimport * as DomUtil from '../../dom/DomUtil';\r\n\r\n\r\n/*\r\n * @class TileLayer\r\n * @inherits GridLayer\r\n * @aka L.TileLayer\r\n * 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\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'}).addTo(map);\n * ```\r\n *\r\n * @section URL template\r\n * @example\r\n *\r\n * A string of the following form:\r\n *\r\n * ```\r\n * 'https://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'\r\n * ```\r\n *\r\n * `{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}` \u2014 zoom level, `{x}` and `{y}` \u2014 tile coordinates. `{r}` can be used to add \"&commat;2x\" to the URL to load retina tiles.\r\n *\r\n * You can use custom keys in the template, which will be [evaluated](#util-template) from TileLayer options, like this:\r\n *\r\n * ```\r\n * L.tileLayer('https://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});\r\n * ```\r\n */\r\n\r\n\r\nexport var TileLayer = GridLayer.extend({\r\n\r\n\t// @section\r\n\t// @aka TileLayer options\r\n\toptions: {\r\n\t\t// @option minZoom: Number = 0\r\n\t\t// The minimum zoom level down to which this layer will be displayed (inclusive).\r\n\t\tminZoom: 0,\r\n\r\n\t\t// @option maxZoom: Number = 18\r\n\t\t// The maximum zoom level up to which this layer will be displayed (inclusive).\r\n\t\tmaxZoom: 18,\r\n\r\n\t\t// @option subdomains: String|String[] = 'abc'\r\n\t\t// 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\n\t\tsubdomains: 'abc',\r\n\r\n\t\t// @option errorTileUrl: String = ''\r\n\t\t// URL to the tile image to show in place of the tile that failed to load.\r\n\t\terrorTileUrl: '',\r\n\r\n\t\t// @option zoomOffset: Number = 0\r\n\t\t// The zoom number used in tile URLs will be offset with this value.\r\n\t\tzoomOffset: 0,\r\n\r\n\t\t// @option tms: Boolean = false\r\n\t\t// If `true`, inverses Y axis numbering for tiles (turn this on for [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) services).\r\n\t\ttms: false,\r\n\r\n\t\t// @option zoomReverse: Boolean = false\r\n\t\t// If set to true, the zoom number used in tile URLs will be reversed (`maxZoom - zoom` instead of `zoom`)\r\n\t\tzoomReverse: false,\r\n\r\n\t\t// @option detectRetina: Boolean = false\r\n\t\t// 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\n\t\tdetectRetina: false,\r\n\r\n\t\t// @option crossOrigin: Boolean|String = false\r\n\t\t// Whether the crossOrigin attribute will be added to the tiles.\r\n\t\t// 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\n\t\t// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r\n\t\tcrossOrigin: false,\r\n\r\n\t\t// @option referrerPolicy: Boolean|String = false\r\n\t\t// Whether the referrerPolicy attribute will be added to the tiles.\r\n\t\t// If a String is provided, all tiles will have their referrerPolicy attribute set to the String provided.\r\n\t\t// This may be needed if your map's rendering context has a strict default but your tile provider expects a valid referrer\r\n\t\t// (e.g. to validate an API token).\r\n\t\t// Refer to [HTMLImageElement.referrerPolicy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy) for valid String values.\r\n\t\treferrerPolicy: false\r\n\t},\r\n\r\n\tinitialize: function (url, options) {\r\n\r\n\t\tthis._url = url;\r\n\r\n\t\toptions = Util.setOptions(this, options);\r\n\r\n\t\t// detecting retina displays, adjusting tileSize and zoom levels\r\n\t\tif (options.detectRetina && Browser.retina && options.maxZoom > 0) {\r\n\r\n\t\t\toptions.tileSize = Math.floor(options.tileSize / 2);\r\n\r\n\t\t\tif (!options.zoomReverse) {\r\n\t\t\t\toptions.zoomOffset++;\r\n\t\t\t\toptions.maxZoom = Math.max(options.minZoom, options.maxZoom - 1);\r\n\t\t\t} else {\r\n\t\t\t\toptions.zoomOffset--;\r\n\t\t\t\toptions.minZoom = Math.min(options.maxZoom, options.minZoom + 1);\r\n\t\t\t}\r\n\r\n\t\t\toptions.minZoom = Math.max(0, options.minZoom);\r\n\t\t} else if (!options.zoomReverse) {\r\n\t\t\t// make sure maxZoom is gte minZoom\r\n\t\t\toptions.maxZoom = Math.max(options.minZoom, options.maxZoom);\r\n\t\t} else {\r\n\t\t\t// make sure minZoom is lte maxZoom\r\n\t\t\toptions.minZoom = Math.min(options.maxZoom, options.minZoom);\r\n\t\t}\r\n\r\n\t\tif (typeof options.subdomains === 'string') {\r\n\t\t\toptions.subdomains = options.subdomains.split('');\r\n\t\t}\r\n\r\n\t\tthis.on('tileunload', this._onTileRemove);\r\n\t},\r\n\r\n\t// @method setUrl(url: String, noRedraw?: Boolean): this\r\n\t// Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).\r\n\t// If the URL does not change, the layer will not be redrawn unless\r\n\t// the noRedraw parameter is set to false.\r\n\tsetUrl: function (url, noRedraw) {\r\n\t\tif (this._url === url && noRedraw === undefined) {\r\n\t\t\tnoRedraw = true;\r\n\t\t}\r\n\r\n\t\tthis._url = url;\r\n\r\n\t\tif (!noRedraw) {\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method createTile(coords: Object, done?: Function): HTMLElement\r\n\t// Called only internally, overrides GridLayer's [`createTile()`](#gridlayer-createtile)\r\n\t// to return an `<img>` HTML element with the appropriate image URL given `coords`. The `done`\r\n\t// callback is called when the tile has been loaded.\r\n\tcreateTile: function (coords, done) {\r\n\t\tvar tile = document.createElement('img');\r\n\r\n\t\tDomEvent.on(tile, 'load', Util.bind(this._tileOnLoad, this, done, tile));\r\n\t\tDomEvent.on(tile, 'error', Util.bind(this._tileOnError, this, done, tile));\r\n\r\n\t\tif (this.options.crossOrigin || this.options.crossOrigin === '') {\r\n\t\t\ttile.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r\n\t\t}\r\n\r\n\t\t// for this new option we follow the documented behavior\r\n\t\t// more closely by only setting the property when string\r\n\t\tif (typeof this.options.referrerPolicy === 'string') {\r\n\t\t\ttile.referrerPolicy = this.options.referrerPolicy;\r\n\t\t}\r\n\r\n\t\t// The alt attribute is set to the empty string,\r\n\t\t// allowing screen readers to ignore the decorative image tiles.\r\n\t\t// https://www.w3.org/WAI/tutorials/images/decorative/\r\n\t\t// https://www.w3.org/TR/html-aria/#el-img-empty-alt\r\n\t\ttile.alt = '';\r\n\r\n\t\ttile.src = this.getTileUrl(coords);\r\n\r\n\t\treturn tile;\r\n\t},\r\n\r\n\t// @section Extension methods\r\n\t// @uninheritable\r\n\t// Layers extending `TileLayer` might reimplement the following method.\r\n\t// @method getTileUrl(coords: Object): String\r\n\t// Called only internally, returns the URL for a tile given its coordinates.\r\n\t// Classes extending `TileLayer` can override this function to provide custom tile URL naming schemes.\r\n\tgetTileUrl: function (coords) {\r\n\t\tvar data = {\r\n\t\t\tr: Browser.retina ? '@2x' : '',\r\n\t\t\ts: this._getSubdomain(coords),\r\n\t\t\tx: coords.x,\r\n\t\t\ty: coords.y,\r\n\t\t\tz: this._getZoomForUrl()\r\n\t\t};\r\n\t\tif (this._map && !this._map.options.crs.infinite) {\r\n\t\t\tvar invertedY = this._globalTileRange.max.y - coords.y;\r\n\t\t\tif (this.options.tms) {\r\n\t\t\t\tdata['y'] = invertedY;\r\n\t\t\t}\r\n\t\t\tdata['-y'] = invertedY;\r\n\t\t}\r\n\r\n\t\treturn Util.template(this._url, Util.extend(data, this.options));\r\n\t},\r\n\r\n\t_tileOnLoad: function (done, tile) {\r\n\t\t// For https://github.com/Leaflet/Leaflet/issues/3332\r\n\t\tif (Browser.ielt9) {\r\n\t\t\tsetTimeout(Util.bind(done, this, null, tile), 0);\r\n\t\t} else {\r\n\t\t\tdone(null, tile);\r\n\t\t}\r\n\t},\r\n\r\n\t_tileOnError: function (done, tile, e) {\r\n\t\tvar errorUrl = this.options.errorTileUrl;\r\n\t\tif (errorUrl && tile.getAttribute('src') !== errorUrl) {\r\n\t\t\ttile.src = errorUrl;\r\n\t\t}\r\n\t\tdone(e, tile);\r\n\t},\r\n\r\n\t_onTileRemove: function (e) {\r\n\t\te.tile.onload = null;\r\n\t},\r\n\r\n\t_getZoomForUrl: function () {\r\n\t\tvar zoom = this._tileZoom,\r\n\t\tmaxZoom = this.options.maxZoom,\r\n\t\tzoomReverse = this.options.zoomReverse,\r\n\t\tzoomOffset = this.options.zoomOffset;\r\n\r\n\t\tif (zoomReverse) {\r\n\t\t\tzoom = maxZoom - zoom;\r\n\t\t}\r\n\r\n\t\treturn zoom + zoomOffset;\r\n\t},\r\n\r\n\t_getSubdomain: function (tilePoint) {\r\n\t\tvar index = Math.abs(tilePoint.x + tilePoint.y) % this.options.subdomains.length;\r\n\t\treturn this.options.subdomains[index];\r\n\t},\r\n\r\n\t// stops loading all tiles in the background layer\r\n\t_abortLoading: function () {\r\n\t\tvar i, tile;\r\n\t\tfor (i in this._tiles) {\r\n\t\t\tif (this._tiles[i].coords.z !== this._tileZoom) {\r\n\t\t\t\ttile = this._tiles[i].el;\r\n\r\n\t\t\t\ttile.onload = Util.falseFn;\r\n\t\t\t\ttile.onerror = Util.falseFn;\r\n\r\n\t\t\t\tif (!tile.complete) {\r\n\t\t\t\t\ttile.src = Util.emptyImageUrl;\r\n\t\t\t\t\tvar coords = this._tiles[i].coords;\r\n\t\t\t\t\tDomUtil.remove(tile);\r\n\t\t\t\t\tdelete this._tiles[i];\r\n\t\t\t\t\t// @event tileabort: TileEvent\r\n\t\t\t\t\t// Fired when a tile was loading but is now not wanted.\r\n\t\t\t\t\tthis.fire('tileabort', {\r\n\t\t\t\t\t\ttile: tile,\r\n\t\t\t\t\t\tcoords: coords\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_removeTile: function (key) {\r\n\t\tvar tile = this._tiles[key];\r\n\t\tif (!tile) { return; }\r\n\r\n\t\t// Cancels any pending http requests associated with the tile\r\n\t\ttile.el.setAttribute('src', Util.emptyImageUrl);\r\n\r\n\t\treturn GridLayer.prototype._removeTile.call(this, key);\r\n\t},\r\n\r\n\t_tileReady: function (coords, err, tile) {\r\n\t\tif (!this._map || (tile && tile.getAttribute('src') === Util.emptyImageUrl)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\treturn GridLayer.prototype._tileReady.call(this, coords, err, tile);\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.tilelayer(urlTemplate: String, options?: TileLayer options)\r\n// Instantiates a tile layer object given a `URL template` and optionally an options object.\r\n\r\nexport function tileLayer(url, options) {\r\n\treturn new TileLayer(url, options);\r\n}\r\n", "import {TileLayer} from './TileLayer';\r\nimport {extend, setOptions, getParamString} from '../../core/Util';\r\nimport Browser from '../../core/Browser';\r\nimport {EPSG4326} from '../../geo/crs/CRS.EPSG4326';\r\nimport {toBounds} from '../../geometry/Bounds';\r\n\r\n/*\r\n * @class TileLayer.WMS\r\n * @inherits TileLayer\r\n * @aka L.TileLayer.WMS\r\n * Used to display [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services as tile layers on the map. Extends `TileLayer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var nexrad = L.tileLayer.wms(\"http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi\", {\r\n * \tlayers: 'nexrad-n0r-900913',\r\n * \tformat: 'image/png',\r\n * \ttransparent: true,\r\n * \tattribution: \"Weather data \u00A9 2012 IEM Nexrad\"\r\n * });\r\n * ```\r\n */\r\n\r\nexport var TileLayerWMS = TileLayer.extend({\r\n\r\n\t// @section\r\n\t// @aka TileLayer.WMS options\r\n\t// If any custom options not documented here are used, they will be sent to the\r\n\t// WMS server as extra parameters in each request URL. This can be useful for\r\n\t// [non-standard vendor WMS parameters](https://docs.geoserver.org/stable/en/user/services/wms/vendor.html).\r\n\tdefaultWmsParams: {\r\n\t\tservice: 'WMS',\r\n\t\trequest: 'GetMap',\r\n\r\n\t\t// @option layers: String = ''\r\n\t\t// **(required)** Comma-separated list of WMS layers to show.\r\n\t\tlayers: '',\r\n\r\n\t\t// @option styles: String = ''\r\n\t\t// Comma-separated list of WMS styles.\r\n\t\tstyles: '',\r\n\r\n\t\t// @option format: String = 'image/jpeg'\r\n\t\t// WMS image format (use `'image/png'` for layers with transparency).\r\n\t\tformat: 'image/jpeg',\r\n\r\n\t\t// @option transparent: Boolean = false\r\n\t\t// If `true`, the WMS service will return images with transparency.\r\n\t\ttransparent: false,\r\n\r\n\t\t// @option version: String = '1.1.1'\r\n\t\t// Version of the WMS service to use\r\n\t\tversion: '1.1.1'\r\n\t},\r\n\r\n\toptions: {\r\n\t\t// @option crs: CRS = null\r\n\t\t// Coordinate Reference System to use for the WMS requests, defaults to\r\n\t\t// map CRS. Don't change this if you're not sure what it means.\r\n\t\tcrs: null,\r\n\r\n\t\t// @option uppercase: Boolean = false\r\n\t\t// If `true`, WMS request parameter keys will be uppercase.\r\n\t\tuppercase: false\r\n\t},\r\n\r\n\tinitialize: function (url, options) {\r\n\r\n\t\tthis._url = url;\r\n\r\n\t\tvar wmsParams = extend({}, this.defaultWmsParams);\r\n\r\n\t\t// all keys that are not TileLayer options go to WMS params\r\n\t\tfor (var i in options) {\r\n\t\t\tif (!(i in this.options)) {\r\n\t\t\t\twmsParams[i] = options[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\toptions = setOptions(this, options);\r\n\r\n\t\tvar realRetina = options.detectRetina && Browser.retina ? 2 : 1;\r\n\t\tvar tileSize = this.getTileSize();\r\n\t\twmsParams.width = tileSize.x * realRetina;\r\n\t\twmsParams.height = tileSize.y * realRetina;\r\n\r\n\t\tthis.wmsParams = wmsParams;\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\r\n\t\tthis._crs = this.options.crs || map.options.crs;\r\n\t\tthis._wmsVersion = parseFloat(this.wmsParams.version);\r\n\r\n\t\tvar projectionKey = this._wmsVersion >= 1.3 ? 'crs' : 'srs';\r\n\t\tthis.wmsParams[projectionKey] = this._crs.code;\r\n\r\n\t\tTileLayer.prototype.onAdd.call(this, map);\r\n\t},\r\n\r\n\tgetTileUrl: function (coords) {\r\n\r\n\t\tvar tileBounds = this._tileCoordsToNwSe(coords),\r\n\t\t    crs = this._crs,\r\n\t\t    bounds = toBounds(crs.project(tileBounds[0]), crs.project(tileBounds[1])),\r\n\t\t    min = bounds.min,\r\n\t\t    max = bounds.max,\r\n\t\t    bbox = (this._wmsVersion >= 1.3 && this._crs === EPSG4326 ?\r\n\t\t    [min.y, min.x, max.y, max.x] :\r\n\t\t    [min.x, min.y, max.x, max.y]).join(','),\r\n\t\t    url = TileLayer.prototype.getTileUrl.call(this, coords);\r\n\t\treturn url +\r\n\t\t\tgetParamString(this.wmsParams, url, this.options.uppercase) +\r\n\t\t\t(this.options.uppercase ? '&BBOX=' : '&bbox=') + bbox;\r\n\t},\r\n\r\n\t// @method setParams(params: Object, noRedraw?: Boolean): this\r\n\t// Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true).\r\n\tsetParams: function (params, noRedraw) {\r\n\r\n\t\textend(this.wmsParams, params);\r\n\r\n\t\tif (!noRedraw) {\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.tileLayer.wms(baseUrl: String, options: TileLayer.WMS options)\r\n// Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.\r\nexport function tileLayerWMS(url, options) {\r\n\treturn new TileLayerWMS(url, options);\r\n}\r\n", "export {GridLayer, gridLayer} from './GridLayer';\nimport {TileLayer, tileLayer} from './TileLayer';\nimport {TileLayerWMS, tileLayerWMS} from './TileLayer.WMS';\nTileLayer.WMS = TileLayerWMS;\ntileLayer.wms = tileLayerWMS;\nexport {TileLayer, tileLayer};\n", "import {Layer} from '../Layer';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as Util from '../../core/Util';\nimport Browser from '../../core/Browser';\nimport {Bounds} from '../../geometry/Bounds';\n\n\n\n/*\n * @class Renderer\n * @inherits Layer\n * @aka L.Renderer\n *\n * Base class for vector renderer implementations (`SVG`, `Canvas`). Handles the\n * DOM container of the renderer, its bounds, and its zoom animation.\n *\n * A `Renderer` works as an implicit layer group for all `Path`s - the renderer\n * itself can be added or removed to the map. All paths use a renderer, which can\n * be implicit (the map will decide the type of renderer and use it automatically)\n * or explicit (using the [`renderer`](#path-renderer) option of the path).\n *\n * Do not use this class directly, use `SVG` and `Canvas` instead.\n *\n * @event update: Event\n * Fired when the renderer updates its bounds, center and zoom, for example when\n * its map has moved\n */\n\nexport var Renderer = Layer.extend({\n\n\t// @section\n\t// @aka Renderer options\n\toptions: {\n\t\t// @option padding: Number = 0.1\n\t\t// How much to extend the clip area around the map view (relative to its size)\n\t\t// e.g. 0.1 would be 10% of map view in each direction\n\t\tpadding: 0.1\n\t},\n\n\tinitialize: function (options) {\n\t\tUtil.setOptions(this, options);\n\t\tUtil.stamp(this);\n\t\tthis._layers = this._layers || {};\n\t},\n\n\tonAdd: function () {\n\t\tif (!this._container) {\n\t\t\tthis._initContainer(); // defined by renderer implementations\n\n\t\t\t// always keep transform-origin as 0 0\n\t\t\tDomUtil.addClass(this._container, 'leaflet-zoom-animated');\n\t\t}\n\n\t\tthis.getPane().appendChild(this._container);\n\t\tthis._update();\n\t\tthis.on('update', this._updatePaths, this);\n\t},\n\n\tonRemove: function () {\n\t\tthis.off('update', this._updatePaths, this);\n\t\tthis._destroyContainer();\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = {\n\t\t\tviewreset: this._reset,\n\t\t\tzoom: this._onZoom,\n\t\t\tmoveend: this._update,\n\t\t\tzoomend: this._onZoomEnd\n\t\t};\n\t\tif (this._zoomAnimated) {\n\t\t\tevents.zoomanim = this._onAnimZoom;\n\t\t}\n\t\treturn events;\n\t},\n\n\t_onAnimZoom: function (ev) {\n\t\tthis._updateTransform(ev.center, ev.zoom);\n\t},\n\n\t_onZoom: function () {\n\t\tthis._updateTransform(this._map.getCenter(), this._map.getZoom());\n\t},\n\n\t_updateTransform: function (center, zoom) {\n\t\tvar scale = this._map.getZoomScale(zoom, this._zoom),\n\t\t    viewHalf = this._map.getSize().multiplyBy(0.5 + this.options.padding),\n\t\t    currentCenterPoint = this._map.project(this._center, zoom),\n\n\t\t    topLeftOffset = viewHalf.multiplyBy(-scale).add(currentCenterPoint)\n\t\t\t\t  .subtract(this._map._getNewPixelOrigin(center, zoom));\n\n\t\tif (Browser.any3d) {\n\t\t\tDomUtil.setTransform(this._container, topLeftOffset, scale);\n\t\t} else {\n\t\t\tDomUtil.setPosition(this._container, topLeftOffset);\n\t\t}\n\t},\n\n\t_reset: function () {\n\t\tthis._update();\n\t\tthis._updateTransform(this._center, this._zoom);\n\n\t\tfor (var id in this._layers) {\n\t\t\tthis._layers[id]._reset();\n\t\t}\n\t},\n\n\t_onZoomEnd: function () {\n\t\tfor (var id in this._layers) {\n\t\t\tthis._layers[id]._project();\n\t\t}\n\t},\n\n\t_updatePaths: function () {\n\t\tfor (var id in this._layers) {\n\t\t\tthis._layers[id]._update();\n\t\t}\n\t},\n\n\t_update: function () {\n\t\t// Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n\t\t// Subclasses are responsible of firing the 'update' event.\n\t\tvar p = this.options.padding,\n\t\t    size = this._map.getSize(),\n\t\t    min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round();\n\n\t\tthis._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());\n\n\t\tthis._center = this._map.getCenter();\n\t\tthis._zoom = this._map.getZoom();\n\t}\n});\n", "import {Renderer} from './Renderer';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as DomEvent from '../../dom/DomEvent';\nimport Browser from '../../core/Browser';\nimport * as Util from '../../core/Util';\nimport {Bounds} from '../../geometry/Bounds';\n\n/*\n * @class Canvas\n * @inherits Renderer\n * @aka L.Canvas\n *\n * Allows vector layers to be displayed with [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).\n * Inherits `Renderer`.\n *\n * Due to [technical limitations](https://caniuse.com/canvas), Canvas is not\n * available in all web browsers, notably IE8, and overlapping geometries might\n * not display properly in some edge cases.\n *\n * @example\n *\n * Use Canvas by default for all paths in the map:\n *\n * ```js\n * var map = L.map('map', {\n * \trenderer: L.canvas()\n * });\n * ```\n *\n * Use a Canvas renderer with extra padding for specific vector geometries:\n *\n * ```js\n * var map = L.map('map');\n * var myRenderer = L.canvas({ padding: 0.5 });\n * var line = L.polyline( coordinates, { renderer: myRenderer } );\n * var circle = L.circle( center, { renderer: myRenderer } );\n * ```\n */\n\nexport var Canvas = Renderer.extend({\n\n\t// @section\n\t// @aka Canvas options\n\toptions: {\n\t\t// @option tolerance: Number = 0\n\t\t// How much to extend the click tolerance around a path/object on the map.\n\t\ttolerance: 0\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = Renderer.prototype.getEvents.call(this);\n\t\tevents.viewprereset = this._onViewPreReset;\n\t\treturn events;\n\t},\n\n\t_onViewPreReset: function () {\n\t\t// Set a flag so that a viewprereset+moveend+viewreset only updates&redraws once\n\t\tthis._postponeUpdatePaths = true;\n\t},\n\n\tonAdd: function () {\n\t\tRenderer.prototype.onAdd.call(this);\n\n\t\t// Redraw vectors since canvas is cleared upon removal,\n\t\t// in case of removing the renderer itself from the map.\n\t\tthis._draw();\n\t},\n\n\t_initContainer: function () {\n\t\tvar container = this._container = document.createElement('canvas');\n\n\t\tDomEvent.on(container, 'mousemove', this._onMouseMove, this);\n\t\tDomEvent.on(container, 'click dblclick mousedown mouseup contextmenu', this._onClick, this);\n\t\tDomEvent.on(container, 'mouseout', this._handleMouseOut, this);\n\t\tcontainer['_leaflet_disable_events'] = true;\n\n\t\tthis._ctx = container.getContext('2d');\n\t},\n\n\t_destroyContainer: function () {\n\t\tUtil.cancelAnimFrame(this._redrawRequest);\n\t\tdelete this._ctx;\n\t\tDomUtil.remove(this._container);\n\t\tDomEvent.off(this._container);\n\t\tdelete this._container;\n\t},\n\n\t_updatePaths: function () {\n\t\tif (this._postponeUpdatePaths) { return; }\n\n\t\tvar layer;\n\t\tthis._redrawBounds = null;\n\t\tfor (var id in this._layers) {\n\t\t\tlayer = this._layers[id];\n\t\t\tlayer._update();\n\t\t}\n\t\tthis._redraw();\n\t},\n\n\t_update: function () {\n\t\tif (this._map._animatingZoom && this._bounds) { return; }\n\n\t\tRenderer.prototype._update.call(this);\n\n\t\tvar b = this._bounds,\n\t\t    container = this._container,\n\t\t    size = b.getSize(),\n\t\t    m = Browser.retina ? 2 : 1;\n\n\t\tDomUtil.setPosition(container, b.min);\n\n\t\t// set canvas size (also clearing it); use double size on retina\n\t\tcontainer.width = m * size.x;\n\t\tcontainer.height = m * size.y;\n\t\tcontainer.style.width = size.x + 'px';\n\t\tcontainer.style.height = size.y + 'px';\n\n\t\tif (Browser.retina) {\n\t\t\tthis._ctx.scale(2, 2);\n\t\t}\n\n\t\t// translate so we use the same path coordinates after canvas element moves\n\t\tthis._ctx.translate(-b.min.x, -b.min.y);\n\n\t\t// Tell paths to redraw themselves\n\t\tthis.fire('update');\n\t},\n\n\t_reset: function () {\n\t\tRenderer.prototype._reset.call(this);\n\n\t\tif (this._postponeUpdatePaths) {\n\t\t\tthis._postponeUpdatePaths = false;\n\t\t\tthis._updatePaths();\n\t\t}\n\t},\n\n\t_initPath: function (layer) {\n\t\tthis._updateDashArray(layer);\n\t\tthis._layers[Util.stamp(layer)] = layer;\n\n\t\tvar order = layer._order = {\n\t\t\tlayer: layer,\n\t\t\tprev: this._drawLast,\n\t\t\tnext: null\n\t\t};\n\t\tif (this._drawLast) { this._drawLast.next = order; }\n\t\tthis._drawLast = order;\n\t\tthis._drawFirst = this._drawFirst || this._drawLast;\n\t},\n\n\t_addPath: function (layer) {\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_removePath: function (layer) {\n\t\tvar order = layer._order;\n\t\tvar next = order.next;\n\t\tvar prev = order.prev;\n\n\t\tif (next) {\n\t\t\tnext.prev = prev;\n\t\t} else {\n\t\t\tthis._drawLast = prev;\n\t\t}\n\t\tif (prev) {\n\t\t\tprev.next = next;\n\t\t} else {\n\t\t\tthis._drawFirst = next;\n\t\t}\n\n\t\tdelete layer._order;\n\n\t\tdelete this._layers[Util.stamp(layer)];\n\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_updatePath: function (layer) {\n\t\t// Redraw the union of the layer's old pixel\n\t\t// bounds and the new pixel bounds.\n\t\tthis._extendRedrawBounds(layer);\n\t\tlayer._project();\n\t\tlayer._update();\n\t\t// The redraw will extend the redraw bounds\n\t\t// with the new pixel bounds.\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_updateStyle: function (layer) {\n\t\tthis._updateDashArray(layer);\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_updateDashArray: function (layer) {\n\t\tif (typeof layer.options.dashArray === 'string') {\n\t\t\tvar parts = layer.options.dashArray.split(/[, ]+/),\n\t\t\t    dashArray = [],\n\t\t\t    dashValue,\n\t\t\t    i;\n\t\t\tfor (i = 0; i < parts.length; i++) {\n\t\t\t\tdashValue = Number(parts[i]);\n\t\t\t\t// Ignore dash array containing invalid lengths\n\t\t\t\tif (isNaN(dashValue)) { return; }\n\t\t\t\tdashArray.push(dashValue);\n\t\t\t}\n\t\t\tlayer.options._dashArray = dashArray;\n\t\t} else {\n\t\t\tlayer.options._dashArray = layer.options.dashArray;\n\t\t}\n\t},\n\n\t_requestRedraw: function (layer) {\n\t\tif (!this._map) { return; }\n\n\t\tthis._extendRedrawBounds(layer);\n\t\tthis._redrawRequest = this._redrawRequest || Util.requestAnimFrame(this._redraw, this);\n\t},\n\n\t_extendRedrawBounds: function (layer) {\n\t\tif (layer._pxBounds) {\n\t\t\tvar padding = (layer.options.weight || 0) + 1;\n\t\t\tthis._redrawBounds = this._redrawBounds || new Bounds();\n\t\t\tthis._redrawBounds.extend(layer._pxBounds.min.subtract([padding, padding]));\n\t\t\tthis._redrawBounds.extend(layer._pxBounds.max.add([padding, padding]));\n\t\t}\n\t},\n\n\t_redraw: function () {\n\t\tthis._redrawRequest = null;\n\n\t\tif (this._redrawBounds) {\n\t\t\tthis._redrawBounds.min._floor();\n\t\t\tthis._redrawBounds.max._ceil();\n\t\t}\n\n\t\tthis._clear(); // clear layers in redraw bounds\n\t\tthis._draw(); // draw layers\n\n\t\tthis._redrawBounds = null;\n\t},\n\n\t_clear: function () {\n\t\tvar bounds = this._redrawBounds;\n\t\tif (bounds) {\n\t\t\tvar size = bounds.getSize();\n\t\t\tthis._ctx.clearRect(bounds.min.x, bounds.min.y, size.x, size.y);\n\t\t} else {\n\t\t\tthis._ctx.save();\n\t\t\tthis._ctx.setTransform(1, 0, 0, 1, 0, 0);\n\t\t\tthis._ctx.clearRect(0, 0, this._container.width, this._container.height);\n\t\t\tthis._ctx.restore();\n\t\t}\n\t},\n\n\t_draw: function () {\n\t\tvar layer, bounds = this._redrawBounds;\n\t\tthis._ctx.save();\n\t\tif (bounds) {\n\t\t\tvar size = bounds.getSize();\n\t\t\tthis._ctx.beginPath();\n\t\t\tthis._ctx.rect(bounds.min.x, bounds.min.y, size.x, size.y);\n\t\t\tthis._ctx.clip();\n\t\t}\n\n\t\tthis._drawing = true;\n\n\t\tfor (var order = this._drawFirst; order; order = order.next) {\n\t\t\tlayer = order.layer;\n\t\t\tif (!bounds || (layer._pxBounds && layer._pxBounds.intersects(bounds))) {\n\t\t\t\tlayer._updatePath();\n\t\t\t}\n\t\t}\n\n\t\tthis._drawing = false;\n\n\t\tthis._ctx.restore();  // Restore state before clipping.\n\t},\n\n\t_updatePoly: function (layer, closed) {\n\t\tif (!this._drawing) { return; }\n\n\t\tvar i, j, len2, p,\n\t\t    parts = layer._parts,\n\t\t    len = parts.length,\n\t\t    ctx = this._ctx;\n\n\t\tif (!len) { return; }\n\n\t\tctx.beginPath();\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tfor (j = 0, len2 = parts[i].length; j < len2; j++) {\n\t\t\t\tp = parts[i][j];\n\t\t\t\tctx[j ? 'lineTo' : 'moveTo'](p.x, p.y);\n\t\t\t}\n\t\t\tif (closed) {\n\t\t\t\tctx.closePath();\n\t\t\t}\n\t\t}\n\n\t\tthis._fillStroke(ctx, layer);\n\n\t\t// TODO optimization: 1 fill/stroke for all features with equal style instead of 1 for each feature\n\t},\n\n\t_updateCircle: function (layer) {\n\n\t\tif (!this._drawing || layer._empty()) { return; }\n\n\t\tvar p = layer._point,\n\t\t    ctx = this._ctx,\n\t\t    r = Math.max(Math.round(layer._radius), 1),\n\t\t    s = (Math.max(Math.round(layer._radiusY), 1) || r) / r;\n\n\t\tif (s !== 1) {\n\t\t\tctx.save();\n\t\t\tctx.scale(1, s);\n\t\t}\n\n\t\tctx.beginPath();\n\t\tctx.arc(p.x, p.y / s, r, 0, Math.PI * 2, false);\n\n\t\tif (s !== 1) {\n\t\t\tctx.restore();\n\t\t}\n\n\t\tthis._fillStroke(ctx, layer);\n\t},\n\n\t_fillStroke: function (ctx, layer) {\n\t\tvar options = layer.options;\n\n\t\tif (options.fill) {\n\t\t\tctx.globalAlpha = options.fillOpacity;\n\t\t\tctx.fillStyle = options.fillColor || options.color;\n\t\t\tctx.fill(options.fillRule || 'evenodd');\n\t\t}\n\n\t\tif (options.stroke && options.weight !== 0) {\n\t\t\tif (ctx.setLineDash) {\n\t\t\t\tctx.setLineDash(layer.options && layer.options._dashArray || []);\n\t\t\t}\n\t\t\tctx.globalAlpha = options.opacity;\n\t\t\tctx.lineWidth = options.weight;\n\t\t\tctx.strokeStyle = options.color;\n\t\t\tctx.lineCap = options.lineCap;\n\t\t\tctx.lineJoin = options.lineJoin;\n\t\t\tctx.stroke();\n\t\t}\n\t},\n\n\t// Canvas obviously doesn't have mouse events for individual drawn objects,\n\t// so we emulate that by calculating what's under the mouse on mousemove/click manually\n\n\t_onClick: function (e) {\n\t\tvar point = this._map.mouseEventToLayerPoint(e), layer, clickedLayer;\n\n\t\tfor (var order = this._drawFirst; order; order = order.next) {\n\t\t\tlayer = order.layer;\n\t\t\tif (layer.options.interactive && layer._containsPoint(point)) {\n\t\t\t\tif (!(e.type === 'click' || e.type === 'preclick') || !this._map._draggableMoved(layer)) {\n\t\t\t\t\tclickedLayer = layer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._fireEvent(clickedLayer ? [clickedLayer] : false, e);\n\t},\n\n\t_onMouseMove: function (e) {\n\t\tif (!this._map || this._map.dragging.moving() || this._map._animatingZoom) { return; }\n\n\t\tvar point = this._map.mouseEventToLayerPoint(e);\n\t\tthis._handleMouseHover(e, point);\n\t},\n\n\n\t_handleMouseOut: function (e) {\n\t\tvar layer = this._hoveredLayer;\n\t\tif (layer) {\n\t\t\t// if we're leaving the layer, fire mouseout\n\t\t\tDomUtil.removeClass(this._container, 'leaflet-interactive');\n\t\t\tthis._fireEvent([layer], e, 'mouseout');\n\t\t\tthis._hoveredLayer = null;\n\t\t\tthis._mouseHoverThrottled = false;\n\t\t}\n\t},\n\n\t_handleMouseHover: function (e, point) {\n\t\tif (this._mouseHoverThrottled) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar layer, candidateHoveredLayer;\n\n\t\tfor (var order = this._drawFirst; order; order = order.next) {\n\t\t\tlayer = order.layer;\n\t\t\tif (layer.options.interactive && layer._containsPoint(point)) {\n\t\t\t\tcandidateHoveredLayer = layer;\n\t\t\t}\n\t\t}\n\n\t\tif (candidateHoveredLayer !== this._hoveredLayer) {\n\t\t\tthis._handleMouseOut(e);\n\n\t\t\tif (candidateHoveredLayer) {\n\t\t\t\tDomUtil.addClass(this._container, 'leaflet-interactive'); // change cursor\n\t\t\t\tthis._fireEvent([candidateHoveredLayer], e, 'mouseover');\n\t\t\t\tthis._hoveredLayer = candidateHoveredLayer;\n\t\t\t}\n\t\t}\n\n\t\tthis._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : false, e);\n\n\t\tthis._mouseHoverThrottled = true;\n\t\tsetTimeout(Util.bind(function () {\n\t\t\tthis._mouseHoverThrottled = false;\n\t\t}, this), 32);\n\t},\n\n\t_fireEvent: function (layers, e, type) {\n\t\tthis._map._fireDOMEvent(e, type || e.type, layers);\n\t},\n\n\t_bringToFront: function (layer) {\n\t\tvar order = layer._order;\n\n\t\tif (!order) { return; }\n\n\t\tvar next = order.next;\n\t\tvar prev = order.prev;\n\n\t\tif (next) {\n\t\t\tnext.prev = prev;\n\t\t} else {\n\t\t\t// Already last\n\t\t\treturn;\n\t\t}\n\t\tif (prev) {\n\t\t\tprev.next = next;\n\t\t} else if (next) {\n\t\t\t// Update first entry unless this is the\n\t\t\t// single entry\n\t\t\tthis._drawFirst = next;\n\t\t}\n\n\t\torder.prev = this._drawLast;\n\t\tthis._drawLast.next = order;\n\n\t\torder.next = null;\n\t\tthis._drawLast = order;\n\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_bringToBack: function (layer) {\n\t\tvar order = layer._order;\n\n\t\tif (!order) { return; }\n\n\t\tvar next = order.next;\n\t\tvar prev = order.prev;\n\n\t\tif (prev) {\n\t\t\tprev.next = next;\n\t\t} else {\n\t\t\t// Already first\n\t\t\treturn;\n\t\t}\n\t\tif (next) {\n\t\t\tnext.prev = prev;\n\t\t} else if (prev) {\n\t\t\t// Update last entry unless this is the\n\t\t\t// single entry\n\t\t\tthis._drawLast = prev;\n\t\t}\n\n\t\torder.prev = null;\n\n\t\torder.next = this._drawFirst;\n\t\tthis._drawFirst.prev = order;\n\t\tthis._drawFirst = order;\n\n\t\tthis._requestRedraw(layer);\n\t}\n});\n\n// @factory L.canvas(options?: Renderer options)\n// Creates a Canvas renderer with the given options.\nexport function canvas(options) {\n\treturn Browser.canvas ? new Canvas(options) : null;\n}\n", "import * as DomUtil from '../../dom/DomUtil';\nimport * as Util from '../../core/Util';\nimport {Renderer} from './Renderer';\n\n/*\n * Thanks to Dmitry Baranovsky and his Raphael library for inspiration!\n */\n\n\nexport var vmlCreate = (function () {\n\ttry {\n\t\tdocument.namespaces.add('lvml', 'urn:schemas-microsoft-com:vml');\n\t\treturn function (name) {\n\t\t\treturn document.createElement('<lvml:' + name + ' class=\"lvml\">');\n\t\t};\n\t} catch (e) {\n\t\t// Do not return fn from catch block so `e` can be garbage collected\n\t\t// See https://github.com/Leaflet/Leaflet/pull/7279\n\t}\n\treturn function (name) {\n\t\treturn document.createElement('<' + name + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"lvml\">');\n\t};\n})();\n\n\n/*\n * @class SVG\n *\n *\n * VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility\n * with old versions of Internet Explorer.\n */\n\n// mixin to redefine some SVG methods to handle VML syntax which is similar but with some differences\nexport var vmlMixin = {\n\n\t_initContainer: function () {\n\t\tthis._container = DomUtil.create('div', 'leaflet-vml-container');\n\t},\n\n\t_update: function () {\n\t\tif (this._map._animatingZoom) { return; }\n\t\tRenderer.prototype._update.call(this);\n\t\tthis.fire('update');\n\t},\n\n\t_initPath: function (layer) {\n\t\tvar container = layer._container = vmlCreate('shape');\n\n\t\tDomUtil.addClass(container, 'leaflet-vml-shape ' + (this.options.className || ''));\n\n\t\tcontainer.coordsize = '1 1';\n\n\t\tlayer._path = vmlCreate('path');\n\t\tcontainer.appendChild(layer._path);\n\n\t\tthis._updateStyle(layer);\n\t\tthis._layers[Util.stamp(layer)] = layer;\n\t},\n\n\t_addPath: function (layer) {\n\t\tvar container = layer._container;\n\t\tthis._container.appendChild(container);\n\n\t\tif (layer.options.interactive) {\n\t\t\tlayer.addInteractiveTarget(container);\n\t\t}\n\t},\n\n\t_removePath: function (layer) {\n\t\tvar container = layer._container;\n\t\tDomUtil.remove(container);\n\t\tlayer.removeInteractiveTarget(container);\n\t\tdelete this._layers[Util.stamp(layer)];\n\t},\n\n\t_updateStyle: function (layer) {\n\t\tvar stroke = layer._stroke,\n\t\t    fill = layer._fill,\n\t\t    options = layer.options,\n\t\t    container = layer._container;\n\n\t\tcontainer.stroked = !!options.stroke;\n\t\tcontainer.filled = !!options.fill;\n\n\t\tif (options.stroke) {\n\t\t\tif (!stroke) {\n\t\t\t\tstroke = layer._stroke = vmlCreate('stroke');\n\t\t\t}\n\t\t\tcontainer.appendChild(stroke);\n\t\t\tstroke.weight = options.weight + 'px';\n\t\t\tstroke.color = options.color;\n\t\t\tstroke.opacity = options.opacity;\n\n\t\t\tif (options.dashArray) {\n\t\t\t\tstroke.dashStyle = Util.isArray(options.dashArray) ?\n\t\t\t\t    options.dashArray.join(' ') :\n\t\t\t\t    options.dashArray.replace(/( *, *)/g, ' ');\n\t\t\t} else {\n\t\t\t\tstroke.dashStyle = '';\n\t\t\t}\n\t\t\tstroke.endcap = options.lineCap.replace('butt', 'flat');\n\t\t\tstroke.joinstyle = options.lineJoin;\n\n\t\t} else if (stroke) {\n\t\t\tcontainer.removeChild(stroke);\n\t\t\tlayer._stroke = null;\n\t\t}\n\n\t\tif (options.fill) {\n\t\t\tif (!fill) {\n\t\t\t\tfill = layer._fill = vmlCreate('fill');\n\t\t\t}\n\t\t\tcontainer.appendChild(fill);\n\t\t\tfill.color = options.fillColor || options.color;\n\t\t\tfill.opacity = options.fillOpacity;\n\n\t\t} else if (fill) {\n\t\t\tcontainer.removeChild(fill);\n\t\t\tlayer._fill = null;\n\t\t}\n\t},\n\n\t_updateCircle: function (layer) {\n\t\tvar p = layer._point.round(),\n\t\t    r = Math.round(layer._radius),\n\t\t    r2 = Math.round(layer._radiusY || r);\n\n\t\tthis._setPath(layer, layer._empty() ? 'M0 0' :\n\t\t\t'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360));\n\t},\n\n\t_setPath: function (layer, path) {\n\t\tlayer._path.v = path;\n\t},\n\n\t_bringToFront: function (layer) {\n\t\tDomUtil.toFront(layer._container);\n\t},\n\n\t_bringToBack: function (layer) {\n\t\tDomUtil.toBack(layer._container);\n\t}\n};\n", "import {Renderer} from './Renderer';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as DomEvent from '../../dom/DomEvent';\nimport Browser from '../../core/Browser';\nimport {stamp} from '../../core/Util';\nimport {svgCreate, pointsToPath} from './SVG.Util';\nexport {pointsToPath};\nimport {vmlMixin, vmlCreate} from './SVG.VML';\n\nexport var create = Browser.vml ? vmlCreate : svgCreate;\n\n/*\n * @class SVG\n * @inherits Renderer\n * @aka L.SVG\n *\n * Allows vector layers to be displayed with [SVG](https://developer.mozilla.org/docs/Web/SVG).\n * Inherits `Renderer`.\n *\n * Due to [technical limitations](https://caniuse.com/svg), SVG is not\n * available in all web browsers, notably Android 2.x and 3.x.\n *\n * Although SVG is not available on IE7 and IE8, these browsers support\n * [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language)\n * (a now deprecated technology), and the SVG renderer will fall back to VML in\n * this case.\n *\n * @example\n *\n * Use SVG by default for all paths in the map:\n *\n * ```js\n * var map = L.map('map', {\n * \trenderer: L.svg()\n * });\n * ```\n *\n * Use a SVG renderer with extra padding for specific vector geometries:\n *\n * ```js\n * var map = L.map('map');\n * var myRenderer = L.svg({ padding: 0.5 });\n * var line = L.polyline( coordinates, { renderer: myRenderer } );\n * var circle = L.circle( center, { renderer: myRenderer } );\n * ```\n */\n\nexport var SVG = Renderer.extend({\n\n\t_initContainer: function () {\n\t\tthis._container = create('svg');\n\n\t\t// makes it possible to click through svg root; we'll reset it back in individual paths\n\t\tthis._container.setAttribute('pointer-events', 'none');\n\n\t\tthis._rootGroup = create('g');\n\t\tthis._container.appendChild(this._rootGroup);\n\t},\n\n\t_destroyContainer: function () {\n\t\tDomUtil.remove(this._container);\n\t\tDomEvent.off(this._container);\n\t\tdelete this._container;\n\t\tdelete this._rootGroup;\n\t\tdelete this._svgSize;\n\t},\n\n\t_update: function () {\n\t\tif (this._map._animatingZoom && this._bounds) { return; }\n\n\t\tRenderer.prototype._update.call(this);\n\n\t\tvar b = this._bounds,\n\t\t    size = b.getSize(),\n\t\t    container = this._container;\n\n\t\t// set size of svg-container if changed\n\t\tif (!this._svgSize || !this._svgSize.equals(size)) {\n\t\t\tthis._svgSize = size;\n\t\t\tcontainer.setAttribute('width', size.x);\n\t\t\tcontainer.setAttribute('height', size.y);\n\t\t}\n\n\t\t// movement: update container viewBox so that we don't have to change coordinates of individual layers\n\t\tDomUtil.setPosition(container, b.min);\n\t\tcontainer.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));\n\n\t\tthis.fire('update');\n\t},\n\n\t// methods below are called by vector layers implementations\n\n\t_initPath: function (layer) {\n\t\tvar path = layer._path = create('path');\n\n\t\t// @namespace Path\n\t\t// @option className: String = null\n\t\t// Custom class name set on an element. Only for SVG renderer.\n\t\tif (layer.options.className) {\n\t\t\tDomUtil.addClass(path, layer.options.className);\n\t\t}\n\n\t\tif (layer.options.interactive) {\n\t\t\tDomUtil.addClass(path, 'leaflet-interactive');\n\t\t}\n\n\t\tthis._updateStyle(layer);\n\t\tthis._layers[stamp(layer)] = layer;\n\t},\n\n\t_addPath: function (layer) {\n\t\tif (!this._rootGroup) { this._initContainer(); }\n\t\tthis._rootGroup.appendChild(layer._path);\n\t\tlayer.addInteractiveTarget(layer._path);\n\t},\n\n\t_removePath: function (layer) {\n\t\tDomUtil.remove(layer._path);\n\t\tlayer.removeInteractiveTarget(layer._path);\n\t\tdelete this._layers[stamp(layer)];\n\t},\n\n\t_updatePath: function (layer) {\n\t\tlayer._project();\n\t\tlayer._update();\n\t},\n\n\t_updateStyle: function (layer) {\n\t\tvar path = layer._path,\n\t\t    options = layer.options;\n\n\t\tif (!path) { return; }\n\n\t\tif (options.stroke) {\n\t\t\tpath.setAttribute('stroke', options.color);\n\t\t\tpath.setAttribute('stroke-opacity', options.opacity);\n\t\t\tpath.setAttribute('stroke-width', options.weight);\n\t\t\tpath.setAttribute('stroke-linecap', options.lineCap);\n\t\t\tpath.setAttribute('stroke-linejoin', options.lineJoin);\n\n\t\t\tif (options.dashArray) {\n\t\t\t\tpath.setAttribute('stroke-dasharray', options.dashArray);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dasharray');\n\t\t\t}\n\n\t\t\tif (options.dashOffset) {\n\t\t\t\tpath.setAttribute('stroke-dashoffset', options.dashOffset);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dashoffset');\n\t\t\t}\n\t\t} else {\n\t\t\tpath.setAttribute('stroke', 'none');\n\t\t}\n\n\t\tif (options.fill) {\n\t\t\tpath.setAttribute('fill', options.fillColor || options.color);\n\t\t\tpath.setAttribute('fill-opacity', options.fillOpacity);\n\t\t\tpath.setAttribute('fill-rule', options.fillRule || 'evenodd');\n\t\t} else {\n\t\t\tpath.setAttribute('fill', 'none');\n\t\t}\n\t},\n\n\t_updatePoly: function (layer, closed) {\n\t\tthis._setPath(layer, pointsToPath(layer._parts, closed));\n\t},\n\n\t_updateCircle: function (layer) {\n\t\tvar p = layer._point,\n\t\t    r = Math.max(Math.round(layer._radius), 1),\n\t\t    r2 = Math.max(Math.round(layer._radiusY), 1) || r,\n\t\t    arc = 'a' + r + ',' + r2 + ' 0 1,0 ';\n\n\t\t// drawing a circle with two half-arcs\n\t\tvar d = layer._empty() ? 'M0 0' :\n\t\t\t'M' + (p.x - r) + ',' + p.y +\n\t\t\tarc + (r * 2) + ',0 ' +\n\t\t\tarc + (-r * 2) + ',0 ';\n\n\t\tthis._setPath(layer, d);\n\t},\n\n\t_setPath: function (layer, path) {\n\t\tlayer._path.setAttribute('d', path);\n\t},\n\n\t// SVG does not have the concept of zIndex so we resort to changing the DOM order of elements\n\t_bringToFront: function (layer) {\n\t\tDomUtil.toFront(layer._path);\n\t},\n\n\t_bringToBack: function (layer) {\n\t\tDomUtil.toBack(layer._path);\n\t}\n});\n\nif (Browser.vml) {\n\tSVG.include(vmlMixin);\n}\n\n// @namespace SVG\n// @factory L.svg(options?: Renderer options)\n// Creates a SVG renderer with the given options.\nexport function svg(options) {\n\treturn Browser.svg || Browser.vml ? new SVG(options) : null;\n}\n", "import {Map} from '../../map/Map';\nimport {canvas} from './Canvas';\nimport {svg} from './SVG';\n\nMap.include({\n\t// @namespace Map; @method getRenderer(layer: Path): Renderer\n\t// Returns the instance of `Renderer` that should be used to render the given\n\t// `Path`. It will ensure that the `renderer` options of the map and paths\n\t// are respected, and that the renderers do exist on the map.\n\tgetRenderer: function (layer) {\n\t\t// @namespace Path; @option renderer: Renderer\n\t\t// Use this specific instance of `Renderer` for this path. Takes\n\t\t// precedence over the map's [default renderer](#map-renderer).\n\t\tvar renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer;\n\n\t\tif (!renderer) {\n\t\t\trenderer = this._renderer = this._createRenderer();\n\t\t}\n\n\t\tif (!this.hasLayer(renderer)) {\n\t\t\tthis.addLayer(renderer);\n\t\t}\n\t\treturn renderer;\n\t},\n\n\t_getPaneRenderer: function (name) {\n\t\tif (name === 'overlayPane' || name === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar renderer = this._paneRenderers[name];\n\t\tif (renderer === undefined) {\n\t\t\trenderer = this._createRenderer({pane: name});\n\t\t\tthis._paneRenderers[name] = renderer;\n\t\t}\n\t\treturn renderer;\n\t},\n\n\t_createRenderer: function (options) {\n\t\t// @namespace Map; @option preferCanvas: Boolean = false\n\t\t// Whether `Path`s should be rendered on a `Canvas` renderer.\n\t\t// By default, all `Path`s are rendered in a `SVG` renderer.\n\t\treturn (this.options.preferCanvas && canvas(options)) || svg(options);\n\t}\n});\n", "import {Polygon} from './Polygon';\nimport {toLatLngBounds} from '../../geo/LatLngBounds';\n\n/*\n * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object.\n */\n\n/*\n * @class Rectangle\n * @aka L.Rectangle\n * @inherits Polygon\n *\n * A class for drawing rectangle overlays on a map. Extends `Polygon`.\n *\n * @example\n *\n * ```js\n * // define rectangle geographical bounds\n * var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];\n *\n * // create an orange rectangle\n * L.rectangle(bounds, {color: \"#ff7800\", weight: 1}).addTo(map);\n *\n * // zoom the map to the rectangle bounds\n * map.fitBounds(bounds);\n * ```\n *\n */\n\n\nexport var Rectangle = Polygon.extend({\n\tinitialize: function (latLngBounds, options) {\n\t\tPolygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options);\n\t},\n\n\t// @method setBounds(latLngBounds: LatLngBounds): this\n\t// Redraws the rectangle with the passed bounds.\n\tsetBounds: function (latLngBounds) {\n\t\treturn this.setLatLngs(this._boundsToLatLngs(latLngBounds));\n\t},\n\n\t_boundsToLatLngs: function (latLngBounds) {\n\t\tlatLngBounds = toLatLngBounds(latLngBounds);\n\t\treturn [\n\t\t\tlatLngBounds.getSouthWest(),\n\t\t\tlatLngBounds.getNorthWest(),\n\t\t\tlatLngBounds.getNorthEast(),\n\t\t\tlatLngBounds.getSouthEast()\n\t\t];\n\t}\n});\n\n\n// @factory L.rectangle(latLngBounds: LatLngBounds, options?: Polyline options)\nexport function rectangle(latLngBounds, options) {\n\treturn new Rectangle(latLngBounds, options);\n}\n", "export {Renderer} from './Renderer';\nexport {Canvas, canvas} from './Canvas';\nimport {SVG, create, pointsToPath, svg} from './SVG';\nSVG.create = create;\nSVG.pointsToPath = pointsToPath;\nexport {SVG, svg};\nimport './Renderer.getRenderer';\t// This is a bit of a hack, but needed because circular dependencies\n\nexport {Path} from './Path';\nexport {CircleMarker, circleMarker} from './CircleMarker';\nexport {Circle, circle} from './Circle';\nexport {Polyline, polyline} from './Polyline';\nexport {Polygon, polygon} from './Polygon';\nexport {Rectangle, rectangle} from './Rectangle';\n", "export {Layer} from './Layer';\nexport {LayerGroup, layerGroup} from './LayerGroup';\nexport {FeatureGroup, featureGroup} from './FeatureGroup';\nimport {GeoJSON, geoJSON, geoJson, geometryToLayer, coordsToLatLng, coordsToLatLngs, latLngToCoords, latLngsToCoords, getFeature, asFeature} from './GeoJSON';\nGeoJSON.geometryToLayer = geometryToLayer;\nGeoJSON.coordsToLatLng = coordsToLatLng;\nGeoJSON.coordsToLatLngs = coordsToLatLngs;\nGeoJSON.latLngToCoords = latLngToCoords;\nGeoJSON.latLngsToCoords = latLngsToCoords;\nGeoJSON.getFeature = getFeature;\nGeoJSON.asFeature = asFeature;\nexport {GeoJSON, geoJSON, geoJson};\n\nexport {ImageOverlay, imageOverlay} from './ImageOverlay';\nexport {VideoOverlay, videoOverlay} from './VideoOverlay';\nexport {SVGOverlay, svgOverlay} from './SVGOverlay';\n\nexport {DivOverlay} from './DivOverlay';\nexport {Popup, popup} from './Popup';\nexport {Tooltip, tooltip} from './Tooltip';\n\nexport * from './marker/index';\nexport * from './tile/index';\nexport * from './vector/index';\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as DomEvent from '../../dom/DomEvent';\nimport {LatLngBounds} from '../../geo/LatLngBounds';\nimport {Bounds} from '../../geometry/Bounds';\n\n/*\n * L.Handler.BoxZoom is used to add shift-drag zoom interaction to the map\n * (zoom to a selected bounding box), enabled by default.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @option boxZoom: Boolean = true\n\t// Whether the map can be zoomed to a rectangular area specified by\n\t// dragging the mouse while pressing the shift key.\n\tboxZoom: true\n});\n\nexport var BoxZoom = Handler.extend({\n\tinitialize: function (map) {\n\t\tthis._map = map;\n\t\tthis._container = map._container;\n\t\tthis._pane = map._panes.overlayPane;\n\t\tthis._resetStateTimeout = 0;\n\t\tmap.on('unload', this._destroy, this);\n\t},\n\n\taddHooks: function () {\n\t\tDomEvent.on(this._container, 'mousedown', this._onMouseDown, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tDomEvent.off(this._container, 'mousedown', this._onMouseDown, this);\n\t},\n\n\tmoved: function () {\n\t\treturn this._moved;\n\t},\n\n\t_destroy: function () {\n\t\tDomUtil.remove(this._pane);\n\t\tdelete this._pane;\n\t},\n\n\t_resetState: function () {\n\t\tthis._resetStateTimeout = 0;\n\t\tthis._moved = false;\n\t},\n\n\t_clearDeferredResetState: function () {\n\t\tif (this._resetStateTimeout !== 0) {\n\t\t\tclearTimeout(this._resetStateTimeout);\n\t\t\tthis._resetStateTimeout = 0;\n\t\t}\n\t},\n\n\t_onMouseDown: function (e) {\n\t\tif (!e.shiftKey || ((e.which !== 1) && (e.button !== 1))) { return false; }\n\n\t\t// Clear the deferred resetState if it hasn't executed yet, otherwise it\n\t\t// will interrupt the interaction and orphan a box element in the container.\n\t\tthis._clearDeferredResetState();\n\t\tthis._resetState();\n\n\t\tDomUtil.disableTextSelection();\n\t\tDomUtil.disableImageDrag();\n\n\t\tthis._startPoint = this._map.mouseEventToContainerPoint(e);\n\n\t\tDomEvent.on(document, {\n\t\t\tcontextmenu: DomEvent.stop,\n\t\t\tmousemove: this._onMouseMove,\n\t\t\tmouseup: this._onMouseUp,\n\t\t\tkeydown: this._onKeyDown\n\t\t}, this);\n\t},\n\n\t_onMouseMove: function (e) {\n\t\tif (!this._moved) {\n\t\t\tthis._moved = true;\n\n\t\t\tthis._box = DomUtil.create('div', 'leaflet-zoom-box', this._container);\n\t\t\tDomUtil.addClass(this._container, 'leaflet-crosshair');\n\n\t\t\tthis._map.fire('boxzoomstart');\n\t\t}\n\n\t\tthis._point = this._map.mouseEventToContainerPoint(e);\n\n\t\tvar bounds = new Bounds(this._point, this._startPoint),\n\t\t    size = bounds.getSize();\n\n\t\tDomUtil.setPosition(this._box, bounds.min);\n\n\t\tthis._box.style.width  = size.x + 'px';\n\t\tthis._box.style.height = size.y + 'px';\n\t},\n\n\t_finish: function () {\n\t\tif (this._moved) {\n\t\t\tDomUtil.remove(this._box);\n\t\t\tDomUtil.removeClass(this._container, 'leaflet-crosshair');\n\t\t}\n\n\t\tDomUtil.enableTextSelection();\n\t\tDomUtil.enableImageDrag();\n\n\t\tDomEvent.off(document, {\n\t\t\tcontextmenu: DomEvent.stop,\n\t\t\tmousemove: this._onMouseMove,\n\t\t\tmouseup: this._onMouseUp,\n\t\t\tkeydown: this._onKeyDown\n\t\t}, this);\n\t},\n\n\t_onMouseUp: function (e) {\n\t\tif ((e.which !== 1) && (e.button !== 1)) { return; }\n\n\t\tthis._finish();\n\n\t\tif (!this._moved) { return; }\n\t\t// Postpone to next JS tick so internal click event handling\n\t\t// still see it as \"moved\".\n\t\tthis._clearDeferredResetState();\n\t\tthis._resetStateTimeout = setTimeout(Util.bind(this._resetState, this), 0);\n\n\t\tvar bounds = new LatLngBounds(\n\t\t        this._map.containerPointToLatLng(this._startPoint),\n\t\t        this._map.containerPointToLatLng(this._point));\n\n\t\tthis._map\n\t\t\t.fitBounds(bounds)\n\t\t\t.fire('boxzoomend', {boxZoomBounds: bounds});\n\t},\n\n\t_onKeyDown: function (e) {\n\t\tif (e.keyCode === 27) {\n\t\t\tthis._finish();\n\t\t\tthis._clearDeferredResetState();\n\t\t\tthis._resetState();\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property boxZoom: Handler\n// Box (shift-drag with mouse) zoom handler.\nMap.addInitHook('addHandler', 'boxZoom', BoxZoom);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\n\n/*\n * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default.\n */\n\n// @namespace Map\n// @section Interaction Options\n\nMap.mergeOptions({\n\t// @option doubleClickZoom: Boolean|String = true\n\t// Whether the map can be zoomed in by double clicking on it and\n\t// zoomed out by double clicking while holding shift. If passed\n\t// `'center'`, double-click zoom will zoom to the center of the\n\t//  view regardless of where the mouse was.\n\tdoubleClickZoom: true\n});\n\nexport var DoubleClickZoom = Handler.extend({\n\taddHooks: function () {\n\t\tthis._map.on('dblclick', this._onDoubleClick, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tthis._map.off('dblclick', this._onDoubleClick, this);\n\t},\n\n\t_onDoubleClick: function (e) {\n\t\tvar map = this._map,\n\t\t    oldZoom = map.getZoom(),\n\t\t    delta = map.options.zoomDelta,\n\t\t    zoom = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta;\n\n\t\tif (map.options.doubleClickZoom === 'center') {\n\t\t\tmap.setZoom(zoom);\n\t\t} else {\n\t\t\tmap.setZoomAround(e.containerPoint, zoom);\n\t\t}\n\t}\n});\n\n// @section Handlers\n//\n// Map properties include interaction handlers that allow you to control\n// interaction behavior in runtime, enabling or disabling certain features such\n// as dragging or touch zoom (see `Handler` methods). For example:\n//\n// ```js\n// map.doubleClickZoom.disable();\n// ```\n//\n// @property doubleClickZoom: Handler\n// Double click zoom handler.\nMap.addInitHook('addHandler', 'doubleClickZoom', DoubleClickZoom);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport {Draggable} from '../../dom/Draggable';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport {toLatLngBounds as latLngBounds} from '../../geo/LatLngBounds';\nimport {toBounds} from '../../geometry/Bounds';\n\n/*\n * L.Handler.MapDrag is used to make the map draggable (with panning inertia), enabled by default.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @option dragging: Boolean = true\n\t// Whether the map is draggable with mouse/touch or not.\n\tdragging: true,\n\n\t// @section Panning Inertia Options\n\t// @option inertia: Boolean = *\n\t// If enabled, panning of the map will have an inertia effect where\n\t// the map builds momentum while dragging and continues moving in\n\t// the same direction for some time. Feels especially nice on touch\n\t// devices. Enabled by default.\n\tinertia: true,\n\n\t// @option inertiaDeceleration: Number = 3000\n\t// The rate with which the inertial movement slows down, in pixels/second\u00B2.\n\tinertiaDeceleration: 3400, // px/s^2\n\n\t// @option inertiaMaxSpeed: Number = Infinity\n\t// Max speed of the inertial movement, in pixels/second.\n\tinertiaMaxSpeed: Infinity, // px/s\n\n\t// @option easeLinearity: Number = 0.2\n\teaseLinearity: 0.2,\n\n\t// TODO refactor, move to CRS\n\t// @option worldCopyJump: Boolean = false\n\t// With this option enabled, the map tracks when you pan to another \"copy\"\n\t// of the world and seamlessly jumps to the original one so that all overlays\n\t// like markers and vector layers are still visible.\n\tworldCopyJump: false,\n\n\t// @option maxBoundsViscosity: Number = 0.0\n\t// If `maxBounds` is set, this option will control how solid the bounds\n\t// are when dragging the map around. The default value of `0.0` allows the\n\t// user to drag outside the bounds at normal speed, higher values will\n\t// slow down map dragging outside bounds, and `1.0` makes the bounds fully\n\t// solid, preventing the user from dragging outside the bounds.\n\tmaxBoundsViscosity: 0.0\n});\n\nexport var Drag = Handler.extend({\n\taddHooks: function () {\n\t\tif (!this._draggable) {\n\t\t\tvar map = this._map;\n\n\t\t\tthis._draggable = new Draggable(map._mapPane, map._container);\n\n\t\t\tthis._draggable.on({\n\t\t\t\tdragstart: this._onDragStart,\n\t\t\t\tdrag: this._onDrag,\n\t\t\t\tdragend: this._onDragEnd\n\t\t\t}, this);\n\n\t\t\tthis._draggable.on('predrag', this._onPreDragLimit, this);\n\t\t\tif (map.options.worldCopyJump) {\n\t\t\t\tthis._draggable.on('predrag', this._onPreDragWrap, this);\n\t\t\t\tmap.on('zoomend', this._onZoomEnd, this);\n\n\t\t\t\tmap.whenReady(this._onZoomEnd, this);\n\t\t\t}\n\t\t}\n\t\tDomUtil.addClass(this._map._container, 'leaflet-grab leaflet-touch-drag');\n\t\tthis._draggable.enable();\n\t\tthis._positions = [];\n\t\tthis._times = [];\n\t},\n\n\tremoveHooks: function () {\n\t\tDomUtil.removeClass(this._map._container, 'leaflet-grab');\n\t\tDomUtil.removeClass(this._map._container, 'leaflet-touch-drag');\n\t\tthis._draggable.disable();\n\t},\n\n\tmoved: function () {\n\t\treturn this._draggable && this._draggable._moved;\n\t},\n\n\tmoving: function () {\n\t\treturn this._draggable && this._draggable._moving;\n\t},\n\n\t_onDragStart: function () {\n\t\tvar map = this._map;\n\n\t\tmap._stop();\n\t\tif (this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {\n\t\t\tvar bounds = latLngBounds(this._map.options.maxBounds);\n\n\t\t\tthis._offsetLimit = toBounds(\n\t\t\t\tthis._map.latLngToContainerPoint(bounds.getNorthWest()).multiplyBy(-1),\n\t\t\t\tthis._map.latLngToContainerPoint(bounds.getSouthEast()).multiplyBy(-1)\n\t\t\t\t\t.add(this._map.getSize()));\n\n\t\t\tthis._viscosity = Math.min(1.0, Math.max(0.0, this._map.options.maxBoundsViscosity));\n\t\t} else {\n\t\t\tthis._offsetLimit = null;\n\t\t}\n\n\t\tmap\n\t\t    .fire('movestart')\n\t\t    .fire('dragstart');\n\n\t\tif (map.options.inertia) {\n\t\t\tthis._positions = [];\n\t\t\tthis._times = [];\n\t\t}\n\t},\n\n\t_onDrag: function (e) {\n\t\tif (this._map.options.inertia) {\n\t\t\tvar time = this._lastTime = +new Date(),\n\t\t\t    pos = this._lastPos = this._draggable._absPos || this._draggable._newPos;\n\n\t\t\tthis._positions.push(pos);\n\t\t\tthis._times.push(time);\n\n\t\t\tthis._prunePositions(time);\n\t\t}\n\n\t\tthis._map\n\t\t    .fire('move', e)\n\t\t    .fire('drag', e);\n\t},\n\n\t_prunePositions: function (time) {\n\t\twhile (this._positions.length > 1 && time - this._times[0] > 50) {\n\t\t\tthis._positions.shift();\n\t\t\tthis._times.shift();\n\t\t}\n\t},\n\n\t_onZoomEnd: function () {\n\t\tvar pxCenter = this._map.getSize().divideBy(2),\n\t\t    pxWorldCenter = this._map.latLngToLayerPoint([0, 0]);\n\n\t\tthis._initialWorldOffset = pxWorldCenter.subtract(pxCenter).x;\n\t\tthis._worldWidth = this._map.getPixelWorldBounds().getSize().x;\n\t},\n\n\t_viscousLimit: function (value, threshold) {\n\t\treturn value - (value - threshold) * this._viscosity;\n\t},\n\n\t_onPreDragLimit: function () {\n\t\tif (!this._viscosity || !this._offsetLimit) { return; }\n\n\t\tvar offset = this._draggable._newPos.subtract(this._draggable._startPos);\n\n\t\tvar limit = this._offsetLimit;\n\t\tif (offset.x < limit.min.x) { offset.x = this._viscousLimit(offset.x, limit.min.x); }\n\t\tif (offset.y < limit.min.y) { offset.y = this._viscousLimit(offset.y, limit.min.y); }\n\t\tif (offset.x > limit.max.x) { offset.x = this._viscousLimit(offset.x, limit.max.x); }\n\t\tif (offset.y > limit.max.y) { offset.y = this._viscousLimit(offset.y, limit.max.y); }\n\n\t\tthis._draggable._newPos = this._draggable._startPos.add(offset);\n\t},\n\n\t_onPreDragWrap: function () {\n\t\t// TODO refactor to be able to adjust map pane position after zoom\n\t\tvar worldWidth = this._worldWidth,\n\t\t    halfWidth = Math.round(worldWidth / 2),\n\t\t    dx = this._initialWorldOffset,\n\t\t    x = this._draggable._newPos.x,\n\t\t    newX1 = (x - halfWidth + dx) % worldWidth + halfWidth - dx,\n\t\t    newX2 = (x + halfWidth + dx) % worldWidth - halfWidth - dx,\n\t\t    newX = Math.abs(newX1 + dx) < Math.abs(newX2 + dx) ? newX1 : newX2;\n\n\t\tthis._draggable._absPos = this._draggable._newPos.clone();\n\t\tthis._draggable._newPos.x = newX;\n\t},\n\n\t_onDragEnd: function (e) {\n\t\tvar map = this._map,\n\t\t    options = map.options,\n\n\t\t    noInertia = !options.inertia || e.noInertia || this._times.length < 2;\n\n\t\tmap.fire('dragend', e);\n\n\t\tif (noInertia) {\n\t\t\tmap.fire('moveend');\n\n\t\t} else {\n\t\t\tthis._prunePositions(+new Date());\n\n\t\t\tvar direction = this._lastPos.subtract(this._positions[0]),\n\t\t\t    duration = (this._lastTime - this._times[0]) / 1000,\n\t\t\t    ease = options.easeLinearity,\n\n\t\t\t    speedVector = direction.multiplyBy(ease / duration),\n\t\t\t    speed = speedVector.distanceTo([0, 0]),\n\n\t\t\t    limitedSpeed = Math.min(options.inertiaMaxSpeed, speed),\n\t\t\t    limitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed),\n\n\t\t\t    decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease),\n\t\t\t    offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();\n\n\t\t\tif (!offset.x && !offset.y) {\n\t\t\t\tmap.fire('moveend');\n\n\t\t\t} else {\n\t\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\n\t\t\t\tUtil.requestAnimFrame(function () {\n\t\t\t\t\tmap.panBy(offset, {\n\t\t\t\t\t\tduration: decelerationDuration,\n\t\t\t\t\t\teaseLinearity: ease,\n\t\t\t\t\t\tnoMoveStart: true,\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property dragging: Handler\n// Map dragging handler (by both mouse and touch).\nMap.addInitHook('addHandler', 'dragging', Drag);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport {on, off, stop} from '../../dom/DomEvent';\nimport {toPoint} from '../../geometry/Point';\n\n\n/*\n * L.Map.Keyboard is handling keyboard interaction with the map, enabled by default.\n */\n\n// @namespace Map\n// @section Keyboard Navigation Options\nMap.mergeOptions({\n\t// @option keyboard: Boolean = true\n\t// Makes the map focusable and allows users to navigate the map with keyboard\n\t// arrows and `+`/`-` keys.\n\tkeyboard: true,\n\n\t// @option keyboardPanDelta: Number = 80\n\t// Amount of pixels to pan when pressing an arrow key.\n\tkeyboardPanDelta: 80\n});\n\nexport var Keyboard = Handler.extend({\n\n\tkeyCodes: {\n\t\tleft:    [37],\n\t\tright:   [39],\n\t\tdown:    [40],\n\t\tup:      [38],\n\t\tzoomIn:  [187, 107, 61, 171],\n\t\tzoomOut: [189, 109, 54, 173]\n\t},\n\n\tinitialize: function (map) {\n\t\tthis._map = map;\n\n\t\tthis._setPanDelta(map.options.keyboardPanDelta);\n\t\tthis._setZoomDelta(map.options.zoomDelta);\n\t},\n\n\taddHooks: function () {\n\t\tvar container = this._map._container;\n\n\t\t// make the container focusable by tabbing\n\t\tif (container.tabIndex <= 0) {\n\t\t\tcontainer.tabIndex = '0';\n\t\t}\n\n\t\ton(container, {\n\t\t\tfocus: this._onFocus,\n\t\t\tblur: this._onBlur,\n\t\t\tmousedown: this._onMouseDown\n\t\t}, this);\n\n\t\tthis._map.on({\n\t\t\tfocus: this._addHooks,\n\t\t\tblur: this._removeHooks\n\t\t}, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tthis._removeHooks();\n\n\t\toff(this._map._container, {\n\t\t\tfocus: this._onFocus,\n\t\t\tblur: this._onBlur,\n\t\t\tmousedown: this._onMouseDown\n\t\t}, this);\n\n\t\tthis._map.off({\n\t\t\tfocus: this._addHooks,\n\t\t\tblur: this._removeHooks\n\t\t}, this);\n\t},\n\n\t_onMouseDown: function () {\n\t\tif (this._focused) { return; }\n\n\t\tvar body = document.body,\n\t\t    docEl = document.documentElement,\n\t\t    top = body.scrollTop || docEl.scrollTop,\n\t\t    left = body.scrollLeft || docEl.scrollLeft;\n\n\t\tthis._map._container.focus();\n\n\t\twindow.scrollTo(left, top);\n\t},\n\n\t_onFocus: function () {\n\t\tthis._focused = true;\n\t\tthis._map.fire('focus');\n\t},\n\n\t_onBlur: function () {\n\t\tthis._focused = false;\n\t\tthis._map.fire('blur');\n\t},\n\n\t_setPanDelta: function (panDelta) {\n\t\tvar keys = this._panKeys = {},\n\t\t    codes = this.keyCodes,\n\t\t    i, len;\n\n\t\tfor (i = 0, len = codes.left.length; i < len; i++) {\n\t\t\tkeys[codes.left[i]] = [-1 * panDelta, 0];\n\t\t}\n\t\tfor (i = 0, len = codes.right.length; i < len; i++) {\n\t\t\tkeys[codes.right[i]] = [panDelta, 0];\n\t\t}\n\t\tfor (i = 0, len = codes.down.length; i < len; i++) {\n\t\t\tkeys[codes.down[i]] = [0, panDelta];\n\t\t}\n\t\tfor (i = 0, len = codes.up.length; i < len; i++) {\n\t\t\tkeys[codes.up[i]] = [0, -1 * panDelta];\n\t\t}\n\t},\n\n\t_setZoomDelta: function (zoomDelta) {\n\t\tvar keys = this._zoomKeys = {},\n\t\t    codes = this.keyCodes,\n\t\t    i, len;\n\n\t\tfor (i = 0, len = codes.zoomIn.length; i < len; i++) {\n\t\t\tkeys[codes.zoomIn[i]] = zoomDelta;\n\t\t}\n\t\tfor (i = 0, len = codes.zoomOut.length; i < len; i++) {\n\t\t\tkeys[codes.zoomOut[i]] = -zoomDelta;\n\t\t}\n\t},\n\n\t_addHooks: function () {\n\t\ton(document, 'keydown', this._onKeyDown, this);\n\t},\n\n\t_removeHooks: function () {\n\t\toff(document, 'keydown', this._onKeyDown, this);\n\t},\n\n\t_onKeyDown: function (e) {\n\t\tif (e.altKey || e.ctrlKey || e.metaKey) { return; }\n\n\t\tvar key = e.keyCode,\n\t\t    map = this._map,\n\t\t    offset;\n\n\t\tif (key in this._panKeys) {\n\t\t\tif (!map._panAnim || !map._panAnim._inProgress) {\n\t\t\t\toffset = this._panKeys[key];\n\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\toffset = toPoint(offset).multiplyBy(3);\n\t\t\t\t}\n\n\t\t\t\tif (map.options.maxBounds) {\n\t\t\t\t\toffset = map._limitOffset(toPoint(offset), map.options.maxBounds);\n\t\t\t\t}\n\n\t\t\t\tif (map.options.worldCopyJump) {\n\t\t\t\t\tvar newLatLng = map.wrapLatLng(map.unproject(map.project(map.getCenter()).add(offset)));\n\t\t\t\t\tmap.panTo(newLatLng);\n\t\t\t\t} else {\n\t\t\t\t\tmap.panBy(offset);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (key in this._zoomKeys) {\n\t\t\tmap.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]);\n\n\t\t} else if (key === 27 && map._popup && map._popup.options.closeOnEscapeKey) {\n\t\t\tmap.closePopup();\n\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tstop(e);\n\t}\n});\n\n// @section Handlers\n// @section Handlers\n// @property keyboard: Handler\n// Keyboard navigation handler.\nMap.addInitHook('addHandler', 'keyboard', Keyboard);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as DomEvent from '../../dom/DomEvent';\nimport * as Util from '../../core/Util';\n\n/*\n * L.Handler.ScrollWheelZoom is used by L.Map to enable mouse scroll wheel zoom on the map.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @section Mouse wheel options\n\t// @option scrollWheelZoom: Boolean|String = true\n\t// Whether the map can be zoomed by using the mouse wheel. If passed `'center'`,\n\t// it will zoom to the center of the view regardless of where the mouse was.\n\tscrollWheelZoom: true,\n\n\t// @option wheelDebounceTime: Number = 40\n\t// Limits the rate at which a wheel can fire (in milliseconds). By default\n\t// user can't zoom via wheel more often than once per 40 ms.\n\twheelDebounceTime: 40,\n\n\t// @option wheelPxPerZoomLevel: Number = 60\n\t// How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta))\n\t// mean a change of one full zoom level. Smaller values will make wheel-zooming\n\t// faster (and vice versa).\n\twheelPxPerZoomLevel: 60\n});\n\nexport var ScrollWheelZoom = Handler.extend({\n\taddHooks: function () {\n\t\tDomEvent.on(this._map._container, 'wheel', this._onWheelScroll, this);\n\n\t\tthis._delta = 0;\n\t},\n\n\tremoveHooks: function () {\n\t\tDomEvent.off(this._map._container, 'wheel', this._onWheelScroll, this);\n\t},\n\n\t_onWheelScroll: function (e) {\n\t\tvar delta = DomEvent.getWheelDelta(e);\n\n\t\tvar debounce = this._map.options.wheelDebounceTime;\n\n\t\tthis._delta += delta;\n\t\tthis._lastMousePos = this._map.mouseEventToContainerPoint(e);\n\n\t\tif (!this._startTime) {\n\t\t\tthis._startTime = +new Date();\n\t\t}\n\n\t\tvar left = Math.max(debounce - (+new Date() - this._startTime), 0);\n\n\t\tclearTimeout(this._timer);\n\t\tthis._timer = setTimeout(Util.bind(this._performZoom, this), left);\n\n\t\tDomEvent.stop(e);\n\t},\n\n\t_performZoom: function () {\n\t\tvar map = this._map,\n\t\t    zoom = map.getZoom(),\n\t\t    snap = this._map.options.zoomSnap || 0;\n\n\t\tmap._stop(); // stop panning and fly animations if any\n\n\t\t// map the delta with a sigmoid function to -4..4 range leaning on -1..1\n\t\tvar d2 = this._delta / (this._map.options.wheelPxPerZoomLevel * 4),\n\t\t    d3 = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(d2)))) / Math.LN2,\n\t\t    d4 = snap ? Math.ceil(d3 / snap) * snap : d3,\n\t\t    delta = map._limitZoom(zoom + (this._delta > 0 ? d4 : -d4)) - zoom;\n\n\t\tthis._delta = 0;\n\t\tthis._startTime = null;\n\n\t\tif (!delta) { return; }\n\n\t\tif (map.options.scrollWheelZoom === 'center') {\n\t\t\tmap.setZoom(zoom + delta);\n\t\t} else {\n\t\t\tmap.setZoomAround(this._lastMousePos, zoom + delta);\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property scrollWheelZoom: Handler\n// Scroll wheel zoom handler.\nMap.addInitHook('addHandler', 'scrollWheelZoom', ScrollWheelZoom);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as DomEvent from '../../dom/DomEvent';\nimport {Point} from '../../geometry/Point';\nimport * as Util from '../../core/Util';\nimport Browser from '../../core/Browser';\n\n/*\n * L.Map.TapHold is used to simulate `contextmenu` event on long hold,\n * which otherwise is not fired by mobile Safari.\n */\n\nvar tapHoldDelay = 600;\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @section Touch interaction options\n\t// @option tapHold: Boolean\n\t// Enables simulation of `contextmenu` event, default is `true` for mobile Safari.\n\ttapHold: Browser.touchNative && Browser.safari && Browser.mobile,\n\n\t// @option tapTolerance: Number = 15\n\t// The max number of pixels a user can shift his finger during touch\n\t// for it to be considered a valid tap.\n\ttapTolerance: 15\n});\n\nexport var TapHold = Handler.extend({\n\taddHooks: function () {\n\t\tDomEvent.on(this._map._container, 'touchstart', this._onDown, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tDomEvent.off(this._map._container, 'touchstart', this._onDown, this);\n\t},\n\n\t_onDown: function (e) {\n\t\tclearTimeout(this._holdTimeout);\n\t\tif (e.touches.length !== 1) { return; }\n\n\t\tvar first = e.touches[0];\n\t\tthis._startPos = this._newPos = new Point(first.clientX, first.clientY);\n\n\t\tthis._holdTimeout = setTimeout(Util.bind(function () {\n\t\t\tthis._cancel();\n\t\t\tif (!this._isTapValid()) { return; }\n\n\t\t\t// prevent simulated mouse events https://w3c.github.io/touch-events/#mouse-events\n\t\t\tDomEvent.on(document, 'touchend', DomEvent.preventDefault);\n\t\t\tDomEvent.on(document, 'touchend touchcancel', this._cancelClickPrevent);\n\t\t\tthis._simulateEvent('contextmenu', first);\n\t\t}, this), tapHoldDelay);\n\n\t\tDomEvent.on(document, 'touchend touchcancel contextmenu', this._cancel, this);\n\t\tDomEvent.on(document, 'touchmove', this._onMove, this);\n\t},\n\n\t_cancelClickPrevent: function cancelClickPrevent() {\n\t\tDomEvent.off(document, 'touchend', DomEvent.preventDefault);\n\t\tDomEvent.off(document, 'touchend touchcancel', cancelClickPrevent);\n\t},\n\n\t_cancel: function () {\n\t\tclearTimeout(this._holdTimeout);\n\t\tDomEvent.off(document, 'touchend touchcancel contextmenu', this._cancel, this);\n\t\tDomEvent.off(document, 'touchmove', this._onMove, this);\n\t},\n\n\t_onMove: function (e) {\n\t\tvar first = e.touches[0];\n\t\tthis._newPos = new Point(first.clientX, first.clientY);\n\t},\n\n\t_isTapValid: function () {\n\t\treturn this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance;\n\t},\n\n\t_simulateEvent: function (type, e) {\n\t\tvar simulatedEvent = new MouseEvent(type, {\n\t\t\tbubbles: true,\n\t\t\tcancelable: true,\n\t\t\tview: window,\n\t\t\t// detail: 1,\n\t\t\tscreenX: e.screenX,\n\t\t\tscreenY: e.screenY,\n\t\t\tclientX: e.clientX,\n\t\t\tclientY: e.clientY,\n\t\t\t// button: 2,\n\t\t\t// buttons: 2\n\t\t});\n\n\t\tsimulatedEvent._simulated = true;\n\n\t\te.target.dispatchEvent(simulatedEvent);\n\t}\n});\n\n// @section Handlers\n// @property tapHold: Handler\n// Long tap handler to simulate `contextmenu` event (useful in mobile Safari).\nMap.addInitHook('addHandler', 'tapHold', TapHold);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as DomEvent from '../../dom/DomEvent';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport Browser from '../../core/Browser';\n\n/*\n * L.Handler.TouchZoom is used by L.Map to add pinch zoom on supported mobile browsers.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @section Touch interaction options\n\t// @option touchZoom: Boolean|String = *\n\t// Whether the map can be zoomed by touch-dragging with two fingers. If\n\t// passed `'center'`, it will zoom to the center of the view regardless of\n\t// where the touch events (fingers) were. Enabled for touch-capable web\n\t// browsers.\n\ttouchZoom: Browser.touch,\n\n\t// @option bounceAtZoomLimits: Boolean = true\n\t// Set it to false if you don't want the map to zoom beyond min/max zoom\n\t// and then bounce back when pinch-zooming.\n\tbounceAtZoomLimits: true\n});\n\nexport var TouchZoom = Handler.extend({\n\taddHooks: function () {\n\t\tDomUtil.addClass(this._map._container, 'leaflet-touch-zoom');\n\t\tDomEvent.on(this._map._container, 'touchstart', this._onTouchStart, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tDomUtil.removeClass(this._map._container, 'leaflet-touch-zoom');\n\t\tDomEvent.off(this._map._container, 'touchstart', this._onTouchStart, this);\n\t},\n\n\t_onTouchStart: function (e) {\n\t\tvar map = this._map;\n\t\tif (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming) { return; }\n\n\t\tvar p1 = map.mouseEventToContainerPoint(e.touches[0]),\n\t\t    p2 = map.mouseEventToContainerPoint(e.touches[1]);\n\n\t\tthis._centerPoint = map.getSize()._divideBy(2);\n\t\tthis._startLatLng = map.containerPointToLatLng(this._centerPoint);\n\t\tif (map.options.touchZoom !== 'center') {\n\t\t\tthis._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2));\n\t\t}\n\n\t\tthis._startDist = p1.distanceTo(p2);\n\t\tthis._startZoom = map.getZoom();\n\n\t\tthis._moved = false;\n\t\tthis._zooming = true;\n\n\t\tmap._stop();\n\n\t\tDomEvent.on(document, 'touchmove', this._onTouchMove, this);\n\t\tDomEvent.on(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n\t\tDomEvent.preventDefault(e);\n\t},\n\n\t_onTouchMove: function (e) {\n\t\tif (!e.touches || e.touches.length !== 2 || !this._zooming) { return; }\n\n\t\tvar map = this._map,\n\t\t    p1 = map.mouseEventToContainerPoint(e.touches[0]),\n\t\t    p2 = map.mouseEventToContainerPoint(e.touches[1]),\n\t\t    scale = p1.distanceTo(p2) / this._startDist;\n\n\t\tthis._zoom = map.getScaleZoom(scale, this._startZoom);\n\n\t\tif (!map.options.bounceAtZoomLimits && (\n\t\t\t(this._zoom < map.getMinZoom() && scale < 1) ||\n\t\t\t(this._zoom > map.getMaxZoom() && scale > 1))) {\n\t\t\tthis._zoom = map._limitZoom(this._zoom);\n\t\t}\n\n\t\tif (map.options.touchZoom === 'center') {\n\t\t\tthis._center = this._startLatLng;\n\t\t\tif (scale === 1) { return; }\n\t\t} else {\n\t\t\t// Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng\n\t\t\tvar delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint);\n\t\t\tif (scale === 1 && delta.x === 0 && delta.y === 0) { return; }\n\t\t\tthis._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom);\n\t\t}\n\n\t\tif (!this._moved) {\n\t\t\tmap._moveStart(true, false);\n\t\t\tthis._moved = true;\n\t\t}\n\n\t\tUtil.cancelAnimFrame(this._animRequest);\n\n\t\tvar moveFn = Util.bind(map._move, map, this._center, this._zoom, {pinch: true, round: false}, undefined);\n\t\tthis._animRequest = Util.requestAnimFrame(moveFn, this, true);\n\n\t\tDomEvent.preventDefault(e);\n\t},\n\n\t_onTouchEnd: function () {\n\t\tif (!this._moved || !this._zooming) {\n\t\t\tthis._zooming = false;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._zooming = false;\n\t\tUtil.cancelAnimFrame(this._animRequest);\n\n\t\tDomEvent.off(document, 'touchmove', this._onTouchMove, this);\n\t\tDomEvent.off(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n\t\t// Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate.\n\t\tif (this._map.options.zoomAnimation) {\n\t\t\tthis._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap);\n\t\t} else {\n\t\t\tthis._map._resetView(this._center, this._map._limitZoom(this._zoom));\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property touchZoom: Handler\n// Touch zoom handler.\nMap.addInitHook('addHandler', 'touchZoom', TouchZoom);\n", "import {Map} from './Map';\nimport {BoxZoom} from './handler/Map.BoxZoom';\nMap.BoxZoom = BoxZoom;\nimport {DoubleClickZoom} from './handler/Map.DoubleClickZoom';\nMap.DoubleClickZoom = DoubleClickZoom;\nimport {Drag} from './handler/Map.Drag';\nMap.Drag = Drag;\nimport {Keyboard} from './handler/Map.Keyboard';\nMap.Keyboard = Keyboard;\nimport {ScrollWheelZoom} from './handler/Map.ScrollWheelZoom';\nMap.ScrollWheelZoom = ScrollWheelZoom;\nimport {TapHold} from './handler/Map.TapHold';\nMap.TapHold = TapHold;\nimport {TouchZoom} from './handler/Map.TouchZoom';\nMap.TouchZoom = TouchZoom;\n\nexport {Map, createMap as map} from './Map';\n", "/**\n *  PDFObject v2.3.0\n *  https://github.com/pipwerks/PDFObject\n *  @license\n *  Copyright (c) 2008-2024 Philip Hutchison\n *  MIT-style license: http://pipwerks.mit-license.org/\n *  UMD module pattern from https://github.com/umdjs/umd/blob/master/templates/returnExports.js\n */\n\n(function (root, factory) {\n    if (typeof define === \"function\" && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([], factory);\n    } else if (typeof module === \"object\" && module.exports) {\n        // Node. Does not work with strict CommonJS, but\n        // only CommonJS-like environments that support module.exports,\n        // like Node.\n        module.exports = factory();\n    } else {\n        // Browser globals (root is window)\n        root.PDFObject = factory();\n  }\n}(this, function () {\n\n    \"use strict\";\n\n    //PDFObject is designed for client-side (browsers), not server-side (node)\n    //Will choke on undefined navigator and window vars when run on server\n    //Return boolean false and exit function when running server-side\n\n    if(typeof window === \"undefined\" || window.navigator === undefined || window.navigator.userAgent === undefined){ return false; }\n\n    let pdfobjectversion = \"2.3.0\";\n    let win = window;\n    let nav = win.navigator;\n    let ua = nav.userAgent;\n    let suppressConsole = false;\n\n    //Fallback validation when navigator.pdfViewerEnabled is not supported\n    let isModernBrowser = function (){\n\n        /*\n           userAgent sniffing is not the ideal path, but most browsers revoked the ability to check navigator.mimeTypes \n           for security purposes. As of 2023, browsers have begun implementing navigator.pdfViewerEnabled, but older versions\n           do not have navigator.pdfViewerEnabled or the ability to check navigator.mimeTypes. We're left with basic browser \n           sniffing and assumptions of PDF support based on browser vendor.\n        */\n\n        //Chromium has provided native PDF support since 2011.\n        //Most modern browsers use Chromium under the hood: Google Chrome, Microsoft Edge, Opera, Brave, Vivaldi, Arc, and more.\n        //Chromium uses the PDFium rendering engine, which is based on Foxit's PDF rendering engine.\n        //Note that MS Edge opts to use a different PDF rendering engine. As of 2024, Edge uses a version of Adobe's Reader\n        let isChromium = (win.chrome !== undefined);\n\n        //Safari on macOS has provided native PDF support since 2009. \n        //This code snippet also detects the DuckDuckGo browser, which uses Safari/Webkit under the hood.\n        let isSafari = (win.safari !== undefined || (nav.vendor !== undefined && /Apple/.test(nav.vendor) && /Safari/.test(ua)));\n\n        //Firefox has provided PDF support via PDFJS since 2013.\n        let isFirefox = (win.Mozilla !== undefined || /irefox/.test(ua));\n\n        return isChromium || isSafari || isFirefox;  \n\n    };\n\n    /*\n       Special handling for Internet Explorer 11.\n       Check for ActiveX support, then whether \"AcroPDF.PDF\" or \"PDF.PdfCtrl\" are valid.\n       IE11 uses ActiveX for Adobe Reader and other PDF plugins, but window.ActiveXObject will evaluate to false. \n       (\"ActiveXObject\" in window) evaluates to true.\n       MS Edge does not support ActiveX so this test will evaluate false for MS Edge.\n    */\n    let validateAX = function (type){\n        var ax = null;\n        try {\n            ax = new ActiveXObject(type);\n        } catch (e) {\n            //ensure ax remains null when ActiveXObject attempt fails\n            ax = null;\n        }\n        return !!ax; //convert resulting object to boolean\n    };\n\n    let hasActiveXPDFPlugin = function (){ return (\"ActiveXObject\" in win) && (validateAX(\"AcroPDF.PDF\") || validateAX(\"PDF.PdfCtrl\")) };\n\n    let checkSupport = function (){\n\n        //Safari on iPadOS doesn't report as 'mobile' when requesting desktop site, yet still fails to embed PDFs\n        let isSafariIOSDesktopMode = (nav.platform !== undefined && nav.platform === \"MacIntel\" && nav.maxTouchPoints !== undefined && nav.maxTouchPoints > 1);\n\n        let isMobileDevice = (isSafariIOSDesktopMode || /Mobi|Tablet|Android|iPad|iPhone/.test(ua));\n\n        //As of June 2023, no mobile browsers properly support inline PDFs. If mobile, just say no.\n        if(isMobileDevice){ return false; }\n        \n        //Modern browsers began supporting navigator.pdfViewerEnabled in late 2022 and early 2023.\n        let supportsPDFVE = (typeof nav.pdfViewerEnabled === \"boolean\");\n\n        //If browser supports nav.pdfViewerEnabled and is explicitly saying PDFs are NOT supported (e.g. PDFJS disabled by user in Firefox), respect it.\n        if(supportsPDFVE && !nav.pdfViewerEnabled){ return false; }\n\n        return (supportsPDFVE && nav.pdfViewerEnabled) || isModernBrowser() || hasActiveXPDFPlugin();\n\n    };\n\n    //Determines whether PDF support is available\n    let supportsPDFs = checkSupport();\n\n    //Create a fragment identifier for using PDF Open parameters when embedding PDF\n    let buildURLFragmentString = function(pdfParams){\n\n        let string = \"\";\n        let prop;\n        let paramArray = [];\n        let fdf = \"\";\n        \n        //The comment, viewrect, and highlight parameters require page to be set first. \n\n        //Check to ensure page is used if comment, viewrect, or highlight are specified\n        if(pdfParams.comment || pdfParams.viewrect || pdfParams.highlight){\n\n            if(!pdfParams.page){\n                \n                //If page is not set, use the first page\n                pdfParams.page = 1;\n                \n                //Inform user that page needs to be set properly\n                embedError(\"The comment, viewrect, and highlight parameters require a page parameter, but none was specified. Defaulting to page 1.\");\n            \n            }\n\n        }\n\n        //Let's go ahead and ensure page is always the first parameter.\n        if(pdfParams.page){\n            paramArray.push(\"page=\" + encodeURIComponent(pdfParams.page));\n            delete pdfParams.page;\n        }\n\n        //FDF needs to be the last parameter in the string\n        if(pdfParams.fdf){\n            fdf = pdfParams.fdf;\n            delete pdfParams.fdf;\n        }\n        \n        //Add all other parameters, as needed\n        if(pdfParams){\n\n            for (prop in pdfParams) {\n                if (pdfParams.hasOwnProperty(prop)) {\n                    paramArray.push(encodeURIComponent(prop) + \"=\" + encodeURIComponent(pdfParams[prop]));\n                }\n            }\n\n            //Add fdf as the last parameter, if needed\n            if(fdf){\n                paramArray.push(\"fdf=\" + encodeURIComponent(fdf));\n            }\n\n            //Join all parameters in the array into a string\n            string = paramArray.join(\"&\");\n\n            //The string will be empty if no PDF Parameters were provided\n            //Only prepend the hash if the string is not empty\n            if(string){\n                string = \"#\" + string;\n            }\n\n        }\n\n        return string;\n\n    };\n\n    let embedError = function (msg){\n        if(!suppressConsole){\n            console.log(\"[PDFObject]\", msg);\n        }\n        return false;\n    };\n\n    let emptyNodeContents = function (node){\n        while(node.firstChild){\n            node.removeChild(node.firstChild);\n        }\n    };\n\n    let getTargetElement = function (targetSelector){\n\n        //Default to body for full-browser PDF\n        let targetNode = document.body;\n\n        //If a targetSelector is specified, check to see whether\n        //it's passing a selector, jQuery object, or an HTML element\n\n        if(typeof targetSelector === \"string\"){\n\n            //Is CSS selector\n            targetNode = document.querySelector(targetSelector);\n\n        } else if (win.jQuery !== undefined && targetSelector instanceof jQuery && targetSelector.length) {\n\n            //Is jQuery element. Extract HTML node\n            targetNode = targetSelector.get(0);\n\n        } else if (targetSelector.nodeType !== undefined && targetSelector.nodeType === 1){\n\n            //Is HTML element\n            targetNode = targetSelector;\n\n        }\n\n        return targetNode;\n\n    };\n\n    let convertBase64ToDownloadableLink = function (b64, filename, targetNode, fallbackHTML) {\n\n        //IE-11 safe version. More verbose than modern fetch()\n        if (window.Blob && window.URL && window.URL.createObjectURL) {\n\n            var xhr = new XMLHttpRequest();\n            xhr.open('GET', b64, true);\n            xhr.responseType = 'blob';\n            xhr.onload = function() {\n\n                if (xhr.status === 200) {\n \n                    var blob = xhr.response;\n                    var link = document.createElement('a');\n                    link.innerText = \"Download PDF\";\n                    link.href = URL.createObjectURL(blob);\n                    link.setAttribute('download', filename);\n                    targetNode.innerHTML = fallbackHTML.replace(/\\[pdflink\\]/g, link.outerHTML);\n\n                }\n\n            };\n\n            xhr.send();\n            \n        }\n\n    };\n\n\n    let generatePDFObjectMarkup = function (embedType, targetNode, url, pdfOpenFragment, width, height, id, title, omitInlineStyles, customAttribute, PDFJS_URL){\n\n        //Ensure target element is empty first\n        emptyNodeContents(targetNode);\n\n        let source = url;\n\n        if(embedType === \"pdfjs\"){ \n            //If PDFJS_URL already contains a ?, assume querystring is in place, and use an ampersand to append PDFJS's file parameter\n            let connector = (PDFJS_URL.indexOf(\"?\") !== -1) ? \"&\" : \"?\"; \n            source = PDFJS_URL + connector + \"file=\" + encodeURIComponent(url) + pdfOpenFragment;\n        } else {\n            source += pdfOpenFragment;\n        }\n\n        let el = document.createElement(\"iframe\");\n        el.className = \"pdfobject\";\n        el.type = \"application/pdf\";\n        el.title = title;\n        el.src = source;\n        el.allow = \"fullscreen\";\n        el.frameborder = \"0\";\n        if(id){ el.id = id; }\n\n        if(!omitInlineStyles){\n\n            let style = \"border: none;\";\n\n            if(targetNode !== document.body){\n                //assign width and height to target node\n                style += \"width: \" + width + \"; height: \" + height + \";\";\n            } else {\n                //this is a full-page embed, use CSS to fill the viewport\n                style += \"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;\";\n            }\n\n            el.style.cssText = style; \n\n        }\n\n        //Allow developer to insert custom attribute on iframe element, but ensure it does not conflict with attributes used by PDFObject\n        let reservedTokens = [\"className\", \"type\", \"title\", \"src\", \"style\", \"id\", \"allow\", \"frameborder\"];\n        if(customAttribute && customAttribute.key && reservedTokens.indexOf(customAttribute.key) === -1){\n            el.setAttribute(customAttribute.key, (typeof customAttribute.value !== \"undefined\") ? customAttribute.value : \"\");\n        }\n\n        targetNode.classList.add(\"pdfobject-container\");\n        targetNode.appendChild(el);\n\n        return targetNode.getElementsByTagName(\"iframe\")[0];\n\n    };\n\n    let embed = function(url, targetSelector, options){\n\n        //If targetSelector is not defined, convert to boolean\n        let selector = targetSelector || false;\n\n        //Ensure options object is not undefined -- enables easier error checking below\n        let opt = options || {};\n\n        //Get passed options, or set reasonable defaults\n        suppressConsole = (typeof opt.suppressConsole === \"boolean\") ? opt.suppressConsole : false;\n        let id = (typeof opt.id === \"string\") ? opt.id : \"\";\n        let page = opt.page || false;\n        let pdfOpenParams = opt.pdfOpenParams || {};\n        let fallbackLink = (typeof opt.fallbackLink === \"string\" || typeof opt.fallbackLink === \"boolean\") ? opt.fallbackLink : true;\n        let width = opt.width || \"100%\";\n        let height = opt.height || \"100%\";\n        let title = opt.title || \"Embedded PDF\";\n        let forcePDFJS = (typeof opt.forcePDFJS === \"boolean\") ? opt.forcePDFJS : false;\n        let omitInlineStyles = (typeof opt.omitInlineStyles === \"boolean\") ? opt.omitInlineStyles : false;\n        let PDFJS_URL = opt.PDFJS_URL || false;\n        let targetNode = getTargetElement(selector);\n        let pdfOpenFragment = \"\";\n        let customAttribute = opt.customAttribute || {};\n        let fallbackHTML_default = \"<p>This browser does not support inline PDFs. Please download the PDF to view it: [pdflink]</p>\";\n\n        //Ensure URL is available. If not, exit now.\n        if(typeof url !== \"string\"){ return embedError(\"URL is not valid\"); }\n\n        //If target element is specified but is not valid, exit without doing anything\n        if(!targetNode){ return embedError(\"Target element cannot be determined\"); }\n\n        //page option overrides pdfOpenParams, if found\n        if(page){ pdfOpenParams.page = page; }\n\n        //Stringify optional Adobe params for opening document (as fragment identifier)\n        pdfOpenFragment = buildURLFragmentString(pdfOpenParams);\n\n\n        // --== Do the dance: Embed attempt #1 ==--\n\n        //If the forcePDFJS option is invoked, skip everything else and embed as directed\n        if(forcePDFJS && PDFJS_URL){\n            return generatePDFObjectMarkup(\"pdfjs\", targetNode, url, pdfOpenFragment, width, height, id, title, omitInlineStyles, customAttribute, PDFJS_URL);\n        }\n \n        // --== Embed attempt #2 ==--\n\n        //Embed PDF if support is detected, or if this is a relatively modern browser \n        if(supportsPDFs){\n            return generatePDFObjectMarkup(\"iframe\", targetNode, url, pdfOpenFragment, width, height, id, title, omitInlineStyles, customAttribute);\n        }\n        \n        // --== Embed attempt #3 ==--\n        \n        //If everything else has failed and a PDFJS fallback is provided, try to use it\n        if(PDFJS_URL){\n            return generatePDFObjectMarkup(\"pdfjs\", targetNode, url, pdfOpenFragment, width, height, id, title, omitInlineStyles, customAttribute, PDFJS_URL);\n        }\n        \n        // --== PDF embed not supported! Use fallback ==-- \n\n        //Display the fallback link if available\n        if(fallbackLink){\n\n            //If a custom fallback has been provided, handle it now\n            if(typeof fallbackLink === \"string\"){\n\n                //Ensure [url] is set in custom fallback\n                targetNode.innerHTML = fallbackLink.replace(/\\[url\\]/g, url);\n\n            } else {\n\n                //If the PDF is a base64 string, convert it to a downloadable link\n                if(url.indexOf(\"data:application/pdf;base64\") !== -1){\n\n                    //Asynchronously append the link to the targetNode\n                    convertBase64ToDownloadableLink(url, \"file.pdf\", targetNode, fallbackHTML_default);\n                \n                } else {\n\n                    //Use default fallback link\n                    let link = \"<a href='\" + url + \"'>Download PDF</a>\";\n                    targetNode.innerHTML = fallbackHTML_default.replace(/\\[pdflink\\]/g, link);\n\n                }\n\n            }\n\n        }\n\n        return embedError(\"This browser does not support embedded PDFs\");\n\n    };\n\n    return {\n        embed: function (a,b,c){ return embed(a,b,c); },\n        pdfobjectversion: (function () { return pdfobjectversion; })(),\n        supportsPDFs: (function (){ return supportsPDFs; })()\n    };\n\n}));", "/*\nTurbo 7.3.0\nCopyright \u00A9 2023 37signals LLC\n */\n(function () {\n    if (window.Reflect === undefined ||\n        window.customElements === undefined ||\n        window.customElements.polyfillWrapFlushCallback) {\n        return;\n    }\n    const BuiltInHTMLElement = HTMLElement;\n    const wrapperForTheName = {\n        HTMLElement: function HTMLElement() {\n            return Reflect.construct(BuiltInHTMLElement, [], this.constructor);\n        },\n    };\n    window.HTMLElement = wrapperForTheName[\"HTMLElement\"];\n    HTMLElement.prototype = BuiltInHTMLElement.prototype;\n    HTMLElement.prototype.constructor = HTMLElement;\n    Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);\n})();\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2019 Javan Makhmali\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function(prototype) {\n  if (typeof prototype.requestSubmit == \"function\") return\n\n  prototype.requestSubmit = function(submitter) {\n    if (submitter) {\n      validateSubmitter(submitter, this);\n      submitter.click();\n    } else {\n      submitter = document.createElement(\"input\");\n      submitter.type = \"submit\";\n      submitter.hidden = true;\n      this.appendChild(submitter);\n      submitter.click();\n      this.removeChild(submitter);\n    }\n  };\n\n  function validateSubmitter(submitter, form) {\n    submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n    submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n    submitter.form == form || raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n  }\n\n  function raise(errorConstructor, message, name) {\n    throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name)\n  }\n})(HTMLFormElement.prototype);\n\nconst submittersByForm = new WeakMap();\nfunction findSubmitterFromClickTarget(target) {\n    const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n    const candidate = element ? element.closest(\"input, button\") : null;\n    return (candidate === null || candidate === void 0 ? void 0 : candidate.type) == \"submit\" ? candidate : null;\n}\nfunction clickCaptured(event) {\n    const submitter = findSubmitterFromClickTarget(event.target);\n    if (submitter && submitter.form) {\n        submittersByForm.set(submitter.form, submitter);\n    }\n}\n(function () {\n    if (\"submitter\" in Event.prototype)\n        return;\n    let prototype = window.Event.prototype;\n    if (\"SubmitEvent\" in window && /Apple Computer/.test(navigator.vendor)) {\n        prototype = window.SubmitEvent.prototype;\n    }\n    else if (\"SubmitEvent\" in window) {\n        return;\n    }\n    addEventListener(\"click\", clickCaptured, true);\n    Object.defineProperty(prototype, \"submitter\", {\n        get() {\n            if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n                return submittersByForm.get(this.target);\n            }\n        },\n    });\n})();\n\nvar FrameLoadingStyle;\n(function (FrameLoadingStyle) {\n    FrameLoadingStyle[\"eager\"] = \"eager\";\n    FrameLoadingStyle[\"lazy\"] = \"lazy\";\n})(FrameLoadingStyle || (FrameLoadingStyle = {}));\nclass FrameElement extends HTMLElement {\n    static get observedAttributes() {\n        return [\"disabled\", \"complete\", \"loading\", \"src\"];\n    }\n    constructor() {\n        super();\n        this.loaded = Promise.resolve();\n        this.delegate = new FrameElement.delegateConstructor(this);\n    }\n    connectedCallback() {\n        this.delegate.connect();\n    }\n    disconnectedCallback() {\n        this.delegate.disconnect();\n    }\n    reload() {\n        return this.delegate.sourceURLReloaded();\n    }\n    attributeChangedCallback(name) {\n        if (name == \"loading\") {\n            this.delegate.loadingStyleChanged();\n        }\n        else if (name == \"complete\") {\n            this.delegate.completeChanged();\n        }\n        else if (name == \"src\") {\n            this.delegate.sourceURLChanged();\n        }\n        else {\n            this.delegate.disabledChanged();\n        }\n    }\n    get src() {\n        return this.getAttribute(\"src\");\n    }\n    set src(value) {\n        if (value) {\n            this.setAttribute(\"src\", value);\n        }\n        else {\n            this.removeAttribute(\"src\");\n        }\n    }\n    get loading() {\n        return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\");\n    }\n    set loading(value) {\n        if (value) {\n            this.setAttribute(\"loading\", value);\n        }\n        else {\n            this.removeAttribute(\"loading\");\n        }\n    }\n    get disabled() {\n        return this.hasAttribute(\"disabled\");\n    }\n    set disabled(value) {\n        if (value) {\n            this.setAttribute(\"disabled\", \"\");\n        }\n        else {\n            this.removeAttribute(\"disabled\");\n        }\n    }\n    get autoscroll() {\n        return this.hasAttribute(\"autoscroll\");\n    }\n    set autoscroll(value) {\n        if (value) {\n            this.setAttribute(\"autoscroll\", \"\");\n        }\n        else {\n            this.removeAttribute(\"autoscroll\");\n        }\n    }\n    get complete() {\n        return !this.delegate.isLoading;\n    }\n    get isActive() {\n        return this.ownerDocument === document && !this.isPreview;\n    }\n    get isPreview() {\n        var _a, _b;\n        return (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.hasAttribute(\"data-turbo-preview\");\n    }\n}\nfunction frameLoadingStyleFromString(style) {\n    switch (style.toLowerCase()) {\n        case \"lazy\":\n            return FrameLoadingStyle.lazy;\n        default:\n            return FrameLoadingStyle.eager;\n    }\n}\n\nfunction expandURL(locatable) {\n    return new URL(locatable.toString(), document.baseURI);\n}\nfunction getAnchor(url) {\n    let anchorMatch;\n    if (url.hash) {\n        return url.hash.slice(1);\n    }\n    else if ((anchorMatch = url.href.match(/#(.*)$/))) {\n        return anchorMatch[1];\n    }\n}\nfunction getAction(form, submitter) {\n    const action = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formaction\")) || form.getAttribute(\"action\") || form.action;\n    return expandURL(action);\n}\nfunction getExtension(url) {\n    return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\";\n}\nfunction isHTML(url) {\n    return !!getExtension(url).match(/^(?:|\\.(?:htm|html|xhtml|php))$/);\n}\nfunction isPrefixedBy(baseURL, url) {\n    const prefix = getPrefix(url);\n    return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);\n}\nfunction locationIsVisitable(location, rootLocation) {\n    return isPrefixedBy(location, rootLocation) && isHTML(location);\n}\nfunction getRequestURL(url) {\n    const anchor = getAnchor(url);\n    return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;\n}\nfunction toCacheKey(url) {\n    return getRequestURL(url);\n}\nfunction urlsAreEqual(left, right) {\n    return expandURL(left).href == expandURL(right).href;\n}\nfunction getPathComponents(url) {\n    return url.pathname.split(\"/\").slice(1);\n}\nfunction getLastPathComponent(url) {\n    return getPathComponents(url).slice(-1)[0];\n}\nfunction getPrefix(url) {\n    return addTrailingSlash(url.origin + url.pathname);\n}\nfunction addTrailingSlash(value) {\n    return value.endsWith(\"/\") ? value : value + \"/\";\n}\n\nclass FetchResponse {\n    constructor(response) {\n        this.response = response;\n    }\n    get succeeded() {\n        return this.response.ok;\n    }\n    get failed() {\n        return !this.succeeded;\n    }\n    get clientError() {\n        return this.statusCode >= 400 && this.statusCode <= 499;\n    }\n    get serverError() {\n        return this.statusCode >= 500 && this.statusCode <= 599;\n    }\n    get redirected() {\n        return this.response.redirected;\n    }\n    get location() {\n        return expandURL(this.response.url);\n    }\n    get isHTML() {\n        return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/);\n    }\n    get statusCode() {\n        return this.response.status;\n    }\n    get contentType() {\n        return this.header(\"Content-Type\");\n    }\n    get responseText() {\n        return this.response.clone().text();\n    }\n    get responseHTML() {\n        if (this.isHTML) {\n            return this.response.clone().text();\n        }\n        else {\n            return Promise.resolve(undefined);\n        }\n    }\n    header(name) {\n        return this.response.headers.get(name);\n    }\n}\n\nfunction activateScriptElement(element) {\n    if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n        return element;\n    }\n    else {\n        const createdScriptElement = document.createElement(\"script\");\n        const cspNonce = getMetaContent(\"csp-nonce\");\n        if (cspNonce) {\n            createdScriptElement.nonce = cspNonce;\n        }\n        createdScriptElement.textContent = element.textContent;\n        createdScriptElement.async = false;\n        copyElementAttributes(createdScriptElement, element);\n        return createdScriptElement;\n    }\n}\nfunction copyElementAttributes(destinationElement, sourceElement) {\n    for (const { name, value } of sourceElement.attributes) {\n        destinationElement.setAttribute(name, value);\n    }\n}\nfunction createDocumentFragment(html) {\n    const template = document.createElement(\"template\");\n    template.innerHTML = html;\n    return template.content;\n}\nfunction dispatch(eventName, { target, cancelable, detail } = {}) {\n    const event = new CustomEvent(eventName, {\n        cancelable,\n        bubbles: true,\n        composed: true,\n        detail,\n    });\n    if (target && target.isConnected) {\n        target.dispatchEvent(event);\n    }\n    else {\n        document.documentElement.dispatchEvent(event);\n    }\n    return event;\n}\nfunction nextAnimationFrame() {\n    return new Promise((resolve) => requestAnimationFrame(() => resolve()));\n}\nfunction nextEventLoopTick() {\n    return new Promise((resolve) => setTimeout(() => resolve(), 0));\n}\nfunction nextMicrotask() {\n    return Promise.resolve();\n}\nfunction parseHTMLDocument(html = \"\") {\n    return new DOMParser().parseFromString(html, \"text/html\");\n}\nfunction unindent(strings, ...values) {\n    const lines = interpolate(strings, values).replace(/^\\n/, \"\").split(\"\\n\");\n    const match = lines[0].match(/^\\s+/);\n    const indent = match ? match[0].length : 0;\n    return lines.map((line) => line.slice(indent)).join(\"\\n\");\n}\nfunction interpolate(strings, values) {\n    return strings.reduce((result, string, i) => {\n        const value = values[i] == undefined ? \"\" : values[i];\n        return result + string + value;\n    }, \"\");\n}\nfunction uuid() {\n    return Array.from({ length: 36 })\n        .map((_, i) => {\n        if (i == 8 || i == 13 || i == 18 || i == 23) {\n            return \"-\";\n        }\n        else if (i == 14) {\n            return \"4\";\n        }\n        else if (i == 19) {\n            return (Math.floor(Math.random() * 4) + 8).toString(16);\n        }\n        else {\n            return Math.floor(Math.random() * 15).toString(16);\n        }\n    })\n        .join(\"\");\n}\nfunction getAttribute(attributeName, ...elements) {\n    for (const value of elements.map((element) => element === null || element === void 0 ? void 0 : element.getAttribute(attributeName))) {\n        if (typeof value == \"string\")\n            return value;\n    }\n    return null;\n}\nfunction hasAttribute(attributeName, ...elements) {\n    return elements.some((element) => element && element.hasAttribute(attributeName));\n}\nfunction markAsBusy(...elements) {\n    for (const element of elements) {\n        if (element.localName == \"turbo-frame\") {\n            element.setAttribute(\"busy\", \"\");\n        }\n        element.setAttribute(\"aria-busy\", \"true\");\n    }\n}\nfunction clearBusyState(...elements) {\n    for (const element of elements) {\n        if (element.localName == \"turbo-frame\") {\n            element.removeAttribute(\"busy\");\n        }\n        element.removeAttribute(\"aria-busy\");\n    }\n}\nfunction waitForLoad(element, timeoutInMilliseconds = 2000) {\n    return new Promise((resolve) => {\n        const onComplete = () => {\n            element.removeEventListener(\"error\", onComplete);\n            element.removeEventListener(\"load\", onComplete);\n            resolve();\n        };\n        element.addEventListener(\"load\", onComplete, { once: true });\n        element.addEventListener(\"error\", onComplete, { once: true });\n        setTimeout(resolve, timeoutInMilliseconds);\n    });\n}\nfunction getHistoryMethodForAction(action) {\n    switch (action) {\n        case \"replace\":\n            return history.replaceState;\n        case \"advance\":\n        case \"restore\":\n            return history.pushState;\n    }\n}\nfunction isAction(action) {\n    return action == \"advance\" || action == \"replace\" || action == \"restore\";\n}\nfunction getVisitAction(...elements) {\n    const action = getAttribute(\"data-turbo-action\", ...elements);\n    return isAction(action) ? action : null;\n}\nfunction getMetaElement(name) {\n    return document.querySelector(`meta[name=\"${name}\"]`);\n}\nfunction getMetaContent(name) {\n    const element = getMetaElement(name);\n    return element && element.content;\n}\nfunction setMetaContent(name, content) {\n    let element = getMetaElement(name);\n    if (!element) {\n        element = document.createElement(\"meta\");\n        element.setAttribute(\"name\", name);\n        document.head.appendChild(element);\n    }\n    element.setAttribute(\"content\", content);\n    return element;\n}\nfunction findClosestRecursively(element, selector) {\n    var _a;\n    if (element instanceof Element) {\n        return (element.closest(selector) ||\n            findClosestRecursively(element.assignedSlot || ((_a = element.getRootNode()) === null || _a === void 0 ? void 0 : _a.host), selector));\n    }\n}\n\nvar FetchMethod;\n(function (FetchMethod) {\n    FetchMethod[FetchMethod[\"get\"] = 0] = \"get\";\n    FetchMethod[FetchMethod[\"post\"] = 1] = \"post\";\n    FetchMethod[FetchMethod[\"put\"] = 2] = \"put\";\n    FetchMethod[FetchMethod[\"patch\"] = 3] = \"patch\";\n    FetchMethod[FetchMethod[\"delete\"] = 4] = \"delete\";\n})(FetchMethod || (FetchMethod = {}));\nfunction fetchMethodFromString(method) {\n    switch (method.toLowerCase()) {\n        case \"get\":\n            return FetchMethod.get;\n        case \"post\":\n            return FetchMethod.post;\n        case \"put\":\n            return FetchMethod.put;\n        case \"patch\":\n            return FetchMethod.patch;\n        case \"delete\":\n            return FetchMethod.delete;\n    }\n}\nclass FetchRequest {\n    constructor(delegate, method, location, body = new URLSearchParams(), target = null) {\n        this.abortController = new AbortController();\n        this.resolveRequestPromise = (_value) => { };\n        this.delegate = delegate;\n        this.method = method;\n        this.headers = this.defaultHeaders;\n        this.body = body;\n        this.url = location;\n        this.target = target;\n    }\n    get location() {\n        return this.url;\n    }\n    get params() {\n        return this.url.searchParams;\n    }\n    get entries() {\n        return this.body ? Array.from(this.body.entries()) : [];\n    }\n    cancel() {\n        this.abortController.abort();\n    }\n    async perform() {\n        const { fetchOptions } = this;\n        this.delegate.prepareRequest(this);\n        await this.allowRequestToBeIntercepted(fetchOptions);\n        try {\n            this.delegate.requestStarted(this);\n            const response = await fetch(this.url.href, fetchOptions);\n            return await this.receive(response);\n        }\n        catch (error) {\n            if (error.name !== \"AbortError\") {\n                if (this.willDelegateErrorHandling(error)) {\n                    this.delegate.requestErrored(this, error);\n                }\n                throw error;\n            }\n        }\n        finally {\n            this.delegate.requestFinished(this);\n        }\n    }\n    async receive(response) {\n        const fetchResponse = new FetchResponse(response);\n        const event = dispatch(\"turbo:before-fetch-response\", {\n            cancelable: true,\n            detail: { fetchResponse },\n            target: this.target,\n        });\n        if (event.defaultPrevented) {\n            this.delegate.requestPreventedHandlingResponse(this, fetchResponse);\n        }\n        else if (fetchResponse.succeeded) {\n            this.delegate.requestSucceededWithResponse(this, fetchResponse);\n        }\n        else {\n            this.delegate.requestFailedWithResponse(this, fetchResponse);\n        }\n        return fetchResponse;\n    }\n    get fetchOptions() {\n        var _a;\n        return {\n            method: FetchMethod[this.method].toUpperCase(),\n            credentials: \"same-origin\",\n            headers: this.headers,\n            redirect: \"follow\",\n            body: this.isSafe ? null : this.body,\n            signal: this.abortSignal,\n            referrer: (_a = this.delegate.referrer) === null || _a === void 0 ? void 0 : _a.href,\n        };\n    }\n    get defaultHeaders() {\n        return {\n            Accept: \"text/html, application/xhtml+xml\",\n        };\n    }\n    get isSafe() {\n        return this.method === FetchMethod.get;\n    }\n    get abortSignal() {\n        return this.abortController.signal;\n    }\n    acceptResponseType(mimeType) {\n        this.headers[\"Accept\"] = [mimeType, this.headers[\"Accept\"]].join(\", \");\n    }\n    async allowRequestToBeIntercepted(fetchOptions) {\n        const requestInterception = new Promise((resolve) => (this.resolveRequestPromise = resolve));\n        const event = dispatch(\"turbo:before-fetch-request\", {\n            cancelable: true,\n            detail: {\n                fetchOptions,\n                url: this.url,\n                resume: this.resolveRequestPromise,\n            },\n            target: this.target,\n        });\n        if (event.defaultPrevented)\n            await requestInterception;\n    }\n    willDelegateErrorHandling(error) {\n        const event = dispatch(\"turbo:fetch-request-error\", {\n            target: this.target,\n            cancelable: true,\n            detail: { request: this, error: error },\n        });\n        return !event.defaultPrevented;\n    }\n}\n\nclass AppearanceObserver {\n    constructor(delegate, element) {\n        this.started = false;\n        this.intersect = (entries) => {\n            const lastEntry = entries.slice(-1)[0];\n            if (lastEntry === null || lastEntry === void 0 ? void 0 : lastEntry.isIntersecting) {\n                this.delegate.elementAppearedInViewport(this.element);\n            }\n        };\n        this.delegate = delegate;\n        this.element = element;\n        this.intersectionObserver = new IntersectionObserver(this.intersect);\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.intersectionObserver.observe(this.element);\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.intersectionObserver.unobserve(this.element);\n        }\n    }\n}\n\nclass StreamMessage {\n    static wrap(message) {\n        if (typeof message == \"string\") {\n            return new this(createDocumentFragment(message));\n        }\n        else {\n            return message;\n        }\n    }\n    constructor(fragment) {\n        this.fragment = importStreamElements(fragment);\n    }\n}\nStreamMessage.contentType = \"text/vnd.turbo-stream.html\";\nfunction importStreamElements(fragment) {\n    for (const element of fragment.querySelectorAll(\"turbo-stream\")) {\n        const streamElement = document.importNode(element, true);\n        for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll(\"script\")) {\n            inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));\n        }\n        element.replaceWith(streamElement);\n    }\n    return fragment;\n}\n\nvar FormSubmissionState;\n(function (FormSubmissionState) {\n    FormSubmissionState[FormSubmissionState[\"initialized\"] = 0] = \"initialized\";\n    FormSubmissionState[FormSubmissionState[\"requesting\"] = 1] = \"requesting\";\n    FormSubmissionState[FormSubmissionState[\"waiting\"] = 2] = \"waiting\";\n    FormSubmissionState[FormSubmissionState[\"receiving\"] = 3] = \"receiving\";\n    FormSubmissionState[FormSubmissionState[\"stopping\"] = 4] = \"stopping\";\n    FormSubmissionState[FormSubmissionState[\"stopped\"] = 5] = \"stopped\";\n})(FormSubmissionState || (FormSubmissionState = {}));\nvar FormEnctype;\n(function (FormEnctype) {\n    FormEnctype[\"urlEncoded\"] = \"application/x-www-form-urlencoded\";\n    FormEnctype[\"multipart\"] = \"multipart/form-data\";\n    FormEnctype[\"plain\"] = \"text/plain\";\n})(FormEnctype || (FormEnctype = {}));\nfunction formEnctypeFromString(encoding) {\n    switch (encoding.toLowerCase()) {\n        case FormEnctype.multipart:\n            return FormEnctype.multipart;\n        case FormEnctype.plain:\n            return FormEnctype.plain;\n        default:\n            return FormEnctype.urlEncoded;\n    }\n}\nclass FormSubmission {\n    static confirmMethod(message, _element, _submitter) {\n        return Promise.resolve(confirm(message));\n    }\n    constructor(delegate, formElement, submitter, mustRedirect = false) {\n        this.state = FormSubmissionState.initialized;\n        this.delegate = delegate;\n        this.formElement = formElement;\n        this.submitter = submitter;\n        this.formData = buildFormData(formElement, submitter);\n        this.location = expandURL(this.action);\n        if (this.method == FetchMethod.get) {\n            mergeFormDataEntries(this.location, [...this.body.entries()]);\n        }\n        this.fetchRequest = new FetchRequest(this, this.method, this.location, this.body, this.formElement);\n        this.mustRedirect = mustRedirect;\n    }\n    get method() {\n        var _a;\n        const method = ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formmethod\")) || this.formElement.getAttribute(\"method\") || \"\";\n        return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;\n    }\n    get action() {\n        var _a;\n        const formElementAction = typeof this.formElement.action === \"string\" ? this.formElement.action : null;\n        if ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"formaction\")) {\n            return this.submitter.getAttribute(\"formaction\") || \"\";\n        }\n        else {\n            return this.formElement.getAttribute(\"action\") || formElementAction || \"\";\n        }\n    }\n    get body() {\n        if (this.enctype == FormEnctype.urlEncoded || this.method == FetchMethod.get) {\n            return new URLSearchParams(this.stringFormData);\n        }\n        else {\n            return this.formData;\n        }\n    }\n    get enctype() {\n        var _a;\n        return formEnctypeFromString(((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formenctype\")) || this.formElement.enctype);\n    }\n    get isSafe() {\n        return this.fetchRequest.isSafe;\n    }\n    get stringFormData() {\n        return [...this.formData].reduce((entries, [name, value]) => {\n            return entries.concat(typeof value == \"string\" ? [[name, value]] : []);\n        }, []);\n    }\n    async start() {\n        const { initialized, requesting } = FormSubmissionState;\n        const confirmationMessage = getAttribute(\"data-turbo-confirm\", this.submitter, this.formElement);\n        if (typeof confirmationMessage === \"string\") {\n            const answer = await FormSubmission.confirmMethod(confirmationMessage, this.formElement, this.submitter);\n            if (!answer) {\n                return;\n            }\n        }\n        if (this.state == initialized) {\n            this.state = requesting;\n            return this.fetchRequest.perform();\n        }\n    }\n    stop() {\n        const { stopping, stopped } = FormSubmissionState;\n        if (this.state != stopping && this.state != stopped) {\n            this.state = stopping;\n            this.fetchRequest.cancel();\n            return true;\n        }\n    }\n    prepareRequest(request) {\n        if (!request.isSafe) {\n            const token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n            if (token) {\n                request.headers[\"X-CSRF-Token\"] = token;\n            }\n        }\n        if (this.requestAcceptsTurboStreamResponse(request)) {\n            request.acceptResponseType(StreamMessage.contentType);\n        }\n    }\n    requestStarted(_request) {\n        var _a;\n        this.state = FormSubmissionState.waiting;\n        (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.setAttribute(\"disabled\", \"\");\n        this.setSubmitsWith();\n        dispatch(\"turbo:submit-start\", {\n            target: this.formElement,\n            detail: { formSubmission: this },\n        });\n        this.delegate.formSubmissionStarted(this);\n    }\n    requestPreventedHandlingResponse(request, response) {\n        this.result = { success: response.succeeded, fetchResponse: response };\n    }\n    requestSucceededWithResponse(request, response) {\n        if (response.clientError || response.serverError) {\n            this.delegate.formSubmissionFailedWithResponse(this, response);\n        }\n        else if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {\n            const error = new Error(\"Form responses must redirect to another location\");\n            this.delegate.formSubmissionErrored(this, error);\n        }\n        else {\n            this.state = FormSubmissionState.receiving;\n            this.result = { success: true, fetchResponse: response };\n            this.delegate.formSubmissionSucceededWithResponse(this, response);\n        }\n    }\n    requestFailedWithResponse(request, response) {\n        this.result = { success: false, fetchResponse: response };\n        this.delegate.formSubmissionFailedWithResponse(this, response);\n    }\n    requestErrored(request, error) {\n        this.result = { success: false, error };\n        this.delegate.formSubmissionErrored(this, error);\n    }\n    requestFinished(_request) {\n        var _a;\n        this.state = FormSubmissionState.stopped;\n        (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.removeAttribute(\"disabled\");\n        this.resetSubmitterText();\n        dispatch(\"turbo:submit-end\", {\n            target: this.formElement,\n            detail: Object.assign({ formSubmission: this }, this.result),\n        });\n        this.delegate.formSubmissionFinished(this);\n    }\n    setSubmitsWith() {\n        if (!this.submitter || !this.submitsWith)\n            return;\n        if (this.submitter.matches(\"button\")) {\n            this.originalSubmitText = this.submitter.innerHTML;\n            this.submitter.innerHTML = this.submitsWith;\n        }\n        else if (this.submitter.matches(\"input\")) {\n            const input = this.submitter;\n            this.originalSubmitText = input.value;\n            input.value = this.submitsWith;\n        }\n    }\n    resetSubmitterText() {\n        if (!this.submitter || !this.originalSubmitText)\n            return;\n        if (this.submitter.matches(\"button\")) {\n            this.submitter.innerHTML = this.originalSubmitText;\n        }\n        else if (this.submitter.matches(\"input\")) {\n            const input = this.submitter;\n            input.value = this.originalSubmitText;\n        }\n    }\n    requestMustRedirect(request) {\n        return !request.isSafe && this.mustRedirect;\n    }\n    requestAcceptsTurboStreamResponse(request) {\n        return !request.isSafe || hasAttribute(\"data-turbo-stream\", this.submitter, this.formElement);\n    }\n    get submitsWith() {\n        var _a;\n        return (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"data-turbo-submits-with\");\n    }\n}\nfunction buildFormData(formElement, submitter) {\n    const formData = new FormData(formElement);\n    const name = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"name\");\n    const value = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"value\");\n    if (name) {\n        formData.append(name, value || \"\");\n    }\n    return formData;\n}\nfunction getCookieValue(cookieName) {\n    if (cookieName != null) {\n        const cookies = document.cookie ? document.cookie.split(\"; \") : [];\n        const cookie = cookies.find((cookie) => cookie.startsWith(cookieName));\n        if (cookie) {\n            const value = cookie.split(\"=\").slice(1).join(\"=\");\n            return value ? decodeURIComponent(value) : undefined;\n        }\n    }\n}\nfunction responseSucceededWithoutRedirect(response) {\n    return response.statusCode == 200 && !response.redirected;\n}\nfunction mergeFormDataEntries(url, entries) {\n    const searchParams = new URLSearchParams();\n    for (const [name, value] of entries) {\n        if (value instanceof File)\n            continue;\n        searchParams.append(name, value);\n    }\n    url.search = searchParams.toString();\n    return url;\n}\n\nclass Snapshot {\n    constructor(element) {\n        this.element = element;\n    }\n    get activeElement() {\n        return this.element.ownerDocument.activeElement;\n    }\n    get children() {\n        return [...this.element.children];\n    }\n    hasAnchor(anchor) {\n        return this.getElementForAnchor(anchor) != null;\n    }\n    getElementForAnchor(anchor) {\n        return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null;\n    }\n    get isConnected() {\n        return this.element.isConnected;\n    }\n    get firstAutofocusableElement() {\n        const inertDisabledOrHidden = \"[inert], :disabled, [hidden], details:not([open]), dialog:not([open])\";\n        for (const element of this.element.querySelectorAll(\"[autofocus]\")) {\n            if (element.closest(inertDisabledOrHidden) == null)\n                return element;\n            else\n                continue;\n        }\n        return null;\n    }\n    get permanentElements() {\n        return queryPermanentElementsAll(this.element);\n    }\n    getPermanentElementById(id) {\n        return getPermanentElementById(this.element, id);\n    }\n    getPermanentElementMapForSnapshot(snapshot) {\n        const permanentElementMap = {};\n        for (const currentPermanentElement of this.permanentElements) {\n            const { id } = currentPermanentElement;\n            const newPermanentElement = snapshot.getPermanentElementById(id);\n            if (newPermanentElement) {\n                permanentElementMap[id] = [currentPermanentElement, newPermanentElement];\n            }\n        }\n        return permanentElementMap;\n    }\n}\nfunction getPermanentElementById(node, id) {\n    return node.querySelector(`#${id}[data-turbo-permanent]`);\n}\nfunction queryPermanentElementsAll(node) {\n    return node.querySelectorAll(\"[id][data-turbo-permanent]\");\n}\n\nclass FormSubmitObserver {\n    constructor(delegate, eventTarget) {\n        this.started = false;\n        this.submitCaptured = () => {\n            this.eventTarget.removeEventListener(\"submit\", this.submitBubbled, false);\n            this.eventTarget.addEventListener(\"submit\", this.submitBubbled, false);\n        };\n        this.submitBubbled = ((event) => {\n            if (!event.defaultPrevented) {\n                const form = event.target instanceof HTMLFormElement ? event.target : undefined;\n                const submitter = event.submitter || undefined;\n                if (form &&\n                    submissionDoesNotDismissDialog(form, submitter) &&\n                    submissionDoesNotTargetIFrame(form, submitter) &&\n                    this.delegate.willSubmitForm(form, submitter)) {\n                    event.preventDefault();\n                    event.stopImmediatePropagation();\n                    this.delegate.formSubmitted(form, submitter);\n                }\n            }\n        });\n        this.delegate = delegate;\n        this.eventTarget = eventTarget;\n    }\n    start() {\n        if (!this.started) {\n            this.eventTarget.addEventListener(\"submit\", this.submitCaptured, true);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.eventTarget.removeEventListener(\"submit\", this.submitCaptured, true);\n            this.started = false;\n        }\n    }\n}\nfunction submissionDoesNotDismissDialog(form, submitter) {\n    const method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.getAttribute(\"method\");\n    return method != \"dialog\";\n}\nfunction submissionDoesNotTargetIFrame(form, submitter) {\n    if ((submitter === null || submitter === void 0 ? void 0 : submitter.hasAttribute(\"formtarget\")) || form.hasAttribute(\"target\")) {\n        const target = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formtarget\")) || form.target;\n        for (const element of document.getElementsByName(target)) {\n            if (element instanceof HTMLIFrameElement)\n                return false;\n        }\n        return true;\n    }\n    else {\n        return true;\n    }\n}\n\nclass View {\n    constructor(delegate, element) {\n        this.resolveRenderPromise = (_value) => { };\n        this.resolveInterceptionPromise = (_value) => { };\n        this.delegate = delegate;\n        this.element = element;\n    }\n    scrollToAnchor(anchor) {\n        const element = this.snapshot.getElementForAnchor(anchor);\n        if (element) {\n            this.scrollToElement(element);\n            this.focusElement(element);\n        }\n        else {\n            this.scrollToPosition({ x: 0, y: 0 });\n        }\n    }\n    scrollToAnchorFromLocation(location) {\n        this.scrollToAnchor(getAnchor(location));\n    }\n    scrollToElement(element) {\n        element.scrollIntoView();\n    }\n    focusElement(element) {\n        if (element instanceof HTMLElement) {\n            if (element.hasAttribute(\"tabindex\")) {\n                element.focus();\n            }\n            else {\n                element.setAttribute(\"tabindex\", \"-1\");\n                element.focus();\n                element.removeAttribute(\"tabindex\");\n            }\n        }\n    }\n    scrollToPosition({ x, y }) {\n        this.scrollRoot.scrollTo(x, y);\n    }\n    scrollToTop() {\n        this.scrollToPosition({ x: 0, y: 0 });\n    }\n    get scrollRoot() {\n        return window;\n    }\n    async render(renderer) {\n        const { isPreview, shouldRender, newSnapshot: snapshot } = renderer;\n        if (shouldRender) {\n            try {\n                this.renderPromise = new Promise((resolve) => (this.resolveRenderPromise = resolve));\n                this.renderer = renderer;\n                await this.prepareToRenderSnapshot(renderer);\n                const renderInterception = new Promise((resolve) => (this.resolveInterceptionPromise = resolve));\n                const options = { resume: this.resolveInterceptionPromise, render: this.renderer.renderElement };\n                const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);\n                if (!immediateRender)\n                    await renderInterception;\n                await this.renderSnapshot(renderer);\n                this.delegate.viewRenderedSnapshot(snapshot, isPreview);\n                this.delegate.preloadOnLoadLinksForView(this.element);\n                this.finishRenderingSnapshot(renderer);\n            }\n            finally {\n                delete this.renderer;\n                this.resolveRenderPromise(undefined);\n                delete this.renderPromise;\n            }\n        }\n        else {\n            this.invalidate(renderer.reloadReason);\n        }\n    }\n    invalidate(reason) {\n        this.delegate.viewInvalidated(reason);\n    }\n    async prepareToRenderSnapshot(renderer) {\n        this.markAsPreview(renderer.isPreview);\n        await renderer.prepareToRender();\n    }\n    markAsPreview(isPreview) {\n        if (isPreview) {\n            this.element.setAttribute(\"data-turbo-preview\", \"\");\n        }\n        else {\n            this.element.removeAttribute(\"data-turbo-preview\");\n        }\n    }\n    async renderSnapshot(renderer) {\n        await renderer.render();\n    }\n    finishRenderingSnapshot(renderer) {\n        renderer.finishRendering();\n    }\n}\n\nclass FrameView extends View {\n    missing() {\n        this.element.innerHTML = `<strong class=\"turbo-frame-error\">Content missing</strong>`;\n    }\n    get snapshot() {\n        return new Snapshot(this.element);\n    }\n}\n\nclass LinkInterceptor {\n    constructor(delegate, element) {\n        this.clickBubbled = (event) => {\n            if (this.respondsToEventTarget(event.target)) {\n                this.clickEvent = event;\n            }\n            else {\n                delete this.clickEvent;\n            }\n        };\n        this.linkClicked = ((event) => {\n            if (this.clickEvent && this.respondsToEventTarget(event.target) && event.target instanceof Element) {\n                if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {\n                    this.clickEvent.preventDefault();\n                    event.preventDefault();\n                    this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);\n                }\n            }\n            delete this.clickEvent;\n        });\n        this.willVisit = ((_event) => {\n            delete this.clickEvent;\n        });\n        this.delegate = delegate;\n        this.element = element;\n    }\n    start() {\n        this.element.addEventListener(\"click\", this.clickBubbled);\n        document.addEventListener(\"turbo:click\", this.linkClicked);\n        document.addEventListener(\"turbo:before-visit\", this.willVisit);\n    }\n    stop() {\n        this.element.removeEventListener(\"click\", this.clickBubbled);\n        document.removeEventListener(\"turbo:click\", this.linkClicked);\n        document.removeEventListener(\"turbo:before-visit\", this.willVisit);\n    }\n    respondsToEventTarget(target) {\n        const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n        return element && element.closest(\"turbo-frame, html\") == this.element;\n    }\n}\n\nclass LinkClickObserver {\n    constructor(delegate, eventTarget) {\n        this.started = false;\n        this.clickCaptured = () => {\n            this.eventTarget.removeEventListener(\"click\", this.clickBubbled, false);\n            this.eventTarget.addEventListener(\"click\", this.clickBubbled, false);\n        };\n        this.clickBubbled = (event) => {\n            if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {\n                const target = (event.composedPath && event.composedPath()[0]) || event.target;\n                const link = this.findLinkFromClickTarget(target);\n                if (link && doesNotTargetIFrame(link)) {\n                    const location = this.getLocationForLink(link);\n                    if (this.delegate.willFollowLinkToLocation(link, location, event)) {\n                        event.preventDefault();\n                        this.delegate.followedLinkToLocation(link, location);\n                    }\n                }\n            }\n        };\n        this.delegate = delegate;\n        this.eventTarget = eventTarget;\n    }\n    start() {\n        if (!this.started) {\n            this.eventTarget.addEventListener(\"click\", this.clickCaptured, true);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.eventTarget.removeEventListener(\"click\", this.clickCaptured, true);\n            this.started = false;\n        }\n    }\n    clickEventIsSignificant(event) {\n        return !((event.target && event.target.isContentEditable) ||\n            event.defaultPrevented ||\n            event.which > 1 ||\n            event.altKey ||\n            event.ctrlKey ||\n            event.metaKey ||\n            event.shiftKey);\n    }\n    findLinkFromClickTarget(target) {\n        return findClosestRecursively(target, \"a[href]:not([target^=_]):not([download])\");\n    }\n    getLocationForLink(link) {\n        return expandURL(link.getAttribute(\"href\") || \"\");\n    }\n}\nfunction doesNotTargetIFrame(anchor) {\n    if (anchor.hasAttribute(\"target\")) {\n        for (const element of document.getElementsByName(anchor.target)) {\n            if (element instanceof HTMLIFrameElement)\n                return false;\n        }\n        return true;\n    }\n    else {\n        return true;\n    }\n}\n\nclass FormLinkClickObserver {\n    constructor(delegate, element) {\n        this.delegate = delegate;\n        this.linkInterceptor = new LinkClickObserver(this, element);\n    }\n    start() {\n        this.linkInterceptor.start();\n    }\n    stop() {\n        this.linkInterceptor.stop();\n    }\n    willFollowLinkToLocation(link, location, originalEvent) {\n        return (this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) &&\n            link.hasAttribute(\"data-turbo-method\"));\n    }\n    followedLinkToLocation(link, location) {\n        const form = document.createElement(\"form\");\n        const type = \"hidden\";\n        for (const [name, value] of location.searchParams) {\n            form.append(Object.assign(document.createElement(\"input\"), { type, name, value }));\n        }\n        const action = Object.assign(location, { search: \"\" });\n        form.setAttribute(\"data-turbo\", \"true\");\n        form.setAttribute(\"action\", action.href);\n        form.setAttribute(\"hidden\", \"\");\n        const method = link.getAttribute(\"data-turbo-method\");\n        if (method)\n            form.setAttribute(\"method\", method);\n        const turboFrame = link.getAttribute(\"data-turbo-frame\");\n        if (turboFrame)\n            form.setAttribute(\"data-turbo-frame\", turboFrame);\n        const turboAction = getVisitAction(link);\n        if (turboAction)\n            form.setAttribute(\"data-turbo-action\", turboAction);\n        const turboConfirm = link.getAttribute(\"data-turbo-confirm\");\n        if (turboConfirm)\n            form.setAttribute(\"data-turbo-confirm\", turboConfirm);\n        const turboStream = link.hasAttribute(\"data-turbo-stream\");\n        if (turboStream)\n            form.setAttribute(\"data-turbo-stream\", \"\");\n        this.delegate.submittedFormLinkToLocation(link, location, form);\n        document.body.appendChild(form);\n        form.addEventListener(\"turbo:submit-end\", () => form.remove(), { once: true });\n        requestAnimationFrame(() => form.requestSubmit());\n    }\n}\n\nclass Bardo {\n    static async preservingPermanentElements(delegate, permanentElementMap, callback) {\n        const bardo = new this(delegate, permanentElementMap);\n        bardo.enter();\n        await callback();\n        bardo.leave();\n    }\n    constructor(delegate, permanentElementMap) {\n        this.delegate = delegate;\n        this.permanentElementMap = permanentElementMap;\n    }\n    enter() {\n        for (const id in this.permanentElementMap) {\n            const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];\n            this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);\n            this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);\n        }\n    }\n    leave() {\n        for (const id in this.permanentElementMap) {\n            const [currentPermanentElement] = this.permanentElementMap[id];\n            this.replaceCurrentPermanentElementWithClone(currentPermanentElement);\n            this.replacePlaceholderWithPermanentElement(currentPermanentElement);\n            this.delegate.leavingBardo(currentPermanentElement);\n        }\n    }\n    replaceNewPermanentElementWithPlaceholder(permanentElement) {\n        const placeholder = createPlaceholderForPermanentElement(permanentElement);\n        permanentElement.replaceWith(placeholder);\n    }\n    replaceCurrentPermanentElementWithClone(permanentElement) {\n        const clone = permanentElement.cloneNode(true);\n        permanentElement.replaceWith(clone);\n    }\n    replacePlaceholderWithPermanentElement(permanentElement) {\n        const placeholder = this.getPlaceholderById(permanentElement.id);\n        placeholder === null || placeholder === void 0 ? void 0 : placeholder.replaceWith(permanentElement);\n    }\n    getPlaceholderById(id) {\n        return this.placeholders.find((element) => element.content == id);\n    }\n    get placeholders() {\n        return [...document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\")];\n    }\n}\nfunction createPlaceholderForPermanentElement(permanentElement) {\n    const element = document.createElement(\"meta\");\n    element.setAttribute(\"name\", \"turbo-permanent-placeholder\");\n    element.setAttribute(\"content\", permanentElement.id);\n    return element;\n}\n\nclass Renderer {\n    constructor(currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n        this.activeElement = null;\n        this.currentSnapshot = currentSnapshot;\n        this.newSnapshot = newSnapshot;\n        this.isPreview = isPreview;\n        this.willRender = willRender;\n        this.renderElement = renderElement;\n        this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }));\n    }\n    get shouldRender() {\n        return true;\n    }\n    get reloadReason() {\n        return;\n    }\n    prepareToRender() {\n        return;\n    }\n    finishRendering() {\n        if (this.resolvingFunctions) {\n            this.resolvingFunctions.resolve();\n            delete this.resolvingFunctions;\n        }\n    }\n    async preservingPermanentElements(callback) {\n        await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);\n    }\n    focusFirstAutofocusableElement() {\n        const element = this.connectedSnapshot.firstAutofocusableElement;\n        if (elementIsFocusable(element)) {\n            element.focus();\n        }\n    }\n    enteringBardo(currentPermanentElement) {\n        if (this.activeElement)\n            return;\n        if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {\n            this.activeElement = this.currentSnapshot.activeElement;\n        }\n    }\n    leavingBardo(currentPermanentElement) {\n        if (currentPermanentElement.contains(this.activeElement) && this.activeElement instanceof HTMLElement) {\n            this.activeElement.focus();\n            this.activeElement = null;\n        }\n    }\n    get connectedSnapshot() {\n        return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;\n    }\n    get currentElement() {\n        return this.currentSnapshot.element;\n    }\n    get newElement() {\n        return this.newSnapshot.element;\n    }\n    get permanentElementMap() {\n        return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);\n    }\n}\nfunction elementIsFocusable(element) {\n    return element && typeof element.focus == \"function\";\n}\n\nclass FrameRenderer extends Renderer {\n    static renderElement(currentElement, newElement) {\n        var _a;\n        const destinationRange = document.createRange();\n        destinationRange.selectNodeContents(currentElement);\n        destinationRange.deleteContents();\n        const frameElement = newElement;\n        const sourceRange = (_a = frameElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.createRange();\n        if (sourceRange) {\n            sourceRange.selectNodeContents(frameElement);\n            currentElement.appendChild(sourceRange.extractContents());\n        }\n    }\n    constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {\n        super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);\n        this.delegate = delegate;\n    }\n    get shouldRender() {\n        return true;\n    }\n    async render() {\n        await nextAnimationFrame();\n        this.preservingPermanentElements(() => {\n            this.loadFrameElement();\n        });\n        this.scrollFrameIntoView();\n        await nextAnimationFrame();\n        this.focusFirstAutofocusableElement();\n        await nextAnimationFrame();\n        this.activateScriptElements();\n    }\n    loadFrameElement() {\n        this.delegate.willRenderFrame(this.currentElement, this.newElement);\n        this.renderElement(this.currentElement, this.newElement);\n    }\n    scrollFrameIntoView() {\n        if (this.currentElement.autoscroll || this.newElement.autoscroll) {\n            const element = this.currentElement.firstElementChild;\n            const block = readScrollLogicalPosition(this.currentElement.getAttribute(\"data-autoscroll-block\"), \"end\");\n            const behavior = readScrollBehavior(this.currentElement.getAttribute(\"data-autoscroll-behavior\"), \"auto\");\n            if (element) {\n                element.scrollIntoView({ block, behavior });\n                return true;\n            }\n        }\n        return false;\n    }\n    activateScriptElements() {\n        for (const inertScriptElement of this.newScriptElements) {\n            const activatedScriptElement = activateScriptElement(inertScriptElement);\n            inertScriptElement.replaceWith(activatedScriptElement);\n        }\n    }\n    get newScriptElements() {\n        return this.currentElement.querySelectorAll(\"script\");\n    }\n}\nfunction readScrollLogicalPosition(value, defaultValue) {\n    if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n        return value;\n    }\n    else {\n        return defaultValue;\n    }\n}\nfunction readScrollBehavior(value, defaultValue) {\n    if (value == \"auto\" || value == \"smooth\") {\n        return value;\n    }\n    else {\n        return defaultValue;\n    }\n}\n\nclass ProgressBar {\n    static get defaultCSS() {\n        return unindent `\n      .turbo-progress-bar {\n        position: fixed;\n        display: block;\n        top: 0;\n        left: 0;\n        height: 3px;\n        background: #0076ff;\n        z-index: 2147483647;\n        transition:\n          width ${ProgressBar.animationDuration}ms ease-out,\n          opacity ${ProgressBar.animationDuration / 2}ms ${ProgressBar.animationDuration / 2}ms ease-in;\n        transform: translate3d(0, 0, 0);\n      }\n    `;\n    }\n    constructor() {\n        this.hiding = false;\n        this.value = 0;\n        this.visible = false;\n        this.trickle = () => {\n            this.setValue(this.value + Math.random() / 100);\n        };\n        this.stylesheetElement = this.createStylesheetElement();\n        this.progressElement = this.createProgressElement();\n        this.installStylesheetElement();\n        this.setValue(0);\n    }\n    show() {\n        if (!this.visible) {\n            this.visible = true;\n            this.installProgressElement();\n            this.startTrickling();\n        }\n    }\n    hide() {\n        if (this.visible && !this.hiding) {\n            this.hiding = true;\n            this.fadeProgressElement(() => {\n                this.uninstallProgressElement();\n                this.stopTrickling();\n                this.visible = false;\n                this.hiding = false;\n            });\n        }\n    }\n    setValue(value) {\n        this.value = value;\n        this.refresh();\n    }\n    installStylesheetElement() {\n        document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n    }\n    installProgressElement() {\n        this.progressElement.style.width = \"0\";\n        this.progressElement.style.opacity = \"1\";\n        document.documentElement.insertBefore(this.progressElement, document.body);\n        this.refresh();\n    }\n    fadeProgressElement(callback) {\n        this.progressElement.style.opacity = \"0\";\n        setTimeout(callback, ProgressBar.animationDuration * 1.5);\n    }\n    uninstallProgressElement() {\n        if (this.progressElement.parentNode) {\n            document.documentElement.removeChild(this.progressElement);\n        }\n    }\n    startTrickling() {\n        if (!this.trickleInterval) {\n            this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n        }\n    }\n    stopTrickling() {\n        window.clearInterval(this.trickleInterval);\n        delete this.trickleInterval;\n    }\n    refresh() {\n        requestAnimationFrame(() => {\n            this.progressElement.style.width = `${10 + this.value * 90}%`;\n        });\n    }\n    createStylesheetElement() {\n        const element = document.createElement(\"style\");\n        element.type = \"text/css\";\n        element.textContent = ProgressBar.defaultCSS;\n        if (this.cspNonce) {\n            element.nonce = this.cspNonce;\n        }\n        return element;\n    }\n    createProgressElement() {\n        const element = document.createElement(\"div\");\n        element.className = \"turbo-progress-bar\";\n        return element;\n    }\n    get cspNonce() {\n        return getMetaContent(\"csp-nonce\");\n    }\n}\nProgressBar.animationDuration = 300;\n\nclass HeadSnapshot extends Snapshot {\n    constructor() {\n        super(...arguments);\n        this.detailsByOuterHTML = this.children\n            .filter((element) => !elementIsNoscript(element))\n            .map((element) => elementWithoutNonce(element))\n            .reduce((result, element) => {\n            const { outerHTML } = element;\n            const details = outerHTML in result\n                ? result[outerHTML]\n                : {\n                    type: elementType(element),\n                    tracked: elementIsTracked(element),\n                    elements: [],\n                };\n            return Object.assign(Object.assign({}, result), { [outerHTML]: Object.assign(Object.assign({}, details), { elements: [...details.elements, element] }) });\n        }, {});\n    }\n    get trackedElementSignature() {\n        return Object.keys(this.detailsByOuterHTML)\n            .filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked)\n            .join(\"\");\n    }\n    getScriptElementsNotInSnapshot(snapshot) {\n        return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot);\n    }\n    getStylesheetElementsNotInSnapshot(snapshot) {\n        return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot);\n    }\n    getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {\n        return Object.keys(this.detailsByOuterHTML)\n            .filter((outerHTML) => !(outerHTML in snapshot.detailsByOuterHTML))\n            .map((outerHTML) => this.detailsByOuterHTML[outerHTML])\n            .filter(({ type }) => type == matchedType)\n            .map(({ elements: [element] }) => element);\n    }\n    get provisionalElements() {\n        return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n            const { type, tracked, elements } = this.detailsByOuterHTML[outerHTML];\n            if (type == null && !tracked) {\n                return [...result, ...elements];\n            }\n            else if (elements.length > 1) {\n                return [...result, ...elements.slice(1)];\n            }\n            else {\n                return result;\n            }\n        }, []);\n    }\n    getMetaValue(name) {\n        const element = this.findMetaElementByName(name);\n        return element ? element.getAttribute(\"content\") : null;\n    }\n    findMetaElementByName(name) {\n        return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n            const { elements: [element], } = this.detailsByOuterHTML[outerHTML];\n            return elementIsMetaElementWithName(element, name) ? element : result;\n        }, undefined);\n    }\n}\nfunction elementType(element) {\n    if (elementIsScript(element)) {\n        return \"script\";\n    }\n    else if (elementIsStylesheet(element)) {\n        return \"stylesheet\";\n    }\n}\nfunction elementIsTracked(element) {\n    return element.getAttribute(\"data-turbo-track\") == \"reload\";\n}\nfunction elementIsScript(element) {\n    const tagName = element.localName;\n    return tagName == \"script\";\n}\nfunction elementIsNoscript(element) {\n    const tagName = element.localName;\n    return tagName == \"noscript\";\n}\nfunction elementIsStylesheet(element) {\n    const tagName = element.localName;\n    return tagName == \"style\" || (tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\");\n}\nfunction elementIsMetaElementWithName(element, name) {\n    const tagName = element.localName;\n    return tagName == \"meta\" && element.getAttribute(\"name\") == name;\n}\nfunction elementWithoutNonce(element) {\n    if (element.hasAttribute(\"nonce\")) {\n        element.setAttribute(\"nonce\", \"\");\n    }\n    return element;\n}\n\nclass PageSnapshot extends Snapshot {\n    static fromHTMLString(html = \"\") {\n        return this.fromDocument(parseHTMLDocument(html));\n    }\n    static fromElement(element) {\n        return this.fromDocument(element.ownerDocument);\n    }\n    static fromDocument({ head, body }) {\n        return new this(body, new HeadSnapshot(head));\n    }\n    constructor(element, headSnapshot) {\n        super(element);\n        this.headSnapshot = headSnapshot;\n    }\n    clone() {\n        const clonedElement = this.element.cloneNode(true);\n        const selectElements = this.element.querySelectorAll(\"select\");\n        const clonedSelectElements = clonedElement.querySelectorAll(\"select\");\n        for (const [index, source] of selectElements.entries()) {\n            const clone = clonedSelectElements[index];\n            for (const option of clone.selectedOptions)\n                option.selected = false;\n            for (const option of source.selectedOptions)\n                clone.options[option.index].selected = true;\n        }\n        for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type=\"password\"]')) {\n            clonedPasswordInput.value = \"\";\n        }\n        return new PageSnapshot(clonedElement, this.headSnapshot);\n    }\n    get headElement() {\n        return this.headSnapshot.element;\n    }\n    get rootLocation() {\n        var _a;\n        const root = (_a = this.getSetting(\"root\")) !== null && _a !== void 0 ? _a : \"/\";\n        return expandURL(root);\n    }\n    get cacheControlValue() {\n        return this.getSetting(\"cache-control\");\n    }\n    get isPreviewable() {\n        return this.cacheControlValue != \"no-preview\";\n    }\n    get isCacheable() {\n        return this.cacheControlValue != \"no-cache\";\n    }\n    get isVisitable() {\n        return this.getSetting(\"visit-control\") != \"reload\";\n    }\n    getSetting(name) {\n        return this.headSnapshot.getMetaValue(`turbo-${name}`);\n    }\n}\n\nvar TimingMetric;\n(function (TimingMetric) {\n    TimingMetric[\"visitStart\"] = \"visitStart\";\n    TimingMetric[\"requestStart\"] = \"requestStart\";\n    TimingMetric[\"requestEnd\"] = \"requestEnd\";\n    TimingMetric[\"visitEnd\"] = \"visitEnd\";\n})(TimingMetric || (TimingMetric = {}));\nvar VisitState;\n(function (VisitState) {\n    VisitState[\"initialized\"] = \"initialized\";\n    VisitState[\"started\"] = \"started\";\n    VisitState[\"canceled\"] = \"canceled\";\n    VisitState[\"failed\"] = \"failed\";\n    VisitState[\"completed\"] = \"completed\";\n})(VisitState || (VisitState = {}));\nconst defaultOptions = {\n    action: \"advance\",\n    historyChanged: false,\n    visitCachedSnapshot: () => { },\n    willRender: true,\n    updateHistory: true,\n    shouldCacheSnapshot: true,\n    acceptsStreamResponse: false,\n};\nvar SystemStatusCode;\n(function (SystemStatusCode) {\n    SystemStatusCode[SystemStatusCode[\"networkFailure\"] = 0] = \"networkFailure\";\n    SystemStatusCode[SystemStatusCode[\"timeoutFailure\"] = -1] = \"timeoutFailure\";\n    SystemStatusCode[SystemStatusCode[\"contentTypeMismatch\"] = -2] = \"contentTypeMismatch\";\n})(SystemStatusCode || (SystemStatusCode = {}));\nclass Visit {\n    constructor(delegate, location, restorationIdentifier, options = {}) {\n        this.identifier = uuid();\n        this.timingMetrics = {};\n        this.followedRedirect = false;\n        this.historyChanged = false;\n        this.scrolled = false;\n        this.shouldCacheSnapshot = true;\n        this.acceptsStreamResponse = false;\n        this.snapshotCached = false;\n        this.state = VisitState.initialized;\n        this.delegate = delegate;\n        this.location = location;\n        this.restorationIdentifier = restorationIdentifier || uuid();\n        const { action, historyChanged, referrer, snapshot, snapshotHTML, response, visitCachedSnapshot, willRender, updateHistory, shouldCacheSnapshot, acceptsStreamResponse, } = Object.assign(Object.assign({}, defaultOptions), options);\n        this.action = action;\n        this.historyChanged = historyChanged;\n        this.referrer = referrer;\n        this.snapshot = snapshot;\n        this.snapshotHTML = snapshotHTML;\n        this.response = response;\n        this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);\n        this.visitCachedSnapshot = visitCachedSnapshot;\n        this.willRender = willRender;\n        this.updateHistory = updateHistory;\n        this.scrolled = !willRender;\n        this.shouldCacheSnapshot = shouldCacheSnapshot;\n        this.acceptsStreamResponse = acceptsStreamResponse;\n    }\n    get adapter() {\n        return this.delegate.adapter;\n    }\n    get view() {\n        return this.delegate.view;\n    }\n    get history() {\n        return this.delegate.history;\n    }\n    get restorationData() {\n        return this.history.getRestorationDataForIdentifier(this.restorationIdentifier);\n    }\n    get silent() {\n        return this.isSamePage;\n    }\n    start() {\n        if (this.state == VisitState.initialized) {\n            this.recordTimingMetric(TimingMetric.visitStart);\n            this.state = VisitState.started;\n            this.adapter.visitStarted(this);\n            this.delegate.visitStarted(this);\n        }\n    }\n    cancel() {\n        if (this.state == VisitState.started) {\n            if (this.request) {\n                this.request.cancel();\n            }\n            this.cancelRender();\n            this.state = VisitState.canceled;\n        }\n    }\n    complete() {\n        if (this.state == VisitState.started) {\n            this.recordTimingMetric(TimingMetric.visitEnd);\n            this.state = VisitState.completed;\n            this.followRedirect();\n            if (!this.followedRedirect) {\n                this.adapter.visitCompleted(this);\n                this.delegate.visitCompleted(this);\n            }\n        }\n    }\n    fail() {\n        if (this.state == VisitState.started) {\n            this.state = VisitState.failed;\n            this.adapter.visitFailed(this);\n        }\n    }\n    changeHistory() {\n        var _a;\n        if (!this.historyChanged && this.updateHistory) {\n            const actionForHistory = this.location.href === ((_a = this.referrer) === null || _a === void 0 ? void 0 : _a.href) ? \"replace\" : this.action;\n            const method = getHistoryMethodForAction(actionForHistory);\n            this.history.update(method, this.location, this.restorationIdentifier);\n            this.historyChanged = true;\n        }\n    }\n    issueRequest() {\n        if (this.hasPreloadedResponse()) {\n            this.simulateRequest();\n        }\n        else if (this.shouldIssueRequest() && !this.request) {\n            this.request = new FetchRequest(this, FetchMethod.get, this.location);\n            this.request.perform();\n        }\n    }\n    simulateRequest() {\n        if (this.response) {\n            this.startRequest();\n            this.recordResponse();\n            this.finishRequest();\n        }\n    }\n    startRequest() {\n        this.recordTimingMetric(TimingMetric.requestStart);\n        this.adapter.visitRequestStarted(this);\n    }\n    recordResponse(response = this.response) {\n        this.response = response;\n        if (response) {\n            const { statusCode } = response;\n            if (isSuccessful(statusCode)) {\n                this.adapter.visitRequestCompleted(this);\n            }\n            else {\n                this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n            }\n        }\n    }\n    finishRequest() {\n        this.recordTimingMetric(TimingMetric.requestEnd);\n        this.adapter.visitRequestFinished(this);\n    }\n    loadResponse() {\n        if (this.response) {\n            const { statusCode, responseHTML } = this.response;\n            this.render(async () => {\n                if (this.shouldCacheSnapshot)\n                    this.cacheSnapshot();\n                if (this.view.renderPromise)\n                    await this.view.renderPromise;\n                if (isSuccessful(statusCode) && responseHTML != null) {\n                    await this.view.renderPage(PageSnapshot.fromHTMLString(responseHTML), false, this.willRender, this);\n                    this.performScroll();\n                    this.adapter.visitRendered(this);\n                    this.complete();\n                }\n                else {\n                    await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);\n                    this.adapter.visitRendered(this);\n                    this.fail();\n                }\n            });\n        }\n    }\n    getCachedSnapshot() {\n        const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\n        if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {\n            if (this.action == \"restore\" || snapshot.isPreviewable) {\n                return snapshot;\n            }\n        }\n    }\n    getPreloadedSnapshot() {\n        if (this.snapshotHTML) {\n            return PageSnapshot.fromHTMLString(this.snapshotHTML);\n        }\n    }\n    hasCachedSnapshot() {\n        return this.getCachedSnapshot() != null;\n    }\n    loadCachedSnapshot() {\n        const snapshot = this.getCachedSnapshot();\n        if (snapshot) {\n            const isPreview = this.shouldIssueRequest();\n            this.render(async () => {\n                this.cacheSnapshot();\n                if (this.isSamePage) {\n                    this.adapter.visitRendered(this);\n                }\n                else {\n                    if (this.view.renderPromise)\n                        await this.view.renderPromise;\n                    await this.view.renderPage(snapshot, isPreview, this.willRender, this);\n                    this.performScroll();\n                    this.adapter.visitRendered(this);\n                    if (!isPreview) {\n                        this.complete();\n                    }\n                }\n            });\n        }\n    }\n    followRedirect() {\n        var _a;\n        if (this.redirectedToLocation && !this.followedRedirect && ((_a = this.response) === null || _a === void 0 ? void 0 : _a.redirected)) {\n            this.adapter.visitProposedToLocation(this.redirectedToLocation, {\n                action: \"replace\",\n                response: this.response,\n                shouldCacheSnapshot: false,\n                willRender: false,\n            });\n            this.followedRedirect = true;\n        }\n    }\n    goToSamePageAnchor() {\n        if (this.isSamePage) {\n            this.render(async () => {\n                this.cacheSnapshot();\n                this.performScroll();\n                this.changeHistory();\n                this.adapter.visitRendered(this);\n            });\n        }\n    }\n    prepareRequest(request) {\n        if (this.acceptsStreamResponse) {\n            request.acceptResponseType(StreamMessage.contentType);\n        }\n    }\n    requestStarted() {\n        this.startRequest();\n    }\n    requestPreventedHandlingResponse(_request, _response) { }\n    async requestSucceededWithResponse(request, response) {\n        const responseHTML = await response.responseHTML;\n        const { redirected, statusCode } = response;\n        if (responseHTML == undefined) {\n            this.recordResponse({\n                statusCode: SystemStatusCode.contentTypeMismatch,\n                redirected,\n            });\n        }\n        else {\n            this.redirectedToLocation = response.redirected ? response.location : undefined;\n            this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n        }\n    }\n    async requestFailedWithResponse(request, response) {\n        const responseHTML = await response.responseHTML;\n        const { redirected, statusCode } = response;\n        if (responseHTML == undefined) {\n            this.recordResponse({\n                statusCode: SystemStatusCode.contentTypeMismatch,\n                redirected,\n            });\n        }\n        else {\n            this.recordResponse({ statusCode: statusCode, responseHTML, redirected });\n        }\n    }\n    requestErrored(_request, _error) {\n        this.recordResponse({\n            statusCode: SystemStatusCode.networkFailure,\n            redirected: false,\n        });\n    }\n    requestFinished() {\n        this.finishRequest();\n    }\n    performScroll() {\n        if (!this.scrolled && !this.view.forceReloaded) {\n            if (this.action == \"restore\") {\n                this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n            }\n            else {\n                this.scrollToAnchor() || this.view.scrollToTop();\n            }\n            if (this.isSamePage) {\n                this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);\n            }\n            this.scrolled = true;\n        }\n    }\n    scrollToRestoredPosition() {\n        const { scrollPosition } = this.restorationData;\n        if (scrollPosition) {\n            this.view.scrollToPosition(scrollPosition);\n            return true;\n        }\n    }\n    scrollToAnchor() {\n        const anchor = getAnchor(this.location);\n        if (anchor != null) {\n            this.view.scrollToAnchor(anchor);\n            return true;\n        }\n    }\n    recordTimingMetric(metric) {\n        this.timingMetrics[metric] = new Date().getTime();\n    }\n    getTimingMetrics() {\n        return Object.assign({}, this.timingMetrics);\n    }\n    getHistoryMethodForAction(action) {\n        switch (action) {\n            case \"replace\":\n                return history.replaceState;\n            case \"advance\":\n            case \"restore\":\n                return history.pushState;\n        }\n    }\n    hasPreloadedResponse() {\n        return typeof this.response == \"object\";\n    }\n    shouldIssueRequest() {\n        if (this.isSamePage) {\n            return false;\n        }\n        else if (this.action == \"restore\") {\n            return !this.hasCachedSnapshot();\n        }\n        else {\n            return this.willRender;\n        }\n    }\n    cacheSnapshot() {\n        if (!this.snapshotCached) {\n            this.view.cacheSnapshot(this.snapshot).then((snapshot) => snapshot && this.visitCachedSnapshot(snapshot));\n            this.snapshotCached = true;\n        }\n    }\n    async render(callback) {\n        this.cancelRender();\n        await new Promise((resolve) => {\n            this.frame = requestAnimationFrame(() => resolve());\n        });\n        await callback();\n        delete this.frame;\n    }\n    cancelRender() {\n        if (this.frame) {\n            cancelAnimationFrame(this.frame);\n            delete this.frame;\n        }\n    }\n}\nfunction isSuccessful(statusCode) {\n    return statusCode >= 200 && statusCode < 300;\n}\n\nclass BrowserAdapter {\n    constructor(session) {\n        this.progressBar = new ProgressBar();\n        this.showProgressBar = () => {\n            this.progressBar.show();\n        };\n        this.session = session;\n    }\n    visitProposedToLocation(location, options) {\n        this.navigator.startVisit(location, (options === null || options === void 0 ? void 0 : options.restorationIdentifier) || uuid(), options);\n    }\n    visitStarted(visit) {\n        this.location = visit.location;\n        visit.loadCachedSnapshot();\n        visit.issueRequest();\n        visit.goToSamePageAnchor();\n    }\n    visitRequestStarted(visit) {\n        this.progressBar.setValue(0);\n        if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n            this.showVisitProgressBarAfterDelay();\n        }\n        else {\n            this.showProgressBar();\n        }\n    }\n    visitRequestCompleted(visit) {\n        visit.loadResponse();\n    }\n    visitRequestFailedWithStatusCode(visit, statusCode) {\n        switch (statusCode) {\n            case SystemStatusCode.networkFailure:\n            case SystemStatusCode.timeoutFailure:\n            case SystemStatusCode.contentTypeMismatch:\n                return this.reload({\n                    reason: \"request_failed\",\n                    context: {\n                        statusCode,\n                    },\n                });\n            default:\n                return visit.loadResponse();\n        }\n    }\n    visitRequestFinished(_visit) {\n        this.progressBar.setValue(1);\n        this.hideVisitProgressBar();\n    }\n    visitCompleted(_visit) { }\n    pageInvalidated(reason) {\n        this.reload(reason);\n    }\n    visitFailed(_visit) { }\n    visitRendered(_visit) { }\n    formSubmissionStarted(_formSubmission) {\n        this.progressBar.setValue(0);\n        this.showFormProgressBarAfterDelay();\n    }\n    formSubmissionFinished(_formSubmission) {\n        this.progressBar.setValue(1);\n        this.hideFormProgressBar();\n    }\n    showVisitProgressBarAfterDelay() {\n        this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n    }\n    hideVisitProgressBar() {\n        this.progressBar.hide();\n        if (this.visitProgressBarTimeout != null) {\n            window.clearTimeout(this.visitProgressBarTimeout);\n            delete this.visitProgressBarTimeout;\n        }\n    }\n    showFormProgressBarAfterDelay() {\n        if (this.formProgressBarTimeout == null) {\n            this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n        }\n    }\n    hideFormProgressBar() {\n        this.progressBar.hide();\n        if (this.formProgressBarTimeout != null) {\n            window.clearTimeout(this.formProgressBarTimeout);\n            delete this.formProgressBarTimeout;\n        }\n    }\n    reload(reason) {\n        var _a;\n        dispatch(\"turbo:reload\", { detail: reason });\n        window.location.href = ((_a = this.location) === null || _a === void 0 ? void 0 : _a.toString()) || window.location.href;\n    }\n    get navigator() {\n        return this.session.navigator;\n    }\n}\n\nclass CacheObserver {\n    constructor() {\n        this.selector = \"[data-turbo-temporary]\";\n        this.deprecatedSelector = \"[data-turbo-cache=false]\";\n        this.started = false;\n        this.removeTemporaryElements = ((_event) => {\n            for (const element of this.temporaryElements) {\n                element.remove();\n            }\n        });\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            addEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            removeEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n        }\n    }\n    get temporaryElements() {\n        return [...document.querySelectorAll(this.selector), ...this.temporaryElementsWithDeprecation];\n    }\n    get temporaryElementsWithDeprecation() {\n        const elements = document.querySelectorAll(this.deprecatedSelector);\n        if (elements.length) {\n            console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`);\n        }\n        return [...elements];\n    }\n}\n\nclass FrameRedirector {\n    constructor(session, element) {\n        this.session = session;\n        this.element = element;\n        this.linkInterceptor = new LinkInterceptor(this, element);\n        this.formSubmitObserver = new FormSubmitObserver(this, element);\n    }\n    start() {\n        this.linkInterceptor.start();\n        this.formSubmitObserver.start();\n    }\n    stop() {\n        this.linkInterceptor.stop();\n        this.formSubmitObserver.stop();\n    }\n    shouldInterceptLinkClick(element, _location, _event) {\n        return this.shouldRedirect(element);\n    }\n    linkClickIntercepted(element, url, event) {\n        const frame = this.findFrameElement(element);\n        if (frame) {\n            frame.delegate.linkClickIntercepted(element, url, event);\n        }\n    }\n    willSubmitForm(element, submitter) {\n        return (element.closest(\"turbo-frame\") == null &&\n            this.shouldSubmit(element, submitter) &&\n            this.shouldRedirect(element, submitter));\n    }\n    formSubmitted(element, submitter) {\n        const frame = this.findFrameElement(element, submitter);\n        if (frame) {\n            frame.delegate.formSubmitted(element, submitter);\n        }\n    }\n    shouldSubmit(form, submitter) {\n        var _a;\n        const action = getAction(form, submitter);\n        const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n        const rootLocation = expandURL((_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\");\n        return this.shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation);\n    }\n    shouldRedirect(element, submitter) {\n        const isNavigatable = element instanceof HTMLFormElement\n            ? this.session.submissionIsNavigatable(element, submitter)\n            : this.session.elementIsNavigatable(element);\n        if (isNavigatable) {\n            const frame = this.findFrameElement(element, submitter);\n            return frame ? frame != element.closest(\"turbo-frame\") : false;\n        }\n        else {\n            return false;\n        }\n    }\n    findFrameElement(element, submitter) {\n        const id = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"data-turbo-frame\")) || element.getAttribute(\"data-turbo-frame\");\n        if (id && id != \"_top\") {\n            const frame = this.element.querySelector(`#${id}:not([disabled])`);\n            if (frame instanceof FrameElement) {\n                return frame;\n            }\n        }\n    }\n}\n\nclass History {\n    constructor(delegate) {\n        this.restorationIdentifier = uuid();\n        this.restorationData = {};\n        this.started = false;\n        this.pageLoaded = false;\n        this.onPopState = (event) => {\n            if (this.shouldHandlePopState()) {\n                const { turbo } = event.state || {};\n                if (turbo) {\n                    this.location = new URL(window.location.href);\n                    const { restorationIdentifier } = turbo;\n                    this.restorationIdentifier = restorationIdentifier;\n                    this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location, restorationIdentifier);\n                }\n            }\n        };\n        this.onPageLoad = async (_event) => {\n            await nextMicrotask();\n            this.pageLoaded = true;\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            addEventListener(\"popstate\", this.onPopState, false);\n            addEventListener(\"load\", this.onPageLoad, false);\n            this.started = true;\n            this.replace(new URL(window.location.href));\n        }\n    }\n    stop() {\n        if (this.started) {\n            removeEventListener(\"popstate\", this.onPopState, false);\n            removeEventListener(\"load\", this.onPageLoad, false);\n            this.started = false;\n        }\n    }\n    push(location, restorationIdentifier) {\n        this.update(history.pushState, location, restorationIdentifier);\n    }\n    replace(location, restorationIdentifier) {\n        this.update(history.replaceState, location, restorationIdentifier);\n    }\n    update(method, location, restorationIdentifier = uuid()) {\n        const state = { turbo: { restorationIdentifier } };\n        method.call(history, state, \"\", location.href);\n        this.location = location;\n        this.restorationIdentifier = restorationIdentifier;\n    }\n    getRestorationDataForIdentifier(restorationIdentifier) {\n        return this.restorationData[restorationIdentifier] || {};\n    }\n    updateRestorationData(additionalData) {\n        const { restorationIdentifier } = this;\n        const restorationData = this.restorationData[restorationIdentifier];\n        this.restorationData[restorationIdentifier] = Object.assign(Object.assign({}, restorationData), additionalData);\n    }\n    assumeControlOfScrollRestoration() {\n        var _a;\n        if (!this.previousScrollRestoration) {\n            this.previousScrollRestoration = (_a = history.scrollRestoration) !== null && _a !== void 0 ? _a : \"auto\";\n            history.scrollRestoration = \"manual\";\n        }\n    }\n    relinquishControlOfScrollRestoration() {\n        if (this.previousScrollRestoration) {\n            history.scrollRestoration = this.previousScrollRestoration;\n            delete this.previousScrollRestoration;\n        }\n    }\n    shouldHandlePopState() {\n        return this.pageIsLoaded();\n    }\n    pageIsLoaded() {\n        return this.pageLoaded || document.readyState == \"complete\";\n    }\n}\n\nclass Navigator {\n    constructor(delegate) {\n        this.delegate = delegate;\n    }\n    proposeVisit(location, options = {}) {\n        if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n            if (locationIsVisitable(location, this.view.snapshot.rootLocation)) {\n                this.delegate.visitProposedToLocation(location, options);\n            }\n            else {\n                window.location.href = location.toString();\n            }\n        }\n    }\n    startVisit(locatable, restorationIdentifier, options = {}) {\n        this.stop();\n        this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, Object.assign({ referrer: this.location }, options));\n        this.currentVisit.start();\n    }\n    submitForm(form, submitter) {\n        this.stop();\n        this.formSubmission = new FormSubmission(this, form, submitter, true);\n        this.formSubmission.start();\n    }\n    stop() {\n        if (this.formSubmission) {\n            this.formSubmission.stop();\n            delete this.formSubmission;\n        }\n        if (this.currentVisit) {\n            this.currentVisit.cancel();\n            delete this.currentVisit;\n        }\n    }\n    get adapter() {\n        return this.delegate.adapter;\n    }\n    get view() {\n        return this.delegate.view;\n    }\n    get history() {\n        return this.delegate.history;\n    }\n    formSubmissionStarted(formSubmission) {\n        if (typeof this.adapter.formSubmissionStarted === \"function\") {\n            this.adapter.formSubmissionStarted(formSubmission);\n        }\n    }\n    async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {\n        if (formSubmission == this.formSubmission) {\n            const responseHTML = await fetchResponse.responseHTML;\n            if (responseHTML) {\n                const shouldCacheSnapshot = formSubmission.isSafe;\n                if (!shouldCacheSnapshot) {\n                    this.view.clearSnapshotCache();\n                }\n                const { statusCode, redirected } = fetchResponse;\n                const action = this.getActionForFormSubmission(formSubmission);\n                const visitOptions = {\n                    action,\n                    shouldCacheSnapshot,\n                    response: { statusCode, responseHTML, redirected },\n                };\n                this.proposeVisit(fetchResponse.location, visitOptions);\n            }\n        }\n    }\n    async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n        const responseHTML = await fetchResponse.responseHTML;\n        if (responseHTML) {\n            const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n            if (fetchResponse.serverError) {\n                await this.view.renderError(snapshot, this.currentVisit);\n            }\n            else {\n                await this.view.renderPage(snapshot, false, true, this.currentVisit);\n            }\n            this.view.scrollToTop();\n            this.view.clearSnapshotCache();\n        }\n    }\n    formSubmissionErrored(formSubmission, error) {\n        console.error(error);\n    }\n    formSubmissionFinished(formSubmission) {\n        if (typeof this.adapter.formSubmissionFinished === \"function\") {\n            this.adapter.formSubmissionFinished(formSubmission);\n        }\n    }\n    visitStarted(visit) {\n        this.delegate.visitStarted(visit);\n    }\n    visitCompleted(visit) {\n        this.delegate.visitCompleted(visit);\n    }\n    locationWithActionIsSamePage(location, action) {\n        const anchor = getAnchor(location);\n        const currentAnchor = getAnchor(this.view.lastRenderedLocation);\n        const isRestorationToTop = action === \"restore\" && typeof anchor === \"undefined\";\n        return (action !== \"replace\" &&\n            getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) &&\n            (isRestorationToTop || (anchor != null && anchor !== currentAnchor)));\n    }\n    visitScrolledToSamePageLocation(oldURL, newURL) {\n        this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);\n    }\n    get location() {\n        return this.history.location;\n    }\n    get restorationIdentifier() {\n        return this.history.restorationIdentifier;\n    }\n    getActionForFormSubmission({ submitter, formElement }) {\n        return getVisitAction(submitter, formElement) || \"advance\";\n    }\n}\n\nvar PageStage;\n(function (PageStage) {\n    PageStage[PageStage[\"initial\"] = 0] = \"initial\";\n    PageStage[PageStage[\"loading\"] = 1] = \"loading\";\n    PageStage[PageStage[\"interactive\"] = 2] = \"interactive\";\n    PageStage[PageStage[\"complete\"] = 3] = \"complete\";\n})(PageStage || (PageStage = {}));\nclass PageObserver {\n    constructor(delegate) {\n        this.stage = PageStage.initial;\n        this.started = false;\n        this.interpretReadyState = () => {\n            const { readyState } = this;\n            if (readyState == \"interactive\") {\n                this.pageIsInteractive();\n            }\n            else if (readyState == \"complete\") {\n                this.pageIsComplete();\n            }\n        };\n        this.pageWillUnload = () => {\n            this.delegate.pageWillUnload();\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            if (this.stage == PageStage.initial) {\n                this.stage = PageStage.loading;\n            }\n            document.addEventListener(\"readystatechange\", this.interpretReadyState, false);\n            addEventListener(\"pagehide\", this.pageWillUnload, false);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            document.removeEventListener(\"readystatechange\", this.interpretReadyState, false);\n            removeEventListener(\"pagehide\", this.pageWillUnload, false);\n            this.started = false;\n        }\n    }\n    pageIsInteractive() {\n        if (this.stage == PageStage.loading) {\n            this.stage = PageStage.interactive;\n            this.delegate.pageBecameInteractive();\n        }\n    }\n    pageIsComplete() {\n        this.pageIsInteractive();\n        if (this.stage == PageStage.interactive) {\n            this.stage = PageStage.complete;\n            this.delegate.pageLoaded();\n        }\n    }\n    get readyState() {\n        return document.readyState;\n    }\n}\n\nclass ScrollObserver {\n    constructor(delegate) {\n        this.started = false;\n        this.onScroll = () => {\n            this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            addEventListener(\"scroll\", this.onScroll, false);\n            this.onScroll();\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            removeEventListener(\"scroll\", this.onScroll, false);\n            this.started = false;\n        }\n    }\n    updatePosition(position) {\n        this.delegate.scrollPositionChanged(position);\n    }\n}\n\nclass StreamMessageRenderer {\n    render({ fragment }) {\n        Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => document.documentElement.appendChild(fragment));\n    }\n    enteringBardo(currentPermanentElement, newPermanentElement) {\n        newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));\n    }\n    leavingBardo() { }\n}\nfunction getPermanentElementMapForFragment(fragment) {\n    const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);\n    const permanentElementMap = {};\n    for (const permanentElementInDocument of permanentElementsInDocument) {\n        const { id } = permanentElementInDocument;\n        for (const streamElement of fragment.querySelectorAll(\"turbo-stream\")) {\n            const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);\n            if (elementInStream) {\n                permanentElementMap[id] = [permanentElementInDocument, elementInStream];\n            }\n        }\n    }\n    return permanentElementMap;\n}\n\nclass StreamObserver {\n    constructor(delegate) {\n        this.sources = new Set();\n        this.started = false;\n        this.inspectFetchResponse = ((event) => {\n            const response = fetchResponseFromEvent(event);\n            if (response && fetchResponseIsStream(response)) {\n                event.preventDefault();\n                this.receiveMessageResponse(response);\n            }\n        });\n        this.receiveMessageEvent = (event) => {\n            if (this.started && typeof event.data == \"string\") {\n                this.receiveMessageHTML(event.data);\n            }\n        };\n        this.delegate = delegate;\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n        }\n    }\n    connectStreamSource(source) {\n        if (!this.streamSourceIsConnected(source)) {\n            this.sources.add(source);\n            source.addEventListener(\"message\", this.receiveMessageEvent, false);\n        }\n    }\n    disconnectStreamSource(source) {\n        if (this.streamSourceIsConnected(source)) {\n            this.sources.delete(source);\n            source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n        }\n    }\n    streamSourceIsConnected(source) {\n        return this.sources.has(source);\n    }\n    async receiveMessageResponse(response) {\n        const html = await response.responseHTML;\n        if (html) {\n            this.receiveMessageHTML(html);\n        }\n    }\n    receiveMessageHTML(html) {\n        this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));\n    }\n}\nfunction fetchResponseFromEvent(event) {\n    var _a;\n    const fetchResponse = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.fetchResponse;\n    if (fetchResponse instanceof FetchResponse) {\n        return fetchResponse;\n    }\n}\nfunction fetchResponseIsStream(response) {\n    var _a;\n    const contentType = (_a = response.contentType) !== null && _a !== void 0 ? _a : \"\";\n    return contentType.startsWith(StreamMessage.contentType);\n}\n\nclass ErrorRenderer extends Renderer {\n    static renderElement(currentElement, newElement) {\n        const { documentElement, body } = document;\n        documentElement.replaceChild(newElement, body);\n    }\n    async render() {\n        this.replaceHeadAndBody();\n        this.activateScriptElements();\n    }\n    replaceHeadAndBody() {\n        const { documentElement, head } = document;\n        documentElement.replaceChild(this.newHead, head);\n        this.renderElement(this.currentElement, this.newElement);\n    }\n    activateScriptElements() {\n        for (const replaceableElement of this.scriptElements) {\n            const parentNode = replaceableElement.parentNode;\n            if (parentNode) {\n                const element = activateScriptElement(replaceableElement);\n                parentNode.replaceChild(element, replaceableElement);\n            }\n        }\n    }\n    get newHead() {\n        return this.newSnapshot.headSnapshot.element;\n    }\n    get scriptElements() {\n        return document.documentElement.querySelectorAll(\"script\");\n    }\n}\n\nclass PageRenderer extends Renderer {\n    static renderElement(currentElement, newElement) {\n        if (document.body && newElement instanceof HTMLBodyElement) {\n            document.body.replaceWith(newElement);\n        }\n        else {\n            document.documentElement.appendChild(newElement);\n        }\n    }\n    get shouldRender() {\n        return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical;\n    }\n    get reloadReason() {\n        if (!this.newSnapshot.isVisitable) {\n            return {\n                reason: \"turbo_visit_control_is_reload\",\n            };\n        }\n        if (!this.trackedElementsAreIdentical) {\n            return {\n                reason: \"tracked_element_mismatch\",\n            };\n        }\n    }\n    async prepareToRender() {\n        await this.mergeHead();\n    }\n    async render() {\n        if (this.willRender) {\n            await this.replaceBody();\n        }\n    }\n    finishRendering() {\n        super.finishRendering();\n        if (!this.isPreview) {\n            this.focusFirstAutofocusableElement();\n        }\n    }\n    get currentHeadSnapshot() {\n        return this.currentSnapshot.headSnapshot;\n    }\n    get newHeadSnapshot() {\n        return this.newSnapshot.headSnapshot;\n    }\n    get newElement() {\n        return this.newSnapshot.element;\n    }\n    async mergeHead() {\n        const mergedHeadElements = this.mergeProvisionalElements();\n        const newStylesheetElements = this.copyNewHeadStylesheetElements();\n        this.copyNewHeadScriptElements();\n        await mergedHeadElements;\n        await newStylesheetElements;\n    }\n    async replaceBody() {\n        await this.preservingPermanentElements(async () => {\n            this.activateNewBody();\n            await this.assignNewBody();\n        });\n    }\n    get trackedElementsAreIdentical() {\n        return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;\n    }\n    async copyNewHeadStylesheetElements() {\n        const loadingElements = [];\n        for (const element of this.newHeadStylesheetElements) {\n            loadingElements.push(waitForLoad(element));\n            document.head.appendChild(element);\n        }\n        await Promise.all(loadingElements);\n    }\n    copyNewHeadScriptElements() {\n        for (const element of this.newHeadScriptElements) {\n            document.head.appendChild(activateScriptElement(element));\n        }\n    }\n    async mergeProvisionalElements() {\n        const newHeadElements = [...this.newHeadProvisionalElements];\n        for (const element of this.currentHeadProvisionalElements) {\n            if (!this.isCurrentElementInElementList(element, newHeadElements)) {\n                document.head.removeChild(element);\n            }\n        }\n        for (const element of newHeadElements) {\n            document.head.appendChild(element);\n        }\n    }\n    isCurrentElementInElementList(element, elementList) {\n        for (const [index, newElement] of elementList.entries()) {\n            if (element.tagName == \"TITLE\") {\n                if (newElement.tagName != \"TITLE\") {\n                    continue;\n                }\n                if (element.innerHTML == newElement.innerHTML) {\n                    elementList.splice(index, 1);\n                    return true;\n                }\n            }\n            if (newElement.isEqualNode(element)) {\n                elementList.splice(index, 1);\n                return true;\n            }\n        }\n        return false;\n    }\n    removeCurrentHeadProvisionalElements() {\n        for (const element of this.currentHeadProvisionalElements) {\n            document.head.removeChild(element);\n        }\n    }\n    copyNewHeadProvisionalElements() {\n        for (const element of this.newHeadProvisionalElements) {\n            document.head.appendChild(element);\n        }\n    }\n    activateNewBody() {\n        document.adoptNode(this.newElement);\n        this.activateNewBodyScriptElements();\n    }\n    activateNewBodyScriptElements() {\n        for (const inertScriptElement of this.newBodyScriptElements) {\n            const activatedScriptElement = activateScriptElement(inertScriptElement);\n            inertScriptElement.replaceWith(activatedScriptElement);\n        }\n    }\n    async assignNewBody() {\n        await this.renderElement(this.currentElement, this.newElement);\n    }\n    get newHeadStylesheetElements() {\n        return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot);\n    }\n    get newHeadScriptElements() {\n        return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot);\n    }\n    get currentHeadProvisionalElements() {\n        return this.currentHeadSnapshot.provisionalElements;\n    }\n    get newHeadProvisionalElements() {\n        return this.newHeadSnapshot.provisionalElements;\n    }\n    get newBodyScriptElements() {\n        return this.newElement.querySelectorAll(\"script\");\n    }\n}\n\nclass SnapshotCache {\n    constructor(size) {\n        this.keys = [];\n        this.snapshots = {};\n        this.size = size;\n    }\n    has(location) {\n        return toCacheKey(location) in this.snapshots;\n    }\n    get(location) {\n        if (this.has(location)) {\n            const snapshot = this.read(location);\n            this.touch(location);\n            return snapshot;\n        }\n    }\n    put(location, snapshot) {\n        this.write(location, snapshot);\n        this.touch(location);\n        return snapshot;\n    }\n    clear() {\n        this.snapshots = {};\n    }\n    read(location) {\n        return this.snapshots[toCacheKey(location)];\n    }\n    write(location, snapshot) {\n        this.snapshots[toCacheKey(location)] = snapshot;\n    }\n    touch(location) {\n        const key = toCacheKey(location);\n        const index = this.keys.indexOf(key);\n        if (index > -1)\n            this.keys.splice(index, 1);\n        this.keys.unshift(key);\n        this.trim();\n    }\n    trim() {\n        for (const key of this.keys.splice(this.size)) {\n            delete this.snapshots[key];\n        }\n    }\n}\n\nclass PageView extends View {\n    constructor() {\n        super(...arguments);\n        this.snapshotCache = new SnapshotCache(10);\n        this.lastRenderedLocation = new URL(location.href);\n        this.forceReloaded = false;\n    }\n    renderPage(snapshot, isPreview = false, willRender = true, visit) {\n        const renderer = new PageRenderer(this.snapshot, snapshot, PageRenderer.renderElement, isPreview, willRender);\n        if (!renderer.shouldRender) {\n            this.forceReloaded = true;\n        }\n        else {\n            visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n        }\n        return this.render(renderer);\n    }\n    renderError(snapshot, visit) {\n        visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n        const renderer = new ErrorRenderer(this.snapshot, snapshot, ErrorRenderer.renderElement, false);\n        return this.render(renderer);\n    }\n    clearSnapshotCache() {\n        this.snapshotCache.clear();\n    }\n    async cacheSnapshot(snapshot = this.snapshot) {\n        if (snapshot.isCacheable) {\n            this.delegate.viewWillCacheSnapshot();\n            const { lastRenderedLocation: location } = this;\n            await nextEventLoopTick();\n            const cachedSnapshot = snapshot.clone();\n            this.snapshotCache.put(location, cachedSnapshot);\n            return cachedSnapshot;\n        }\n    }\n    getCachedSnapshotForLocation(location) {\n        return this.snapshotCache.get(location);\n    }\n    get snapshot() {\n        return PageSnapshot.fromElement(this.element);\n    }\n}\n\nclass Preloader {\n    constructor(delegate) {\n        this.selector = \"a[data-turbo-preload]\";\n        this.delegate = delegate;\n    }\n    get snapshotCache() {\n        return this.delegate.navigator.view.snapshotCache;\n    }\n    start() {\n        if (document.readyState === \"loading\") {\n            return document.addEventListener(\"DOMContentLoaded\", () => {\n                this.preloadOnLoadLinksForView(document.body);\n            });\n        }\n        else {\n            this.preloadOnLoadLinksForView(document.body);\n        }\n    }\n    preloadOnLoadLinksForView(element) {\n        for (const link of element.querySelectorAll(this.selector)) {\n            this.preloadURL(link);\n        }\n    }\n    async preloadURL(link) {\n        const location = new URL(link.href);\n        if (this.snapshotCache.has(location)) {\n            return;\n        }\n        try {\n            const response = await fetch(location.toString(), { headers: { \"VND.PREFETCH\": \"true\", Accept: \"text/html\" } });\n            const responseText = await response.text();\n            const snapshot = PageSnapshot.fromHTMLString(responseText);\n            this.snapshotCache.put(location, snapshot);\n        }\n        catch (_) {\n        }\n    }\n}\n\nclass Session {\n    constructor() {\n        this.navigator = new Navigator(this);\n        this.history = new History(this);\n        this.preloader = new Preloader(this);\n        this.view = new PageView(this, document.documentElement);\n        this.adapter = new BrowserAdapter(this);\n        this.pageObserver = new PageObserver(this);\n        this.cacheObserver = new CacheObserver();\n        this.linkClickObserver = new LinkClickObserver(this, window);\n        this.formSubmitObserver = new FormSubmitObserver(this, document);\n        this.scrollObserver = new ScrollObserver(this);\n        this.streamObserver = new StreamObserver(this);\n        this.formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement);\n        this.frameRedirector = new FrameRedirector(this, document.documentElement);\n        this.streamMessageRenderer = new StreamMessageRenderer();\n        this.drive = true;\n        this.enabled = true;\n        this.progressBarDelay = 500;\n        this.started = false;\n        this.formMode = \"on\";\n    }\n    start() {\n        if (!this.started) {\n            this.pageObserver.start();\n            this.cacheObserver.start();\n            this.formLinkClickObserver.start();\n            this.linkClickObserver.start();\n            this.formSubmitObserver.start();\n            this.scrollObserver.start();\n            this.streamObserver.start();\n            this.frameRedirector.start();\n            this.history.start();\n            this.preloader.start();\n            this.started = true;\n            this.enabled = true;\n        }\n    }\n    disable() {\n        this.enabled = false;\n    }\n    stop() {\n        if (this.started) {\n            this.pageObserver.stop();\n            this.cacheObserver.stop();\n            this.formLinkClickObserver.stop();\n            this.linkClickObserver.stop();\n            this.formSubmitObserver.stop();\n            this.scrollObserver.stop();\n            this.streamObserver.stop();\n            this.frameRedirector.stop();\n            this.history.stop();\n            this.started = false;\n        }\n    }\n    registerAdapter(adapter) {\n        this.adapter = adapter;\n    }\n    visit(location, options = {}) {\n        const frameElement = options.frame ? document.getElementById(options.frame) : null;\n        if (frameElement instanceof FrameElement) {\n            frameElement.src = location.toString();\n            frameElement.loaded;\n        }\n        else {\n            this.navigator.proposeVisit(expandURL(location), options);\n        }\n    }\n    connectStreamSource(source) {\n        this.streamObserver.connectStreamSource(source);\n    }\n    disconnectStreamSource(source) {\n        this.streamObserver.disconnectStreamSource(source);\n    }\n    renderStreamMessage(message) {\n        this.streamMessageRenderer.render(StreamMessage.wrap(message));\n    }\n    clearCache() {\n        this.view.clearSnapshotCache();\n    }\n    setProgressBarDelay(delay) {\n        this.progressBarDelay = delay;\n    }\n    setFormMode(mode) {\n        this.formMode = mode;\n    }\n    get location() {\n        return this.history.location;\n    }\n    get restorationIdentifier() {\n        return this.history.restorationIdentifier;\n    }\n    historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier) {\n        if (this.enabled) {\n            this.navigator.startVisit(location, restorationIdentifier, {\n                action: \"restore\",\n                historyChanged: true,\n            });\n        }\n        else {\n            this.adapter.pageInvalidated({\n                reason: \"turbo_disabled\",\n            });\n        }\n    }\n    scrollPositionChanged(position) {\n        this.history.updateRestorationData({ scrollPosition: position });\n    }\n    willSubmitFormLinkToLocation(link, location) {\n        return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation);\n    }\n    submittedFormLinkToLocation() { }\n    willFollowLinkToLocation(link, location, event) {\n        return (this.elementIsNavigatable(link) &&\n            locationIsVisitable(location, this.snapshot.rootLocation) &&\n            this.applicationAllowsFollowingLinkToLocation(link, location, event));\n    }\n    followedLinkToLocation(link, location) {\n        const action = this.getActionForLink(link);\n        const acceptsStreamResponse = link.hasAttribute(\"data-turbo-stream\");\n        this.visit(location.href, { action, acceptsStreamResponse });\n    }\n    allowsVisitingLocationWithAction(location, action) {\n        return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location);\n    }\n    visitProposedToLocation(location, options) {\n        extendURLWithDeprecatedProperties(location);\n        this.adapter.visitProposedToLocation(location, options);\n    }\n    visitStarted(visit) {\n        if (!visit.acceptsStreamResponse) {\n            markAsBusy(document.documentElement);\n        }\n        extendURLWithDeprecatedProperties(visit.location);\n        if (!visit.silent) {\n            this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n        }\n    }\n    visitCompleted(visit) {\n        clearBusyState(document.documentElement);\n        this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n    }\n    locationWithActionIsSamePage(location, action) {\n        return this.navigator.locationWithActionIsSamePage(location, action);\n    }\n    visitScrolledToSamePageLocation(oldURL, newURL) {\n        this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);\n    }\n    willSubmitForm(form, submitter) {\n        const action = getAction(form, submitter);\n        return (this.submissionIsNavigatable(form, submitter) &&\n            locationIsVisitable(expandURL(action), this.snapshot.rootLocation));\n    }\n    formSubmitted(form, submitter) {\n        this.navigator.submitForm(form, submitter);\n    }\n    pageBecameInteractive() {\n        this.view.lastRenderedLocation = this.location;\n        this.notifyApplicationAfterPageLoad();\n    }\n    pageLoaded() {\n        this.history.assumeControlOfScrollRestoration();\n    }\n    pageWillUnload() {\n        this.history.relinquishControlOfScrollRestoration();\n    }\n    receivedMessageFromStream(message) {\n        this.renderStreamMessage(message);\n    }\n    viewWillCacheSnapshot() {\n        var _a;\n        if (!((_a = this.navigator.currentVisit) === null || _a === void 0 ? void 0 : _a.silent)) {\n            this.notifyApplicationBeforeCachingSnapshot();\n        }\n    }\n    allowsImmediateRender({ element }, options) {\n        const event = this.notifyApplicationBeforeRender(element, options);\n        const { defaultPrevented, detail: { render }, } = event;\n        if (this.view.renderer && render) {\n            this.view.renderer.renderElement = render;\n        }\n        return !defaultPrevented;\n    }\n    viewRenderedSnapshot(_snapshot, _isPreview) {\n        this.view.lastRenderedLocation = this.history.location;\n        this.notifyApplicationAfterRender();\n    }\n    preloadOnLoadLinksForView(element) {\n        this.preloader.preloadOnLoadLinksForView(element);\n    }\n    viewInvalidated(reason) {\n        this.adapter.pageInvalidated(reason);\n    }\n    frameLoaded(frame) {\n        this.notifyApplicationAfterFrameLoad(frame);\n    }\n    frameRendered(fetchResponse, frame) {\n        this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n    }\n    applicationAllowsFollowingLinkToLocation(link, location, ev) {\n        const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);\n        return !event.defaultPrevented;\n    }\n    applicationAllowsVisitingLocation(location) {\n        const event = this.notifyApplicationBeforeVisitingLocation(location);\n        return !event.defaultPrevented;\n    }\n    notifyApplicationAfterClickingLinkToLocation(link, location, event) {\n        return dispatch(\"turbo:click\", {\n            target: link,\n            detail: { url: location.href, originalEvent: event },\n            cancelable: true,\n        });\n    }\n    notifyApplicationBeforeVisitingLocation(location) {\n        return dispatch(\"turbo:before-visit\", {\n            detail: { url: location.href },\n            cancelable: true,\n        });\n    }\n    notifyApplicationAfterVisitingLocation(location, action) {\n        return dispatch(\"turbo:visit\", { detail: { url: location.href, action } });\n    }\n    notifyApplicationBeforeCachingSnapshot() {\n        return dispatch(\"turbo:before-cache\");\n    }\n    notifyApplicationBeforeRender(newBody, options) {\n        return dispatch(\"turbo:before-render\", {\n            detail: Object.assign({ newBody }, options),\n            cancelable: true,\n        });\n    }\n    notifyApplicationAfterRender() {\n        return dispatch(\"turbo:render\");\n    }\n    notifyApplicationAfterPageLoad(timing = {}) {\n        return dispatch(\"turbo:load\", {\n            detail: { url: this.location.href, timing },\n        });\n    }\n    notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n        dispatchEvent(new HashChangeEvent(\"hashchange\", {\n            oldURL: oldURL.toString(),\n            newURL: newURL.toString(),\n        }));\n    }\n    notifyApplicationAfterFrameLoad(frame) {\n        return dispatch(\"turbo:frame-load\", { target: frame });\n    }\n    notifyApplicationAfterFrameRender(fetchResponse, frame) {\n        return dispatch(\"turbo:frame-render\", {\n            detail: { fetchResponse },\n            target: frame,\n            cancelable: true,\n        });\n    }\n    submissionIsNavigatable(form, submitter) {\n        if (this.formMode == \"off\") {\n            return false;\n        }\n        else {\n            const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;\n            if (this.formMode == \"optin\") {\n                return submitterIsNavigatable && form.closest('[data-turbo=\"true\"]') != null;\n            }\n            else {\n                return submitterIsNavigatable && this.elementIsNavigatable(form);\n            }\n        }\n    }\n    elementIsNavigatable(element) {\n        const container = findClosestRecursively(element, \"[data-turbo]\");\n        const withinFrame = findClosestRecursively(element, \"turbo-frame\");\n        if (this.drive || withinFrame) {\n            if (container) {\n                return container.getAttribute(\"data-turbo\") != \"false\";\n            }\n            else {\n                return true;\n            }\n        }\n        else {\n            if (container) {\n                return container.getAttribute(\"data-turbo\") == \"true\";\n            }\n            else {\n                return false;\n            }\n        }\n    }\n    getActionForLink(link) {\n        return getVisitAction(link) || \"advance\";\n    }\n    get snapshot() {\n        return this.view.snapshot;\n    }\n}\nfunction extendURLWithDeprecatedProperties(url) {\n    Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\nconst deprecatedLocationPropertyDescriptors = {\n    absoluteURL: {\n        get() {\n            return this.toString();\n        },\n    },\n};\n\nclass Cache {\n    constructor(session) {\n        this.session = session;\n    }\n    clear() {\n        this.session.clearCache();\n    }\n    resetCacheControl() {\n        this.setCacheControl(\"\");\n    }\n    exemptPageFromCache() {\n        this.setCacheControl(\"no-cache\");\n    }\n    exemptPageFromPreview() {\n        this.setCacheControl(\"no-preview\");\n    }\n    setCacheControl(value) {\n        setMetaContent(\"turbo-cache-control\", value);\n    }\n}\n\nconst StreamActions = {\n    after() {\n        this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e.nextSibling); });\n    },\n    append() {\n        this.removeDuplicateTargetChildren();\n        this.targetElements.forEach((e) => e.append(this.templateContent));\n    },\n    before() {\n        this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e); });\n    },\n    prepend() {\n        this.removeDuplicateTargetChildren();\n        this.targetElements.forEach((e) => e.prepend(this.templateContent));\n    },\n    remove() {\n        this.targetElements.forEach((e) => e.remove());\n    },\n    replace() {\n        this.targetElements.forEach((e) => e.replaceWith(this.templateContent));\n    },\n    update() {\n        this.targetElements.forEach((targetElement) => {\n            targetElement.innerHTML = \"\";\n            targetElement.append(this.templateContent);\n        });\n    },\n};\n\nconst session = new Session();\nconst cache = new Cache(session);\nconst { navigator: navigator$1 } = session;\nfunction start() {\n    session.start();\n}\nfunction registerAdapter(adapter) {\n    session.registerAdapter(adapter);\n}\nfunction visit(location, options) {\n    session.visit(location, options);\n}\nfunction connectStreamSource(source) {\n    session.connectStreamSource(source);\n}\nfunction disconnectStreamSource(source) {\n    session.disconnectStreamSource(source);\n}\nfunction renderStreamMessage(message) {\n    session.renderStreamMessage(message);\n}\nfunction clearCache() {\n    console.warn(\"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`\");\n    session.clearCache();\n}\nfunction setProgressBarDelay(delay) {\n    session.setProgressBarDelay(delay);\n}\nfunction setConfirmMethod(confirmMethod) {\n    FormSubmission.confirmMethod = confirmMethod;\n}\nfunction setFormMode(mode) {\n    session.setFormMode(mode);\n}\n\nvar Turbo = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    navigator: navigator$1,\n    session: session,\n    cache: cache,\n    PageRenderer: PageRenderer,\n    PageSnapshot: PageSnapshot,\n    FrameRenderer: FrameRenderer,\n    start: start,\n    registerAdapter: registerAdapter,\n    visit: visit,\n    connectStreamSource: connectStreamSource,\n    disconnectStreamSource: disconnectStreamSource,\n    renderStreamMessage: renderStreamMessage,\n    clearCache: clearCache,\n    setProgressBarDelay: setProgressBarDelay,\n    setConfirmMethod: setConfirmMethod,\n    setFormMode: setFormMode,\n    StreamActions: StreamActions\n});\n\nclass TurboFrameMissingError extends Error {\n}\n\nclass FrameController {\n    constructor(element) {\n        this.fetchResponseLoaded = (_fetchResponse) => { };\n        this.currentFetchRequest = null;\n        this.resolveVisitPromise = () => { };\n        this.connected = false;\n        this.hasBeenLoaded = false;\n        this.ignoredAttributes = new Set();\n        this.action = null;\n        this.visitCachedSnapshot = ({ element }) => {\n            const frame = element.querySelector(\"#\" + this.element.id);\n            if (frame && this.previousFrameElement) {\n                frame.replaceChildren(...this.previousFrameElement.children);\n            }\n            delete this.previousFrameElement;\n        };\n        this.element = element;\n        this.view = new FrameView(this, this.element);\n        this.appearanceObserver = new AppearanceObserver(this, this.element);\n        this.formLinkClickObserver = new FormLinkClickObserver(this, this.element);\n        this.linkInterceptor = new LinkInterceptor(this, this.element);\n        this.restorationIdentifier = uuid();\n        this.formSubmitObserver = new FormSubmitObserver(this, this.element);\n    }\n    connect() {\n        if (!this.connected) {\n            this.connected = true;\n            if (this.loadingStyle == FrameLoadingStyle.lazy) {\n                this.appearanceObserver.start();\n            }\n            else {\n                this.loadSourceURL();\n            }\n            this.formLinkClickObserver.start();\n            this.linkInterceptor.start();\n            this.formSubmitObserver.start();\n        }\n    }\n    disconnect() {\n        if (this.connected) {\n            this.connected = false;\n            this.appearanceObserver.stop();\n            this.formLinkClickObserver.stop();\n            this.linkInterceptor.stop();\n            this.formSubmitObserver.stop();\n        }\n    }\n    disabledChanged() {\n        if (this.loadingStyle == FrameLoadingStyle.eager) {\n            this.loadSourceURL();\n        }\n    }\n    sourceURLChanged() {\n        if (this.isIgnoringChangesTo(\"src\"))\n            return;\n        if (this.element.isConnected) {\n            this.complete = false;\n        }\n        if (this.loadingStyle == FrameLoadingStyle.eager || this.hasBeenLoaded) {\n            this.loadSourceURL();\n        }\n    }\n    sourceURLReloaded() {\n        const { src } = this.element;\n        this.ignoringChangesToAttribute(\"complete\", () => {\n            this.element.removeAttribute(\"complete\");\n        });\n        this.element.src = null;\n        this.element.src = src;\n        return this.element.loaded;\n    }\n    completeChanged() {\n        if (this.isIgnoringChangesTo(\"complete\"))\n            return;\n        this.loadSourceURL();\n    }\n    loadingStyleChanged() {\n        if (this.loadingStyle == FrameLoadingStyle.lazy) {\n            this.appearanceObserver.start();\n        }\n        else {\n            this.appearanceObserver.stop();\n            this.loadSourceURL();\n        }\n    }\n    async loadSourceURL() {\n        if (this.enabled && this.isActive && !this.complete && this.sourceURL) {\n            this.element.loaded = this.visit(expandURL(this.sourceURL));\n            this.appearanceObserver.stop();\n            await this.element.loaded;\n            this.hasBeenLoaded = true;\n        }\n    }\n    async loadResponse(fetchResponse) {\n        if (fetchResponse.redirected || (fetchResponse.succeeded && fetchResponse.isHTML)) {\n            this.sourceURL = fetchResponse.response.url;\n        }\n        try {\n            const html = await fetchResponse.responseHTML;\n            if (html) {\n                const document = parseHTMLDocument(html);\n                const pageSnapshot = PageSnapshot.fromDocument(document);\n                if (pageSnapshot.isVisitable) {\n                    await this.loadFrameResponse(fetchResponse, document);\n                }\n                else {\n                    await this.handleUnvisitableFrameResponse(fetchResponse);\n                }\n            }\n        }\n        finally {\n            this.fetchResponseLoaded = () => { };\n        }\n    }\n    elementAppearedInViewport(element) {\n        this.proposeVisitIfNavigatedWithAction(element, element);\n        this.loadSourceURL();\n    }\n    willSubmitFormLinkToLocation(link) {\n        return this.shouldInterceptNavigation(link);\n    }\n    submittedFormLinkToLocation(link, _location, form) {\n        const frame = this.findFrameElement(link);\n        if (frame)\n            form.setAttribute(\"data-turbo-frame\", frame.id);\n    }\n    shouldInterceptLinkClick(element, _location, _event) {\n        return this.shouldInterceptNavigation(element);\n    }\n    linkClickIntercepted(element, location) {\n        this.navigateFrame(element, location);\n    }\n    willSubmitForm(element, submitter) {\n        return element.closest(\"turbo-frame\") == this.element && this.shouldInterceptNavigation(element, submitter);\n    }\n    formSubmitted(element, submitter) {\n        if (this.formSubmission) {\n            this.formSubmission.stop();\n        }\n        this.formSubmission = new FormSubmission(this, element, submitter);\n        const { fetchRequest } = this.formSubmission;\n        this.prepareRequest(fetchRequest);\n        this.formSubmission.start();\n    }\n    prepareRequest(request) {\n        var _a;\n        request.headers[\"Turbo-Frame\"] = this.id;\n        if ((_a = this.currentNavigationElement) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"data-turbo-stream\")) {\n            request.acceptResponseType(StreamMessage.contentType);\n        }\n    }\n    requestStarted(_request) {\n        markAsBusy(this.element);\n    }\n    requestPreventedHandlingResponse(_request, _response) {\n        this.resolveVisitPromise();\n    }\n    async requestSucceededWithResponse(request, response) {\n        await this.loadResponse(response);\n        this.resolveVisitPromise();\n    }\n    async requestFailedWithResponse(request, response) {\n        await this.loadResponse(response);\n        this.resolveVisitPromise();\n    }\n    requestErrored(request, error) {\n        console.error(error);\n        this.resolveVisitPromise();\n    }\n    requestFinished(_request) {\n        clearBusyState(this.element);\n    }\n    formSubmissionStarted({ formElement }) {\n        markAsBusy(formElement, this.findFrameElement(formElement));\n    }\n    formSubmissionSucceededWithResponse(formSubmission, response) {\n        const frame = this.findFrameElement(formSubmission.formElement, formSubmission.submitter);\n        frame.delegate.proposeVisitIfNavigatedWithAction(frame, formSubmission.formElement, formSubmission.submitter);\n        frame.delegate.loadResponse(response);\n        if (!formSubmission.isSafe) {\n            session.clearCache();\n        }\n    }\n    formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n        this.element.delegate.loadResponse(fetchResponse);\n        session.clearCache();\n    }\n    formSubmissionErrored(formSubmission, error) {\n        console.error(error);\n    }\n    formSubmissionFinished({ formElement }) {\n        clearBusyState(formElement, this.findFrameElement(formElement));\n    }\n    allowsImmediateRender({ element: newFrame }, options) {\n        const event = dispatch(\"turbo:before-frame-render\", {\n            target: this.element,\n            detail: Object.assign({ newFrame }, options),\n            cancelable: true,\n        });\n        const { defaultPrevented, detail: { render }, } = event;\n        if (this.view.renderer && render) {\n            this.view.renderer.renderElement = render;\n        }\n        return !defaultPrevented;\n    }\n    viewRenderedSnapshot(_snapshot, _isPreview) { }\n    preloadOnLoadLinksForView(element) {\n        session.preloadOnLoadLinksForView(element);\n    }\n    viewInvalidated() { }\n    willRenderFrame(currentElement, _newElement) {\n        this.previousFrameElement = currentElement.cloneNode(true);\n    }\n    async loadFrameResponse(fetchResponse, document) {\n        const newFrameElement = await this.extractForeignFrameElement(document.body);\n        if (newFrameElement) {\n            const snapshot = new Snapshot(newFrameElement);\n            const renderer = new FrameRenderer(this, this.view.snapshot, snapshot, FrameRenderer.renderElement, false, false);\n            if (this.view.renderPromise)\n                await this.view.renderPromise;\n            this.changeHistory();\n            await this.view.render(renderer);\n            this.complete = true;\n            session.frameRendered(fetchResponse, this.element);\n            session.frameLoaded(this.element);\n            this.fetchResponseLoaded(fetchResponse);\n        }\n        else if (this.willHandleFrameMissingFromResponse(fetchResponse)) {\n            this.handleFrameMissingFromResponse(fetchResponse);\n        }\n    }\n    async visit(url) {\n        var _a;\n        const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n        (_a = this.currentFetchRequest) === null || _a === void 0 ? void 0 : _a.cancel();\n        this.currentFetchRequest = request;\n        return new Promise((resolve) => {\n            this.resolveVisitPromise = () => {\n                this.resolveVisitPromise = () => { };\n                this.currentFetchRequest = null;\n                resolve();\n            };\n            request.perform();\n        });\n    }\n    navigateFrame(element, url, submitter) {\n        const frame = this.findFrameElement(element, submitter);\n        frame.delegate.proposeVisitIfNavigatedWithAction(frame, element, submitter);\n        this.withCurrentNavigationElement(element, () => {\n            frame.src = url;\n        });\n    }\n    proposeVisitIfNavigatedWithAction(frame, element, submitter) {\n        this.action = getVisitAction(submitter, element, frame);\n        if (this.action) {\n            const pageSnapshot = PageSnapshot.fromElement(frame).clone();\n            const { visitCachedSnapshot } = frame.delegate;\n            frame.delegate.fetchResponseLoaded = (fetchResponse) => {\n                if (frame.src) {\n                    const { statusCode, redirected } = fetchResponse;\n                    const responseHTML = frame.ownerDocument.documentElement.outerHTML;\n                    const response = { statusCode, redirected, responseHTML };\n                    const options = {\n                        response,\n                        visitCachedSnapshot,\n                        willRender: false,\n                        updateHistory: false,\n                        restorationIdentifier: this.restorationIdentifier,\n                        snapshot: pageSnapshot,\n                    };\n                    if (this.action)\n                        options.action = this.action;\n                    session.visit(frame.src, options);\n                }\n            };\n        }\n    }\n    changeHistory() {\n        if (this.action) {\n            const method = getHistoryMethodForAction(this.action);\n            session.history.update(method, expandURL(this.element.src || \"\"), this.restorationIdentifier);\n        }\n    }\n    async handleUnvisitableFrameResponse(fetchResponse) {\n        console.warn(`The response (${fetchResponse.statusCode}) from <turbo-frame id=\"${this.element.id}\"> is performing a full page visit due to turbo-visit-control.`);\n        await this.visitResponse(fetchResponse.response);\n    }\n    willHandleFrameMissingFromResponse(fetchResponse) {\n        this.element.setAttribute(\"complete\", \"\");\n        const response = fetchResponse.response;\n        const visit = async (url, options = {}) => {\n            if (url instanceof Response) {\n                this.visitResponse(url);\n            }\n            else {\n                session.visit(url, options);\n            }\n        };\n        const event = dispatch(\"turbo:frame-missing\", {\n            target: this.element,\n            detail: { response, visit },\n            cancelable: true,\n        });\n        return !event.defaultPrevented;\n    }\n    handleFrameMissingFromResponse(fetchResponse) {\n        this.view.missing();\n        this.throwFrameMissingError(fetchResponse);\n    }\n    throwFrameMissingError(fetchResponse) {\n        const message = `The response (${fetchResponse.statusCode}) did not contain the expected <turbo-frame id=\"${this.element.id}\"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;\n        throw new TurboFrameMissingError(message);\n    }\n    async visitResponse(response) {\n        const wrapped = new FetchResponse(response);\n        const responseHTML = await wrapped.responseHTML;\n        const { location, redirected, statusCode } = wrapped;\n        return session.visit(location, { response: { redirected, statusCode, responseHTML } });\n    }\n    findFrameElement(element, submitter) {\n        var _a;\n        const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n        return (_a = getFrameElementById(id)) !== null && _a !== void 0 ? _a : this.element;\n    }\n    async extractForeignFrameElement(container) {\n        let element;\n        const id = CSS.escape(this.id);\n        try {\n            element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);\n            if (element) {\n                return element;\n            }\n            element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.sourceURL);\n            if (element) {\n                await element.loaded;\n                return await this.extractForeignFrameElement(element);\n            }\n        }\n        catch (error) {\n            console.error(error);\n            return new FrameElement();\n        }\n        return null;\n    }\n    formActionIsVisitable(form, submitter) {\n        const action = getAction(form, submitter);\n        return locationIsVisitable(expandURL(action), this.rootLocation);\n    }\n    shouldInterceptNavigation(element, submitter) {\n        const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n        if (element instanceof HTMLFormElement && !this.formActionIsVisitable(element, submitter)) {\n            return false;\n        }\n        if (!this.enabled || id == \"_top\") {\n            return false;\n        }\n        if (id) {\n            const frameElement = getFrameElementById(id);\n            if (frameElement) {\n                return !frameElement.disabled;\n            }\n        }\n        if (!session.elementIsNavigatable(element)) {\n            return false;\n        }\n        if (submitter && !session.elementIsNavigatable(submitter)) {\n            return false;\n        }\n        return true;\n    }\n    get id() {\n        return this.element.id;\n    }\n    get enabled() {\n        return !this.element.disabled;\n    }\n    get sourceURL() {\n        if (this.element.src) {\n            return this.element.src;\n        }\n    }\n    set sourceURL(sourceURL) {\n        this.ignoringChangesToAttribute(\"src\", () => {\n            this.element.src = sourceURL !== null && sourceURL !== void 0 ? sourceURL : null;\n        });\n    }\n    get loadingStyle() {\n        return this.element.loading;\n    }\n    get isLoading() {\n        return this.formSubmission !== undefined || this.resolveVisitPromise() !== undefined;\n    }\n    get complete() {\n        return this.element.hasAttribute(\"complete\");\n    }\n    set complete(value) {\n        this.ignoringChangesToAttribute(\"complete\", () => {\n            if (value) {\n                this.element.setAttribute(\"complete\", \"\");\n            }\n            else {\n                this.element.removeAttribute(\"complete\");\n            }\n        });\n    }\n    get isActive() {\n        return this.element.isActive && this.connected;\n    }\n    get rootLocation() {\n        var _a;\n        const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n        const root = (_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\";\n        return expandURL(root);\n    }\n    isIgnoringChangesTo(attributeName) {\n        return this.ignoredAttributes.has(attributeName);\n    }\n    ignoringChangesToAttribute(attributeName, callback) {\n        this.ignoredAttributes.add(attributeName);\n        callback();\n        this.ignoredAttributes.delete(attributeName);\n    }\n    withCurrentNavigationElement(element, callback) {\n        this.currentNavigationElement = element;\n        callback();\n        delete this.currentNavigationElement;\n    }\n}\nfunction getFrameElementById(id) {\n    if (id != null) {\n        const element = document.getElementById(id);\n        if (element instanceof FrameElement) {\n            return element;\n        }\n    }\n}\nfunction activateElement(element, currentURL) {\n    if (element) {\n        const src = element.getAttribute(\"src\");\n        if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {\n            throw new Error(`Matching <turbo-frame id=\"${element.id}\"> element has a source URL which references itself`);\n        }\n        if (element.ownerDocument !== document) {\n            element = document.importNode(element, true);\n        }\n        if (element instanceof FrameElement) {\n            element.connectedCallback();\n            element.disconnectedCallback();\n            return element;\n        }\n    }\n}\n\nclass StreamElement extends HTMLElement {\n    static async renderElement(newElement) {\n        await newElement.performAction();\n    }\n    async connectedCallback() {\n        try {\n            await this.render();\n        }\n        catch (error) {\n            console.error(error);\n        }\n        finally {\n            this.disconnect();\n        }\n    }\n    async render() {\n        var _a;\n        return ((_a = this.renderPromise) !== null && _a !== void 0 ? _a : (this.renderPromise = (async () => {\n            const event = this.beforeRenderEvent;\n            if (this.dispatchEvent(event)) {\n                await nextAnimationFrame();\n                await event.detail.render(this);\n            }\n        })()));\n    }\n    disconnect() {\n        try {\n            this.remove();\n        }\n        catch (_a) { }\n    }\n    removeDuplicateTargetChildren() {\n        this.duplicateChildren.forEach((c) => c.remove());\n    }\n    get duplicateChildren() {\n        var _a;\n        const existingChildren = this.targetElements.flatMap((e) => [...e.children]).filter((c) => !!c.id);\n        const newChildrenIds = [...(((_a = this.templateContent) === null || _a === void 0 ? void 0 : _a.children) || [])].filter((c) => !!c.id).map((c) => c.id);\n        return existingChildren.filter((c) => newChildrenIds.includes(c.id));\n    }\n    get performAction() {\n        if (this.action) {\n            const actionFunction = StreamActions[this.action];\n            if (actionFunction) {\n                return actionFunction;\n            }\n            this.raise(\"unknown action\");\n        }\n        this.raise(\"action attribute is missing\");\n    }\n    get targetElements() {\n        if (this.target) {\n            return this.targetElementsById;\n        }\n        else if (this.targets) {\n            return this.targetElementsByQuery;\n        }\n        else {\n            this.raise(\"target or targets attribute is missing\");\n        }\n    }\n    get templateContent() {\n        return this.templateElement.content.cloneNode(true);\n    }\n    get templateElement() {\n        if (this.firstElementChild === null) {\n            const template = this.ownerDocument.createElement(\"template\");\n            this.appendChild(template);\n            return template;\n        }\n        else if (this.firstElementChild instanceof HTMLTemplateElement) {\n            return this.firstElementChild;\n        }\n        this.raise(\"first child element must be a <template> element\");\n    }\n    get action() {\n        return this.getAttribute(\"action\");\n    }\n    get target() {\n        return this.getAttribute(\"target\");\n    }\n    get targets() {\n        return this.getAttribute(\"targets\");\n    }\n    raise(message) {\n        throw new Error(`${this.description}: ${message}`);\n    }\n    get description() {\n        var _a, _b;\n        return (_b = ((_a = this.outerHTML.match(/<[^>]+>/)) !== null && _a !== void 0 ? _a : [])[0]) !== null && _b !== void 0 ? _b : \"<turbo-stream>\";\n    }\n    get beforeRenderEvent() {\n        return new CustomEvent(\"turbo:before-stream-render\", {\n            bubbles: true,\n            cancelable: true,\n            detail: { newStream: this, render: StreamElement.renderElement },\n        });\n    }\n    get targetElementsById() {\n        var _a;\n        const element = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.getElementById(this.target);\n        if (element !== null) {\n            return [element];\n        }\n        else {\n            return [];\n        }\n    }\n    get targetElementsByQuery() {\n        var _a;\n        const elements = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.targets);\n        if (elements.length !== 0) {\n            return Array.prototype.slice.call(elements);\n        }\n        else {\n            return [];\n        }\n    }\n}\n\nclass StreamSourceElement extends HTMLElement {\n    constructor() {\n        super(...arguments);\n        this.streamSource = null;\n    }\n    connectedCallback() {\n        this.streamSource = this.src.match(/^ws{1,2}:/) ? new WebSocket(this.src) : new EventSource(this.src);\n        connectStreamSource(this.streamSource);\n    }\n    disconnectedCallback() {\n        if (this.streamSource) {\n            disconnectStreamSource(this.streamSource);\n        }\n    }\n    get src() {\n        return this.getAttribute(\"src\") || \"\";\n    }\n}\n\nFrameElement.delegateConstructor = FrameController;\nif (customElements.get(\"turbo-frame\") === undefined) {\n    customElements.define(\"turbo-frame\", FrameElement);\n}\nif (customElements.get(\"turbo-stream\") === undefined) {\n    customElements.define(\"turbo-stream\", StreamElement);\n}\nif (customElements.get(\"turbo-stream-source\") === undefined) {\n    customElements.define(\"turbo-stream-source\", StreamSourceElement);\n}\n\n(() => {\n    let element = document.currentScript;\n    if (!element)\n        return;\n    if (element.hasAttribute(\"data-turbo-suppress-warning\"))\n        return;\n    element = element.parentElement;\n    while (element) {\n        if (element == document.body) {\n            return console.warn(unindent `\n        You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!\n\n        Load your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\n        For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements\n\n        \u2014\u2014\n        Suppress this warning by adding a \"data-turbo-suppress-warning\" attribute to: %s\n      `, element.outerHTML);\n        }\n        element = element.parentElement;\n    }\n})();\n\nwindow.Turbo = Turbo;\nstart();\n\nexport { FrameElement, FrameLoadingStyle, FrameRenderer, PageRenderer, PageSnapshot, StreamActions, StreamElement, StreamSourceElement, cache, clearCache, connectStreamSource, disconnectStreamSource, navigator$1 as navigator, registerAdapter, renderStreamMessage, session, setConfirmMethod, setFormMode, setProgressBarDelay, start, visit };\n", "let consumer\n\nexport async function getConsumer() {\n  return consumer || setConsumer(createConsumer().then(setConsumer))\n}\n\nexport function setConsumer(newConsumer) {\n  return consumer = newConsumer\n}\n\nexport async function createConsumer() {\n  const { createConsumer } = await import(/* webpackChunkName: \"actioncable\" */ \"@rails/actioncable/src\")\n  return createConsumer()\n}\n\nexport async function subscribeTo(channel, mixin) {\n  const { subscriptions } = await getConsumer()\n  return subscriptions.create(channel, mixin)\n}\n", "// Based on https://github.com/nathan7/snakeize\n//\n// This software is released under the MIT license:\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nexport default function walk (obj) {\n    if (!obj || typeof obj !== 'object') return obj;\n    if (obj instanceof Date || obj instanceof RegExp) return obj;\n    if (Array.isArray(obj)) return obj.map(walk);\n    return Object.keys(obj).reduce(function (acc, key) {\n        var camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, function (m, x) {\n            return '_' + x.toLowerCase();\n        });\n        acc[camel] = walk(obj[key]);\n        return acc;\n    }, {});\n};", "import { connectStreamSource, disconnectStreamSource } from \"@hotwired/turbo\"\nimport { subscribeTo } from \"./cable\"\nimport snakeize from \"./snakeize\"\n\nclass TurboCableStreamSourceElement extends HTMLElement {\n  async connectedCallback() {\n    connectStreamSource(this)\n    this.subscription = await subscribeTo(this.channel, {\n      received: this.dispatchMessageEvent.bind(this),\n      connected: this.subscriptionConnected.bind(this),\n      disconnected: this.subscriptionDisconnected.bind(this)\n    })\n  }\n\n  disconnectedCallback() {\n    disconnectStreamSource(this)\n    if (this.subscription) this.subscription.unsubscribe()\n  }\n\n  dispatchMessageEvent(data) {\n    const event = new MessageEvent(\"message\", { data })\n    return this.dispatchEvent(event)\n  }\n\n  subscriptionConnected() {\n    this.setAttribute(\"connected\", \"\")\n  }\n\n  subscriptionDisconnected() {\n    this.removeAttribute(\"connected\")\n  }\n\n  get channel() {\n    const channel = this.getAttribute(\"channel\")\n    const signed_stream_name = this.getAttribute(\"signed-stream-name\")\n    return { channel, signed_stream_name, ...snakeize({ ...this.dataset }) }\n  }\n}\n\n\nif (customElements.get(\"turbo-cable-stream-source\") === undefined) {\n  customElements.define(\"turbo-cable-stream-source\", TurboCableStreamSourceElement)\n}\n", "export function encodeMethodIntoRequestBody(event) {\n  if (event.target instanceof HTMLFormElement) {\n    const { target: form, detail: { fetchOptions } } = event\n\n    form.addEventListener(\"turbo:submit-start\", ({ detail: { formSubmission: { submitter } } }) => {\n      const body = isBodyInit(fetchOptions.body) ? fetchOptions.body : new URLSearchParams()\n      const method = determineFetchMethod(submitter, body, form)\n\n      if (!/get/i.test(method)) {\n        if (/post/i.test(method)) {\n          body.delete(\"_method\")\n        } else {\n          body.set(\"_method\", method)\n        }\n\n        fetchOptions.method = \"post\"\n      }\n    }, { once: true })\n  }\n}\n\nfunction determineFetchMethod(submitter, body, form) {\n  const formMethod = determineFormMethod(submitter)\n  const overrideMethod = body.get(\"_method\")\n  const method = form.getAttribute(\"method\") || \"get\"\n\n  if (typeof formMethod == \"string\") {\n    return formMethod\n  } else if (typeof overrideMethod == \"string\") {\n    return overrideMethod\n  } else {\n    return method\n  }\n}\n\nfunction determineFormMethod(submitter) {\n  if (submitter instanceof HTMLButtonElement || submitter instanceof HTMLInputElement) {\n    if (submitter.hasAttribute(\"formmethod\")) {\n      return submitter.formMethod\n    } else {\n      return null\n    }\n  } else {\n    return null\n  }\n}\n\nfunction isBodyInit(body) {\n  return body instanceof FormData || body instanceof URLSearchParams\n}\n", "import \"./cable_stream_source_element\"\n\nimport * as Turbo from \"@hotwired/turbo\"\nexport { Turbo }\n\nimport * as cable from \"./cable\"\nexport { cable }\n\nimport { encodeMethodIntoRequestBody } from \"./fetch_requests\"\n\naddEventListener(\"turbo:before-fetch-request\", encodeMethodIntoRequestBody)\n", "/*\nStimulus 3.0.1\nCopyright \u00A9 2021 Basecamp, LLC\n */\nclass EventListener {\n    constructor(eventTarget, eventName, eventOptions) {\n        this.eventTarget = eventTarget;\n        this.eventName = eventName;\n        this.eventOptions = eventOptions;\n        this.unorderedBindings = new Set();\n    }\n    connect() {\n        this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n    }\n    disconnect() {\n        this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n    }\n    bindingConnected(binding) {\n        this.unorderedBindings.add(binding);\n    }\n    bindingDisconnected(binding) {\n        this.unorderedBindings.delete(binding);\n    }\n    handleEvent(event) {\n        const extendedEvent = extendEvent(event);\n        for (const binding of this.bindings) {\n            if (extendedEvent.immediatePropagationStopped) {\n                break;\n            }\n            else {\n                binding.handleEvent(extendedEvent);\n            }\n        }\n    }\n    get bindings() {\n        return Array.from(this.unorderedBindings).sort((left, right) => {\n            const leftIndex = left.index, rightIndex = right.index;\n            return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n        });\n    }\n}\nfunction extendEvent(event) {\n    if (\"immediatePropagationStopped\" in event) {\n        return event;\n    }\n    else {\n        const { stopImmediatePropagation } = event;\n        return Object.assign(event, {\n            immediatePropagationStopped: false,\n            stopImmediatePropagation() {\n                this.immediatePropagationStopped = true;\n                stopImmediatePropagation.call(this);\n            }\n        });\n    }\n}\n\nclass Dispatcher {\n    constructor(application) {\n        this.application = application;\n        this.eventListenerMaps = new Map;\n        this.started = false;\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.eventListeners.forEach(eventListener => eventListener.connect());\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.started = false;\n            this.eventListeners.forEach(eventListener => eventListener.disconnect());\n        }\n    }\n    get eventListeners() {\n        return Array.from(this.eventListenerMaps.values())\n            .reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n    }\n    bindingConnected(binding) {\n        this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n    }\n    bindingDisconnected(binding) {\n        this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n    }\n    handleError(error, message, detail = {}) {\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    fetchEventListenerForBinding(binding) {\n        const { eventTarget, eventName, eventOptions } = binding;\n        return this.fetchEventListener(eventTarget, eventName, eventOptions);\n    }\n    fetchEventListener(eventTarget, eventName, eventOptions) {\n        const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n        const cacheKey = this.cacheKey(eventName, eventOptions);\n        let eventListener = eventListenerMap.get(cacheKey);\n        if (!eventListener) {\n            eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n            eventListenerMap.set(cacheKey, eventListener);\n        }\n        return eventListener;\n    }\n    createEventListener(eventTarget, eventName, eventOptions) {\n        const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n        if (this.started) {\n            eventListener.connect();\n        }\n        return eventListener;\n    }\n    fetchEventListenerMapForEventTarget(eventTarget) {\n        let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n        if (!eventListenerMap) {\n            eventListenerMap = new Map;\n            this.eventListenerMaps.set(eventTarget, eventListenerMap);\n        }\n        return eventListenerMap;\n    }\n    cacheKey(eventName, eventOptions) {\n        const parts = [eventName];\n        Object.keys(eventOptions).sort().forEach(key => {\n            parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n        });\n        return parts.join(\":\");\n    }\n}\n\nconst descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n    const source = descriptorString.trim();\n    const matches = source.match(descriptorPattern) || [];\n    return {\n        eventTarget: parseEventTarget(matches[4]),\n        eventName: matches[2],\n        eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},\n        identifier: matches[5],\n        methodName: matches[7]\n    };\n}\nfunction parseEventTarget(eventTargetName) {\n    if (eventTargetName == \"window\") {\n        return window;\n    }\n    else if (eventTargetName == \"document\") {\n        return document;\n    }\n}\nfunction parseEventOptions(eventOptions) {\n    return eventOptions.split(\":\").reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n    if (eventTarget == window) {\n        return \"window\";\n    }\n    else if (eventTarget == document) {\n        return \"document\";\n    }\n}\n\nfunction camelize(value) {\n    return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction capitalize(value) {\n    return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n    return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n    return value.match(/[^\\s]+/g) || [];\n}\n\nclass Action {\n    constructor(element, index, descriptor) {\n        this.element = element;\n        this.index = index;\n        this.eventTarget = descriptor.eventTarget || element;\n        this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n        this.eventOptions = descriptor.eventOptions || {};\n        this.identifier = descriptor.identifier || error(\"missing identifier\");\n        this.methodName = descriptor.methodName || error(\"missing method name\");\n    }\n    static forToken(token) {\n        return new this(token.element, token.index, parseActionDescriptorString(token.content));\n    }\n    toString() {\n        const eventNameSuffix = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n        return `${this.eventName}${eventNameSuffix}->${this.identifier}#${this.methodName}`;\n    }\n    get params() {\n        if (this.eventTarget instanceof Element) {\n            return this.getParamsFromEventTargetAttributes(this.eventTarget);\n        }\n        else {\n            return {};\n        }\n    }\n    getParamsFromEventTargetAttributes(eventTarget) {\n        const params = {};\n        const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`);\n        const attributes = Array.from(eventTarget.attributes);\n        attributes.forEach(({ name, value }) => {\n            const match = name.match(pattern);\n            const key = match && match[1];\n            if (key) {\n                Object.assign(params, { [camelize(key)]: typecast(value) });\n            }\n        });\n        return params;\n    }\n    get eventTargetName() {\n        return stringifyEventTarget(this.eventTarget);\n    }\n}\nconst defaultEventNames = {\n    \"a\": e => \"click\",\n    \"button\": e => \"click\",\n    \"form\": e => \"submit\",\n    \"details\": e => \"toggle\",\n    \"input\": e => e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\",\n    \"select\": e => \"change\",\n    \"textarea\": e => \"input\"\n};\nfunction getDefaultEventNameForElement(element) {\n    const tagName = element.tagName.toLowerCase();\n    if (tagName in defaultEventNames) {\n        return defaultEventNames[tagName](element);\n    }\n}\nfunction error(message) {\n    throw new Error(message);\n}\nfunction typecast(value) {\n    try {\n        return JSON.parse(value);\n    }\n    catch (o_O) {\n        return value;\n    }\n}\n\nclass Binding {\n    constructor(context, action) {\n        this.context = context;\n        this.action = action;\n    }\n    get index() {\n        return this.action.index;\n    }\n    get eventTarget() {\n        return this.action.eventTarget;\n    }\n    get eventOptions() {\n        return this.action.eventOptions;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    handleEvent(event) {\n        if (this.willBeInvokedByEvent(event)) {\n            this.invokeWithEvent(event);\n        }\n    }\n    get eventName() {\n        return this.action.eventName;\n    }\n    get method() {\n        const method = this.controller[this.methodName];\n        if (typeof method == \"function\") {\n            return method;\n        }\n        throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n    }\n    invokeWithEvent(event) {\n        const { target, currentTarget } = event;\n        try {\n            const { params } = this.action;\n            const actionEvent = Object.assign(event, { params });\n            this.method.call(this.controller, actionEvent);\n            this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n        }\n        catch (error) {\n            const { identifier, controller, element, index } = this;\n            const detail = { identifier, controller, element, index, event };\n            this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n        }\n    }\n    willBeInvokedByEvent(event) {\n        const eventTarget = event.target;\n        if (this.element === eventTarget) {\n            return true;\n        }\n        else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n            return this.scope.containsElement(eventTarget);\n        }\n        else {\n            return this.scope.containsElement(this.action.element);\n        }\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    get methodName() {\n        return this.action.methodName;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nclass ElementObserver {\n    constructor(element, delegate) {\n        this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n        this.element = element;\n        this.started = false;\n        this.delegate = delegate;\n        this.elements = new Set;\n        this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.refresh();\n        }\n    }\n    pause(callback) {\n        if (this.started) {\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n        callback();\n        if (!this.started) {\n            this.mutationObserver.observe(this.element, this.mutationObserverInit);\n            this.started = true;\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            const matches = new Set(this.matchElementsInTree());\n            for (const element of Array.from(this.elements)) {\n                if (!matches.has(element)) {\n                    this.removeElement(element);\n                }\n            }\n            for (const element of Array.from(matches)) {\n                this.addElement(element);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        if (mutation.type == \"attributes\") {\n            this.processAttributeChange(mutation.target, mutation.attributeName);\n        }\n        else if (mutation.type == \"childList\") {\n            this.processRemovedNodes(mutation.removedNodes);\n            this.processAddedNodes(mutation.addedNodes);\n        }\n    }\n    processAttributeChange(node, attributeName) {\n        const element = node;\n        if (this.elements.has(element)) {\n            if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n                this.delegate.elementAttributeChanged(element, attributeName);\n            }\n            else {\n                this.removeElement(element);\n            }\n        }\n        else if (this.matchElement(element)) {\n            this.addElement(element);\n        }\n    }\n    processRemovedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element) {\n                this.processTree(element, this.removeElement);\n            }\n        }\n    }\n    processAddedNodes(nodes) {\n        for (const node of Array.from(nodes)) {\n            const element = this.elementFromNode(node);\n            if (element && this.elementIsActive(element)) {\n                this.processTree(element, this.addElement);\n            }\n        }\n    }\n    matchElement(element) {\n        return this.delegate.matchElement(element);\n    }\n    matchElementsInTree(tree = this.element) {\n        return this.delegate.matchElementsInTree(tree);\n    }\n    processTree(tree, processor) {\n        for (const element of this.matchElementsInTree(tree)) {\n            processor.call(this, element);\n        }\n    }\n    elementFromNode(node) {\n        if (node.nodeType == Node.ELEMENT_NODE) {\n            return node;\n        }\n    }\n    elementIsActive(element) {\n        if (element.isConnected != this.element.isConnected) {\n            return false;\n        }\n        else {\n            return this.element.contains(element);\n        }\n    }\n    addElement(element) {\n        if (!this.elements.has(element)) {\n            if (this.elementIsActive(element)) {\n                this.elements.add(element);\n                if (this.delegate.elementMatched) {\n                    this.delegate.elementMatched(element);\n                }\n            }\n        }\n    }\n    removeElement(element) {\n        if (this.elements.has(element)) {\n            this.elements.delete(element);\n            if (this.delegate.elementUnmatched) {\n                this.delegate.elementUnmatched(element);\n            }\n        }\n    }\n}\n\nclass AttributeObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeName = attributeName;\n        this.delegate = delegate;\n        this.elementObserver = new ElementObserver(element, this);\n    }\n    get element() {\n        return this.elementObserver.element;\n    }\n    get selector() {\n        return `[${this.attributeName}]`;\n    }\n    start() {\n        this.elementObserver.start();\n    }\n    pause(callback) {\n        this.elementObserver.pause(callback);\n    }\n    stop() {\n        this.elementObserver.stop();\n    }\n    refresh() {\n        this.elementObserver.refresh();\n    }\n    get started() {\n        return this.elementObserver.started;\n    }\n    matchElement(element) {\n        return element.hasAttribute(this.attributeName);\n    }\n    matchElementsInTree(tree) {\n        const match = this.matchElement(tree) ? [tree] : [];\n        const matches = Array.from(tree.querySelectorAll(this.selector));\n        return match.concat(matches);\n    }\n    elementMatched(element) {\n        if (this.delegate.elementMatchedAttribute) {\n            this.delegate.elementMatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementUnmatched(element) {\n        if (this.delegate.elementUnmatchedAttribute) {\n            this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n        }\n    }\n    elementAttributeChanged(element, attributeName) {\n        if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n            this.delegate.elementAttributeValueChanged(element, attributeName);\n        }\n    }\n}\n\nclass StringMapObserver {\n    constructor(element, delegate) {\n        this.element = element;\n        this.delegate = delegate;\n        this.started = false;\n        this.stringMap = new Map;\n        this.mutationObserver = new MutationObserver(mutations => this.processMutations(mutations));\n    }\n    start() {\n        if (!this.started) {\n            this.started = true;\n            this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n            this.refresh();\n        }\n    }\n    stop() {\n        if (this.started) {\n            this.mutationObserver.takeRecords();\n            this.mutationObserver.disconnect();\n            this.started = false;\n        }\n    }\n    refresh() {\n        if (this.started) {\n            for (const attributeName of this.knownAttributeNames) {\n                this.refreshAttribute(attributeName, null);\n            }\n        }\n    }\n    processMutations(mutations) {\n        if (this.started) {\n            for (const mutation of mutations) {\n                this.processMutation(mutation);\n            }\n        }\n    }\n    processMutation(mutation) {\n        const attributeName = mutation.attributeName;\n        if (attributeName) {\n            this.refreshAttribute(attributeName, mutation.oldValue);\n        }\n    }\n    refreshAttribute(attributeName, oldValue) {\n        const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n        if (key != null) {\n            if (!this.stringMap.has(attributeName)) {\n                this.stringMapKeyAdded(key, attributeName);\n            }\n            const value = this.element.getAttribute(attributeName);\n            if (this.stringMap.get(attributeName) != value) {\n                this.stringMapValueChanged(value, key, oldValue);\n            }\n            if (value == null) {\n                const oldValue = this.stringMap.get(attributeName);\n                this.stringMap.delete(attributeName);\n                if (oldValue)\n                    this.stringMapKeyRemoved(key, attributeName, oldValue);\n            }\n            else {\n                this.stringMap.set(attributeName, value);\n            }\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        if (this.delegate.stringMapKeyAdded) {\n            this.delegate.stringMapKeyAdded(key, attributeName);\n        }\n    }\n    stringMapValueChanged(value, key, oldValue) {\n        if (this.delegate.stringMapValueChanged) {\n            this.delegate.stringMapValueChanged(value, key, oldValue);\n        }\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        if (this.delegate.stringMapKeyRemoved) {\n            this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n        }\n    }\n    get knownAttributeNames() {\n        return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n    }\n    get currentAttributeNames() {\n        return Array.from(this.element.attributes).map(attribute => attribute.name);\n    }\n    get recordedAttributeNames() {\n        return Array.from(this.stringMap.keys());\n    }\n}\n\nfunction add(map, key, value) {\n    fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n    fetch(map, key).delete(value);\n    prune(map, key);\n}\nfunction fetch(map, key) {\n    let values = map.get(key);\n    if (!values) {\n        values = new Set();\n        map.set(key, values);\n    }\n    return values;\n}\nfunction prune(map, key) {\n    const values = map.get(key);\n    if (values != null && values.size == 0) {\n        map.delete(key);\n    }\n}\n\nclass Multimap {\n    constructor() {\n        this.valuesByKey = new Map();\n    }\n    get keys() {\n        return Array.from(this.valuesByKey.keys());\n    }\n    get values() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n    }\n    get size() {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.reduce((size, set) => size + set.size, 0);\n    }\n    add(key, value) {\n        add(this.valuesByKey, key, value);\n    }\n    delete(key, value) {\n        del(this.valuesByKey, key, value);\n    }\n    has(key, value) {\n        const values = this.valuesByKey.get(key);\n        return values != null && values.has(value);\n    }\n    hasKey(key) {\n        return this.valuesByKey.has(key);\n    }\n    hasValue(value) {\n        const sets = Array.from(this.valuesByKey.values());\n        return sets.some(set => set.has(value));\n    }\n    getValuesForKey(key) {\n        const values = this.valuesByKey.get(key);\n        return values ? Array.from(values) : [];\n    }\n    getKeysForValue(value) {\n        return Array.from(this.valuesByKey)\n            .filter(([key, values]) => values.has(value))\n            .map(([key, values]) => key);\n    }\n}\n\nclass IndexedMultimap extends Multimap {\n    constructor() {\n        super();\n        this.keysByValue = new Map;\n    }\n    get values() {\n        return Array.from(this.keysByValue.keys());\n    }\n    add(key, value) {\n        super.add(key, value);\n        add(this.keysByValue, value, key);\n    }\n    delete(key, value) {\n        super.delete(key, value);\n        del(this.keysByValue, value, key);\n    }\n    hasValue(value) {\n        return this.keysByValue.has(value);\n    }\n    getKeysForValue(value) {\n        const set = this.keysByValue.get(value);\n        return set ? Array.from(set) : [];\n    }\n}\n\nclass TokenListObserver {\n    constructor(element, attributeName, delegate) {\n        this.attributeObserver = new AttributeObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.tokensByElement = new Multimap;\n    }\n    get started() {\n        return this.attributeObserver.started;\n    }\n    start() {\n        this.attributeObserver.start();\n    }\n    pause(callback) {\n        this.attributeObserver.pause(callback);\n    }\n    stop() {\n        this.attributeObserver.stop();\n    }\n    refresh() {\n        this.attributeObserver.refresh();\n    }\n    get element() {\n        return this.attributeObserver.element;\n    }\n    get attributeName() {\n        return this.attributeObserver.attributeName;\n    }\n    elementMatchedAttribute(element) {\n        this.tokensMatched(this.readTokensForElement(element));\n    }\n    elementAttributeValueChanged(element) {\n        const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n        this.tokensUnmatched(unmatchedTokens);\n        this.tokensMatched(matchedTokens);\n    }\n    elementUnmatchedAttribute(element) {\n        this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n    }\n    tokensMatched(tokens) {\n        tokens.forEach(token => this.tokenMatched(token));\n    }\n    tokensUnmatched(tokens) {\n        tokens.forEach(token => this.tokenUnmatched(token));\n    }\n    tokenMatched(token) {\n        this.delegate.tokenMatched(token);\n        this.tokensByElement.add(token.element, token);\n    }\n    tokenUnmatched(token) {\n        this.delegate.tokenUnmatched(token);\n        this.tokensByElement.delete(token.element, token);\n    }\n    refreshTokensForElement(element) {\n        const previousTokens = this.tokensByElement.getValuesForKey(element);\n        const currentTokens = this.readTokensForElement(element);\n        const firstDifferingIndex = zip(previousTokens, currentTokens)\n            .findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n        if (firstDifferingIndex == -1) {\n            return [[], []];\n        }\n        else {\n            return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n        }\n    }\n    readTokensForElement(element) {\n        const attributeName = this.attributeName;\n        const tokenString = element.getAttribute(attributeName) || \"\";\n        return parseTokenString(tokenString, element, attributeName);\n    }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n    return tokenString.trim().split(/\\s+/).filter(content => content.length)\n        .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n    const length = Math.max(left.length, right.length);\n    return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n    return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n    constructor(element, attributeName, delegate) {\n        this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n        this.delegate = delegate;\n        this.parseResultsByToken = new WeakMap;\n        this.valuesByTokenByElement = new WeakMap;\n    }\n    get started() {\n        return this.tokenListObserver.started;\n    }\n    start() {\n        this.tokenListObserver.start();\n    }\n    stop() {\n        this.tokenListObserver.stop();\n    }\n    refresh() {\n        this.tokenListObserver.refresh();\n    }\n    get element() {\n        return this.tokenListObserver.element;\n    }\n    get attributeName() {\n        return this.tokenListObserver.attributeName;\n    }\n    tokenMatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).set(token, value);\n            this.delegate.elementMatchedValue(element, value);\n        }\n    }\n    tokenUnmatched(token) {\n        const { element } = token;\n        const { value } = this.fetchParseResultForToken(token);\n        if (value) {\n            this.fetchValuesByTokenForElement(element).delete(token);\n            this.delegate.elementUnmatchedValue(element, value);\n        }\n    }\n    fetchParseResultForToken(token) {\n        let parseResult = this.parseResultsByToken.get(token);\n        if (!parseResult) {\n            parseResult = this.parseToken(token);\n            this.parseResultsByToken.set(token, parseResult);\n        }\n        return parseResult;\n    }\n    fetchValuesByTokenForElement(element) {\n        let valuesByToken = this.valuesByTokenByElement.get(element);\n        if (!valuesByToken) {\n            valuesByToken = new Map;\n            this.valuesByTokenByElement.set(element, valuesByToken);\n        }\n        return valuesByToken;\n    }\n    parseToken(token) {\n        try {\n            const value = this.delegate.parseValueForToken(token);\n            return { value };\n        }\n        catch (error) {\n            return { error };\n        }\n    }\n}\n\nclass BindingObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.bindingsByAction = new Map;\n    }\n    start() {\n        if (!this.valueListObserver) {\n            this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n            this.valueListObserver.start();\n        }\n    }\n    stop() {\n        if (this.valueListObserver) {\n            this.valueListObserver.stop();\n            delete this.valueListObserver;\n            this.disconnectAllActions();\n        }\n    }\n    get element() {\n        return this.context.element;\n    }\n    get identifier() {\n        return this.context.identifier;\n    }\n    get actionAttribute() {\n        return this.schema.actionAttribute;\n    }\n    get schema() {\n        return this.context.schema;\n    }\n    get bindings() {\n        return Array.from(this.bindingsByAction.values());\n    }\n    connectAction(action) {\n        const binding = new Binding(this.context, action);\n        this.bindingsByAction.set(action, binding);\n        this.delegate.bindingConnected(binding);\n    }\n    disconnectAction(action) {\n        const binding = this.bindingsByAction.get(action);\n        if (binding) {\n            this.bindingsByAction.delete(action);\n            this.delegate.bindingDisconnected(binding);\n        }\n    }\n    disconnectAllActions() {\n        this.bindings.forEach(binding => this.delegate.bindingDisconnected(binding));\n        this.bindingsByAction.clear();\n    }\n    parseValueForToken(token) {\n        const action = Action.forToken(token);\n        if (action.identifier == this.identifier) {\n            return action;\n        }\n    }\n    elementMatchedValue(element, action) {\n        this.connectAction(action);\n    }\n    elementUnmatchedValue(element, action) {\n        this.disconnectAction(action);\n    }\n}\n\nclass ValueObserver {\n    constructor(context, receiver) {\n        this.context = context;\n        this.receiver = receiver;\n        this.stringMapObserver = new StringMapObserver(this.element, this);\n        this.valueDescriptorMap = this.controller.valueDescriptorMap;\n        this.invokeChangedCallbacksForDefaultValues();\n    }\n    start() {\n        this.stringMapObserver.start();\n    }\n    stop() {\n        this.stringMapObserver.stop();\n    }\n    get element() {\n        return this.context.element;\n    }\n    get controller() {\n        return this.context.controller;\n    }\n    getStringMapKeyForAttribute(attributeName) {\n        if (attributeName in this.valueDescriptorMap) {\n            return this.valueDescriptorMap[attributeName].name;\n        }\n    }\n    stringMapKeyAdded(key, attributeName) {\n        const descriptor = this.valueDescriptorMap[attributeName];\n        if (!this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n        }\n    }\n    stringMapValueChanged(value, name, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[name];\n        if (value === null)\n            return;\n        if (oldValue === null) {\n            oldValue = descriptor.writer(descriptor.defaultValue);\n        }\n        this.invokeChangedCallback(name, value, oldValue);\n    }\n    stringMapKeyRemoved(key, attributeName, oldValue) {\n        const descriptor = this.valueDescriptorNameMap[key];\n        if (this.hasValue(key)) {\n            this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n        }\n        else {\n            this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n        }\n    }\n    invokeChangedCallbacksForDefaultValues() {\n        for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n            if (defaultValue != undefined && !this.controller.data.has(key)) {\n                this.invokeChangedCallback(name, writer(defaultValue), undefined);\n            }\n        }\n    }\n    invokeChangedCallback(name, rawValue, rawOldValue) {\n        const changedMethodName = `${name}Changed`;\n        const changedMethod = this.receiver[changedMethodName];\n        if (typeof changedMethod == \"function\") {\n            const descriptor = this.valueDescriptorNameMap[name];\n            const value = descriptor.reader(rawValue);\n            let oldValue = rawOldValue;\n            if (rawOldValue) {\n                oldValue = descriptor.reader(rawOldValue);\n            }\n            changedMethod.call(this.receiver, value, oldValue);\n        }\n    }\n    get valueDescriptors() {\n        const { valueDescriptorMap } = this;\n        return Object.keys(valueDescriptorMap).map(key => valueDescriptorMap[key]);\n    }\n    get valueDescriptorNameMap() {\n        const descriptors = {};\n        Object.keys(this.valueDescriptorMap).forEach(key => {\n            const descriptor = this.valueDescriptorMap[key];\n            descriptors[descriptor.name] = descriptor;\n        });\n        return descriptors;\n    }\n    hasValue(attributeName) {\n        const descriptor = this.valueDescriptorNameMap[attributeName];\n        const hasMethodName = `has${capitalize(descriptor.name)}`;\n        return this.receiver[hasMethodName];\n    }\n}\n\nclass TargetObserver {\n    constructor(context, delegate) {\n        this.context = context;\n        this.delegate = delegate;\n        this.targetsByName = new Multimap;\n    }\n    start() {\n        if (!this.tokenListObserver) {\n            this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n            this.tokenListObserver.start();\n        }\n    }\n    stop() {\n        if (this.tokenListObserver) {\n            this.disconnectAllTargets();\n            this.tokenListObserver.stop();\n            delete this.tokenListObserver;\n        }\n    }\n    tokenMatched({ element, content: name }) {\n        if (this.scope.containsElement(element)) {\n            this.connectTarget(element, name);\n        }\n    }\n    tokenUnmatched({ element, content: name }) {\n        this.disconnectTarget(element, name);\n    }\n    connectTarget(element, name) {\n        var _a;\n        if (!this.targetsByName.has(name, element)) {\n            this.targetsByName.add(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetConnected(element, name));\n        }\n    }\n    disconnectTarget(element, name) {\n        var _a;\n        if (this.targetsByName.has(name, element)) {\n            this.targetsByName.delete(name, element);\n            (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetDisconnected(element, name));\n        }\n    }\n    disconnectAllTargets() {\n        for (const name of this.targetsByName.keys) {\n            for (const element of this.targetsByName.getValuesForKey(name)) {\n                this.disconnectTarget(element, name);\n            }\n        }\n    }\n    get attributeName() {\n        return `data-${this.context.identifier}-target`;\n    }\n    get element() {\n        return this.context.element;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n}\n\nclass Context {\n    constructor(module, scope) {\n        this.logDebugActivity = (functionName, detail = {}) => {\n            const { identifier, controller, element } = this;\n            detail = Object.assign({ identifier, controller, element }, detail);\n            this.application.logDebugActivity(this.identifier, functionName, detail);\n        };\n        this.module = module;\n        this.scope = scope;\n        this.controller = new module.controllerConstructor(this);\n        this.bindingObserver = new BindingObserver(this, this.dispatcher);\n        this.valueObserver = new ValueObserver(this, this.controller);\n        this.targetObserver = new TargetObserver(this, this);\n        try {\n            this.controller.initialize();\n            this.logDebugActivity(\"initialize\");\n        }\n        catch (error) {\n            this.handleError(error, \"initializing controller\");\n        }\n    }\n    connect() {\n        this.bindingObserver.start();\n        this.valueObserver.start();\n        this.targetObserver.start();\n        try {\n            this.controller.connect();\n            this.logDebugActivity(\"connect\");\n        }\n        catch (error) {\n            this.handleError(error, \"connecting controller\");\n        }\n    }\n    disconnect() {\n        try {\n            this.controller.disconnect();\n            this.logDebugActivity(\"disconnect\");\n        }\n        catch (error) {\n            this.handleError(error, \"disconnecting controller\");\n        }\n        this.targetObserver.stop();\n        this.valueObserver.stop();\n        this.bindingObserver.stop();\n    }\n    get application() {\n        return this.module.application;\n    }\n    get identifier() {\n        return this.module.identifier;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get dispatcher() {\n        return this.application.dispatcher;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get parentElement() {\n        return this.element.parentElement;\n    }\n    handleError(error, message, detail = {}) {\n        const { identifier, controller, element } = this;\n        detail = Object.assign({ identifier, controller, element }, detail);\n        this.application.handleError(error, `Error ${message}`, detail);\n    }\n    targetConnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetConnected`, element);\n    }\n    targetDisconnected(element, name) {\n        this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n    }\n    invokeControllerMethod(methodName, ...args) {\n        const controller = this.controller;\n        if (typeof controller[methodName] == \"function\") {\n            controller[methodName](...args);\n        }\n    }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return Array.from(ancestors.reduce((values, constructor) => {\n        getOwnStaticArrayValues(constructor, propertyName).forEach(name => values.add(name));\n        return values;\n    }, new Set));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n    const ancestors = getAncestorsForConstructor(constructor);\n    return ancestors.reduce((pairs, constructor) => {\n        pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n        return pairs;\n    }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n    const ancestors = [];\n    while (constructor) {\n        ancestors.push(constructor);\n        constructor = Object.getPrototypeOf(constructor);\n    }\n    return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n    const definition = constructor[propertyName];\n    return definition ? Object.keys(definition).map(key => [key, definition[key]]) : [];\n}\n\nfunction bless(constructor) {\n    return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n    const shadowConstructor = extend(constructor);\n    const shadowProperties = getShadowProperties(constructor.prototype, properties);\n    Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n    return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n    const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n    return blessings.reduce((blessedProperties, blessing) => {\n        const properties = blessing(constructor);\n        for (const key in properties) {\n            const descriptor = blessedProperties[key] || {};\n            blessedProperties[key] = Object.assign(descriptor, properties[key]);\n        }\n        return blessedProperties;\n    }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n    return getOwnKeys(properties).reduce((shadowProperties, key) => {\n        const descriptor = getShadowedDescriptor(prototype, properties, key);\n        if (descriptor) {\n            Object.assign(shadowProperties, { [key]: descriptor });\n        }\n        return shadowProperties;\n    }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n    const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n    const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n    if (!shadowedByValue) {\n        const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n        if (shadowingDescriptor) {\n            descriptor.get = shadowingDescriptor.get || descriptor.get;\n            descriptor.set = shadowingDescriptor.set || descriptor.set;\n        }\n        return descriptor;\n    }\n}\nconst getOwnKeys = (() => {\n    if (typeof Object.getOwnPropertySymbols == \"function\") {\n        return (object) => [\n            ...Object.getOwnPropertyNames(object),\n            ...Object.getOwnPropertySymbols(object)\n        ];\n    }\n    else {\n        return Object.getOwnPropertyNames;\n    }\n})();\nconst extend = (() => {\n    function extendWithReflect(constructor) {\n        function extended() {\n            return Reflect.construct(constructor, arguments, new.target);\n        }\n        extended.prototype = Object.create(constructor.prototype, {\n            constructor: { value: extended }\n        });\n        Reflect.setPrototypeOf(extended, constructor);\n        return extended;\n    }\n    function testReflectExtension() {\n        const a = function () { this.a.call(this); };\n        const b = extendWithReflect(a);\n        b.prototype.a = function () { };\n        return new b;\n    }\n    try {\n        testReflectExtension();\n        return extendWithReflect;\n    }\n    catch (error) {\n        return (constructor) => class extended extends constructor {\n        };\n    }\n})();\n\nfunction blessDefinition(definition) {\n    return {\n        identifier: definition.identifier,\n        controllerConstructor: bless(definition.controllerConstructor)\n    };\n}\n\nclass Module {\n    constructor(application, definition) {\n        this.application = application;\n        this.definition = blessDefinition(definition);\n        this.contextsByScope = new WeakMap;\n        this.connectedContexts = new Set;\n    }\n    get identifier() {\n        return this.definition.identifier;\n    }\n    get controllerConstructor() {\n        return this.definition.controllerConstructor;\n    }\n    get contexts() {\n        return Array.from(this.connectedContexts);\n    }\n    connectContextForScope(scope) {\n        const context = this.fetchContextForScope(scope);\n        this.connectedContexts.add(context);\n        context.connect();\n    }\n    disconnectContextForScope(scope) {\n        const context = this.contextsByScope.get(scope);\n        if (context) {\n            this.connectedContexts.delete(context);\n            context.disconnect();\n        }\n    }\n    fetchContextForScope(scope) {\n        let context = this.contextsByScope.get(scope);\n        if (!context) {\n            context = new Context(this, scope);\n            this.contextsByScope.set(scope, context);\n        }\n        return context;\n    }\n}\n\nclass ClassMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    has(name) {\n        return this.data.has(this.getDataKey(name));\n    }\n    get(name) {\n        return this.getAll(name)[0];\n    }\n    getAll(name) {\n        const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n        return tokenize(tokenString);\n    }\n    getAttributeName(name) {\n        return this.data.getAttributeNameForKey(this.getDataKey(name));\n    }\n    getDataKey(name) {\n        return `${name}-class`;\n    }\n    get data() {\n        return this.scope.data;\n    }\n}\n\nclass DataMap {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.getAttribute(name);\n    }\n    set(key, value) {\n        const name = this.getAttributeNameForKey(key);\n        this.element.setAttribute(name, value);\n        return this.get(key);\n    }\n    has(key) {\n        const name = this.getAttributeNameForKey(key);\n        return this.element.hasAttribute(name);\n    }\n    delete(key) {\n        if (this.has(key)) {\n            const name = this.getAttributeNameForKey(key);\n            this.element.removeAttribute(name);\n            return true;\n        }\n        else {\n            return false;\n        }\n    }\n    getAttributeNameForKey(key) {\n        return `data-${this.identifier}-${dasherize(key)}`;\n    }\n}\n\nclass Guide {\n    constructor(logger) {\n        this.warnedKeysByObject = new WeakMap;\n        this.logger = logger;\n    }\n    warn(object, key, message) {\n        let warnedKeys = this.warnedKeysByObject.get(object);\n        if (!warnedKeys) {\n            warnedKeys = new Set;\n            this.warnedKeysByObject.set(object, warnedKeys);\n        }\n        if (!warnedKeys.has(key)) {\n            warnedKeys.add(key);\n            this.logger.warn(message, object);\n        }\n    }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n    return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n    constructor(scope) {\n        this.scope = scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get schema() {\n        return this.scope.schema;\n    }\n    has(targetName) {\n        return this.find(targetName) != null;\n    }\n    find(...targetNames) {\n        return targetNames.reduce((target, targetName) => target\n            || this.findTarget(targetName)\n            || this.findLegacyTarget(targetName), undefined);\n    }\n    findAll(...targetNames) {\n        return targetNames.reduce((targets, targetName) => [\n            ...targets,\n            ...this.findAllTargets(targetName),\n            ...this.findAllLegacyTargets(targetName)\n        ], []);\n    }\n    findTarget(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findElement(selector);\n    }\n    findAllTargets(targetName) {\n        const selector = this.getSelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector);\n    }\n    getSelectorForTargetName(targetName) {\n        const attributeName = this.schema.targetAttributeForScope(this.identifier);\n        return attributeValueContainsToken(attributeName, targetName);\n    }\n    findLegacyTarget(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.deprecate(this.scope.findElement(selector), targetName);\n    }\n    findAllLegacyTargets(targetName) {\n        const selector = this.getLegacySelectorForTargetName(targetName);\n        return this.scope.findAllElements(selector).map(element => this.deprecate(element, targetName));\n    }\n    getLegacySelectorForTargetName(targetName) {\n        const targetDescriptor = `${this.identifier}.${targetName}`;\n        return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n    }\n    deprecate(element, targetName) {\n        if (element) {\n            const { identifier } = this;\n            const attributeName = this.schema.targetAttribute;\n            const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n            this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n                `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n        }\n        return element;\n    }\n    get guide() {\n        return this.scope.guide;\n    }\n}\n\nclass Scope {\n    constructor(schema, element, identifier, logger) {\n        this.targets = new TargetSet(this);\n        this.classes = new ClassMap(this);\n        this.data = new DataMap(this);\n        this.containsElement = (element) => {\n            return element.closest(this.controllerSelector) === this.element;\n        };\n        this.schema = schema;\n        this.element = element;\n        this.identifier = identifier;\n        this.guide = new Guide(logger);\n    }\n    findElement(selector) {\n        return this.element.matches(selector)\n            ? this.element\n            : this.queryElements(selector).find(this.containsElement);\n    }\n    findAllElements(selector) {\n        return [\n            ...this.element.matches(selector) ? [this.element] : [],\n            ...this.queryElements(selector).filter(this.containsElement)\n        ];\n    }\n    queryElements(selector) {\n        return Array.from(this.element.querySelectorAll(selector));\n    }\n    get controllerSelector() {\n        return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n    }\n}\n\nclass ScopeObserver {\n    constructor(element, schema, delegate) {\n        this.element = element;\n        this.schema = schema;\n        this.delegate = delegate;\n        this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n        this.scopesByIdentifierByElement = new WeakMap;\n        this.scopeReferenceCounts = new WeakMap;\n    }\n    start() {\n        this.valueListObserver.start();\n    }\n    stop() {\n        this.valueListObserver.stop();\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    parseValueForToken(token) {\n        const { element, content: identifier } = token;\n        const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n        let scope = scopesByIdentifier.get(identifier);\n        if (!scope) {\n            scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n            scopesByIdentifier.set(identifier, scope);\n        }\n        return scope;\n    }\n    elementMatchedValue(element, value) {\n        const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n        this.scopeReferenceCounts.set(value, referenceCount);\n        if (referenceCount == 1) {\n            this.delegate.scopeConnected(value);\n        }\n    }\n    elementUnmatchedValue(element, value) {\n        const referenceCount = this.scopeReferenceCounts.get(value);\n        if (referenceCount) {\n            this.scopeReferenceCounts.set(value, referenceCount - 1);\n            if (referenceCount == 1) {\n                this.delegate.scopeDisconnected(value);\n            }\n        }\n    }\n    fetchScopesByIdentifierForElement(element) {\n        let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n        if (!scopesByIdentifier) {\n            scopesByIdentifier = new Map;\n            this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n        }\n        return scopesByIdentifier;\n    }\n}\n\nclass Router {\n    constructor(application) {\n        this.application = application;\n        this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n        this.scopesByIdentifier = new Multimap;\n        this.modulesByIdentifier = new Map;\n    }\n    get element() {\n        return this.application.element;\n    }\n    get schema() {\n        return this.application.schema;\n    }\n    get logger() {\n        return this.application.logger;\n    }\n    get controllerAttribute() {\n        return this.schema.controllerAttribute;\n    }\n    get modules() {\n        return Array.from(this.modulesByIdentifier.values());\n    }\n    get contexts() {\n        return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n    }\n    start() {\n        this.scopeObserver.start();\n    }\n    stop() {\n        this.scopeObserver.stop();\n    }\n    loadDefinition(definition) {\n        this.unloadIdentifier(definition.identifier);\n        const module = new Module(this.application, definition);\n        this.connectModule(module);\n    }\n    unloadIdentifier(identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            this.disconnectModule(module);\n        }\n    }\n    getContextForElementAndIdentifier(element, identifier) {\n        const module = this.modulesByIdentifier.get(identifier);\n        if (module) {\n            return module.contexts.find(context => context.element == element);\n        }\n    }\n    handleError(error, message, detail) {\n        this.application.handleError(error, message, detail);\n    }\n    createScopeForElementAndIdentifier(element, identifier) {\n        return new Scope(this.schema, element, identifier, this.logger);\n    }\n    scopeConnected(scope) {\n        this.scopesByIdentifier.add(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.connectContextForScope(scope);\n        }\n    }\n    scopeDisconnected(scope) {\n        this.scopesByIdentifier.delete(scope.identifier, scope);\n        const module = this.modulesByIdentifier.get(scope.identifier);\n        if (module) {\n            module.disconnectContextForScope(scope);\n        }\n    }\n    connectModule(module) {\n        this.modulesByIdentifier.set(module.identifier, module);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach(scope => module.connectContextForScope(scope));\n    }\n    disconnectModule(module) {\n        this.modulesByIdentifier.delete(module.identifier);\n        const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n        scopes.forEach(scope => module.disconnectContextForScope(scope));\n    }\n}\n\nconst defaultSchema = {\n    controllerAttribute: \"data-controller\",\n    actionAttribute: \"data-action\",\n    targetAttribute: \"data-target\",\n    targetAttributeForScope: identifier => `data-${identifier}-target`\n};\n\nclass Application {\n    constructor(element = document.documentElement, schema = defaultSchema) {\n        this.logger = console;\n        this.debug = false;\n        this.logDebugActivity = (identifier, functionName, detail = {}) => {\n            if (this.debug) {\n                this.logFormattedMessage(identifier, functionName, detail);\n            }\n        };\n        this.element = element;\n        this.schema = schema;\n        this.dispatcher = new Dispatcher(this);\n        this.router = new Router(this);\n    }\n    static start(element, schema) {\n        const application = new Application(element, schema);\n        application.start();\n        return application;\n    }\n    async start() {\n        await domReady();\n        this.logDebugActivity(\"application\", \"starting\");\n        this.dispatcher.start();\n        this.router.start();\n        this.logDebugActivity(\"application\", \"start\");\n    }\n    stop() {\n        this.logDebugActivity(\"application\", \"stopping\");\n        this.dispatcher.stop();\n        this.router.stop();\n        this.logDebugActivity(\"application\", \"stop\");\n    }\n    register(identifier, controllerConstructor) {\n        if (controllerConstructor.shouldLoad) {\n            this.load({ identifier, controllerConstructor });\n        }\n    }\n    load(head, ...rest) {\n        const definitions = Array.isArray(head) ? head : [head, ...rest];\n        definitions.forEach(definition => this.router.loadDefinition(definition));\n    }\n    unload(head, ...rest) {\n        const identifiers = Array.isArray(head) ? head : [head, ...rest];\n        identifiers.forEach(identifier => this.router.unloadIdentifier(identifier));\n    }\n    get controllers() {\n        return this.router.contexts.map(context => context.controller);\n    }\n    getControllerForElementAndIdentifier(element, identifier) {\n        const context = this.router.getContextForElementAndIdentifier(element, identifier);\n        return context ? context.controller : null;\n    }\n    handleError(error, message, detail) {\n        var _a;\n        this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n        (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n    }\n    logFormattedMessage(identifier, functionName, detail = {}) {\n        detail = Object.assign({ application: this }, detail);\n        this.logger.groupCollapsed(`${identifier} #${functionName}`);\n        this.logger.log(\"details:\", Object.assign({}, detail));\n        this.logger.groupEnd();\n    }\n}\nfunction domReady() {\n    return new Promise(resolve => {\n        if (document.readyState == \"loading\") {\n            document.addEventListener(\"DOMContentLoaded\", () => resolve());\n        }\n        else {\n            resolve();\n        }\n    });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n    const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n    return classes.reduce((properties, classDefinition) => {\n        return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n    }, {});\n}\nfunction propertiesForClassDefinition(key) {\n    return {\n        [`${key}Class`]: {\n            get() {\n                const { classes } = this;\n                if (classes.has(key)) {\n                    return classes.get(key);\n                }\n                else {\n                    const attribute = classes.getAttributeName(key);\n                    throw new Error(`Missing attribute \"${attribute}\"`);\n                }\n            }\n        },\n        [`${key}Classes`]: {\n            get() {\n                return this.classes.getAll(key);\n            }\n        },\n        [`has${capitalize(key)}Class`]: {\n            get() {\n                return this.classes.has(key);\n            }\n        }\n    };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n    const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n    return targets.reduce((properties, targetDefinition) => {\n        return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n    }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n    return {\n        [`${name}Target`]: {\n            get() {\n                const target = this.targets.find(name);\n                if (target) {\n                    return target;\n                }\n                else {\n                    throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n                }\n            }\n        },\n        [`${name}Targets`]: {\n            get() {\n                return this.targets.findAll(name);\n            }\n        },\n        [`has${capitalize(name)}Target`]: {\n            get() {\n                return this.targets.has(name);\n            }\n        }\n    };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n    const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n    const propertyDescriptorMap = {\n        valueDescriptorMap: {\n            get() {\n                return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n                    const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n                    const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n                    return Object.assign(result, { [attributeName]: valueDescriptor });\n                }, {});\n            }\n        }\n    };\n    return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n        return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n    }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair) {\n    const definition = parseValueDefinitionPair(valueDefinitionPair);\n    const { key, name, reader: read, writer: write } = definition;\n    return {\n        [name]: {\n            get() {\n                const value = this.data.get(key);\n                if (value !== null) {\n                    return read(value);\n                }\n                else {\n                    return definition.defaultValue;\n                }\n            },\n            set(value) {\n                if (value === undefined) {\n                    this.data.delete(key);\n                }\n                else {\n                    this.data.set(key, write(value));\n                }\n            }\n        },\n        [`has${capitalize(name)}`]: {\n            get() {\n                return this.data.has(key) || definition.hasCustomDefaultValue;\n            }\n        }\n    };\n}\nfunction parseValueDefinitionPair([token, typeDefinition]) {\n    return valueDescriptorForTokenAndTypeDefinition(token, typeDefinition);\n}\nfunction parseValueTypeConstant(constant) {\n    switch (constant) {\n        case Array: return \"array\";\n        case Boolean: return \"boolean\";\n        case Number: return \"number\";\n        case Object: return \"object\";\n        case String: return \"string\";\n    }\n}\nfunction parseValueTypeDefault(defaultValue) {\n    switch (typeof defaultValue) {\n        case \"boolean\": return \"boolean\";\n        case \"number\": return \"number\";\n        case \"string\": return \"string\";\n    }\n    if (Array.isArray(defaultValue))\n        return \"array\";\n    if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n        return \"object\";\n}\nfunction parseValueTypeObject(typeObject) {\n    const typeFromObject = parseValueTypeConstant(typeObject.type);\n    if (typeFromObject) {\n        const defaultValueType = parseValueTypeDefault(typeObject.default);\n        if (typeFromObject !== defaultValueType) {\n            throw new Error(`Type \"${typeFromObject}\" must match the type of the default value. Given default value: \"${typeObject.default}\" as \"${defaultValueType}\"`);\n        }\n        return typeFromObject;\n    }\n}\nfunction parseValueTypeDefinition(typeDefinition) {\n    const typeFromObject = parseValueTypeObject(typeDefinition);\n    const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n    const typeFromConstant = parseValueTypeConstant(typeDefinition);\n    const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n    if (type)\n        return type;\n    throw new Error(`Unknown value type \"${typeDefinition}\"`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n    const constant = parseValueTypeConstant(typeDefinition);\n    if (constant)\n        return defaultValuesByType[constant];\n    const defaultValue = typeDefinition.default;\n    if (defaultValue !== undefined)\n        return defaultValue;\n    return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(token, typeDefinition) {\n    const key = `${dasherize(token)}-value`;\n    const type = parseValueTypeDefinition(typeDefinition);\n    return {\n        type,\n        key,\n        name: camelize(key),\n        get defaultValue() { return defaultValueForDefinition(typeDefinition); },\n        get hasCustomDefaultValue() { return parseValueTypeDefault(typeDefinition) !== undefined; },\n        reader: readers[type],\n        writer: writers[type] || writers.default\n    };\n}\nconst defaultValuesByType = {\n    get array() { return []; },\n    boolean: false,\n    number: 0,\n    get object() { return {}; },\n    string: \"\"\n};\nconst readers = {\n    array(value) {\n        const array = JSON.parse(value);\n        if (!Array.isArray(array)) {\n            throw new TypeError(\"Expected array\");\n        }\n        return array;\n    },\n    boolean(value) {\n        return !(value == \"0\" || value == \"false\");\n    },\n    number(value) {\n        return Number(value);\n    },\n    object(value) {\n        const object = JSON.parse(value);\n        if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n            throw new TypeError(\"Expected object\");\n        }\n        return object;\n    },\n    string(value) {\n        return value;\n    }\n};\nconst writers = {\n    default: writeString,\n    array: writeJSON,\n    object: writeJSON\n};\nfunction writeJSON(value) {\n    return JSON.stringify(value);\n}\nfunction writeString(value) {\n    return `${value}`;\n}\n\nclass Controller {\n    constructor(context) {\n        this.context = context;\n    }\n    static get shouldLoad() {\n        return true;\n    }\n    get application() {\n        return this.context.application;\n    }\n    get scope() {\n        return this.context.scope;\n    }\n    get element() {\n        return this.scope.element;\n    }\n    get identifier() {\n        return this.scope.identifier;\n    }\n    get targets() {\n        return this.scope.targets;\n    }\n    get classes() {\n        return this.scope.classes;\n    }\n    get data() {\n        return this.scope.data;\n    }\n    initialize() {\n    }\n    connect() {\n    }\n    disconnect() {\n    }\n    dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true } = {}) {\n        const type = prefix ? `${prefix}:${eventName}` : eventName;\n        const event = new CustomEvent(type, { detail, bubbles, cancelable });\n        target.dispatchEvent(event);\n        return event;\n    }\n}\nController.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing];\nController.targets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n", "import { Application } from \"@hotwired/stimulus\"\n\nconst application = Application.start()\n\n// Configure Stimulus development experience\napplication.debug = false\nwindow.Stimulus   = application\n\nexport { application }\n", "/*! choices.js v11.0.3 | \u00A9 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function (d, b) {\n  extendStatics = Object.setPrototypeOf || {\n    __proto__: []\n  } instanceof Array && function (d, b) {\n    d.__proto__ = b;\n  } || function (d, b) {\n    for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n  };\n  return extendStatics(d, b);\n};\nfunction __extends(d, b) {\n  if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n  extendStatics(d, b);\n  function __() {\n    this.constructor = d;\n  }\n  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\nvar __assign = function () {\n  __assign = Object.assign || function __assign(t) {\n    for (var s, i = 1, n = arguments.length; i < n; i++) {\n      s = arguments[i];\n      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n    }\n    return t;\n  };\n  return __assign.apply(this, arguments);\n};\nfunction __spreadArray(to, from, pack) {\n  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n    if (ar || !(i in from)) {\n      if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n      ar[i] = from[i];\n    }\n  }\n  return to.concat(ar || Array.prototype.slice.call(from));\n}\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n  var e = new Error(message);\n  return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nvar ActionType = {\n    ADD_CHOICE: 'ADD_CHOICE',\n    REMOVE_CHOICE: 'REMOVE_CHOICE',\n    FILTER_CHOICES: 'FILTER_CHOICES',\n    ACTIVATE_CHOICES: 'ACTIVATE_CHOICES',\n    CLEAR_CHOICES: 'CLEAR_CHOICES',\n    ADD_GROUP: 'ADD_GROUP',\n    ADD_ITEM: 'ADD_ITEM',\n    REMOVE_ITEM: 'REMOVE_ITEM',\n    HIGHLIGHT_ITEM: 'HIGHLIGHT_ITEM',\n};\n\nvar EventType = {\n    showDropdown: 'showDropdown',\n    hideDropdown: 'hideDropdown',\n    change: 'change',\n    choice: 'choice',\n    search: 'search',\n    addItem: 'addItem',\n    removeItem: 'removeItem',\n    highlightItem: 'highlightItem',\n    highlightChoice: 'highlightChoice',\n    unhighlightItem: 'unhighlightItem',\n};\n\nvar KeyCodeMap = {\n    TAB_KEY: 9,\n    SHIFT_KEY: 16,\n    BACK_KEY: 46,\n    DELETE_KEY: 8,\n    ENTER_KEY: 13,\n    A_KEY: 65,\n    ESC_KEY: 27,\n    UP_KEY: 38,\n    DOWN_KEY: 40,\n    PAGE_UP_KEY: 33,\n    PAGE_DOWN_KEY: 34,\n};\n\nvar ObjectsInConfig = ['fuseOptions', 'classNames'];\n\nvar PassedElementTypes = {\n    Text: 'text',\n    SelectOne: 'select-one',\n    SelectMultiple: 'select-multiple',\n};\n\nvar addChoice = function (choice) { return ({\n    type: ActionType.ADD_CHOICE,\n    choice: choice,\n}); };\nvar removeChoice = function (choice) { return ({\n    type: ActionType.REMOVE_CHOICE,\n    choice: choice,\n}); };\nvar filterChoices = function (results) { return ({\n    type: ActionType.FILTER_CHOICES,\n    results: results,\n}); };\nvar activateChoices = function (active) {\n    return ({\n        type: ActionType.ACTIVATE_CHOICES,\n        active: active,\n    });\n};\n\nvar addGroup = function (group) { return ({\n    type: ActionType.ADD_GROUP,\n    group: group,\n}); };\n\nvar addItem = function (item) { return ({\n    type: ActionType.ADD_ITEM,\n    item: item,\n}); };\nvar removeItem$1 = function (item) { return ({\n    type: ActionType.REMOVE_ITEM,\n    item: item,\n}); };\nvar highlightItem = function (item, highlighted) { return ({\n    type: ActionType.HIGHLIGHT_ITEM,\n    item: item,\n    highlighted: highlighted,\n}); };\n\nvar getRandomNumber = function (min, max) { return Math.floor(Math.random() * (max - min) + min); };\nvar generateChars = function (length) {\n    return Array.from({ length: length }, function () { return getRandomNumber(0, 36).toString(36); }).join('');\n};\nvar generateId = function (element, prefix) {\n    var id = element.id || (element.name && \"\".concat(element.name, \"-\").concat(generateChars(2))) || generateChars(4);\n    id = id.replace(/(:|\\.|\\[|\\]|,)/g, '');\n    id = \"\".concat(prefix, \"-\").concat(id);\n    return id;\n};\nvar getAdjacentEl = function (startEl, selector, direction) {\n    if (direction === void 0) { direction = 1; }\n    var prop = \"\".concat(direction > 0 ? 'next' : 'previous', \"ElementSibling\");\n    var sibling = startEl[prop];\n    while (sibling) {\n        if (sibling.matches(selector)) {\n            return sibling;\n        }\n        sibling = sibling[prop];\n    }\n    return null;\n};\nvar isScrolledIntoView = function (element, parent, direction) {\n    if (direction === void 0) { direction = 1; }\n    var isVisible;\n    if (direction > 0) {\n        // In view from bottom\n        isVisible = parent.scrollTop + parent.offsetHeight >= element.offsetTop + element.offsetHeight;\n    }\n    else {\n        // In view from top\n        isVisible = element.offsetTop >= parent.scrollTop;\n    }\n    return isVisible;\n};\nvar sanitise = function (value) {\n    if (typeof value !== 'string') {\n        if (value === null || value === undefined) {\n            return '';\n        }\n        if (typeof value === 'object') {\n            if ('raw' in value) {\n                return sanitise(value.raw);\n            }\n            if ('trusted' in value) {\n                return value.trusted;\n            }\n        }\n        return value;\n    }\n    return value\n        .replace(/&/g, '&amp;')\n        .replace(/>/g, '&gt;')\n        .replace(/</g, '&lt;')\n        .replace(/'/g, '&#039;')\n        .replace(/\"/g, '&quot;');\n};\nvar strToEl = (function () {\n    var tmpEl = document.createElement('div');\n    return function (str) {\n        tmpEl.innerHTML = str.trim();\n        var firstChild = tmpEl.children[0];\n        while (tmpEl.firstChild) {\n            tmpEl.removeChild(tmpEl.firstChild);\n        }\n        return firstChild;\n    };\n})();\nvar resolveNoticeFunction = function (fn, value) {\n    return typeof fn === 'function' ? fn(sanitise(value), value) : fn;\n};\nvar resolveStringFunction = function (fn) {\n    return typeof fn === 'function' ? fn() : fn;\n};\nvar unwrapStringForRaw = function (s) {\n    if (typeof s === 'string') {\n        return s;\n    }\n    if (typeof s === 'object') {\n        if ('trusted' in s) {\n            return s.trusted;\n        }\n        if ('raw' in s) {\n            return s.raw;\n        }\n    }\n    return '';\n};\nvar unwrapStringForEscaped = function (s) {\n    if (typeof s === 'string') {\n        return s;\n    }\n    if (typeof s === 'object') {\n        if ('escaped' in s) {\n            return s.escaped;\n        }\n        if ('trusted' in s) {\n            return s.trusted;\n        }\n    }\n    return '';\n};\nvar escapeForTemplate = function (allowHTML, s) {\n    return allowHTML ? unwrapStringForEscaped(s) : sanitise(s);\n};\nvar setElementHtml = function (el, allowHtml, html) {\n    el.innerHTML = escapeForTemplate(allowHtml, html);\n};\nvar sortByAlpha = function (_a, _b) {\n    var value = _a.value, _c = _a.label, label = _c === void 0 ? value : _c;\n    var value2 = _b.value, _d = _b.label, label2 = _d === void 0 ? value2 : _d;\n    return unwrapStringForRaw(label).localeCompare(unwrapStringForRaw(label2), [], {\n        sensitivity: 'base',\n        ignorePunctuation: true,\n        numeric: true,\n    });\n};\nvar sortByRank = function (a, b) {\n    return a.rank - b.rank;\n};\nvar dispatchEvent = function (element, type, customArgs) {\n    if (customArgs === void 0) { customArgs = null; }\n    var event = new CustomEvent(type, {\n        detail: customArgs,\n        bubbles: true,\n        cancelable: true,\n    });\n    return element.dispatchEvent(event);\n};\n/**\n * Returns an array of keys present on the first but missing on the second object\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nvar diff = function (a, b) {\n    var aKeys = Object.keys(a).sort();\n    var bKeys = Object.keys(b).sort();\n    return aKeys.filter(function (i) { return bKeys.indexOf(i) < 0; });\n};\nvar getClassNames = function (ClassNames) {\n    return Array.isArray(ClassNames) ? ClassNames : [ClassNames];\n};\nvar getClassNamesSelector = function (option) {\n    if (option && Array.isArray(option)) {\n        return option\n            .map(function (item) {\n            return \".\".concat(item);\n        })\n            .join('');\n    }\n    return \".\".concat(option);\n};\nvar addClassesToElement = function (element, className) {\n    var _a;\n    (_a = element.classList).add.apply(_a, getClassNames(className));\n};\nvar removeClassesFromElement = function (element, className) {\n    var _a;\n    (_a = element.classList).remove.apply(_a, getClassNames(className));\n};\nvar parseCustomProperties = function (customProperties) {\n    if (typeof customProperties !== 'undefined') {\n        try {\n            return JSON.parse(customProperties);\n        }\n        catch (e) {\n            return customProperties;\n        }\n    }\n    return {};\n};\nvar updateClassList = function (item, add, remove) {\n    var itemEl = item.itemEl;\n    if (itemEl) {\n        removeClassesFromElement(itemEl, remove);\n        addClassesToElement(itemEl, add);\n    }\n};\n\nvar Dropdown = /** @class */ (function () {\n    function Dropdown(_a) {\n        var element = _a.element, type = _a.type, classNames = _a.classNames;\n        this.element = element;\n        this.classNames = classNames;\n        this.type = type;\n        this.isActive = false;\n    }\n    /**\n     * Show dropdown to user by adding active state class\n     */\n    Dropdown.prototype.show = function () {\n        addClassesToElement(this.element, this.classNames.activeState);\n        this.element.setAttribute('aria-expanded', 'true');\n        this.isActive = true;\n        return this;\n    };\n    /**\n     * Hide dropdown from user\n     */\n    Dropdown.prototype.hide = function () {\n        removeClassesFromElement(this.element, this.classNames.activeState);\n        this.element.setAttribute('aria-expanded', 'false');\n        this.isActive = false;\n        return this;\n    };\n    return Dropdown;\n}());\n\nvar Container = /** @class */ (function () {\n    function Container(_a) {\n        var element = _a.element, type = _a.type, classNames = _a.classNames, position = _a.position;\n        this.element = element;\n        this.classNames = classNames;\n        this.type = type;\n        this.position = position;\n        this.isOpen = false;\n        this.isFlipped = false;\n        this.isDisabled = false;\n        this.isLoading = false;\n    }\n    /**\n     * Determine whether container should be flipped based on passed\n     * dropdown position\n     */\n    Container.prototype.shouldFlip = function (dropdownPos, dropdownHeight) {\n        // If flip is enabled and the dropdown bottom position is\n        // greater than the window height flip the dropdown.\n        var shouldFlip = false;\n        if (this.position === 'auto') {\n            shouldFlip =\n                this.element.getBoundingClientRect().top - dropdownHeight >= 0 &&\n                    !window.matchMedia(\"(min-height: \".concat(dropdownPos + 1, \"px)\")).matches;\n        }\n        else if (this.position === 'top') {\n            shouldFlip = true;\n        }\n        return shouldFlip;\n    };\n    Container.prototype.setActiveDescendant = function (activeDescendantID) {\n        this.element.setAttribute('aria-activedescendant', activeDescendantID);\n    };\n    Container.prototype.removeActiveDescendant = function () {\n        this.element.removeAttribute('aria-activedescendant');\n    };\n    Container.prototype.open = function (dropdownPos, dropdownHeight) {\n        addClassesToElement(this.element, this.classNames.openState);\n        this.element.setAttribute('aria-expanded', 'true');\n        this.isOpen = true;\n        if (this.shouldFlip(dropdownPos, dropdownHeight)) {\n            addClassesToElement(this.element, this.classNames.flippedState);\n            this.isFlipped = true;\n        }\n    };\n    Container.prototype.close = function () {\n        removeClassesFromElement(this.element, this.classNames.openState);\n        this.element.setAttribute('aria-expanded', 'false');\n        this.removeActiveDescendant();\n        this.isOpen = false;\n        // A dropdown flips if it does not have space within the page\n        if (this.isFlipped) {\n            removeClassesFromElement(this.element, this.classNames.flippedState);\n            this.isFlipped = false;\n        }\n    };\n    Container.prototype.addFocusState = function () {\n        addClassesToElement(this.element, this.classNames.focusState);\n    };\n    Container.prototype.removeFocusState = function () {\n        removeClassesFromElement(this.element, this.classNames.focusState);\n    };\n    Container.prototype.enable = function () {\n        removeClassesFromElement(this.element, this.classNames.disabledState);\n        this.element.removeAttribute('aria-disabled');\n        if (this.type === PassedElementTypes.SelectOne) {\n            this.element.setAttribute('tabindex', '0');\n        }\n        this.isDisabled = false;\n    };\n    Container.prototype.disable = function () {\n        addClassesToElement(this.element, this.classNames.disabledState);\n        this.element.setAttribute('aria-disabled', 'true');\n        if (this.type === PassedElementTypes.SelectOne) {\n            this.element.setAttribute('tabindex', '-1');\n        }\n        this.isDisabled = true;\n    };\n    Container.prototype.wrap = function (element) {\n        var el = this.element;\n        var parentNode = element.parentNode;\n        if (parentNode) {\n            if (element.nextSibling) {\n                parentNode.insertBefore(el, element.nextSibling);\n            }\n            else {\n                parentNode.appendChild(el);\n            }\n        }\n        el.appendChild(element);\n    };\n    Container.prototype.unwrap = function (element) {\n        var el = this.element;\n        var parentNode = el.parentNode;\n        if (parentNode) {\n            // Move passed element outside this element\n            parentNode.insertBefore(element, el);\n            // Remove this element\n            parentNode.removeChild(el);\n        }\n    };\n    Container.prototype.addLoadingState = function () {\n        addClassesToElement(this.element, this.classNames.loadingState);\n        this.element.setAttribute('aria-busy', 'true');\n        this.isLoading = true;\n    };\n    Container.prototype.removeLoadingState = function () {\n        removeClassesFromElement(this.element, this.classNames.loadingState);\n        this.element.removeAttribute('aria-busy');\n        this.isLoading = false;\n    };\n    return Container;\n}());\n\nvar Input = /** @class */ (function () {\n    function Input(_a) {\n        var element = _a.element, type = _a.type, classNames = _a.classNames, preventPaste = _a.preventPaste;\n        this.element = element;\n        this.type = type;\n        this.classNames = classNames;\n        this.preventPaste = preventPaste;\n        this.isFocussed = this.element.isEqualNode(document.activeElement);\n        this.isDisabled = element.disabled;\n        this._onPaste = this._onPaste.bind(this);\n        this._onInput = this._onInput.bind(this);\n        this._onFocus = this._onFocus.bind(this);\n        this._onBlur = this._onBlur.bind(this);\n    }\n    Object.defineProperty(Input.prototype, \"placeholder\", {\n        set: function (placeholder) {\n            this.element.placeholder = placeholder;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Input.prototype, \"value\", {\n        get: function () {\n            return this.element.value;\n        },\n        set: function (value) {\n            this.element.value = value;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Input.prototype.addEventListeners = function () {\n        var el = this.element;\n        el.addEventListener('paste', this._onPaste);\n        el.addEventListener('input', this._onInput, {\n            passive: true,\n        });\n        el.addEventListener('focus', this._onFocus, {\n            passive: true,\n        });\n        el.addEventListener('blur', this._onBlur, {\n            passive: true,\n        });\n    };\n    Input.prototype.removeEventListeners = function () {\n        var el = this.element;\n        el.removeEventListener('input', this._onInput);\n        el.removeEventListener('paste', this._onPaste);\n        el.removeEventListener('focus', this._onFocus);\n        el.removeEventListener('blur', this._onBlur);\n    };\n    Input.prototype.enable = function () {\n        var el = this.element;\n        el.removeAttribute('disabled');\n        this.isDisabled = false;\n    };\n    Input.prototype.disable = function () {\n        var el = this.element;\n        el.setAttribute('disabled', '');\n        this.isDisabled = true;\n    };\n    Input.prototype.focus = function () {\n        if (!this.isFocussed) {\n            this.element.focus();\n        }\n    };\n    Input.prototype.blur = function () {\n        if (this.isFocussed) {\n            this.element.blur();\n        }\n    };\n    Input.prototype.clear = function (setWidth) {\n        if (setWidth === void 0) { setWidth = true; }\n        this.element.value = '';\n        if (setWidth) {\n            this.setWidth();\n        }\n        return this;\n    };\n    /**\n     * Set the correct input width based on placeholder\n     * value or input value\n     */\n    Input.prototype.setWidth = function () {\n        // Resize input to contents or placeholder\n        var element = this.element;\n        element.style.minWidth = \"\".concat(element.placeholder.length + 1, \"ch\");\n        element.style.width = \"\".concat(element.value.length + 1, \"ch\");\n    };\n    Input.prototype.setActiveDescendant = function (activeDescendantID) {\n        this.element.setAttribute('aria-activedescendant', activeDescendantID);\n    };\n    Input.prototype.removeActiveDescendant = function () {\n        this.element.removeAttribute('aria-activedescendant');\n    };\n    Input.prototype._onInput = function () {\n        if (this.type !== PassedElementTypes.SelectOne) {\n            this.setWidth();\n        }\n    };\n    Input.prototype._onPaste = function (event) {\n        if (this.preventPaste) {\n            event.preventDefault();\n        }\n    };\n    Input.prototype._onFocus = function () {\n        this.isFocussed = true;\n    };\n    Input.prototype._onBlur = function () {\n        this.isFocussed = false;\n    };\n    return Input;\n}());\n\nvar SCROLLING_SPEED = 4;\n\nvar List = /** @class */ (function () {\n    function List(_a) {\n        var element = _a.element;\n        this.element = element;\n        this.scrollPos = this.element.scrollTop;\n        this.height = this.element.offsetHeight;\n    }\n    List.prototype.prepend = function (node) {\n        var child = this.element.firstElementChild;\n        if (child) {\n            this.element.insertBefore(node, child);\n        }\n        else {\n            this.element.append(node);\n        }\n    };\n    List.prototype.scrollToTop = function () {\n        this.element.scrollTop = 0;\n    };\n    List.prototype.scrollToChildElement = function (element, direction) {\n        var _this = this;\n        if (!element) {\n            return;\n        }\n        var listHeight = this.element.offsetHeight;\n        // Scroll position of dropdown\n        var listScrollPosition = this.element.scrollTop + listHeight;\n        var elementHeight = element.offsetHeight;\n        // Distance from bottom of element to top of parent\n        var elementPos = element.offsetTop + elementHeight;\n        // Difference between the element and scroll position\n        var destination = direction > 0 ? this.element.scrollTop + elementPos - listScrollPosition : element.offsetTop;\n        requestAnimationFrame(function () {\n            _this._animateScroll(destination, direction);\n        });\n    };\n    List.prototype._scrollDown = function (scrollPos, strength, destination) {\n        var easing = (destination - scrollPos) / strength;\n        var distance = easing > 1 ? easing : 1;\n        this.element.scrollTop = scrollPos + distance;\n    };\n    List.prototype._scrollUp = function (scrollPos, strength, destination) {\n        var easing = (scrollPos - destination) / strength;\n        var distance = easing > 1 ? easing : 1;\n        this.element.scrollTop = scrollPos - distance;\n    };\n    List.prototype._animateScroll = function (destination, direction) {\n        var _this = this;\n        var strength = SCROLLING_SPEED;\n        var choiceListScrollTop = this.element.scrollTop;\n        var continueAnimation = false;\n        if (direction > 0) {\n            this._scrollDown(choiceListScrollTop, strength, destination);\n            if (choiceListScrollTop < destination) {\n                continueAnimation = true;\n            }\n        }\n        else {\n            this._scrollUp(choiceListScrollTop, strength, destination);\n            if (choiceListScrollTop > destination) {\n                continueAnimation = true;\n            }\n        }\n        if (continueAnimation) {\n            requestAnimationFrame(function () {\n                _this._animateScroll(destination, direction);\n            });\n        }\n    };\n    return List;\n}());\n\nvar WrappedElement = /** @class */ (function () {\n    function WrappedElement(_a) {\n        var element = _a.element, classNames = _a.classNames;\n        this.element = element;\n        this.classNames = classNames;\n        this.isDisabled = false;\n    }\n    Object.defineProperty(WrappedElement.prototype, \"isActive\", {\n        get: function () {\n            return this.element.dataset.choice === 'active';\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(WrappedElement.prototype, \"dir\", {\n        get: function () {\n            return this.element.dir;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(WrappedElement.prototype, \"value\", {\n        get: function () {\n            return this.element.value;\n        },\n        set: function (value) {\n            this.element.setAttribute('value', value);\n            this.element.value = value;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    WrappedElement.prototype.conceal = function () {\n        var el = this.element;\n        // Hide passed input\n        addClassesToElement(el, this.classNames.input);\n        el.hidden = true;\n        // Remove element from tab index\n        el.tabIndex = -1;\n        // Backup original styles if any\n        var origStyle = el.getAttribute('style');\n        if (origStyle) {\n            el.setAttribute('data-choice-orig-style', origStyle);\n        }\n        el.setAttribute('data-choice', 'active');\n    };\n    WrappedElement.prototype.reveal = function () {\n        var el = this.element;\n        // Reinstate passed element\n        removeClassesFromElement(el, this.classNames.input);\n        el.hidden = false;\n        el.removeAttribute('tabindex');\n        // Recover original styles if any\n        var origStyle = el.getAttribute('data-choice-orig-style');\n        if (origStyle) {\n            el.removeAttribute('data-choice-orig-style');\n            el.setAttribute('style', origStyle);\n        }\n        else {\n            el.removeAttribute('style');\n        }\n        el.removeAttribute('data-choice');\n    };\n    WrappedElement.prototype.enable = function () {\n        this.element.removeAttribute('disabled');\n        this.element.disabled = false;\n        this.isDisabled = false;\n    };\n    WrappedElement.prototype.disable = function () {\n        this.element.setAttribute('disabled', '');\n        this.element.disabled = true;\n        this.isDisabled = true;\n    };\n    WrappedElement.prototype.triggerEvent = function (eventType, data) {\n        dispatchEvent(this.element, eventType, data || {});\n    };\n    return WrappedElement;\n}());\n\nvar WrappedInput = /** @class */ (function (_super) {\n    __extends(WrappedInput, _super);\n    function WrappedInput() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    return WrappedInput;\n}(WrappedElement));\n\nvar coerceBool = function (arg, defaultValue) {\n    if (defaultValue === void 0) { defaultValue = true; }\n    return typeof arg === 'undefined' ? defaultValue : !!arg;\n};\nvar stringToHtmlClass = function (input) {\n    if (typeof input === 'string') {\n        // eslint-disable-next-line no-param-reassign\n        input = input.split(' ').filter(function (s) { return s.length; });\n    }\n    if (Array.isArray(input) && input.length) {\n        return input;\n    }\n    return undefined;\n};\nvar mapInputToChoice = function (value, allowGroup, allowRawString) {\n    if (allowRawString === void 0) { allowRawString = true; }\n    if (typeof value === 'string') {\n        var sanitisedValue = sanitise(value);\n        var userValue = allowRawString || sanitisedValue === value ? value : { escaped: sanitisedValue, raw: value };\n        var result_1 = mapInputToChoice({\n            value: value,\n            label: userValue,\n            selected: true,\n        }, false);\n        return result_1;\n    }\n    var groupOrChoice = value;\n    if ('choices' in groupOrChoice) {\n        if (!allowGroup) {\n            // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup\n            throw new TypeError(\"optGroup is not allowed\");\n        }\n        var group = groupOrChoice;\n        var choices = group.choices.map(function (e) { return mapInputToChoice(e, false); });\n        var result_2 = {\n            id: 0, // actual ID will be assigned during _addGroup\n            label: unwrapStringForRaw(group.label) || group.value,\n            active: !!choices.length,\n            disabled: !!group.disabled,\n            choices: choices,\n        };\n        return result_2;\n    }\n    var choice = groupOrChoice;\n    var result = {\n        id: 0, // actual ID will be assigned during _addChoice\n        group: null, // actual group will be assigned during _addGroup but before _addChoice\n        score: 0, // used in search\n        rank: 0, // used in search, stable sort order\n        value: choice.value,\n        label: choice.label || choice.value,\n        active: coerceBool(choice.active),\n        selected: coerceBool(choice.selected, false),\n        disabled: coerceBool(choice.disabled, false),\n        placeholder: coerceBool(choice.placeholder, false),\n        highlighted: false,\n        labelClass: stringToHtmlClass(choice.labelClass),\n        labelDescription: choice.labelDescription,\n        customProperties: choice.customProperties,\n    };\n    return result;\n};\n\nvar isHtmlInputElement = function (e) { return e.tagName === 'INPUT'; };\nvar isHtmlSelectElement = function (e) { return e.tagName === 'SELECT'; };\nvar isHtmlOption = function (e) { return e.tagName === 'OPTION'; };\nvar isHtmlOptgroup = function (e) { return e.tagName === 'OPTGROUP'; };\n\nvar WrappedSelect = /** @class */ (function (_super) {\n    __extends(WrappedSelect, _super);\n    function WrappedSelect(_a) {\n        var element = _a.element, classNames = _a.classNames, template = _a.template, extractPlaceholder = _a.extractPlaceholder;\n        var _this = _super.call(this, { element: element, classNames: classNames }) || this;\n        _this.template = template;\n        _this.extractPlaceholder = extractPlaceholder;\n        return _this;\n    }\n    Object.defineProperty(WrappedSelect.prototype, \"placeholderOption\", {\n        get: function () {\n            return (this.element.querySelector('option[value=\"\"]') ||\n                // Backward compatibility layer for the non-standard placeholder attribute supported in older versions.\n                this.element.querySelector('option[placeholder]'));\n        },\n        enumerable: false,\n        configurable: true\n    });\n    WrappedSelect.prototype.addOptions = function (choices) {\n        var _this = this;\n        var fragment = document.createDocumentFragment();\n        choices.forEach(function (obj) {\n            var choice = obj;\n            if (choice.element) {\n                return;\n            }\n            var option = _this.template(choice);\n            fragment.appendChild(option);\n            choice.element = option;\n        });\n        this.element.appendChild(fragment);\n    };\n    WrappedSelect.prototype.optionsAsChoices = function () {\n        var _this = this;\n        var choices = [];\n        this.element.querySelectorAll(':scope > option, :scope > optgroup').forEach(function (e) {\n            if (isHtmlOption(e)) {\n                choices.push(_this._optionToChoice(e));\n            }\n            else if (isHtmlOptgroup(e)) {\n                choices.push(_this._optgroupToChoice(e));\n            }\n            // todo: hr as empty optgroup, requires displaying empty opt-groups to be useful\n        });\n        return choices;\n    };\n    // eslint-disable-next-line class-methods-use-this\n    WrappedSelect.prototype._optionToChoice = function (option) {\n        // option.value returns the label if there is no value attribute, which can break legacy placeholder attribute support\n        if (!option.hasAttribute('value') && option.hasAttribute('placeholder')) {\n            option.setAttribute('value', '');\n            option.value = '';\n        }\n        return {\n            id: 0,\n            group: null,\n            score: 0,\n            rank: 0,\n            value: option.value,\n            label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...\n            element: option,\n            active: true,\n            // this returns true if nothing is selected on initial load, which will break placeholder support\n            selected: this.extractPlaceholder ? option.selected : option.hasAttribute('selected'),\n            disabled: option.disabled,\n            highlighted: false,\n            placeholder: this.extractPlaceholder && (!option.value || option.hasAttribute('placeholder')),\n            labelClass: typeof option.dataset.labelClass !== 'undefined' ? stringToHtmlClass(option.dataset.labelClass) : undefined,\n            labelDescription: typeof option.dataset.labelDescription !== 'undefined' ? option.dataset.labelDescription : undefined,\n            customProperties: parseCustomProperties(option.dataset.customProperties),\n        };\n    };\n    WrappedSelect.prototype._optgroupToChoice = function (optgroup) {\n        var _this = this;\n        var options = optgroup.querySelectorAll('option');\n        var choices = Array.from(options).map(function (option) { return _this._optionToChoice(option); });\n        return {\n            id: 0,\n            label: optgroup.label || '',\n            element: optgroup,\n            active: !!choices.length,\n            disabled: optgroup.disabled,\n            choices: choices,\n        };\n    };\n    return WrappedSelect;\n}(WrappedElement));\n\nvar DEFAULT_CLASSNAMES = {\n    containerOuter: ['choices'],\n    containerInner: ['choices__inner'],\n    input: ['choices__input'],\n    inputCloned: ['choices__input--cloned'],\n    list: ['choices__list'],\n    listItems: ['choices__list--multiple'],\n    listSingle: ['choices__list--single'],\n    listDropdown: ['choices__list--dropdown'],\n    item: ['choices__item'],\n    itemSelectable: ['choices__item--selectable'],\n    itemDisabled: ['choices__item--disabled'],\n    itemChoice: ['choices__item--choice'],\n    description: ['choices__description'],\n    placeholder: ['choices__placeholder'],\n    group: ['choices__group'],\n    groupHeading: ['choices__heading'],\n    button: ['choices__button'],\n    activeState: ['is-active'],\n    focusState: ['is-focused'],\n    openState: ['is-open'],\n    disabledState: ['is-disabled'],\n    highlightedState: ['is-highlighted'],\n    selectedState: ['is-selected'],\n    flippedState: ['is-flipped'],\n    loadingState: ['is-loading'],\n    notice: ['choices__notice'],\n    addChoice: ['choices__item--selectable', 'add-choice'],\n    noResults: ['has-no-results'],\n    noChoices: ['has-no-choices'],\n};\nvar DEFAULT_CONFIG = {\n    items: [],\n    choices: [],\n    silent: false,\n    renderChoiceLimit: -1,\n    maxItemCount: -1,\n    closeDropdownOnSelect: 'auto',\n    singleModeForMultiSelect: false,\n    addChoices: false,\n    addItems: true,\n    addItemFilter: function (value) { return !!value && value !== ''; },\n    removeItems: true,\n    removeItemButton: false,\n    removeItemButtonAlignLeft: false,\n    editItems: false,\n    allowHTML: false,\n    allowHtmlUserInput: false,\n    duplicateItemsAllowed: true,\n    delimiter: ',',\n    paste: true,\n    searchEnabled: true,\n    searchChoices: true,\n    searchFloor: 1,\n    searchResultLimit: 4,\n    searchFields: ['label', 'value'],\n    position: 'auto',\n    resetScrollPosition: true,\n    shouldSort: true,\n    shouldSortItems: false,\n    sorter: sortByAlpha,\n    shadowRoot: null,\n    placeholder: true,\n    placeholderValue: null,\n    searchPlaceholderValue: null,\n    prependValue: null,\n    appendValue: null,\n    renderSelectedChoices: 'auto',\n    loadingText: 'Loading...',\n    noResultsText: 'No results found',\n    noChoicesText: 'No choices to choose from',\n    itemSelectText: 'Press to select',\n    uniqueItemText: 'Only unique values can be added',\n    customAddItemText: 'Only values matching specific conditions can be added',\n    addItemText: function (value) { return \"Press Enter to add <b>\\\"\".concat(value, \"\\\"</b>\"); },\n    removeItemIconText: function () { return \"Remove item\"; },\n    removeItemLabelText: function (value) { return \"Remove item: \".concat(value); },\n    maxItemText: function (maxItemCount) { return \"Only \".concat(maxItemCount, \" values can be added\"); },\n    valueComparer: function (value1, value2) { return value1 === value2; },\n    fuseOptions: {\n        includeScore: true,\n    },\n    labelId: '',\n    callbackOnInit: null,\n    callbackOnCreateTemplates: null,\n    classNames: DEFAULT_CLASSNAMES,\n    appendGroupInSearch: false,\n};\n\nvar removeItem = function (item) {\n    var itemEl = item.itemEl;\n    if (itemEl) {\n        itemEl.remove();\n        item.itemEl = undefined;\n    }\n};\nfunction items(s, action, context) {\n    var state = s;\n    var update = true;\n    switch (action.type) {\n        case ActionType.ADD_ITEM: {\n            action.item.selected = true;\n            var el = action.item.element;\n            if (el) {\n                el.selected = true;\n                el.setAttribute('selected', '');\n            }\n            state.push(action.item);\n            break;\n        }\n        case ActionType.REMOVE_ITEM: {\n            action.item.selected = false;\n            var el = action.item.element;\n            if (el) {\n                el.selected = false;\n                el.removeAttribute('selected');\n                // For a select-one, if all options are deselected, the first item is selected. To set a black value, select.value needs to be set\n                var select = el.parentElement;\n                if (select && isHtmlSelectElement(select) && select.type === PassedElementTypes.SelectOne) {\n                    select.value = '';\n                }\n            }\n            // this is mixing concerns, but this is *so much faster*\n            removeItem(action.item);\n            state = state.filter(function (choice) { return choice.id !== action.item.id; });\n            break;\n        }\n        case ActionType.REMOVE_CHOICE: {\n            removeItem(action.choice);\n            state = state.filter(function (item) { return item.id !== action.choice.id; });\n            break;\n        }\n        case ActionType.HIGHLIGHT_ITEM: {\n            var highlighted = action.highlighted;\n            var item = state.find(function (obj) { return obj.id === action.item.id; });\n            if (item && item.highlighted !== highlighted) {\n                item.highlighted = highlighted;\n                if (context) {\n                    updateClassList(item, highlighted ? context.classNames.highlightedState : context.classNames.selectedState, highlighted ? context.classNames.selectedState : context.classNames.highlightedState);\n                }\n            }\n            break;\n        }\n        default: {\n            update = false;\n            break;\n        }\n    }\n    return { state: state, update: update };\n}\n\nfunction groups(s, action) {\n    var state = s;\n    var update = true;\n    switch (action.type) {\n        case ActionType.ADD_GROUP: {\n            state.push(action.group);\n            break;\n        }\n        case ActionType.CLEAR_CHOICES: {\n            state = [];\n            break;\n        }\n        default: {\n            update = false;\n            break;\n        }\n    }\n    return { state: state, update: update };\n}\n\n/* eslint-disable */\nfunction choices(s, action, context) {\n    var state = s;\n    var update = true;\n    switch (action.type) {\n        case ActionType.ADD_CHOICE: {\n            state.push(action.choice);\n            break;\n        }\n        case ActionType.REMOVE_CHOICE: {\n            action.choice.choiceEl = undefined;\n            if (action.choice.group) {\n                action.choice.group.choices = action.choice.group.choices.filter(function (obj) { return obj.id !== action.choice.id; });\n            }\n            state = state.filter(function (obj) { return obj.id !== action.choice.id; });\n            break;\n        }\n        case ActionType.ADD_ITEM:\n        case ActionType.REMOVE_ITEM: {\n            action.item.choiceEl = undefined;\n            break;\n        }\n        case ActionType.FILTER_CHOICES: {\n            // avoid O(n^2) algorithm complexity when searching/filtering choices\n            var scoreLookup_1 = [];\n            action.results.forEach(function (result) {\n                scoreLookup_1[result.item.id] = result;\n            });\n            state.forEach(function (choice) {\n                var result = scoreLookup_1[choice.id];\n                if (result !== undefined) {\n                    choice.score = result.score;\n                    choice.rank = result.rank;\n                    choice.active = true;\n                }\n                else {\n                    choice.score = 0;\n                    choice.rank = 0;\n                    choice.active = false;\n                }\n                if (context && context.appendGroupInSearch) {\n                    choice.choiceEl = undefined;\n                }\n            });\n            break;\n        }\n        case ActionType.ACTIVATE_CHOICES: {\n            state.forEach(function (choice) {\n                choice.active = action.active;\n                if (context && context.appendGroupInSearch) {\n                    choice.choiceEl = undefined;\n                }\n            });\n            break;\n        }\n        case ActionType.CLEAR_CHOICES: {\n            state = [];\n            break;\n        }\n        default: {\n            update = false;\n            break;\n        }\n    }\n    return { state: state, update: update };\n}\n\nvar reducers = {\n    groups: groups,\n    items: items,\n    choices: choices,\n};\nvar Store = /** @class */ (function () {\n    function Store(context) {\n        this._state = this.defaultState;\n        this._listeners = [];\n        this._txn = 0;\n        this._context = context;\n    }\n    Object.defineProperty(Store.prototype, \"defaultState\", {\n        // eslint-disable-next-line class-methods-use-this\n        get: function () {\n            return {\n                groups: [],\n                items: [],\n                choices: [],\n            };\n        },\n        enumerable: false,\n        configurable: true\n    });\n    // eslint-disable-next-line class-methods-use-this\n    Store.prototype.changeSet = function (init) {\n        return {\n            groups: init,\n            items: init,\n            choices: init,\n        };\n    };\n    Store.prototype.reset = function () {\n        this._state = this.defaultState;\n        var changes = this.changeSet(true);\n        if (this._txn) {\n            this._changeSet = changes;\n        }\n        else {\n            this._listeners.forEach(function (l) { return l(changes); });\n        }\n    };\n    Store.prototype.subscribe = function (onChange) {\n        this._listeners.push(onChange);\n        return this;\n    };\n    Store.prototype.dispatch = function (action) {\n        var _this = this;\n        var state = this._state;\n        var hasChanges = false;\n        var changes = this._changeSet || this.changeSet(false);\n        Object.keys(reducers).forEach(function (key) {\n            var stateUpdate = reducers[key](state[key], action, _this._context);\n            if (stateUpdate.update) {\n                hasChanges = true;\n                changes[key] = true;\n                state[key] = stateUpdate.state;\n            }\n        });\n        if (hasChanges) {\n            if (this._txn) {\n                this._changeSet = changes;\n            }\n            else {\n                this._listeners.forEach(function (l) { return l(changes); });\n            }\n        }\n    };\n    Store.prototype.withTxn = function (func) {\n        this._txn++;\n        try {\n            func();\n        }\n        finally {\n            this._txn = Math.max(0, this._txn - 1);\n            if (!this._txn) {\n                var changeSet_1 = this._changeSet;\n                if (changeSet_1) {\n                    this._changeSet = undefined;\n                    this._listeners.forEach(function (l) { return l(changeSet_1); });\n                }\n            }\n        }\n    };\n    Object.defineProperty(Store.prototype, \"state\", {\n        /**\n         * Get store object\n         */\n        get: function () {\n            return this._state;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Store.prototype, \"items\", {\n        /**\n         * Get items from store\n         */\n        get: function () {\n            return this.state.items;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Store.prototype, \"highlightedActiveItems\", {\n        /**\n         * Get highlighted items from store\n         */\n        get: function () {\n            return this.items.filter(function (item) { return !item.disabled && item.active && item.highlighted; });\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Store.prototype, \"choices\", {\n        /**\n         * Get choices from store\n         */\n        get: function () {\n            return this.state.choices;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Store.prototype, \"activeChoices\", {\n        /**\n         * Get active choices from store\n         */\n        get: function () {\n            return this.choices.filter(function (choice) { return choice.active; });\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Store.prototype, \"searchableChoices\", {\n        /**\n         * Get choices that can be searched (excluding placeholders)\n         */\n        get: function () {\n            return this.choices.filter(function (choice) { return !choice.disabled && !choice.placeholder; });\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Store.prototype, \"groups\", {\n        /**\n         * Get groups from store\n         */\n        get: function () {\n            return this.state.groups;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Object.defineProperty(Store.prototype, \"activeGroups\", {\n        /**\n         * Get active groups from store\n         */\n        get: function () {\n            var _this = this;\n            return this.state.groups.filter(function (group) {\n                var isActive = group.active && !group.disabled;\n                var hasActiveOptions = _this.state.choices.some(function (choice) { return choice.active && !choice.disabled; });\n                return isActive && hasActiveOptions;\n            }, []);\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Store.prototype.inTxn = function () {\n        return this._txn > 0;\n    };\n    /**\n     * Get single choice by it's ID\n     */\n    Store.prototype.getChoiceById = function (id) {\n        return this.activeChoices.find(function (choice) { return choice.id === id; });\n    };\n    /**\n     * Get group by group id\n     */\n    Store.prototype.getGroupById = function (id) {\n        return this.groups.find(function (group) { return group.id === id; });\n    };\n    return Store;\n}());\n\nvar NoticeTypes = {\n    noChoices: 'no-choices',\n    noResults: 'no-results',\n    addChoice: 'add-choice',\n    generic: '',\n};\n\nfunction _defineProperty(e, r, t) {\n  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n    value: t,\n    enumerable: !0,\n    configurable: !0,\n    writable: !0\n  }) : e[r] = t, e;\n}\nfunction ownKeys(e, r) {\n  var t = Object.keys(e);\n  if (Object.getOwnPropertySymbols) {\n    var o = Object.getOwnPropertySymbols(e);\n    r && (o = o.filter(function (r) {\n      return Object.getOwnPropertyDescriptor(e, r).enumerable;\n    })), t.push.apply(t, o);\n  }\n  return t;\n}\nfunction _objectSpread2(e) {\n  for (var r = 1; r < arguments.length; r++) {\n    var t = null != arguments[r] ? arguments[r] : {};\n    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n      _defineProperty(e, r, t[r]);\n    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n    });\n  }\n  return e;\n}\nfunction _toPrimitive(t, r) {\n  if (\"object\" != typeof t || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (void 0 !== e) {\n    var i = e.call(t, r || \"default\");\n    if (\"object\" != typeof i) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n  var i = _toPrimitive(t, \"string\");\n  return \"symbol\" == typeof i ? i : i + \"\";\n}\n\n/**\n * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2023 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction isArray(value) {\n  return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js\nconst INFINITY = 1 / 0;\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  let result = value + '';\n  return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n}\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\nfunction isString(value) {\n  return typeof value === 'string';\n}\nfunction isNumber(value) {\n  return typeof value === 'number';\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js\nfunction isBoolean(value) {\n  return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';\n}\nfunction isObject(value) {\n  return typeof value === 'object';\n}\n\n// Checks if `value` is object-like.\nfunction isObjectLike(value) {\n  return isObject(value) && value !== null;\n}\nfunction isDefined(value) {\n  return value !== undefined && value !== null;\n}\nfunction isBlank(value) {\n  return !value.trim().length;\n}\n\n// Gets the `toStringTag` of `value`.\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js\nfunction getTag(value) {\n  return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);\n}\nconst EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = key => `Invalid value for key ${key}`;\nconst PATTERN_LENGTH_TOO_LARGE = max => `Pattern length exceeds max of ${max}.`;\nconst MISSING_KEY_PROPERTY = name => `Missing ${name} property in key`;\nconst INVALID_KEY_WEIGHT_VALUE = key => `Property 'weight' in key '${key}' must be a positive integer`;\nconst hasOwn = Object.prototype.hasOwnProperty;\nclass KeyStore {\n  constructor(keys) {\n    this._keys = [];\n    this._keyMap = {};\n    let totalWeight = 0;\n    keys.forEach(key => {\n      let obj = createKey(key);\n      this._keys.push(obj);\n      this._keyMap[obj.id] = obj;\n      totalWeight += obj.weight;\n    });\n\n    // Normalize weights so that their sum is equal to 1\n    this._keys.forEach(key => {\n      key.weight /= totalWeight;\n    });\n  }\n  get(keyId) {\n    return this._keyMap[keyId];\n  }\n  keys() {\n    return this._keys;\n  }\n  toJSON() {\n    return JSON.stringify(this._keys);\n  }\n}\nfunction createKey(key) {\n  let path = null;\n  let id = null;\n  let src = null;\n  let weight = 1;\n  let getFn = null;\n  if (isString(key) || isArray(key)) {\n    src = key;\n    path = createKeyPath(key);\n    id = createKeyId(key);\n  } else {\n    if (!hasOwn.call(key, 'name')) {\n      throw new Error(MISSING_KEY_PROPERTY('name'));\n    }\n    const name = key.name;\n    src = name;\n    if (hasOwn.call(key, 'weight')) {\n      weight = key.weight;\n      if (weight <= 0) {\n        throw new Error(INVALID_KEY_WEIGHT_VALUE(name));\n      }\n    }\n    path = createKeyPath(name);\n    id = createKeyId(name);\n    getFn = key.getFn;\n  }\n  return {\n    path,\n    id,\n    weight,\n    src,\n    getFn\n  };\n}\nfunction createKeyPath(key) {\n  return isArray(key) ? key : key.split('.');\n}\nfunction createKeyId(key) {\n  return isArray(key) ? key.join('.') : key;\n}\nfunction get(obj, path) {\n  let list = [];\n  let arr = false;\n  const deepGet = (obj, path, index) => {\n    if (!isDefined(obj)) {\n      return;\n    }\n    if (!path[index]) {\n      // If there's no path left, we've arrived at the object we care about.\n      list.push(obj);\n    } else {\n      let key = path[index];\n      const value = obj[key];\n      if (!isDefined(value)) {\n        return;\n      }\n\n      // If we're at the last value in the path, and if it's a string/number/bool,\n      // add it to the list\n      if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {\n        list.push(toString(value));\n      } else if (isArray(value)) {\n        arr = true;\n        // Search each item in the array.\n        for (let i = 0, len = value.length; i < len; i += 1) {\n          deepGet(value[i], path, index + 1);\n        }\n      } else if (path.length) {\n        // An object. Recurse further.\n        deepGet(value, path, index + 1);\n      }\n    }\n  };\n\n  // Backwards compatibility (since path used to be a string)\n  deepGet(obj, isString(path) ? path.split('.') : path, 0);\n  return arr ? list : list[0];\n}\nconst MatchOptions = {\n  // Whether the matches should be included in the result set. When `true`, each record in the result\n  // set will include the indices of the matched characters.\n  // These can consequently be used for highlighting purposes.\n  includeMatches: false,\n  // When `true`, the matching function will continue to the end of a search pattern even if\n  // a perfect match has already been located in the string.\n  findAllMatches: false,\n  // Minimum number of characters that must be matched before a result is considered a match\n  minMatchCharLength: 1\n};\nconst BasicOptions = {\n  // When `true`, the algorithm continues searching to the end of the input even if a perfect\n  // match is found before the end of the same input.\n  isCaseSensitive: false,\n  // When true, the matching function will continue to the end of a search pattern even if\n  includeScore: false,\n  // List of properties that will be searched. This also supports nested properties.\n  keys: [],\n  // Whether to sort the result list, by score\n  shouldSort: true,\n  // Default sort function: sort by ascending score, ascending index\n  sortFn: (a, b) => a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1\n};\nconst FuzzyOptions = {\n  // Approximately where in the text is the pattern expected to be found?\n  location: 0,\n  // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match\n  // (of both letters and location), a threshold of '1.0' would match anything.\n  threshold: 0.6,\n  // Determines how close the match must be to the fuzzy location (specified above).\n  // An exact letter match which is 'distance' characters away from the fuzzy location\n  // would score as a complete mismatch. A distance of '0' requires the match be at\n  // the exact location specified, a threshold of '1000' would require a perfect match\n  // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.\n  distance: 100\n};\nconst AdvancedOptions = {\n  // When `true`, it enables the use of unix-like search commands\n  useExtendedSearch: false,\n  // The get function to use when fetching an object's properties.\n  // The default will search nested paths *ie foo.bar.baz*\n  getFn: get,\n  // When `true`, search will ignore `location` and `distance`, so it won't matter\n  // where in the string the pattern appears.\n  // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score\n  ignoreLocation: false,\n  // When `true`, the calculation for the relevance score (used for sorting) will\n  // ignore the field-length norm.\n  // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm\n  ignoreFieldNorm: false,\n  // The weight to determine how much field length norm effects scoring.\n  fieldNormWeight: 1\n};\nvar Config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions);\nconst SPACE = /[^ ]+/g;\n\n// Field-length norm: the shorter the field, the higher the weight.\n// Set to 3 decimals to reduce index size.\nfunction norm(weight = 1, mantissa = 3) {\n  const cache = new Map();\n  const m = Math.pow(10, mantissa);\n  return {\n    get(value) {\n      const numTokens = value.match(SPACE).length;\n      if (cache.has(numTokens)) {\n        return cache.get(numTokens);\n      }\n\n      // Default function is 1/sqrt(x), weight makes that variable\n      const norm = 1 / Math.pow(numTokens, 0.5 * weight);\n\n      // In place of `toFixed(mantissa)`, for faster computation\n      const n = parseFloat(Math.round(norm * m) / m);\n      cache.set(numTokens, n);\n      return n;\n    },\n    clear() {\n      cache.clear();\n    }\n  };\n}\nclass FuseIndex {\n  constructor({\n    getFn = Config.getFn,\n    fieldNormWeight = Config.fieldNormWeight\n  } = {}) {\n    this.norm = norm(fieldNormWeight, 3);\n    this.getFn = getFn;\n    this.isCreated = false;\n    this.setIndexRecords();\n  }\n  setSources(docs = []) {\n    this.docs = docs;\n  }\n  setIndexRecords(records = []) {\n    this.records = records;\n  }\n  setKeys(keys = []) {\n    this.keys = keys;\n    this._keysMap = {};\n    keys.forEach((key, idx) => {\n      this._keysMap[key.id] = idx;\n    });\n  }\n  create() {\n    if (this.isCreated || !this.docs.length) {\n      return;\n    }\n    this.isCreated = true;\n\n    // List is Array<String>\n    if (isString(this.docs[0])) {\n      this.docs.forEach((doc, docIndex) => {\n        this._addString(doc, docIndex);\n      });\n    } else {\n      // List is Array<Object>\n      this.docs.forEach((doc, docIndex) => {\n        this._addObject(doc, docIndex);\n      });\n    }\n    this.norm.clear();\n  }\n  // Adds a doc to the end of the index\n  add(doc) {\n    const idx = this.size();\n    if (isString(doc)) {\n      this._addString(doc, idx);\n    } else {\n      this._addObject(doc, idx);\n    }\n  }\n  // Removes the doc at the specified index of the index\n  removeAt(idx) {\n    this.records.splice(idx, 1);\n\n    // Change ref index of every subsquent doc\n    for (let i = idx, len = this.size(); i < len; i += 1) {\n      this.records[i].i -= 1;\n    }\n  }\n  getValueForItemAtKeyId(item, keyId) {\n    return item[this._keysMap[keyId]];\n  }\n  size() {\n    return this.records.length;\n  }\n  _addString(doc, docIndex) {\n    if (!isDefined(doc) || isBlank(doc)) {\n      return;\n    }\n    let record = {\n      v: doc,\n      i: docIndex,\n      n: this.norm.get(doc)\n    };\n    this.records.push(record);\n  }\n  _addObject(doc, docIndex) {\n    let record = {\n      i: docIndex,\n      $: {}\n    };\n\n    // Iterate over every key (i.e, path), and fetch the value at that key\n    this.keys.forEach((key, keyIndex) => {\n      let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);\n      if (!isDefined(value)) {\n        return;\n      }\n      if (isArray(value)) {\n        let subRecords = [];\n        const stack = [{\n          nestedArrIndex: -1,\n          value\n        }];\n        while (stack.length) {\n          const {\n            nestedArrIndex,\n            value\n          } = stack.pop();\n          if (!isDefined(value)) {\n            continue;\n          }\n          if (isString(value) && !isBlank(value)) {\n            let subRecord = {\n              v: value,\n              i: nestedArrIndex,\n              n: this.norm.get(value)\n            };\n            subRecords.push(subRecord);\n          } else if (isArray(value)) {\n            value.forEach((item, k) => {\n              stack.push({\n                nestedArrIndex: k,\n                value: item\n              });\n            });\n          } else ;\n        }\n        record.$[keyIndex] = subRecords;\n      } else if (isString(value) && !isBlank(value)) {\n        let subRecord = {\n          v: value,\n          n: this.norm.get(value)\n        };\n        record.$[keyIndex] = subRecord;\n      }\n    });\n    this.records.push(record);\n  }\n  toJSON() {\n    return {\n      keys: this.keys,\n      records: this.records\n    };\n  }\n}\nfunction createIndex(keys, docs, {\n  getFn = Config.getFn,\n  fieldNormWeight = Config.fieldNormWeight\n} = {}) {\n  const myIndex = new FuseIndex({\n    getFn,\n    fieldNormWeight\n  });\n  myIndex.setKeys(keys.map(createKey));\n  myIndex.setSources(docs);\n  myIndex.create();\n  return myIndex;\n}\nfunction parseIndex(data, {\n  getFn = Config.getFn,\n  fieldNormWeight = Config.fieldNormWeight\n} = {}) {\n  const {\n    keys,\n    records\n  } = data;\n  const myIndex = new FuseIndex({\n    getFn,\n    fieldNormWeight\n  });\n  myIndex.setKeys(keys);\n  myIndex.setIndexRecords(records);\n  return myIndex;\n}\nfunction computeScore$1(pattern, {\n  errors = 0,\n  currentLocation = 0,\n  expectedLocation = 0,\n  distance = Config.distance,\n  ignoreLocation = Config.ignoreLocation\n} = {}) {\n  const accuracy = errors / pattern.length;\n  if (ignoreLocation) {\n    return accuracy;\n  }\n  const proximity = Math.abs(expectedLocation - currentLocation);\n  if (!distance) {\n    // Dodge divide by zero error.\n    return proximity ? 1.0 : accuracy;\n  }\n  return accuracy + proximity / distance;\n}\nfunction convertMaskToIndices(matchmask = [], minMatchCharLength = Config.minMatchCharLength) {\n  let indices = [];\n  let start = -1;\n  let end = -1;\n  let i = 0;\n  for (let len = matchmask.length; i < len; i += 1) {\n    let match = matchmask[i];\n    if (match && start === -1) {\n      start = i;\n    } else if (!match && start !== -1) {\n      end = i - 1;\n      if (end - start + 1 >= minMatchCharLength) {\n        indices.push([start, end]);\n      }\n      start = -1;\n    }\n  }\n\n  // (i-1 - start) + 1 => i - start\n  if (matchmask[i - 1] && i - start >= minMatchCharLength) {\n    indices.push([start, i - 1]);\n  }\n  return indices;\n}\n\n// Machine word size\nconst MAX_BITS = 32;\nfunction search(text, pattern, patternAlphabet, {\n  location = Config.location,\n  distance = Config.distance,\n  threshold = Config.threshold,\n  findAllMatches = Config.findAllMatches,\n  minMatchCharLength = Config.minMatchCharLength,\n  includeMatches = Config.includeMatches,\n  ignoreLocation = Config.ignoreLocation\n} = {}) {\n  if (pattern.length > MAX_BITS) {\n    throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));\n  }\n  const patternLen = pattern.length;\n  // Set starting location at beginning text and initialize the alphabet.\n  const textLen = text.length;\n  // Handle the case when location > text.length\n  const expectedLocation = Math.max(0, Math.min(location, textLen));\n  // Highest score beyond which we give up.\n  let currentThreshold = threshold;\n  // Is there a nearby exact match? (speedup)\n  let bestLocation = expectedLocation;\n\n  // Performance: only computer matches when the minMatchCharLength > 1\n  // OR if `includeMatches` is true.\n  const computeMatches = minMatchCharLength > 1 || includeMatches;\n  // A mask of the matches, used for building the indices\n  const matchMask = computeMatches ? Array(textLen) : [];\n  let index;\n\n  // Get all exact matches, here for speed up\n  while ((index = text.indexOf(pattern, bestLocation)) > -1) {\n    let score = computeScore$1(pattern, {\n      currentLocation: index,\n      expectedLocation,\n      distance,\n      ignoreLocation\n    });\n    currentThreshold = Math.min(score, currentThreshold);\n    bestLocation = index + patternLen;\n    if (computeMatches) {\n      let i = 0;\n      while (i < patternLen) {\n        matchMask[index + i] = 1;\n        i += 1;\n      }\n    }\n  }\n\n  // Reset the best location\n  bestLocation = -1;\n  let lastBitArr = [];\n  let finalScore = 1;\n  let binMax = patternLen + textLen;\n  const mask = 1 << patternLen - 1;\n  for (let i = 0; i < patternLen; i += 1) {\n    // Scan for the best match; each iteration allows for one more error.\n    // Run a binary search to determine how far from the match location we can stray\n    // at this error level.\n    let binMin = 0;\n    let binMid = binMax;\n    while (binMin < binMid) {\n      const score = computeScore$1(pattern, {\n        errors: i,\n        currentLocation: expectedLocation + binMid,\n        expectedLocation,\n        distance,\n        ignoreLocation\n      });\n      if (score <= currentThreshold) {\n        binMin = binMid;\n      } else {\n        binMax = binMid;\n      }\n      binMid = Math.floor((binMax - binMin) / 2 + binMin);\n    }\n\n    // Use the result from this iteration as the maximum for the next.\n    binMax = binMid;\n    let start = Math.max(1, expectedLocation - binMid + 1);\n    let finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen;\n\n    // Initialize the bit array\n    let bitArr = Array(finish + 2);\n    bitArr[finish + 1] = (1 << i) - 1;\n    for (let j = finish; j >= start; j -= 1) {\n      let currentLocation = j - 1;\n      let charMatch = patternAlphabet[text.charAt(currentLocation)];\n      if (computeMatches) {\n        // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)\n        matchMask[currentLocation] = +!!charMatch;\n      }\n\n      // First pass: exact match\n      bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch;\n\n      // Subsequent passes: fuzzy match\n      if (i) {\n        bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];\n      }\n      if (bitArr[j] & mask) {\n        finalScore = computeScore$1(pattern, {\n          errors: i,\n          currentLocation,\n          expectedLocation,\n          distance,\n          ignoreLocation\n        });\n\n        // This match will almost certainly be better than any existing match.\n        // But check anyway.\n        if (finalScore <= currentThreshold) {\n          // Indeed it is\n          currentThreshold = finalScore;\n          bestLocation = currentLocation;\n\n          // Already passed `loc`, downhill from here on in.\n          if (bestLocation <= expectedLocation) {\n            break;\n          }\n\n          // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.\n          start = Math.max(1, 2 * expectedLocation - bestLocation);\n        }\n      }\n    }\n\n    // No hope for a (better) match at greater error levels.\n    const score = computeScore$1(pattern, {\n      errors: i + 1,\n      currentLocation: expectedLocation,\n      expectedLocation,\n      distance,\n      ignoreLocation\n    });\n    if (score > currentThreshold) {\n      break;\n    }\n    lastBitArr = bitArr;\n  }\n  const result = {\n    isMatch: bestLocation >= 0,\n    // Count exact matches (those with a score of 0) to be \"almost\" exact\n    score: Math.max(0.001, finalScore)\n  };\n  if (computeMatches) {\n    const indices = convertMaskToIndices(matchMask, minMatchCharLength);\n    if (!indices.length) {\n      result.isMatch = false;\n    } else if (includeMatches) {\n      result.indices = indices;\n    }\n  }\n  return result;\n}\nfunction createPatternAlphabet(pattern) {\n  let mask = {};\n  for (let i = 0, len = pattern.length; i < len; i += 1) {\n    const char = pattern.charAt(i);\n    mask[char] = (mask[char] || 0) | 1 << len - i - 1;\n  }\n  return mask;\n}\nclass BitapSearch {\n  constructor(pattern, {\n    location = Config.location,\n    threshold = Config.threshold,\n    distance = Config.distance,\n    includeMatches = Config.includeMatches,\n    findAllMatches = Config.findAllMatches,\n    minMatchCharLength = Config.minMatchCharLength,\n    isCaseSensitive = Config.isCaseSensitive,\n    ignoreLocation = Config.ignoreLocation\n  } = {}) {\n    this.options = {\n      location,\n      threshold,\n      distance,\n      includeMatches,\n      findAllMatches,\n      minMatchCharLength,\n      isCaseSensitive,\n      ignoreLocation\n    };\n    this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n    this.chunks = [];\n    if (!this.pattern.length) {\n      return;\n    }\n    const addChunk = (pattern, startIndex) => {\n      this.chunks.push({\n        pattern,\n        alphabet: createPatternAlphabet(pattern),\n        startIndex\n      });\n    };\n    const len = this.pattern.length;\n    if (len > MAX_BITS) {\n      let i = 0;\n      const remainder = len % MAX_BITS;\n      const end = len - remainder;\n      while (i < end) {\n        addChunk(this.pattern.substr(i, MAX_BITS), i);\n        i += MAX_BITS;\n      }\n      if (remainder) {\n        const startIndex = len - MAX_BITS;\n        addChunk(this.pattern.substr(startIndex), startIndex);\n      }\n    } else {\n      addChunk(this.pattern, 0);\n    }\n  }\n  searchIn(text) {\n    const {\n      isCaseSensitive,\n      includeMatches\n    } = this.options;\n    if (!isCaseSensitive) {\n      text = text.toLowerCase();\n    }\n\n    // Exact match\n    if (this.pattern === text) {\n      let result = {\n        isMatch: true,\n        score: 0\n      };\n      if (includeMatches) {\n        result.indices = [[0, text.length - 1]];\n      }\n      return result;\n    }\n\n    // Otherwise, use Bitap algorithm\n    const {\n      location,\n      distance,\n      threshold,\n      findAllMatches,\n      minMatchCharLength,\n      ignoreLocation\n    } = this.options;\n    let allIndices = [];\n    let totalScore = 0;\n    let hasMatches = false;\n    this.chunks.forEach(({\n      pattern,\n      alphabet,\n      startIndex\n    }) => {\n      const {\n        isMatch,\n        score,\n        indices\n      } = search(text, pattern, alphabet, {\n        location: location + startIndex,\n        distance,\n        threshold,\n        findAllMatches,\n        minMatchCharLength,\n        includeMatches,\n        ignoreLocation\n      });\n      if (isMatch) {\n        hasMatches = true;\n      }\n      totalScore += score;\n      if (isMatch && indices) {\n        allIndices = [...allIndices, ...indices];\n      }\n    });\n    let result = {\n      isMatch: hasMatches,\n      score: hasMatches ? totalScore / this.chunks.length : 1\n    };\n    if (hasMatches && includeMatches) {\n      result.indices = allIndices;\n    }\n    return result;\n  }\n}\nclass BaseMatch {\n  constructor(pattern) {\n    this.pattern = pattern;\n  }\n  static isMultiMatch(pattern) {\n    return getMatch(pattern, this.multiRegex);\n  }\n  static isSingleMatch(pattern) {\n    return getMatch(pattern, this.singleRegex);\n  }\n  search( /*text*/) {}\n}\nfunction getMatch(pattern, exp) {\n  const matches = pattern.match(exp);\n  return matches ? matches[1] : null;\n}\n\n// Token: 'file\n\nclass ExactMatch extends BaseMatch {\n  constructor(pattern) {\n    super(pattern);\n  }\n  static get type() {\n    return 'exact';\n  }\n  static get multiRegex() {\n    return /^=\"(.*)\"$/;\n  }\n  static get singleRegex() {\n    return /^=(.*)$/;\n  }\n  search(text) {\n    const isMatch = text === this.pattern;\n    return {\n      isMatch,\n      score: isMatch ? 0 : 1,\n      indices: [0, this.pattern.length - 1]\n    };\n  }\n}\n\n// Token: !fire\n\nclass InverseExactMatch extends BaseMatch {\n  constructor(pattern) {\n    super(pattern);\n  }\n  static get type() {\n    return 'inverse-exact';\n  }\n  static get multiRegex() {\n    return /^!\"(.*)\"$/;\n  }\n  static get singleRegex() {\n    return /^!(.*)$/;\n  }\n  search(text) {\n    const index = text.indexOf(this.pattern);\n    const isMatch = index === -1;\n    return {\n      isMatch,\n      score: isMatch ? 0 : 1,\n      indices: [0, text.length - 1]\n    };\n  }\n}\n\n// Token: ^file\n\nclass PrefixExactMatch extends BaseMatch {\n  constructor(pattern) {\n    super(pattern);\n  }\n  static get type() {\n    return 'prefix-exact';\n  }\n  static get multiRegex() {\n    return /^\\^\"(.*)\"$/;\n  }\n  static get singleRegex() {\n    return /^\\^(.*)$/;\n  }\n  search(text) {\n    const isMatch = text.startsWith(this.pattern);\n    return {\n      isMatch,\n      score: isMatch ? 0 : 1,\n      indices: [0, this.pattern.length - 1]\n    };\n  }\n}\n\n// Token: !^fire\n\nclass InversePrefixExactMatch extends BaseMatch {\n  constructor(pattern) {\n    super(pattern);\n  }\n  static get type() {\n    return 'inverse-prefix-exact';\n  }\n  static get multiRegex() {\n    return /^!\\^\"(.*)\"$/;\n  }\n  static get singleRegex() {\n    return /^!\\^(.*)$/;\n  }\n  search(text) {\n    const isMatch = !text.startsWith(this.pattern);\n    return {\n      isMatch,\n      score: isMatch ? 0 : 1,\n      indices: [0, text.length - 1]\n    };\n  }\n}\n\n// Token: .file$\n\nclass SuffixExactMatch extends BaseMatch {\n  constructor(pattern) {\n    super(pattern);\n  }\n  static get type() {\n    return 'suffix-exact';\n  }\n  static get multiRegex() {\n    return /^\"(.*)\"\\$$/;\n  }\n  static get singleRegex() {\n    return /^(.*)\\$$/;\n  }\n  search(text) {\n    const isMatch = text.endsWith(this.pattern);\n    return {\n      isMatch,\n      score: isMatch ? 0 : 1,\n      indices: [text.length - this.pattern.length, text.length - 1]\n    };\n  }\n}\n\n// Token: !.file$\n\nclass InverseSuffixExactMatch extends BaseMatch {\n  constructor(pattern) {\n    super(pattern);\n  }\n  static get type() {\n    return 'inverse-suffix-exact';\n  }\n  static get multiRegex() {\n    return /^!\"(.*)\"\\$$/;\n  }\n  static get singleRegex() {\n    return /^!(.*)\\$$/;\n  }\n  search(text) {\n    const isMatch = !text.endsWith(this.pattern);\n    return {\n      isMatch,\n      score: isMatch ? 0 : 1,\n      indices: [0, text.length - 1]\n    };\n  }\n}\nclass FuzzyMatch extends BaseMatch {\n  constructor(pattern, {\n    location = Config.location,\n    threshold = Config.threshold,\n    distance = Config.distance,\n    includeMatches = Config.includeMatches,\n    findAllMatches = Config.findAllMatches,\n    minMatchCharLength = Config.minMatchCharLength,\n    isCaseSensitive = Config.isCaseSensitive,\n    ignoreLocation = Config.ignoreLocation\n  } = {}) {\n    super(pattern);\n    this._bitapSearch = new BitapSearch(pattern, {\n      location,\n      threshold,\n      distance,\n      includeMatches,\n      findAllMatches,\n      minMatchCharLength,\n      isCaseSensitive,\n      ignoreLocation\n    });\n  }\n  static get type() {\n    return 'fuzzy';\n  }\n  static get multiRegex() {\n    return /^\"(.*)\"$/;\n  }\n  static get singleRegex() {\n    return /^(.*)$/;\n  }\n  search(text) {\n    return this._bitapSearch.searchIn(text);\n  }\n}\n\n// Token: 'file\n\nclass IncludeMatch extends BaseMatch {\n  constructor(pattern) {\n    super(pattern);\n  }\n  static get type() {\n    return 'include';\n  }\n  static get multiRegex() {\n    return /^'\"(.*)\"$/;\n  }\n  static get singleRegex() {\n    return /^'(.*)$/;\n  }\n  search(text) {\n    let location = 0;\n    let index;\n    const indices = [];\n    const patternLen = this.pattern.length;\n\n    // Get all exact matches\n    while ((index = text.indexOf(this.pattern, location)) > -1) {\n      location = index + patternLen;\n      indices.push([index, location - 1]);\n    }\n    const isMatch = !!indices.length;\n    return {\n      isMatch,\n      score: isMatch ? 0 : 1,\n      indices\n    };\n  }\n}\n\n// \u2757Order is important. DO NOT CHANGE.\nconst searchers = [ExactMatch, IncludeMatch, PrefixExactMatch, InversePrefixExactMatch, InverseSuffixExactMatch, SuffixExactMatch, InverseExactMatch, FuzzyMatch];\nconst searchersLen = searchers.length;\n\n// Regex to split by spaces, but keep anything in quotes together\nconst SPACE_RE = / +(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)/;\nconst OR_TOKEN = '|';\n\n// Return a 2D array representation of the query, for simpler parsing.\n// Example:\n// \"^core go$ | rb$ | py$ xy$\" => [[\"^core\", \"go$\"], [\"rb$\"], [\"py$\", \"xy$\"]]\nfunction parseQuery(pattern, options = {}) {\n  return pattern.split(OR_TOKEN).map(item => {\n    let query = item.trim().split(SPACE_RE).filter(item => item && !!item.trim());\n    let results = [];\n    for (let i = 0, len = query.length; i < len; i += 1) {\n      const queryItem = query[i];\n\n      // 1. Handle multiple query match (i.e, once that are quoted, like `\"hello world\"`)\n      let found = false;\n      let idx = -1;\n      while (!found && ++idx < searchersLen) {\n        const searcher = searchers[idx];\n        let token = searcher.isMultiMatch(queryItem);\n        if (token) {\n          results.push(new searcher(token, options));\n          found = true;\n        }\n      }\n      if (found) {\n        continue;\n      }\n\n      // 2. Handle single query matches (i.e, once that are *not* quoted)\n      idx = -1;\n      while (++idx < searchersLen) {\n        const searcher = searchers[idx];\n        let token = searcher.isSingleMatch(queryItem);\n        if (token) {\n          results.push(new searcher(token, options));\n          break;\n        }\n      }\n    }\n    return results;\n  });\n}\n\n// These extended matchers can return an array of matches, as opposed\n// to a singl match\nconst MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);\n\n/**\n * Command-like searching\n * ======================\n *\n * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,\n * search in a given text.\n *\n * Search syntax:\n *\n * | Token       | Match type                 | Description                            |\n * | ----------- | -------------------------- | -------------------------------------- |\n * | `jscript`   | fuzzy-match                | Items that fuzzy match `jscript`       |\n * | `=scheme`   | exact-match                | Items that are `scheme`                |\n * | `'python`   | include-match              | Items that include `python`            |\n * | `!ruby`     | inverse-exact-match        | Items that do not include `ruby`       |\n * | `^java`     | prefix-exact-match         | Items that start with `java`           |\n * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |\n * | `.js$`      | suffix-exact-match         | Items that end with `.js`              |\n * | `!.go$`     | inverse-suffix-exact-match | Items that do not end with `.go`       |\n *\n * A single pipe character acts as an OR operator. For example, the following\n * query matches entries that start with `core` and end with either`go`, `rb`,\n * or`py`.\n *\n * ```\n * ^core go$ | rb$ | py$\n * ```\n */\nclass ExtendedSearch {\n  constructor(pattern, {\n    isCaseSensitive = Config.isCaseSensitive,\n    includeMatches = Config.includeMatches,\n    minMatchCharLength = Config.minMatchCharLength,\n    ignoreLocation = Config.ignoreLocation,\n    findAllMatches = Config.findAllMatches,\n    location = Config.location,\n    threshold = Config.threshold,\n    distance = Config.distance\n  } = {}) {\n    this.query = null;\n    this.options = {\n      isCaseSensitive,\n      includeMatches,\n      minMatchCharLength,\n      findAllMatches,\n      ignoreLocation,\n      location,\n      threshold,\n      distance\n    };\n    this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n    this.query = parseQuery(this.pattern, this.options);\n  }\n  static condition(_, options) {\n    return options.useExtendedSearch;\n  }\n  searchIn(text) {\n    const query = this.query;\n    if (!query) {\n      return {\n        isMatch: false,\n        score: 1\n      };\n    }\n    const {\n      includeMatches,\n      isCaseSensitive\n    } = this.options;\n    text = isCaseSensitive ? text : text.toLowerCase();\n    let numMatches = 0;\n    let allIndices = [];\n    let totalScore = 0;\n\n    // ORs\n    for (let i = 0, qLen = query.length; i < qLen; i += 1) {\n      const searchers = query[i];\n\n      // Reset indices\n      allIndices.length = 0;\n      numMatches = 0;\n\n      // ANDs\n      for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {\n        const searcher = searchers[j];\n        const {\n          isMatch,\n          indices,\n          score\n        } = searcher.search(text);\n        if (isMatch) {\n          numMatches += 1;\n          totalScore += score;\n          if (includeMatches) {\n            const type = searcher.constructor.type;\n            if (MultiMatchSet.has(type)) {\n              allIndices = [...allIndices, ...indices];\n            } else {\n              allIndices.push(indices);\n            }\n          }\n        } else {\n          totalScore = 0;\n          numMatches = 0;\n          allIndices.length = 0;\n          break;\n        }\n      }\n\n      // OR condition, so if TRUE, return\n      if (numMatches) {\n        let result = {\n          isMatch: true,\n          score: totalScore / numMatches\n        };\n        if (includeMatches) {\n          result.indices = allIndices;\n        }\n        return result;\n      }\n    }\n\n    // Nothing was matched\n    return {\n      isMatch: false,\n      score: 1\n    };\n  }\n}\nconst registeredSearchers = [];\nfunction register(...args) {\n  registeredSearchers.push(...args);\n}\nfunction createSearcher(pattern, options) {\n  for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {\n    let searcherClass = registeredSearchers[i];\n    if (searcherClass.condition(pattern, options)) {\n      return new searcherClass(pattern, options);\n    }\n  }\n  return new BitapSearch(pattern, options);\n}\nconst LogicalOperator = {\n  AND: '$and',\n  OR: '$or'\n};\nconst KeyType = {\n  PATH: '$path',\n  PATTERN: '$val'\n};\nconst isExpression = query => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);\nconst isPath = query => !!query[KeyType.PATH];\nconst isLeaf = query => !isArray(query) && isObject(query) && !isExpression(query);\nconst convertToExplicit = query => ({\n  [LogicalOperator.AND]: Object.keys(query).map(key => ({\n    [key]: query[key]\n  }))\n});\n\n// When `auto` is `true`, the parse function will infer and initialize and add\n// the appropriate `Searcher` instance\nfunction parse(query, options, {\n  auto = true\n} = {}) {\n  const next = query => {\n    let keys = Object.keys(query);\n    const isQueryPath = isPath(query);\n    if (!isQueryPath && keys.length > 1 && !isExpression(query)) {\n      return next(convertToExplicit(query));\n    }\n    if (isLeaf(query)) {\n      const key = isQueryPath ? query[KeyType.PATH] : keys[0];\n      const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];\n      if (!isString(pattern)) {\n        throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));\n      }\n      const obj = {\n        keyId: createKeyId(key),\n        pattern\n      };\n      if (auto) {\n        obj.searcher = createSearcher(pattern, options);\n      }\n      return obj;\n    }\n    let node = {\n      children: [],\n      operator: keys[0]\n    };\n    keys.forEach(key => {\n      const value = query[key];\n      if (isArray(value)) {\n        value.forEach(item => {\n          node.children.push(next(item));\n        });\n      }\n    });\n    return node;\n  };\n  if (!isExpression(query)) {\n    query = convertToExplicit(query);\n  }\n  return next(query);\n}\n\n// Practical scoring function\nfunction computeScore(results, {\n  ignoreFieldNorm = Config.ignoreFieldNorm\n}) {\n  results.forEach(result => {\n    let totalScore = 1;\n    result.matches.forEach(({\n      key,\n      norm,\n      score\n    }) => {\n      const weight = key ? key.weight : null;\n      totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));\n    });\n    result.score = totalScore;\n  });\n}\nfunction transformMatches(result, data) {\n  const matches = result.matches;\n  data.matches = [];\n  if (!isDefined(matches)) {\n    return;\n  }\n  matches.forEach(match => {\n    if (!isDefined(match.indices) || !match.indices.length) {\n      return;\n    }\n    const {\n      indices,\n      value\n    } = match;\n    let obj = {\n      indices,\n      value\n    };\n    if (match.key) {\n      obj.key = match.key.src;\n    }\n    if (match.idx > -1) {\n      obj.refIndex = match.idx;\n    }\n    data.matches.push(obj);\n  });\n}\nfunction transformScore(result, data) {\n  data.score = result.score;\n}\nfunction format(results, docs, {\n  includeMatches = Config.includeMatches,\n  includeScore = Config.includeScore\n} = {}) {\n  const transformers = [];\n  if (includeMatches) transformers.push(transformMatches);\n  if (includeScore) transformers.push(transformScore);\n  return results.map(result => {\n    const {\n      idx\n    } = result;\n    const data = {\n      item: docs[idx],\n      refIndex: idx\n    };\n    if (transformers.length) {\n      transformers.forEach(transformer => {\n        transformer(result, data);\n      });\n    }\n    return data;\n  });\n}\nclass Fuse {\n  constructor(docs, options = {}, index) {\n    this.options = _objectSpread2(_objectSpread2({}, Config), options);\n    if (this.options.useExtendedSearch && !true) {\n      throw new Error(EXTENDED_SEARCH_UNAVAILABLE);\n    }\n    this._keyStore = new KeyStore(this.options.keys);\n    this.setCollection(docs, index);\n  }\n  setCollection(docs, index) {\n    this._docs = docs;\n    if (index && !(index instanceof FuseIndex)) {\n      throw new Error(INCORRECT_INDEX_TYPE);\n    }\n    this._myIndex = index || createIndex(this.options.keys, this._docs, {\n      getFn: this.options.getFn,\n      fieldNormWeight: this.options.fieldNormWeight\n    });\n  }\n  add(doc) {\n    if (!isDefined(doc)) {\n      return;\n    }\n    this._docs.push(doc);\n    this._myIndex.add(doc);\n  }\n  remove(predicate = ( /* doc, idx */) => false) {\n    const results = [];\n    for (let i = 0, len = this._docs.length; i < len; i += 1) {\n      const doc = this._docs[i];\n      if (predicate(doc, i)) {\n        this.removeAt(i);\n        i -= 1;\n        len -= 1;\n        results.push(doc);\n      }\n    }\n    return results;\n  }\n  removeAt(idx) {\n    this._docs.splice(idx, 1);\n    this._myIndex.removeAt(idx);\n  }\n  getIndex() {\n    return this._myIndex;\n  }\n  search(query, {\n    limit = -1\n  } = {}) {\n    const {\n      includeMatches,\n      includeScore,\n      shouldSort,\n      sortFn,\n      ignoreFieldNorm\n    } = this.options;\n    let results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);\n    computeScore(results, {\n      ignoreFieldNorm\n    });\n    if (shouldSort) {\n      results.sort(sortFn);\n    }\n    if (isNumber(limit) && limit > -1) {\n      results = results.slice(0, limit);\n    }\n    return format(results, this._docs, {\n      includeMatches,\n      includeScore\n    });\n  }\n  _searchStringList(query) {\n    const searcher = createSearcher(query, this.options);\n    const {\n      records\n    } = this._myIndex;\n    const results = [];\n\n    // Iterate over every string in the index\n    records.forEach(({\n      v: text,\n      i: idx,\n      n: norm\n    }) => {\n      if (!isDefined(text)) {\n        return;\n      }\n      const {\n        isMatch,\n        score,\n        indices\n      } = searcher.searchIn(text);\n      if (isMatch) {\n        results.push({\n          item: text,\n          idx,\n          matches: [{\n            score,\n            value: text,\n            norm,\n            indices\n          }]\n        });\n      }\n    });\n    return results;\n  }\n  _searchLogical(query) {\n    const expression = parse(query, this.options);\n    const evaluate = (node, item, idx) => {\n      if (!node.children) {\n        const {\n          keyId,\n          searcher\n        } = node;\n        const matches = this._findMatches({\n          key: this._keyStore.get(keyId),\n          value: this._myIndex.getValueForItemAtKeyId(item, keyId),\n          searcher\n        });\n        if (matches && matches.length) {\n          return [{\n            idx,\n            item,\n            matches\n          }];\n        }\n        return [];\n      }\n      const res = [];\n      for (let i = 0, len = node.children.length; i < len; i += 1) {\n        const child = node.children[i];\n        const result = evaluate(child, item, idx);\n        if (result.length) {\n          res.push(...result);\n        } else if (node.operator === LogicalOperator.AND) {\n          return [];\n        }\n      }\n      return res;\n    };\n    const records = this._myIndex.records;\n    const resultMap = {};\n    const results = [];\n    records.forEach(({\n      $: item,\n      i: idx\n    }) => {\n      if (isDefined(item)) {\n        let expResults = evaluate(expression, item, idx);\n        if (expResults.length) {\n          // Dedupe when adding\n          if (!resultMap[idx]) {\n            resultMap[idx] = {\n              idx,\n              item,\n              matches: []\n            };\n            results.push(resultMap[idx]);\n          }\n          expResults.forEach(({\n            matches\n          }) => {\n            resultMap[idx].matches.push(...matches);\n          });\n        }\n      }\n    });\n    return results;\n  }\n  _searchObjectList(query) {\n    const searcher = createSearcher(query, this.options);\n    const {\n      keys,\n      records\n    } = this._myIndex;\n    const results = [];\n\n    // List is Array<Object>\n    records.forEach(({\n      $: item,\n      i: idx\n    }) => {\n      if (!isDefined(item)) {\n        return;\n      }\n      let matches = [];\n\n      // Iterate over every key (i.e, path), and fetch the value at that key\n      keys.forEach((key, keyIndex) => {\n        matches.push(...this._findMatches({\n          key,\n          value: item[keyIndex],\n          searcher\n        }));\n      });\n      if (matches.length) {\n        results.push({\n          idx,\n          item,\n          matches\n        });\n      }\n    });\n    return results;\n  }\n  _findMatches({\n    key,\n    value,\n    searcher\n  }) {\n    if (!isDefined(value)) {\n      return [];\n    }\n    let matches = [];\n    if (isArray(value)) {\n      value.forEach(({\n        v: text,\n        i: idx,\n        n: norm\n      }) => {\n        if (!isDefined(text)) {\n          return;\n        }\n        const {\n          isMatch,\n          score,\n          indices\n        } = searcher.searchIn(text);\n        if (isMatch) {\n          matches.push({\n            score,\n            key,\n            value: text,\n            idx,\n            norm,\n            indices\n          });\n        }\n      });\n    } else {\n      const {\n        v: text,\n        n: norm\n      } = value;\n      const {\n        isMatch,\n        score,\n        indices\n      } = searcher.searchIn(text);\n      if (isMatch) {\n        matches.push({\n          score,\n          key,\n          value: text,\n          norm,\n          indices\n        });\n      }\n    }\n    return matches;\n  }\n}\nFuse.version = '7.0.0';\nFuse.createIndex = createIndex;\nFuse.parseIndex = parseIndex;\nFuse.config = Config;\n{\n  Fuse.parseQuery = parse;\n}\n{\n  register(ExtendedSearch);\n}\n\nvar SearchByFuse = /** @class */ (function () {\n    function SearchByFuse(config) {\n        this._haystack = [];\n        this._fuseOptions = __assign(__assign({}, config.fuseOptions), { keys: __spreadArray([], config.searchFields, true), includeMatches: true });\n    }\n    SearchByFuse.prototype.index = function (data) {\n        this._haystack = data;\n        if (this._fuse) {\n            this._fuse.setCollection(data);\n        }\n    };\n    SearchByFuse.prototype.reset = function () {\n        this._haystack = [];\n        this._fuse = undefined;\n    };\n    SearchByFuse.prototype.isEmptyIndex = function () {\n        return !this._haystack.length;\n    };\n    SearchByFuse.prototype.search = function (needle) {\n        if (!this._fuse) {\n            {\n                this._fuse = new Fuse(this._haystack, this._fuseOptions);\n            }\n        }\n        var results = this._fuse.search(needle);\n        return results.map(function (value, i) {\n            return {\n                item: value.item,\n                score: value.score || 0,\n                rank: i + 1, // If value.score is used for sorting, this can create non-stable sorts!\n            };\n        });\n    };\n    return SearchByFuse;\n}());\n\nfunction getSearcher(config) {\n    {\n        return new SearchByFuse(config);\n    }\n}\n\n/**\n * Helpers to create HTML elements used by Choices\n * Can be overridden by providing `callbackOnCreateTemplates` option.\n * `Choices.defaults.templates` allows access to the default template methods from `callbackOnCreateTemplates`\n */\nvar isEmptyObject = function (obj) {\n    // eslint-disable-next-line no-restricted-syntax\n    for (var prop in obj) {\n        if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n            return false;\n        }\n    }\n    return true;\n};\nvar assignCustomProperties = function (el, choice, withCustomProperties) {\n    var dataset = el.dataset;\n    var customProperties = choice.customProperties, labelClass = choice.labelClass, labelDescription = choice.labelDescription;\n    if (labelClass) {\n        dataset.labelClass = getClassNames(labelClass).join(' ');\n    }\n    if (labelDescription) {\n        dataset.labelDescription = labelDescription;\n    }\n    if (withCustomProperties && customProperties) {\n        if (typeof customProperties === 'string') {\n            dataset.customProperties = customProperties;\n        }\n        else if (typeof customProperties === 'object' && !isEmptyObject(customProperties)) {\n            dataset.customProperties = JSON.stringify(customProperties);\n        }\n    }\n};\nvar addAriaLabel = function (docRoot, id, element) {\n    var label = id && docRoot.querySelector(\"label[for='\".concat(id, \"']\"));\n    var text = label && label.innerText;\n    if (text) {\n        element.setAttribute('aria-label', text);\n    }\n};\nvar templates = {\n    containerOuter: function (_a, dir, isSelectElement, isSelectOneElement, searchEnabled, passedElementType, labelId) {\n        var containerOuter = _a.classNames.containerOuter;\n        var div = document.createElement('div');\n        addClassesToElement(div, containerOuter);\n        div.dataset.type = passedElementType;\n        if (dir) {\n            div.dir = dir;\n        }\n        if (isSelectOneElement) {\n            div.tabIndex = 0;\n        }\n        if (isSelectElement) {\n            div.setAttribute('role', searchEnabled ? 'combobox' : 'listbox');\n            if (searchEnabled) {\n                div.setAttribute('aria-autocomplete', 'list');\n            }\n            else if (!labelId) {\n                addAriaLabel(this._docRoot, this.passedElement.element.id, div);\n            }\n            div.setAttribute('aria-haspopup', 'true');\n            div.setAttribute('aria-expanded', 'false');\n        }\n        if (labelId) {\n            div.setAttribute('aria-labelledby', labelId);\n        }\n        return div;\n    },\n    containerInner: function (_a) {\n        var containerInner = _a.classNames.containerInner;\n        var div = document.createElement('div');\n        addClassesToElement(div, containerInner);\n        return div;\n    },\n    itemList: function (_a, isSelectOneElement) {\n        var searchEnabled = _a.searchEnabled, _b = _a.classNames, list = _b.list, listSingle = _b.listSingle, listItems = _b.listItems;\n        var div = document.createElement('div');\n        addClassesToElement(div, list);\n        addClassesToElement(div, isSelectOneElement ? listSingle : listItems);\n        if (this._isSelectElement && searchEnabled) {\n            div.setAttribute('role', 'listbox');\n        }\n        return div;\n    },\n    placeholder: function (_a, value) {\n        var allowHTML = _a.allowHTML, placeholder = _a.classNames.placeholder;\n        var div = document.createElement('div');\n        addClassesToElement(div, placeholder);\n        setElementHtml(div, allowHTML, value);\n        return div;\n    },\n    item: function (_a, choice, removeItemButton) {\n        var allowHTML = _a.allowHTML, removeItemButtonAlignLeft = _a.removeItemButtonAlignLeft, removeItemIconText = _a.removeItemIconText, removeItemLabelText = _a.removeItemLabelText, _b = _a.classNames, item = _b.item, button = _b.button, highlightedState = _b.highlightedState, itemSelectable = _b.itemSelectable, placeholder = _b.placeholder;\n        var rawValue = unwrapStringForRaw(choice.value);\n        var div = document.createElement('div');\n        addClassesToElement(div, item);\n        if (choice.labelClass) {\n            var spanLabel = document.createElement('span');\n            setElementHtml(spanLabel, allowHTML, choice.label);\n            addClassesToElement(spanLabel, choice.labelClass);\n            div.appendChild(spanLabel);\n        }\n        else {\n            setElementHtml(div, allowHTML, choice.label);\n        }\n        div.dataset.item = '';\n        div.dataset.id = choice.id;\n        div.dataset.value = rawValue;\n        assignCustomProperties(div, choice, true);\n        if (choice.disabled || this.containerOuter.isDisabled) {\n            div.setAttribute('aria-disabled', 'true');\n        }\n        if (this._isSelectElement) {\n            div.setAttribute('aria-selected', 'true');\n            div.setAttribute('role', 'option');\n        }\n        if (choice.placeholder) {\n            addClassesToElement(div, placeholder);\n            div.dataset.placeholder = '';\n        }\n        addClassesToElement(div, choice.highlighted ? highlightedState : itemSelectable);\n        if (removeItemButton) {\n            if (choice.disabled) {\n                removeClassesFromElement(div, itemSelectable);\n            }\n            div.dataset.deletable = '';\n            var removeButton = document.createElement('button');\n            removeButton.type = 'button';\n            addClassesToElement(removeButton, button);\n            setElementHtml(removeButton, true, resolveNoticeFunction(removeItemIconText, choice.value));\n            var REMOVE_ITEM_LABEL = resolveNoticeFunction(removeItemLabelText, choice.value);\n            if (REMOVE_ITEM_LABEL) {\n                removeButton.setAttribute('aria-label', REMOVE_ITEM_LABEL);\n            }\n            removeButton.dataset.button = '';\n            if (removeItemButtonAlignLeft) {\n                div.insertAdjacentElement('afterbegin', removeButton);\n            }\n            else {\n                div.appendChild(removeButton);\n            }\n        }\n        return div;\n    },\n    choiceList: function (_a, isSelectOneElement) {\n        var list = _a.classNames.list;\n        var div = document.createElement('div');\n        addClassesToElement(div, list);\n        if (!isSelectOneElement) {\n            div.setAttribute('aria-multiselectable', 'true');\n        }\n        div.setAttribute('role', 'listbox');\n        return div;\n    },\n    choiceGroup: function (_a, _b) {\n        var allowHTML = _a.allowHTML, _c = _a.classNames, group = _c.group, groupHeading = _c.groupHeading, itemDisabled = _c.itemDisabled;\n        var id = _b.id, label = _b.label, disabled = _b.disabled;\n        var rawLabel = unwrapStringForRaw(label);\n        var div = document.createElement('div');\n        addClassesToElement(div, group);\n        if (disabled) {\n            addClassesToElement(div, itemDisabled);\n        }\n        div.setAttribute('role', 'group');\n        div.dataset.group = '';\n        div.dataset.id = id;\n        div.dataset.value = rawLabel;\n        if (disabled) {\n            div.setAttribute('aria-disabled', 'true');\n        }\n        var heading = document.createElement('div');\n        addClassesToElement(heading, groupHeading);\n        setElementHtml(heading, allowHTML, label || '');\n        div.appendChild(heading);\n        return div;\n    },\n    choice: function (_a, choice, selectText, groupName) {\n        var allowHTML = _a.allowHTML, _b = _a.classNames, item = _b.item, itemChoice = _b.itemChoice, itemSelectable = _b.itemSelectable, selectedState = _b.selectedState, itemDisabled = _b.itemDisabled, description = _b.description, placeholder = _b.placeholder;\n        // eslint-disable-next-line prefer-destructuring\n        var label = choice.label;\n        var rawValue = unwrapStringForRaw(choice.value);\n        var div = document.createElement('div');\n        div.id = choice.elementId;\n        addClassesToElement(div, item);\n        addClassesToElement(div, itemChoice);\n        if (groupName && typeof label === 'string') {\n            label = escapeForTemplate(allowHTML, label);\n            label += \" (\".concat(groupName, \")\");\n            label = { trusted: label };\n        }\n        var describedBy = div;\n        if (choice.labelClass) {\n            var spanLabel = document.createElement('span');\n            setElementHtml(spanLabel, allowHTML, label);\n            addClassesToElement(spanLabel, choice.labelClass);\n            describedBy = spanLabel;\n            div.appendChild(spanLabel);\n        }\n        else {\n            setElementHtml(div, allowHTML, label);\n        }\n        if (choice.labelDescription) {\n            var descId = \"\".concat(choice.elementId, \"-description\");\n            describedBy.setAttribute('aria-describedby', descId);\n            var spanDesc = document.createElement('span');\n            setElementHtml(spanDesc, allowHTML, choice.labelDescription);\n            spanDesc.id = descId;\n            addClassesToElement(spanDesc, description);\n            div.appendChild(spanDesc);\n        }\n        if (choice.selected) {\n            addClassesToElement(div, selectedState);\n        }\n        if (choice.placeholder) {\n            addClassesToElement(div, placeholder);\n        }\n        div.setAttribute('role', choice.group ? 'treeitem' : 'option');\n        div.dataset.choice = '';\n        div.dataset.id = choice.id;\n        div.dataset.value = rawValue;\n        if (selectText) {\n            div.dataset.selectText = selectText;\n        }\n        if (choice.group) {\n            div.dataset.groupId = \"\".concat(choice.group.id);\n        }\n        assignCustomProperties(div, choice, false);\n        if (choice.disabled) {\n            addClassesToElement(div, itemDisabled);\n            div.dataset.choiceDisabled = '';\n            div.setAttribute('aria-disabled', 'true');\n        }\n        else {\n            addClassesToElement(div, itemSelectable);\n            div.dataset.choiceSelectable = '';\n        }\n        return div;\n    },\n    input: function (_a, placeholderValue) {\n        var _b = _a.classNames, input = _b.input, inputCloned = _b.inputCloned, labelId = _a.labelId;\n        var inp = document.createElement('input');\n        inp.type = 'search';\n        addClassesToElement(inp, input);\n        addClassesToElement(inp, inputCloned);\n        inp.autocomplete = 'off';\n        inp.autocapitalize = 'off';\n        inp.spellcheck = false;\n        inp.setAttribute('role', 'textbox');\n        inp.setAttribute('aria-autocomplete', 'list');\n        if (placeholderValue) {\n            inp.setAttribute('aria-label', placeholderValue);\n        }\n        else if (!labelId) {\n            addAriaLabel(this._docRoot, this.passedElement.element.id, inp);\n        }\n        return inp;\n    },\n    dropdown: function (_a) {\n        var _b = _a.classNames, list = _b.list, listDropdown = _b.listDropdown;\n        var div = document.createElement('div');\n        addClassesToElement(div, list);\n        addClassesToElement(div, listDropdown);\n        div.setAttribute('aria-expanded', 'false');\n        return div;\n    },\n    notice: function (_a, innerHTML, type) {\n        var _b = _a.classNames, item = _b.item, itemChoice = _b.itemChoice, addChoice = _b.addChoice, noResults = _b.noResults, noChoices = _b.noChoices, noticeItem = _b.notice;\n        if (type === void 0) { type = NoticeTypes.generic; }\n        var notice = document.createElement('div');\n        setElementHtml(notice, true, innerHTML);\n        addClassesToElement(notice, item);\n        addClassesToElement(notice, itemChoice);\n        addClassesToElement(notice, noticeItem);\n        // eslint-disable-next-line default-case\n        switch (type) {\n            case NoticeTypes.addChoice:\n                addClassesToElement(notice, addChoice);\n                break;\n            case NoticeTypes.noResults:\n                addClassesToElement(notice, noResults);\n                break;\n            case NoticeTypes.noChoices:\n                addClassesToElement(notice, noChoices);\n                break;\n        }\n        if (type === NoticeTypes.addChoice) {\n            notice.dataset.choiceSelectable = '';\n            notice.dataset.choice = '';\n        }\n        return notice;\n    },\n    option: function (choice) {\n        // HtmlOptionElement's label value does not support HTML, so the avoid double escaping unwrap the untrusted string.\n        var labelValue = unwrapStringForRaw(choice.label);\n        var opt = new Option(labelValue, choice.value, false, choice.selected);\n        assignCustomProperties(opt, choice, true);\n        opt.disabled = choice.disabled;\n        if (choice.selected) {\n            opt.setAttribute('selected', '');\n        }\n        return opt;\n    },\n};\n\n/** @see {@link http://browserhacks.com/#hack-acea075d0ac6954f275a70023906050c} */\nvar IS_IE11 = '-ms-scroll-limit' in document.documentElement.style &&\n    '-ms-ime-align' in document.documentElement.style;\nvar USER_DEFAULTS = {};\nvar parseDataSetId = function (element) {\n    if (!element) {\n        return undefined;\n    }\n    return element.dataset.id ? parseInt(element.dataset.id, 10) : undefined;\n};\nvar selectableChoiceIdentifier = '[data-choice-selectable]';\n/**\n * Choices\n * @author Josh Johnson<josh@joshuajohnson.co.uk>\n */\nvar Choices = /** @class */ (function () {\n    function Choices(element, userConfig) {\n        if (element === void 0) { element = '[data-choice]'; }\n        if (userConfig === void 0) { userConfig = {}; }\n        var _this = this;\n        this.initialisedOK = undefined;\n        this._hasNonChoicePlaceholder = false;\n        this._lastAddedChoiceId = 0;\n        this._lastAddedGroupId = 0;\n        var defaults = Choices.defaults;\n        this.config = __assign(__assign(__assign({}, defaults.allOptions), defaults.options), userConfig);\n        ObjectsInConfig.forEach(function (key) {\n            _this.config[key] = __assign(__assign(__assign({}, defaults.allOptions[key]), defaults.options[key]), userConfig[key]);\n        });\n        var config = this.config;\n        if (!config.silent) {\n            this._validateConfig();\n        }\n        var docRoot = config.shadowRoot || document.documentElement;\n        this._docRoot = docRoot;\n        var passedElement = typeof element === 'string' ? docRoot.querySelector(element) : element;\n        if (!passedElement ||\n            typeof passedElement !== 'object' ||\n            !(isHtmlInputElement(passedElement) || isHtmlSelectElement(passedElement))) {\n            if (!passedElement && typeof element === 'string') {\n                throw TypeError(\"Selector \".concat(element, \" failed to find an element\"));\n            }\n            throw TypeError(\"Expected one of the following types text|select-one|select-multiple\");\n        }\n        var elementType = passedElement.type;\n        var isText = elementType === PassedElementTypes.Text;\n        if (isText || config.maxItemCount !== 1) {\n            config.singleModeForMultiSelect = false;\n        }\n        if (config.singleModeForMultiSelect) {\n            elementType = PassedElementTypes.SelectMultiple;\n        }\n        var isSelectOne = elementType === PassedElementTypes.SelectOne;\n        var isSelectMultiple = elementType === PassedElementTypes.SelectMultiple;\n        var isSelect = isSelectOne || isSelectMultiple;\n        this._elementType = elementType;\n        this._isTextElement = isText;\n        this._isSelectOneElement = isSelectOne;\n        this._isSelectMultipleElement = isSelectMultiple;\n        this._isSelectElement = isSelectOne || isSelectMultiple;\n        this._canAddUserChoices = (isText && config.addItems) || (isSelect && config.addChoices);\n        if (typeof config.renderSelectedChoices !== 'boolean') {\n            config.renderSelectedChoices = config.renderSelectedChoices === 'always' || isSelectOne;\n        }\n        if (config.closeDropdownOnSelect === 'auto') {\n            config.closeDropdownOnSelect = isText || isSelectOne || config.singleModeForMultiSelect;\n        }\n        else {\n            config.closeDropdownOnSelect = coerceBool(config.closeDropdownOnSelect);\n        }\n        if (config.placeholder) {\n            if (config.placeholderValue) {\n                this._hasNonChoicePlaceholder = true;\n            }\n            else if (passedElement.dataset.placeholder) {\n                this._hasNonChoicePlaceholder = true;\n                config.placeholderValue = passedElement.dataset.placeholder;\n            }\n        }\n        if (userConfig.addItemFilter && typeof userConfig.addItemFilter !== 'function') {\n            var re = userConfig.addItemFilter instanceof RegExp ? userConfig.addItemFilter : new RegExp(userConfig.addItemFilter);\n            config.addItemFilter = re.test.bind(re);\n        }\n        if (this._isTextElement) {\n            this.passedElement = new WrappedInput({\n                element: passedElement,\n                classNames: config.classNames,\n            });\n        }\n        else {\n            var selectEl = passedElement;\n            this.passedElement = new WrappedSelect({\n                element: selectEl,\n                classNames: config.classNames,\n                template: function (data) { return _this._templates.option(data); },\n                extractPlaceholder: config.placeholder && !this._hasNonChoicePlaceholder,\n            });\n        }\n        this.initialised = false;\n        this._store = new Store(config);\n        this._currentValue = '';\n        config.searchEnabled = (!isText && config.searchEnabled) || isSelectMultiple;\n        this._canSearch = config.searchEnabled;\n        this._isScrollingOnIe = false;\n        this._highlightPosition = 0;\n        this._wasTap = true;\n        this._placeholderValue = this._generatePlaceholderValue();\n        this._baseId = generateId(passedElement, 'choices-');\n        /**\n         * setting direction in cases where it's explicitly set on passedElement\n         * or when calculated direction is different from the document\n         */\n        this._direction = passedElement.dir;\n        if (!this._direction) {\n            var elementDirection = window.getComputedStyle(passedElement).direction;\n            var documentDirection = window.getComputedStyle(document.documentElement).direction;\n            if (elementDirection !== documentDirection) {\n                this._direction = elementDirection;\n            }\n        }\n        this._idNames = {\n            itemChoice: 'item-choice',\n        };\n        this._templates = defaults.templates;\n        this._render = this._render.bind(this);\n        this._onFocus = this._onFocus.bind(this);\n        this._onBlur = this._onBlur.bind(this);\n        this._onKeyUp = this._onKeyUp.bind(this);\n        this._onKeyDown = this._onKeyDown.bind(this);\n        this._onInput = this._onInput.bind(this);\n        this._onClick = this._onClick.bind(this);\n        this._onTouchMove = this._onTouchMove.bind(this);\n        this._onTouchEnd = this._onTouchEnd.bind(this);\n        this._onMouseDown = this._onMouseDown.bind(this);\n        this._onMouseOver = this._onMouseOver.bind(this);\n        this._onFormReset = this._onFormReset.bind(this);\n        this._onSelectKey = this._onSelectKey.bind(this);\n        this._onEnterKey = this._onEnterKey.bind(this);\n        this._onEscapeKey = this._onEscapeKey.bind(this);\n        this._onDirectionKey = this._onDirectionKey.bind(this);\n        this._onDeleteKey = this._onDeleteKey.bind(this);\n        // If element has already been initialised with Choices, fail silently\n        if (this.passedElement.isActive) {\n            if (!config.silent) {\n                console.warn('Trying to initialise Choices on element already initialised', { element: element });\n            }\n            this.initialised = true;\n            this.initialisedOK = false;\n            return;\n        }\n        // Let's go\n        this.init();\n        // preserve the selected item list after setup for form reset\n        this._initialItems = this._store.items.map(function (choice) { return choice.value; });\n    }\n    Object.defineProperty(Choices, \"defaults\", {\n        get: function () {\n            return Object.preventExtensions({\n                get options() {\n                    return USER_DEFAULTS;\n                },\n                get allOptions() {\n                    return DEFAULT_CONFIG;\n                },\n                get templates() {\n                    return templates;\n                },\n            });\n        },\n        enumerable: false,\n        configurable: true\n    });\n    Choices.prototype.init = function () {\n        if (this.initialised || this.initialisedOK !== undefined) {\n            return;\n        }\n        this._searcher = getSearcher(this.config);\n        this._loadChoices();\n        this._createTemplates();\n        this._createElements();\n        this._createStructure();\n        if ((this._isTextElement && !this.config.addItems) ||\n            this.passedElement.element.hasAttribute('disabled') ||\n            !!this.passedElement.element.closest('fieldset:disabled')) {\n            this.disable();\n        }\n        else {\n            this.enable();\n            this._addEventListeners();\n        }\n        // should be triggered **after** disabled state to avoid additional re-draws\n        this._initStore();\n        this.initialised = true;\n        this.initialisedOK = true;\n        var callbackOnInit = this.config.callbackOnInit;\n        // Run callback if it is a function\n        if (typeof callbackOnInit === 'function') {\n            callbackOnInit.call(this);\n        }\n    };\n    Choices.prototype.destroy = function () {\n        if (!this.initialised) {\n            return;\n        }\n        this._removeEventListeners();\n        this.passedElement.reveal();\n        this.containerOuter.unwrap(this.passedElement.element);\n        this._store._listeners = []; // prevents select/input value being wiped\n        this.clearStore(false);\n        this._stopSearch();\n        this._templates = Choices.defaults.templates;\n        this.initialised = false;\n        this.initialisedOK = undefined;\n    };\n    Choices.prototype.enable = function () {\n        if (this.passedElement.isDisabled) {\n            this.passedElement.enable();\n        }\n        if (this.containerOuter.isDisabled) {\n            this._addEventListeners();\n            this.input.enable();\n            this.containerOuter.enable();\n        }\n        return this;\n    };\n    Choices.prototype.disable = function () {\n        if (!this.passedElement.isDisabled) {\n            this.passedElement.disable();\n        }\n        if (!this.containerOuter.isDisabled) {\n            this._removeEventListeners();\n            this.input.disable();\n            this.containerOuter.disable();\n        }\n        return this;\n    };\n    Choices.prototype.highlightItem = function (item, runEvent) {\n        if (runEvent === void 0) { runEvent = true; }\n        if (!item || !item.id) {\n            return this;\n        }\n        var choice = this._store.items.find(function (c) { return c.id === item.id; });\n        if (!choice || choice.highlighted) {\n            return this;\n        }\n        this._store.dispatch(highlightItem(choice, true));\n        if (runEvent) {\n            this.passedElement.triggerEvent(EventType.highlightItem, this._getChoiceForOutput(choice));\n        }\n        return this;\n    };\n    Choices.prototype.unhighlightItem = function (item, runEvent) {\n        if (runEvent === void 0) { runEvent = true; }\n        if (!item || !item.id) {\n            return this;\n        }\n        var choice = this._store.items.find(function (c) { return c.id === item.id; });\n        if (!choice || !choice.highlighted) {\n            return this;\n        }\n        this._store.dispatch(highlightItem(choice, false));\n        if (runEvent) {\n            this.passedElement.triggerEvent(EventType.unhighlightItem, this._getChoiceForOutput(choice));\n        }\n        return this;\n    };\n    Choices.prototype.highlightAll = function () {\n        var _this = this;\n        this._store.withTxn(function () {\n            _this._store.items.forEach(function (item) {\n                if (!item.highlighted) {\n                    _this._store.dispatch(highlightItem(item, true));\n                    _this.passedElement.triggerEvent(EventType.highlightItem, _this._getChoiceForOutput(item));\n                }\n            });\n        });\n        return this;\n    };\n    Choices.prototype.unhighlightAll = function () {\n        var _this = this;\n        this._store.withTxn(function () {\n            _this._store.items.forEach(function (item) {\n                if (item.highlighted) {\n                    _this._store.dispatch(highlightItem(item, false));\n                    _this.passedElement.triggerEvent(EventType.highlightItem, _this._getChoiceForOutput(item));\n                }\n            });\n        });\n        return this;\n    };\n    Choices.prototype.removeActiveItemsByValue = function (value) {\n        var _this = this;\n        this._store.withTxn(function () {\n            _this._store.items.filter(function (item) { return item.value === value; }).forEach(function (item) { return _this._removeItem(item); });\n        });\n        return this;\n    };\n    Choices.prototype.removeActiveItems = function (excludedId) {\n        var _this = this;\n        this._store.withTxn(function () {\n            _this._store.items.filter(function (_a) {\n                var id = _a.id;\n                return id !== excludedId;\n            }).forEach(function (item) { return _this._removeItem(item); });\n        });\n        return this;\n    };\n    Choices.prototype.removeHighlightedItems = function (runEvent) {\n        var _this = this;\n        if (runEvent === void 0) { runEvent = false; }\n        this._store.withTxn(function () {\n            _this._store.highlightedActiveItems.forEach(function (item) {\n                _this._removeItem(item);\n                // If this action was performed by the user\n                // trigger the event\n                if (runEvent) {\n                    _this._triggerChange(item.value);\n                }\n            });\n        });\n        return this;\n    };\n    Choices.prototype.showDropdown = function (preventInputFocus) {\n        var _this = this;\n        if (this.dropdown.isActive) {\n            return this;\n        }\n        if (preventInputFocus === undefined) {\n            // eslint-disable-next-line no-param-reassign\n            preventInputFocus = !this._canSearch;\n        }\n        requestAnimationFrame(function () {\n            _this.dropdown.show();\n            var rect = _this.dropdown.element.getBoundingClientRect();\n            _this.containerOuter.open(rect.bottom, rect.height);\n            if (!preventInputFocus) {\n                _this.input.focus();\n            }\n            _this.passedElement.triggerEvent(EventType.showDropdown);\n        });\n        return this;\n    };\n    Choices.prototype.hideDropdown = function (preventInputBlur) {\n        var _this = this;\n        if (!this.dropdown.isActive) {\n            return this;\n        }\n        requestAnimationFrame(function () {\n            _this.dropdown.hide();\n            _this.containerOuter.close();\n            if (!preventInputBlur && _this._canSearch) {\n                _this.input.removeActiveDescendant();\n                _this.input.blur();\n            }\n            _this.passedElement.triggerEvent(EventType.hideDropdown);\n        });\n        return this;\n    };\n    Choices.prototype.getValue = function (valueOnly) {\n        var _this = this;\n        var values = this._store.items.map(function (item) {\n            return (valueOnly ? item.value : _this._getChoiceForOutput(item));\n        });\n        return this._isSelectOneElement || this.config.singleModeForMultiSelect ? values[0] : values;\n    };\n    Choices.prototype.setValue = function (items) {\n        var _this = this;\n        if (!this.initialisedOK) {\n            this._warnChoicesInitFailed('setValue');\n            return this;\n        }\n        this._store.withTxn(function () {\n            items.forEach(function (value) {\n                if (value) {\n                    _this._addChoice(mapInputToChoice(value, false));\n                }\n            });\n        });\n        // @todo integrate with Store\n        this._searcher.reset();\n        return this;\n    };\n    Choices.prototype.setChoiceByValue = function (value) {\n        var _this = this;\n        if (!this.initialisedOK) {\n            this._warnChoicesInitFailed('setChoiceByValue');\n            return this;\n        }\n        if (this._isTextElement) {\n            return this;\n        }\n        this._store.withTxn(function () {\n            // If only one value has been passed, convert to array\n            var choiceValue = Array.isArray(value) ? value : [value];\n            // Loop through each value and\n            choiceValue.forEach(function (val) { return _this._findAndSelectChoiceByValue(val); });\n            _this.unhighlightAll();\n        });\n        // @todo integrate with Store\n        this._searcher.reset();\n        return this;\n    };\n    /**\n     * Set choices of select input via an array of objects (or function that returns array of object or promise of it),\n     * a value field name and a label field name.\n     * This behaves the same as passing items via the choices option but can be called after initialising Choices.\n     * This can also be used to add groups of choices (see example 2); Optionally pass a true `replaceChoices` value to remove any existing choices.\n     * Optionally pass a `customProperties` object to add additional data to your choices (useful when searching/filtering etc).\n     *\n     * **Input types affected:** select-one, select-multiple\n     *\n     * @example\n     * ```js\n     * const example = new Choices(element);\n     *\n     * example.setChoices([\n     *   {value: 'One', label: 'Label One', disabled: true},\n     *   {value: 'Two', label: 'Label Two', selected: true},\n     *   {value: 'Three', label: 'Label Three'},\n     * ], 'value', 'label', false);\n     * ```\n     *\n     * @example\n     * ```js\n     * const example = new Choices(element);\n     *\n     * example.setChoices(async () => {\n     *   try {\n     *      const items = await fetch('/items');\n     *      return items.json()\n     *   } catch(err) {\n     *      console.error(err)\n     *   }\n     * });\n     * ```\n     *\n     * @example\n     * ```js\n     * const example = new Choices(element);\n     *\n     * example.setChoices([{\n     *   label: 'Group one',\n     *   id: 1,\n     *   disabled: false,\n     *   choices: [\n     *     {value: 'Child One', label: 'Child One', selected: true},\n     *     {value: 'Child Two', label: 'Child Two',  disabled: true},\n     *     {value: 'Child Three', label: 'Child Three'},\n     *   ]\n     * },\n     * {\n     *   label: 'Group two',\n     *   id: 2,\n     *   disabled: false,\n     *   choices: [\n     *     {value: 'Child Four', label: 'Child Four', disabled: true},\n     *     {value: 'Child Five', label: 'Child Five'},\n     *     {value: 'Child Six', label: 'Child Six', customProperties: {\n     *       description: 'Custom description about child six',\n     *       random: 'Another random custom property'\n     *     }},\n     *   ]\n     * }], 'value', 'label', false);\n     * ```\n     */\n    Choices.prototype.setChoices = function (choicesArrayOrFetcher, value, label, replaceChoices, clearSearchFlag) {\n        var _this = this;\n        if (choicesArrayOrFetcher === void 0) { choicesArrayOrFetcher = []; }\n        if (value === void 0) { value = 'value'; }\n        if (label === void 0) { label = 'label'; }\n        if (replaceChoices === void 0) { replaceChoices = false; }\n        if (clearSearchFlag === void 0) { clearSearchFlag = true; }\n        if (!this.initialisedOK) {\n            this._warnChoicesInitFailed('setChoices');\n            return this;\n        }\n        if (!this._isSelectElement) {\n            throw new TypeError(\"setChoices can't be used with INPUT based Choices\");\n        }\n        if (typeof value !== 'string' || !value) {\n            throw new TypeError(\"value parameter must be a name of 'value' field in passed objects\");\n        }\n        // Clear choices if needed\n        if (replaceChoices) {\n            this.clearChoices();\n        }\n        if (typeof choicesArrayOrFetcher === 'function') {\n            // it's a choices fetcher function\n            var fetcher_1 = choicesArrayOrFetcher(this);\n            if (typeof Promise === 'function' && fetcher_1 instanceof Promise) {\n                // that's a promise\n                // eslint-disable-next-line no-promise-executor-return\n                return new Promise(function (resolve) { return requestAnimationFrame(resolve); })\n                    .then(function () { return _this._handleLoadingState(true); })\n                    .then(function () { return fetcher_1; })\n                    .then(function (data) { return _this.setChoices(data, value, label, replaceChoices); })\n                    .catch(function (err) {\n                    if (!_this.config.silent) {\n                        console.error(err);\n                    }\n                })\n                    .then(function () { return _this._handleLoadingState(false); })\n                    .then(function () { return _this; });\n            }\n            // function returned something else than promise, let's check if it's an array of choices\n            if (!Array.isArray(fetcher_1)) {\n                throw new TypeError(\".setChoices first argument function must return either array of choices or Promise, got: \".concat(typeof fetcher_1));\n            }\n            // recursion with results, it's sync and choices were cleared already\n            return this.setChoices(fetcher_1, value, label, false);\n        }\n        if (!Array.isArray(choicesArrayOrFetcher)) {\n            throw new TypeError(\".setChoices must be called either with array of choices with a function resulting into Promise of array of choices\");\n        }\n        this.containerOuter.removeLoadingState();\n        this._store.withTxn(function () {\n            if (clearSearchFlag) {\n                _this._isSearching = false;\n            }\n            var isDefaultValue = value === 'value';\n            var isDefaultLabel = label === 'label';\n            choicesArrayOrFetcher.forEach(function (groupOrChoice) {\n                if ('choices' in groupOrChoice) {\n                    var group = groupOrChoice;\n                    if (!isDefaultLabel) {\n                        group = __assign(__assign({}, group), { label: group[label] });\n                    }\n                    _this._addGroup(mapInputToChoice(group, true));\n                }\n                else {\n                    var choice = groupOrChoice;\n                    if (!isDefaultLabel || !isDefaultValue) {\n                        choice = __assign(__assign({}, choice), { value: choice[value], label: choice[label] });\n                    }\n                    _this._addChoice(mapInputToChoice(choice, false));\n                }\n            });\n            _this.unhighlightAll();\n        });\n        // @todo integrate with Store\n        this._searcher.reset();\n        return this;\n    };\n    Choices.prototype.refresh = function (withEvents, selectFirstOption, deselectAll) {\n        var _this = this;\n        if (withEvents === void 0) { withEvents = false; }\n        if (selectFirstOption === void 0) { selectFirstOption = false; }\n        if (deselectAll === void 0) { deselectAll = false; }\n        if (!this._isSelectElement) {\n            if (!this.config.silent) {\n                console.warn('refresh method can only be used on choices backed by a <select> element');\n            }\n            return this;\n        }\n        this._store.withTxn(function () {\n            var choicesFromOptions = _this.passedElement.optionsAsChoices();\n            // Build the list of items which require preserving\n            var existingItems = {};\n            if (!deselectAll) {\n                _this._store.items.forEach(function (choice) {\n                    if (choice.id && choice.active && choice.selected && !choice.disabled) {\n                        existingItems[choice.value] = true;\n                    }\n                });\n            }\n            _this.clearStore(false);\n            var updateChoice = function (choice) {\n                if (deselectAll) {\n                    _this._store.dispatch(removeItem$1(choice));\n                }\n                else if (existingItems[choice.value]) {\n                    choice.selected = true;\n                }\n            };\n            choicesFromOptions.forEach(function (groupOrChoice) {\n                if ('choices' in groupOrChoice) {\n                    groupOrChoice.choices.forEach(updateChoice);\n                    return;\n                }\n                updateChoice(groupOrChoice);\n            });\n            /* @todo only generate add events for the added options instead of all\n            if (withEvents) {\n              items.forEach((choice) => {\n                if (existingItems[choice.value]) {\n                  this.passedElement.triggerEvent(\n                    EventType.removeItem,\n                    this._getChoiceForEvent(choice),\n                  );\n                }\n              });\n            }\n            */\n            // load new choices & items\n            _this._addPredefinedChoices(choicesFromOptions, selectFirstOption, withEvents);\n            // re-do search if required\n            if (_this._isSearching) {\n                _this._searchChoices(_this.input.value);\n            }\n        });\n        return this;\n    };\n    Choices.prototype.removeChoice = function (value) {\n        var choice = this._store.choices.find(function (c) { return c.value === value; });\n        if (!choice) {\n            return this;\n        }\n        this._clearNotice();\n        this._store.dispatch(removeChoice(choice));\n        // @todo integrate with Store\n        this._searcher.reset();\n        if (choice.selected) {\n            this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(choice));\n        }\n        return this;\n    };\n    Choices.prototype.clearChoices = function () {\n        var _this = this;\n        this._store.withTxn(function () {\n            _this._store.choices.forEach(function (choice) {\n                if (!choice.selected) {\n                    _this._store.dispatch(removeChoice(choice));\n                }\n            });\n        });\n        // @todo integrate with Store\n        this._searcher.reset();\n        return this;\n    };\n    Choices.prototype.clearStore = function (clearOptions) {\n        if (clearOptions === void 0) { clearOptions = true; }\n        this._stopSearch();\n        if (clearOptions) {\n            this.passedElement.element.replaceChildren('');\n        }\n        this.itemList.element.replaceChildren('');\n        this.choiceList.element.replaceChildren('');\n        this._clearNotice();\n        this._store.reset();\n        this._lastAddedChoiceId = 0;\n        this._lastAddedGroupId = 0;\n        // @todo integrate with Store\n        this._searcher.reset();\n        return this;\n    };\n    Choices.prototype.clearInput = function () {\n        var shouldSetInputWidth = !this._isSelectOneElement;\n        this.input.clear(shouldSetInputWidth);\n        this._stopSearch();\n        return this;\n    };\n    Choices.prototype._validateConfig = function () {\n        var config = this.config;\n        var invalidConfigOptions = diff(config, DEFAULT_CONFIG);\n        if (invalidConfigOptions.length) {\n            console.warn('Unknown config option(s) passed', invalidConfigOptions.join(', '));\n        }\n        if (config.allowHTML && config.allowHtmlUserInput) {\n            if (config.addItems) {\n                console.warn('Warning: allowHTML/allowHtmlUserInput/addItems all being true is strongly not recommended and may lead to XSS attacks');\n            }\n            if (config.addChoices) {\n                console.warn('Warning: allowHTML/allowHtmlUserInput/addChoices all being true is strongly not recommended and may lead to XSS attacks');\n            }\n        }\n    };\n    Choices.prototype._render = function (changes) {\n        if (changes === void 0) { changes = { choices: true, groups: true, items: true }; }\n        if (this._store.inTxn()) {\n            return;\n        }\n        if (this._isSelectElement) {\n            if (changes.choices || changes.groups) {\n                this._renderChoices();\n            }\n        }\n        if (changes.items) {\n            this._renderItems();\n        }\n    };\n    Choices.prototype._renderChoices = function () {\n        var _this = this;\n        if (!this._canAddItems()) {\n            return; // block rendering choices if the input limit is reached.\n        }\n        var _a = this, config = _a.config, isSearching = _a._isSearching;\n        var _b = this._store, activeGroups = _b.activeGroups, activeChoices = _b.activeChoices;\n        var renderLimit = 0;\n        if (isSearching && config.searchResultLimit > 0) {\n            renderLimit = config.searchResultLimit;\n        }\n        else if (config.renderChoiceLimit > 0) {\n            renderLimit = config.renderChoiceLimit;\n        }\n        if (this._isSelectElement) {\n            var backingOptions = activeChoices.filter(function (choice) { return !choice.element; });\n            if (backingOptions.length) {\n                this.passedElement.addOptions(backingOptions);\n            }\n        }\n        var fragment = document.createDocumentFragment();\n        var renderableChoices = function (choices) {\n            return choices.filter(function (choice) {\n                return !choice.placeholder && (isSearching ? !!choice.rank : config.renderSelectedChoices || !choice.selected);\n            });\n        };\n        var selectableChoices = false;\n        var renderChoices = function (choices, withinGroup, groupLabel) {\n            if (isSearching) {\n                // sortByRank is used to ensure stable sorting, as scores are non-unique\n                // this additionally ensures fuseOptions.sortFn is not ignored\n                choices.sort(sortByRank);\n            }\n            else if (config.shouldSort) {\n                choices.sort(config.sorter);\n            }\n            var choiceLimit = choices.length;\n            choiceLimit = !withinGroup && renderLimit && choiceLimit > renderLimit ? renderLimit : choiceLimit;\n            choiceLimit--;\n            choices.every(function (choice, index) {\n                // choiceEl being empty signals the contents has probably significantly changed\n                var dropdownItem = choice.choiceEl || _this._templates.choice(config, choice, config.itemSelectText, groupLabel);\n                choice.choiceEl = dropdownItem;\n                fragment.appendChild(dropdownItem);\n                if (!choice.disabled && (isSearching || !choice.selected)) {\n                    selectableChoices = true;\n                }\n                return index < choiceLimit;\n            });\n        };\n        if (activeChoices.length) {\n            if (config.resetScrollPosition) {\n                requestAnimationFrame(function () { return _this.choiceList.scrollToTop(); });\n            }\n            if (!this._hasNonChoicePlaceholder && !isSearching && this._isSelectOneElement) {\n                // If we have a placeholder choice along with groups\n                renderChoices(activeChoices.filter(function (choice) { return choice.placeholder && !choice.group; }), false, undefined);\n            }\n            // If we have grouped options\n            if (activeGroups.length && !isSearching) {\n                if (config.shouldSort) {\n                    activeGroups.sort(config.sorter);\n                }\n                // render Choices without group first, regardless of sort, otherwise they won't be distinguishable\n                // from the last group\n                renderChoices(activeChoices.filter(function (choice) { return !choice.placeholder && !choice.group; }), false, undefined);\n                activeGroups.forEach(function (group) {\n                    var groupChoices = renderableChoices(group.choices);\n                    if (groupChoices.length) {\n                        if (group.label) {\n                            var dropdownGroup = group.groupEl || _this._templates.choiceGroup(_this.config, group);\n                            group.groupEl = dropdownGroup;\n                            dropdownGroup.remove();\n                            fragment.appendChild(dropdownGroup);\n                        }\n                        renderChoices(groupChoices, true, config.appendGroupInSearch && isSearching ? group.label : undefined);\n                    }\n                });\n            }\n            else {\n                renderChoices(renderableChoices(activeChoices), false, undefined);\n            }\n        }\n        if (!selectableChoices) {\n            if (!this._notice) {\n                this._notice = {\n                    text: resolveStringFunction(isSearching ? config.noResultsText : config.noChoicesText),\n                    type: isSearching ? NoticeTypes.noResults : NoticeTypes.noChoices,\n                };\n            }\n            fragment.replaceChildren('');\n        }\n        this._renderNotice(fragment);\n        this.choiceList.element.replaceChildren(fragment);\n        if (selectableChoices) {\n            this._highlightChoice();\n        }\n    };\n    Choices.prototype._renderItems = function () {\n        var _this = this;\n        var items = this._store.items || [];\n        var itemList = this.itemList.element;\n        var config = this.config;\n        var fragment = document.createDocumentFragment();\n        var itemFromList = function (item) {\n            return itemList.querySelector(\"[data-item][data-id=\\\"\".concat(item.id, \"\\\"]\"));\n        };\n        var addItemToFragment = function (item) {\n            var el = item.itemEl;\n            if (el && el.parentElement) {\n                return;\n            }\n            el = itemFromList(item) || _this._templates.item(config, item, config.removeItemButton);\n            item.itemEl = el;\n            fragment.appendChild(el);\n        };\n        // new items\n        items.forEach(addItemToFragment);\n        var addItems = !!fragment.childNodes.length;\n        if (this._isSelectOneElement && this._hasNonChoicePlaceholder) {\n            var existingItems = itemList.children.length;\n            if (addItems || existingItems > 1) {\n                var placeholder = itemList.querySelector(getClassNamesSelector(config.classNames.placeholder));\n                if (placeholder) {\n                    placeholder.remove();\n                }\n            }\n            else if (!existingItems) {\n                addItems = true;\n                addItemToFragment(mapInputToChoice({\n                    selected: true,\n                    value: '',\n                    label: config.placeholderValue || '',\n                    placeholder: true,\n                }, false));\n            }\n        }\n        if (addItems) {\n            itemList.append(fragment);\n            if (config.shouldSortItems && !this._isSelectOneElement) {\n                items.sort(config.sorter);\n                // push sorting into the DOM\n                items.forEach(function (item) {\n                    var el = itemFromList(item);\n                    if (el) {\n                        el.remove();\n                        fragment.append(el);\n                    }\n                });\n                itemList.append(fragment);\n            }\n        }\n        if (this._isTextElement) {\n            // Update the value of the hidden input\n            this.passedElement.value = items.map(function (_a) {\n                var value = _a.value;\n                return value;\n            }).join(config.delimiter);\n        }\n    };\n    Choices.prototype._displayNotice = function (text, type, openDropdown) {\n        if (openDropdown === void 0) { openDropdown = true; }\n        var oldNotice = this._notice;\n        if (oldNotice &&\n            ((oldNotice.type === type && oldNotice.text === text) ||\n                (oldNotice.type === NoticeTypes.addChoice &&\n                    (type === NoticeTypes.noResults || type === NoticeTypes.noChoices)))) {\n            if (openDropdown) {\n                this.showDropdown(true);\n            }\n            return;\n        }\n        this._clearNotice();\n        this._notice = text\n            ? {\n                text: text,\n                type: type,\n            }\n            : undefined;\n        this._renderNotice();\n        if (openDropdown && text) {\n            this.showDropdown(true);\n        }\n    };\n    Choices.prototype._clearNotice = function () {\n        if (!this._notice) {\n            return;\n        }\n        var noticeElement = this.choiceList.element.querySelector(getClassNamesSelector(this.config.classNames.notice));\n        if (noticeElement) {\n            noticeElement.remove();\n        }\n        this._notice = undefined;\n    };\n    Choices.prototype._renderNotice = function (fragment) {\n        var noticeConf = this._notice;\n        if (noticeConf) {\n            var notice = this._templates.notice(this.config, noticeConf.text, noticeConf.type);\n            if (fragment) {\n                fragment.append(notice);\n            }\n            else {\n                this.choiceList.prepend(notice);\n            }\n        }\n    };\n    // eslint-disable-next-line class-methods-use-this\n    Choices.prototype._getChoiceForOutput = function (choice, keyCode) {\n        return {\n            id: choice.id,\n            highlighted: choice.highlighted,\n            labelClass: choice.labelClass,\n            labelDescription: choice.labelDescription,\n            customProperties: choice.customProperties,\n            disabled: choice.disabled,\n            active: choice.active,\n            label: choice.label,\n            placeholder: choice.placeholder,\n            value: choice.value,\n            groupValue: choice.group ? choice.group.label : undefined,\n            element: choice.element,\n            keyCode: keyCode,\n        };\n    };\n    Choices.prototype._triggerChange = function (value) {\n        if (value === undefined || value === null) {\n            return;\n        }\n        this.passedElement.triggerEvent(EventType.change, {\n            value: value,\n        });\n    };\n    Choices.prototype._handleButtonAction = function (element) {\n        var _this = this;\n        var items = this._store.items;\n        if (!items.length || !this.config.removeItems || !this.config.removeItemButton) {\n            return;\n        }\n        var id = element && parseDataSetId(element.parentElement);\n        var itemToRemove = id && items.find(function (item) { return item.id === id; });\n        if (!itemToRemove) {\n            return;\n        }\n        this._store.withTxn(function () {\n            // Remove item associated with button\n            _this._removeItem(itemToRemove);\n            _this._triggerChange(itemToRemove.value);\n            if (_this._isSelectOneElement && !_this._hasNonChoicePlaceholder) {\n                var placeholderChoice = _this._store.choices\n                    .reverse()\n                    .find(function (choice) { return !choice.disabled && choice.placeholder; });\n                if (placeholderChoice) {\n                    _this._addItem(placeholderChoice);\n                    _this.unhighlightAll();\n                    if (placeholderChoice.value) {\n                        _this._triggerChange(placeholderChoice.value);\n                    }\n                }\n            }\n        });\n    };\n    Choices.prototype._handleItemAction = function (element, hasShiftKey) {\n        var _this = this;\n        if (hasShiftKey === void 0) { hasShiftKey = false; }\n        var items = this._store.items;\n        if (!items.length || !this.config.removeItems || this._isSelectOneElement) {\n            return;\n        }\n        var id = parseDataSetId(element);\n        if (!id) {\n            return;\n        }\n        // We only want to select one item with a click\n        // so we deselect any items that aren't the target\n        // unless shift is being pressed\n        items.forEach(function (item) {\n            if (item.id === id && !item.highlighted) {\n                _this.highlightItem(item);\n            }\n            else if (!hasShiftKey && item.highlighted) {\n                _this.unhighlightItem(item);\n            }\n        });\n        // Focus input as without focus, a user cannot do anything with a\n        // highlighted item\n        this.input.focus();\n    };\n    Choices.prototype._handleChoiceAction = function (element) {\n        var _this = this;\n        // If we are clicking on an option\n        var id = parseDataSetId(element);\n        var choice = id && this._store.getChoiceById(id);\n        if (!choice || choice.disabled) {\n            return false;\n        }\n        var hasActiveDropdown = this.dropdown.isActive;\n        if (!choice.selected) {\n            if (!this._canAddItems()) {\n                return true; // causes _onEnterKey to early out\n            }\n            this._store.withTxn(function () {\n                _this._addItem(choice, true, true);\n                _this.clearInput();\n                _this.unhighlightAll();\n            });\n            this._triggerChange(choice.value);\n        }\n        // We want to close the dropdown if we are dealing with a single select box\n        if (hasActiveDropdown && this.config.closeDropdownOnSelect) {\n            this.hideDropdown(true);\n            this.containerOuter.element.focus();\n        }\n        return true;\n    };\n    Choices.prototype._handleBackspace = function (items) {\n        var config = this.config;\n        if (!config.removeItems || !items.length) {\n            return;\n        }\n        var lastItem = items[items.length - 1];\n        var hasHighlightedItems = items.some(function (item) { return item.highlighted; });\n        // If editing the last item is allowed and there are not other selected items,\n        // we can edit the item value. Otherwise if we can remove items, remove all selected items\n        if (config.editItems && !hasHighlightedItems && lastItem) {\n            this.input.value = lastItem.value;\n            this.input.setWidth();\n            this._removeItem(lastItem);\n            this._triggerChange(lastItem.value);\n        }\n        else {\n            if (!hasHighlightedItems) {\n                // Highlight last item if none already highlighted\n                this.highlightItem(lastItem, false);\n            }\n            this.removeHighlightedItems(true);\n        }\n    };\n    Choices.prototype._loadChoices = function () {\n        var _a;\n        var _this = this;\n        var config = this.config;\n        if (this._isTextElement) {\n            // Assign preset items from passed object first\n            this._presetChoices = config.items.map(function (e) { return mapInputToChoice(e, false); });\n            // Add any values passed from attribute\n            if (this.passedElement.value) {\n                var elementItems = this.passedElement.value\n                    .split(config.delimiter)\n                    .map(function (e) { return mapInputToChoice(e, false, _this.config.allowHtmlUserInput); });\n                this._presetChoices = this._presetChoices.concat(elementItems);\n            }\n            this._presetChoices.forEach(function (choice) {\n                choice.selected = true;\n            });\n        }\n        else if (this._isSelectElement) {\n            // Assign preset choices from passed object\n            this._presetChoices = config.choices.map(function (e) { return mapInputToChoice(e, true); });\n            // Create array of choices from option elements\n            var choicesFromOptions = this.passedElement.optionsAsChoices();\n            if (choicesFromOptions) {\n                (_a = this._presetChoices).push.apply(_a, choicesFromOptions);\n            }\n        }\n    };\n    Choices.prototype._handleLoadingState = function (setLoading) {\n        if (setLoading === void 0) { setLoading = true; }\n        var el = this.itemList.element;\n        if (setLoading) {\n            this.disable();\n            this.containerOuter.addLoadingState();\n            if (this._isSelectOneElement) {\n                el.replaceChildren(this._templates.placeholder(this.config, this.config.loadingText));\n            }\n            else {\n                this.input.placeholder = this.config.loadingText;\n            }\n        }\n        else {\n            this.enable();\n            this.containerOuter.removeLoadingState();\n            if (this._isSelectOneElement) {\n                el.replaceChildren('');\n                this._render();\n            }\n            else {\n                this.input.placeholder = this._placeholderValue || '';\n            }\n        }\n    };\n    Choices.prototype._handleSearch = function (value) {\n        if (!this.input.isFocussed) {\n            return;\n        }\n        // Check that we have a value to search and the input was an alphanumeric character\n        if (value !== null && typeof value !== 'undefined' && value.length >= this.config.searchFloor) {\n            var resultCount = this.config.searchChoices ? this._searchChoices(value) : 0;\n            if (resultCount !== null) {\n                // Trigger search event\n                this.passedElement.triggerEvent(EventType.search, {\n                    value: value,\n                    resultCount: resultCount,\n                });\n            }\n        }\n        else if (this._store.choices.some(function (option) { return !option.active; })) {\n            this._stopSearch();\n        }\n    };\n    Choices.prototype._canAddItems = function () {\n        var config = this.config;\n        var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;\n        if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {\n            this.choiceList.element.replaceChildren('');\n            this._notice = undefined;\n            this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);\n            return false;\n        }\n        return true;\n    };\n    Choices.prototype._canCreateItem = function (value) {\n        var config = this.config;\n        var canAddItem = true;\n        var notice = '';\n        if (canAddItem && typeof config.addItemFilter === 'function' && !config.addItemFilter(value)) {\n            canAddItem = false;\n            notice = resolveNoticeFunction(config.customAddItemText, value);\n        }\n        if (canAddItem) {\n            var foundChoice = this._store.choices.find(function (choice) { return config.valueComparer(choice.value, value); });\n            if (this._isSelectElement) {\n                // for exact matches, do not prompt to add it as a custom choice\n                if (foundChoice) {\n                    this._displayNotice('', NoticeTypes.addChoice);\n                    return false;\n                }\n            }\n            else if (this._isTextElement && !config.duplicateItemsAllowed) {\n                if (foundChoice) {\n                    canAddItem = false;\n                    notice = resolveNoticeFunction(config.uniqueItemText, value);\n                }\n            }\n        }\n        if (canAddItem) {\n            notice = resolveNoticeFunction(config.addItemText, value);\n        }\n        if (notice) {\n            this._displayNotice(notice, NoticeTypes.addChoice);\n        }\n        return canAddItem;\n    };\n    Choices.prototype._searchChoices = function (value) {\n        var newValue = value.trim().replace(/\\s{2,}/, ' ');\n        // signal input didn't change search\n        if (!newValue.length || newValue === this._currentValue) {\n            return null;\n        }\n        var searcher = this._searcher;\n        if (searcher.isEmptyIndex()) {\n            searcher.index(this._store.searchableChoices);\n        }\n        // If new value matches the desired length and is not the same as the current value with a space\n        var results = searcher.search(newValue);\n        this._currentValue = newValue;\n        this._highlightPosition = 0;\n        this._isSearching = true;\n        var notice = this._notice;\n        var noticeType = notice && notice.type;\n        if (noticeType !== NoticeTypes.addChoice) {\n            if (!results.length) {\n                this._displayNotice(resolveStringFunction(this.config.noResultsText), NoticeTypes.noResults);\n            }\n            else {\n                this._clearNotice();\n            }\n        }\n        this._store.dispatch(filterChoices(results));\n        return results.length;\n    };\n    Choices.prototype._stopSearch = function () {\n        if (this._isSearching) {\n            this._currentValue = '';\n            this._isSearching = false;\n            this._clearNotice();\n            this._store.dispatch(activateChoices(true));\n            this.passedElement.triggerEvent(EventType.search, {\n                value: '',\n                resultCount: 0,\n            });\n        }\n    };\n    Choices.prototype._addEventListeners = function () {\n        var documentElement = this._docRoot;\n        var outerElement = this.containerOuter.element;\n        var inputElement = this.input.element;\n        // capture events - can cancel event processing or propagation\n        documentElement.addEventListener('touchend', this._onTouchEnd, true);\n        outerElement.addEventListener('keydown', this._onKeyDown, true);\n        outerElement.addEventListener('mousedown', this._onMouseDown, true);\n        // passive events - doesn't call `preventDefault` or `stopPropagation`\n        documentElement.addEventListener('click', this._onClick, { passive: true });\n        documentElement.addEventListener('touchmove', this._onTouchMove, {\n            passive: true,\n        });\n        this.dropdown.element.addEventListener('mouseover', this._onMouseOver, {\n            passive: true,\n        });\n        if (this._isSelectOneElement) {\n            outerElement.addEventListener('focus', this._onFocus, {\n                passive: true,\n            });\n            outerElement.addEventListener('blur', this._onBlur, {\n                passive: true,\n            });\n        }\n        inputElement.addEventListener('keyup', this._onKeyUp, {\n            passive: true,\n        });\n        inputElement.addEventListener('input', this._onInput, {\n            passive: true,\n        });\n        inputElement.addEventListener('focus', this._onFocus, {\n            passive: true,\n        });\n        inputElement.addEventListener('blur', this._onBlur, {\n            passive: true,\n        });\n        if (inputElement.form) {\n            inputElement.form.addEventListener('reset', this._onFormReset, {\n                passive: true,\n            });\n        }\n        this.input.addEventListeners();\n    };\n    Choices.prototype._removeEventListeners = function () {\n        var documentElement = this._docRoot;\n        var outerElement = this.containerOuter.element;\n        var inputElement = this.input.element;\n        documentElement.removeEventListener('touchend', this._onTouchEnd, true);\n        outerElement.removeEventListener('keydown', this._onKeyDown, true);\n        outerElement.removeEventListener('mousedown', this._onMouseDown, true);\n        documentElement.removeEventListener('click', this._onClick);\n        documentElement.removeEventListener('touchmove', this._onTouchMove);\n        this.dropdown.element.removeEventListener('mouseover', this._onMouseOver);\n        if (this._isSelectOneElement) {\n            outerElement.removeEventListener('focus', this._onFocus);\n            outerElement.removeEventListener('blur', this._onBlur);\n        }\n        inputElement.removeEventListener('keyup', this._onKeyUp);\n        inputElement.removeEventListener('input', this._onInput);\n        inputElement.removeEventListener('focus', this._onFocus);\n        inputElement.removeEventListener('blur', this._onBlur);\n        if (inputElement.form) {\n            inputElement.form.removeEventListener('reset', this._onFormReset);\n        }\n        this.input.removeEventListeners();\n    };\n    Choices.prototype._onKeyDown = function (event) {\n        var keyCode = event.keyCode;\n        var hasActiveDropdown = this.dropdown.isActive;\n        /*\n        See:\n        https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n        https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values\n        https://en.wikipedia.org/wiki/UTF-16#Code_points_from_U+010000_to_U+10FFFF - UTF-16 surrogate pairs\n        https://stackoverflow.com/a/70866532 - \"Unidentified\" for mobile\n        http://www.unicode.org/versions/Unicode5.2.0/ch16.pdf#G19635 - U+FFFF is reserved (Section 16.7)\n    \n        Logic: when a key event is sent, `event.key` represents its printable value _or_ one\n        of a large list of special values indicating meta keys/functionality. In addition,\n        key events for compose functionality contain a value of `Dead` when mid-composition.\n    \n        I can't quite verify it, but non-English IMEs may also be able to generate key codes\n        for code points in the surrogate-pair range, which could potentially be seen as having\n        key.length > 1. Since `Fn` is one of the special keys, we can't distinguish by that\n        alone.\n    \n        Here, key.length === 1 means we know for sure the input was printable and not a special\n        `key` value. When the length is greater than 1, it could be either a printable surrogate\n        pair or a special `key` value. We can tell the difference by checking if the _character\n        code_ value (not code point!) is in the \"surrogate pair\" range or not.\n    \n        We don't use .codePointAt because an invalid code point would return 65535, which wouldn't\n        pass the >= 0x10000 check we would otherwise use.\n    \n        > ...The Unicode Standard sets aside 66 noncharacter code points. The last two code points\n        > of each plane are noncharacters: U+FFFE and U+FFFF on the BMP...\n        */\n        var wasPrintableChar = event.key.length === 1 ||\n            (event.key.length === 2 && event.key.charCodeAt(0) >= 0xd800) ||\n            event.key === 'Unidentified';\n        /*\n          We do not show the dropdown if focusing out with esc or navigating through input fields.\n          An activated search can still be opened with any other key.\n         */\n        if (!this._isTextElement &&\n            !hasActiveDropdown &&\n            keyCode !== KeyCodeMap.ESC_KEY &&\n            keyCode !== KeyCodeMap.TAB_KEY &&\n            keyCode !== KeyCodeMap.SHIFT_KEY) {\n            this.showDropdown();\n            if (!this.input.isFocussed && wasPrintableChar) {\n                /*\n                  We update the input value with the pressed key as\n                  the input was not focussed at the time of key press\n                  therefore does not have the value of the key.\n                */\n                this.input.value += event.key;\n                // browsers interpret a space as pagedown\n                if (event.key === ' ') {\n                    event.preventDefault();\n                }\n            }\n        }\n        switch (keyCode) {\n            case KeyCodeMap.A_KEY:\n                return this._onSelectKey(event, this.itemList.element.hasChildNodes());\n            case KeyCodeMap.ENTER_KEY:\n                return this._onEnterKey(event, hasActiveDropdown);\n            case KeyCodeMap.ESC_KEY:\n                return this._onEscapeKey(event, hasActiveDropdown);\n            case KeyCodeMap.UP_KEY:\n            case KeyCodeMap.PAGE_UP_KEY:\n            case KeyCodeMap.DOWN_KEY:\n            case KeyCodeMap.PAGE_DOWN_KEY:\n                return this._onDirectionKey(event, hasActiveDropdown);\n            case KeyCodeMap.DELETE_KEY:\n            case KeyCodeMap.BACK_KEY:\n                return this._onDeleteKey(event, this._store.items, this.input.isFocussed);\n        }\n    };\n    Choices.prototype._onKeyUp = function ( /* event: KeyboardEvent */) {\n        this._canSearch = this.config.searchEnabled;\n    };\n    Choices.prototype._onInput = function ( /* event: InputEvent */) {\n        var value = this.input.value;\n        if (!value) {\n            if (this._isTextElement) {\n                this.hideDropdown(true);\n            }\n            else {\n                this._stopSearch();\n            }\n            return;\n        }\n        if (!this._canAddItems()) {\n            return;\n        }\n        if (this._canSearch) {\n            // do the search even if the entered text can not be added\n            this._handleSearch(value);\n        }\n        if (!this._canAddUserChoices) {\n            return;\n        }\n        // determine if a notice needs to be displayed for why a search result can't be added\n        this._canCreateItem(value);\n        if (this._isSelectElement) {\n            this._highlightPosition = 0; // reset to select the notice and/or exact match\n            this._highlightChoice();\n        }\n    };\n    Choices.prototype._onSelectKey = function (event, hasItems) {\n        // If CTRL + A or CMD + A have been pressed and there are items to select\n        if ((event.ctrlKey || event.metaKey) && hasItems) {\n            this._canSearch = false;\n            var shouldHightlightAll = this.config.removeItems && !this.input.value && this.input.element === document.activeElement;\n            if (shouldHightlightAll) {\n                this.highlightAll();\n            }\n        }\n    };\n    Choices.prototype._onEnterKey = function (event, hasActiveDropdown) {\n        var _this = this;\n        var value = this.input.value;\n        var target = event.target;\n        event.preventDefault();\n        if (target && target.hasAttribute('data-button')) {\n            this._handleButtonAction(target);\n            return;\n        }\n        if (!hasActiveDropdown) {\n            if (this._isSelectElement || this._notice) {\n                this.showDropdown();\n            }\n            return;\n        }\n        var highlightedChoice = this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.highlightedState));\n        if (highlightedChoice && this._handleChoiceAction(highlightedChoice)) {\n            return;\n        }\n        if (!target || !value) {\n            this.hideDropdown(true);\n            return;\n        }\n        if (!this._canAddItems()) {\n            return;\n        }\n        var addedItem = false;\n        this._store.withTxn(function () {\n            addedItem = _this._findAndSelectChoiceByValue(value, true);\n            if (!addedItem) {\n                if (!_this._canAddUserChoices) {\n                    return;\n                }\n                if (!_this._canCreateItem(value)) {\n                    return;\n                }\n                _this._addChoice(mapInputToChoice(value, false, _this.config.allowHtmlUserInput), true, true);\n                addedItem = true;\n            }\n            _this.clearInput();\n            _this.unhighlightAll();\n        });\n        if (!addedItem) {\n            return;\n        }\n        this._triggerChange(value);\n        if (this.config.closeDropdownOnSelect) {\n            this.hideDropdown(true);\n        }\n    };\n    Choices.prototype._onEscapeKey = function (event, hasActiveDropdown) {\n        if (hasActiveDropdown) {\n            event.stopPropagation();\n            this.hideDropdown(true);\n            this._stopSearch();\n            this.containerOuter.element.focus();\n        }\n    };\n    Choices.prototype._onDirectionKey = function (event, hasActiveDropdown) {\n        var keyCode = event.keyCode;\n        // If up or down key is pressed, traverse through options\n        if (hasActiveDropdown || this._isSelectOneElement) {\n            this.showDropdown();\n            this._canSearch = false;\n            var directionInt = keyCode === KeyCodeMap.DOWN_KEY || keyCode === KeyCodeMap.PAGE_DOWN_KEY ? 1 : -1;\n            var skipKey = event.metaKey || keyCode === KeyCodeMap.PAGE_DOWN_KEY || keyCode === KeyCodeMap.PAGE_UP_KEY;\n            var nextEl = void 0;\n            if (skipKey) {\n                if (directionInt > 0) {\n                    nextEl = this.dropdown.element.querySelector(\"\".concat(selectableChoiceIdentifier, \":last-of-type\"));\n                }\n                else {\n                    nextEl = this.dropdown.element.querySelector(selectableChoiceIdentifier);\n                }\n            }\n            else {\n                var currentEl = this.dropdown.element.querySelector(getClassNamesSelector(this.config.classNames.highlightedState));\n                if (currentEl) {\n                    nextEl = getAdjacentEl(currentEl, selectableChoiceIdentifier, directionInt);\n                }\n                else {\n                    nextEl = this.dropdown.element.querySelector(selectableChoiceIdentifier);\n                }\n            }\n            if (nextEl) {\n                // We prevent default to stop the cursor moving\n                // when pressing the arrow\n                if (!isScrolledIntoView(nextEl, this.choiceList.element, directionInt)) {\n                    this.choiceList.scrollToChildElement(nextEl, directionInt);\n                }\n                this._highlightChoice(nextEl);\n            }\n            // Prevent default to maintain cursor position whilst\n            // traversing dropdown options\n            event.preventDefault();\n        }\n    };\n    Choices.prototype._onDeleteKey = function (event, items, hasFocusedInput) {\n        // If backspace or delete key is pressed and the input has no value\n        if (!this._isSelectOneElement && !event.target.value && hasFocusedInput) {\n            this._handleBackspace(items);\n            event.preventDefault();\n        }\n    };\n    Choices.prototype._onTouchMove = function () {\n        if (this._wasTap) {\n            this._wasTap = false;\n        }\n    };\n    Choices.prototype._onTouchEnd = function (event) {\n        var target = (event || event.touches[0]).target;\n        var touchWasWithinContainer = this._wasTap && this.containerOuter.element.contains(target);\n        if (touchWasWithinContainer) {\n            var containerWasExactTarget = target === this.containerOuter.element || target === this.containerInner.element;\n            if (containerWasExactTarget) {\n                if (this._isTextElement) {\n                    this.input.focus();\n                }\n                else if (this._isSelectMultipleElement) {\n                    this.showDropdown();\n                }\n            }\n            // Prevents focus event firing\n            event.stopPropagation();\n        }\n        this._wasTap = true;\n    };\n    /**\n     * Handles mousedown event in capture mode for containetOuter.element\n     */\n    Choices.prototype._onMouseDown = function (event) {\n        var target = event.target;\n        if (!(target instanceof HTMLElement)) {\n            return;\n        }\n        // If we have our mouse down on the scrollbar and are on IE11...\n        if (IS_IE11 && this.choiceList.element.contains(target)) {\n            // check if click was on a scrollbar area\n            var firstChoice = this.choiceList.element.firstElementChild;\n            this._isScrollingOnIe =\n                this._direction === 'ltr' ? event.offsetX >= firstChoice.offsetWidth : event.offsetX < firstChoice.offsetLeft;\n        }\n        if (target === this.input.element) {\n            return;\n        }\n        var item = target.closest('[data-button],[data-item],[data-choice]');\n        if (item instanceof HTMLElement) {\n            if ('button' in item.dataset) {\n                this._handleButtonAction(item);\n            }\n            else if ('item' in item.dataset) {\n                this._handleItemAction(item, event.shiftKey);\n            }\n            else if ('choice' in item.dataset) {\n                this._handleChoiceAction(item);\n            }\n        }\n        event.preventDefault();\n    };\n    /**\n     * Handles mouseover event over this.dropdown\n     * @param {MouseEvent} event\n     */\n    Choices.prototype._onMouseOver = function (_a) {\n        var target = _a.target;\n        if (target instanceof HTMLElement && 'choice' in target.dataset) {\n            this._highlightChoice(target);\n        }\n    };\n    Choices.prototype._onClick = function (_a) {\n        var target = _a.target;\n        var containerOuter = this.containerOuter;\n        var clickWasWithinContainer = containerOuter.element.contains(target);\n        if (clickWasWithinContainer) {\n            if (!this.dropdown.isActive && !containerOuter.isDisabled) {\n                if (this._isTextElement) {\n                    if (document.activeElement !== this.input.element) {\n                        this.input.focus();\n                    }\n                }\n                else {\n                    this.showDropdown();\n                    containerOuter.element.focus();\n                }\n            }\n            else if (this._isSelectOneElement &&\n                target !== this.input.element &&\n                !this.dropdown.element.contains(target)) {\n                this.hideDropdown();\n            }\n        }\n        else {\n            containerOuter.removeFocusState();\n            this.hideDropdown(true);\n            this.unhighlightAll();\n        }\n    };\n    Choices.prototype._onFocus = function (_a) {\n        var target = _a.target;\n        var containerOuter = this.containerOuter;\n        var focusWasWithinContainer = target && containerOuter.element.contains(target);\n        if (!focusWasWithinContainer) {\n            return;\n        }\n        var targetIsInput = target === this.input.element;\n        if (this._isTextElement) {\n            if (targetIsInput) {\n                containerOuter.addFocusState();\n            }\n        }\n        else if (this._isSelectMultipleElement) {\n            if (targetIsInput) {\n                this.showDropdown(true);\n                // If element is a select box, the focused element is the container and the dropdown\n                // isn't already open, focus and show dropdown\n                containerOuter.addFocusState();\n            }\n        }\n        else {\n            containerOuter.addFocusState();\n            if (targetIsInput) {\n                this.showDropdown(true);\n            }\n        }\n    };\n    Choices.prototype._onBlur = function (_a) {\n        var target = _a.target;\n        var containerOuter = this.containerOuter;\n        var blurWasWithinContainer = target && containerOuter.element.contains(target);\n        if (blurWasWithinContainer && !this._isScrollingOnIe) {\n            if (target === this.input.element) {\n                containerOuter.removeFocusState();\n                this.hideDropdown(true);\n                if (this._isTextElement || this._isSelectMultipleElement) {\n                    this.unhighlightAll();\n                }\n            }\n            else if (target === this.containerOuter.element) {\n                // Remove the focus state when the past outerContainer was the target\n                containerOuter.removeFocusState();\n            }\n        }\n        else {\n            // On IE11, clicking the scollbar blurs our input and thus\n            // closes the dropdown. To stop this, we refocus our input\n            // if we know we are on IE *and* are scrolling.\n            this._isScrollingOnIe = false;\n            this.input.element.focus();\n        }\n    };\n    Choices.prototype._onFormReset = function () {\n        var _this = this;\n        this._store.withTxn(function () {\n            _this.clearInput();\n            _this.hideDropdown();\n            _this.refresh(false, false, true);\n            if (_this._initialItems.length) {\n                _this.setChoiceByValue(_this._initialItems);\n            }\n        });\n    };\n    Choices.prototype._highlightChoice = function (el) {\n        if (el === void 0) { el = null; }\n        var choices = Array.from(this.dropdown.element.querySelectorAll(selectableChoiceIdentifier));\n        if (!choices.length) {\n            return;\n        }\n        var passedEl = el;\n        var highlightedState = this.config.classNames.highlightedState;\n        var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));\n        // Remove any highlighted choices\n        highlightedChoices.forEach(function (choice) {\n            removeClassesFromElement(choice, highlightedState);\n            choice.setAttribute('aria-selected', 'false');\n        });\n        if (passedEl) {\n            this._highlightPosition = choices.indexOf(passedEl);\n        }\n        else {\n            // Highlight choice based on last known highlight location\n            if (choices.length > this._highlightPosition) {\n                // If we have an option to highlight\n                passedEl = choices[this._highlightPosition];\n            }\n            else {\n                // Otherwise highlight the option before\n                passedEl = choices[choices.length - 1];\n            }\n            if (!passedEl) {\n                passedEl = choices[0];\n            }\n        }\n        addClassesToElement(passedEl, highlightedState);\n        passedEl.setAttribute('aria-selected', 'true');\n        this.passedElement.triggerEvent(EventType.highlightChoice, {\n            el: passedEl,\n        });\n        if (this.dropdown.isActive) {\n            // IE11 ignores aria-label and blocks virtual keyboard\n            // if aria-activedescendant is set without a dropdown\n            this.input.setActiveDescendant(passedEl.id);\n            this.containerOuter.setActiveDescendant(passedEl.id);\n        }\n    };\n    Choices.prototype._addItem = function (item, withEvents, userTriggered) {\n        if (withEvents === void 0) { withEvents = true; }\n        if (userTriggered === void 0) { userTriggered = false; }\n        if (!item.id) {\n            throw new TypeError('item.id must be set before _addItem is called for a choice/item');\n        }\n        if (this.config.singleModeForMultiSelect || this._isSelectOneElement) {\n            this.removeActiveItems(item.id);\n        }\n        this._store.dispatch(addItem(item));\n        if (withEvents) {\n            this.passedElement.triggerEvent(EventType.addItem, this._getChoiceForOutput(item));\n            if (userTriggered) {\n                this.passedElement.triggerEvent(EventType.choice, this._getChoiceForOutput(item));\n            }\n        }\n    };\n    Choices.prototype._removeItem = function (item) {\n        if (!item.id) {\n            return;\n        }\n        this._store.dispatch(removeItem$1(item));\n        var notice = this._notice;\n        if (notice && notice.type === NoticeTypes.noChoices) {\n            this._clearNotice();\n        }\n        this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));\n    };\n    Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {\n        if (withEvents === void 0) { withEvents = true; }\n        if (userTriggered === void 0) { userTriggered = false; }\n        if (choice.id) {\n            throw new TypeError('Can not re-add a choice which has already been added');\n        }\n        var config = this.config;\n        if ((this._isSelectElement || !config.duplicateItemsAllowed) &&\n            this._store.choices.find(function (c) { return config.valueComparer(c.value, choice.value); })) {\n            return;\n        }\n        // Generate unique id, in-place update is required so chaining _addItem works as expected\n        this._lastAddedChoiceId++;\n        choice.id = this._lastAddedChoiceId;\n        choice.elementId = \"\".concat(this._baseId, \"-\").concat(this._idNames.itemChoice, \"-\").concat(choice.id);\n        var prependValue = config.prependValue, appendValue = config.appendValue;\n        if (prependValue) {\n            choice.value = prependValue + choice.value;\n        }\n        if (appendValue) {\n            choice.value += appendValue.toString();\n        }\n        if ((prependValue || appendValue) && choice.element) {\n            choice.element.value = choice.value;\n        }\n        this._clearNotice();\n        this._store.dispatch(addChoice(choice));\n        if (choice.selected) {\n            this._addItem(choice, withEvents, userTriggered);\n        }\n    };\n    Choices.prototype._addGroup = function (group, withEvents) {\n        var _this = this;\n        if (withEvents === void 0) { withEvents = true; }\n        if (group.id) {\n            throw new TypeError('Can not re-add a group which has already been added');\n        }\n        this._store.dispatch(addGroup(group));\n        if (!group.choices) {\n            return;\n        }\n        // add unique id for the group(s), and do not store the full list of choices in this group\n        this._lastAddedGroupId++;\n        group.id = this._lastAddedGroupId;\n        group.choices.forEach(function (item) {\n            item.group = group;\n            if (group.disabled) {\n                item.disabled = true;\n            }\n            _this._addChoice(item, withEvents);\n        });\n    };\n    Choices.prototype._createTemplates = function () {\n        var _this = this;\n        var callbackOnCreateTemplates = this.config.callbackOnCreateTemplates;\n        var userTemplates = {};\n        if (typeof callbackOnCreateTemplates === 'function') {\n            userTemplates = callbackOnCreateTemplates.call(this, strToEl, escapeForTemplate, getClassNames);\n        }\n        var templating = {};\n        Object.keys(this._templates).forEach(function (name) {\n            if (name in userTemplates) {\n                templating[name] = userTemplates[name].bind(_this);\n            }\n            else {\n                templating[name] = _this._templates[name].bind(_this);\n            }\n        });\n        this._templates = templating;\n    };\n    Choices.prototype._createElements = function () {\n        var templating = this._templates;\n        var _a = this, config = _a.config, isSelectOneElement = _a._isSelectOneElement;\n        var position = config.position, classNames = config.classNames;\n        var elementType = this._elementType;\n        this.containerOuter = new Container({\n            element: templating.containerOuter(config, this._direction, this._isSelectElement, isSelectOneElement, config.searchEnabled, elementType, config.labelId),\n            classNames: classNames,\n            type: elementType,\n            position: position,\n        });\n        this.containerInner = new Container({\n            element: templating.containerInner(config),\n            classNames: classNames,\n            type: elementType,\n            position: position,\n        });\n        this.input = new Input({\n            element: templating.input(config, this._placeholderValue),\n            classNames: classNames,\n            type: elementType,\n            preventPaste: !config.paste,\n        });\n        this.choiceList = new List({\n            element: templating.choiceList(config, isSelectOneElement),\n        });\n        this.itemList = new List({\n            element: templating.itemList(config, isSelectOneElement),\n        });\n        this.dropdown = new Dropdown({\n            element: templating.dropdown(config),\n            classNames: classNames,\n            type: elementType,\n        });\n    };\n    Choices.prototype._createStructure = function () {\n        var _a = this, containerInner = _a.containerInner, containerOuter = _a.containerOuter, passedElement = _a.passedElement;\n        var dropdownElement = this.dropdown.element;\n        // Hide original element\n        passedElement.conceal();\n        // Wrap input in container preserving DOM ordering\n        containerInner.wrap(passedElement.element);\n        // Wrapper inner container with outer container\n        containerOuter.wrap(containerInner.element);\n        if (this._isSelectOneElement) {\n            this.input.placeholder = this.config.searchPlaceholderValue || '';\n        }\n        else {\n            if (this._placeholderValue) {\n                this.input.placeholder = this._placeholderValue;\n            }\n            this.input.setWidth();\n        }\n        containerOuter.element.appendChild(containerInner.element);\n        containerOuter.element.appendChild(dropdownElement);\n        containerInner.element.appendChild(this.itemList.element);\n        dropdownElement.appendChild(this.choiceList.element);\n        if (!this._isSelectOneElement) {\n            containerInner.element.appendChild(this.input.element);\n        }\n        else if (this.config.searchEnabled) {\n            dropdownElement.insertBefore(this.input.element, dropdownElement.firstChild);\n        }\n        this._highlightPosition = 0;\n        this._isSearching = false;\n    };\n    Choices.prototype._initStore = function () {\n        var _this = this;\n        this._store.subscribe(this._render).withTxn(function () {\n            _this._addPredefinedChoices(_this._presetChoices, _this._isSelectOneElement && !_this._hasNonChoicePlaceholder, false);\n        });\n        if (!this._store.choices.length || (this._isSelectOneElement && this._hasNonChoicePlaceholder)) {\n            this._render();\n        }\n    };\n    Choices.prototype._addPredefinedChoices = function (choices, selectFirstOption, withEvents) {\n        var _this = this;\n        if (selectFirstOption === void 0) { selectFirstOption = false; }\n        if (withEvents === void 0) { withEvents = true; }\n        if (selectFirstOption) {\n            /**\n             * If there is a selected choice already or the choice is not the first in\n             * the array, add each choice normally.\n             *\n             * Otherwise we pre-select the first enabled choice in the array (\"select-one\" only)\n             */\n            var noSelectedChoices = choices.findIndex(function (choice) { return choice.selected; }) === -1;\n            if (noSelectedChoices) {\n                choices.some(function (choice) {\n                    if (choice.disabled || 'choices' in choice) {\n                        return false;\n                    }\n                    choice.selected = true;\n                    return true;\n                });\n            }\n        }\n        choices.forEach(function (item) {\n            if ('choices' in item) {\n                if (_this._isSelectElement) {\n                    _this._addGroup(item, withEvents);\n                }\n            }\n            else {\n                _this._addChoice(item, withEvents);\n            }\n        });\n    };\n    Choices.prototype._findAndSelectChoiceByValue = function (value, userTriggered) {\n        var _this = this;\n        if (userTriggered === void 0) { userTriggered = false; }\n        // Check 'value' property exists and the choice isn't already selected\n        var foundChoice = this._store.choices.find(function (choice) { return _this.config.valueComparer(choice.value, value); });\n        if (foundChoice && !foundChoice.disabled && !foundChoice.selected) {\n            this._addItem(foundChoice, true, userTriggered);\n            return true;\n        }\n        return false;\n    };\n    Choices.prototype._generatePlaceholderValue = function () {\n        var config = this.config;\n        if (!config.placeholder) {\n            return null;\n        }\n        if (this._hasNonChoicePlaceholder) {\n            return config.placeholderValue;\n        }\n        if (this._isSelectElement) {\n            var placeholderOption = this.passedElement.placeholderOption;\n            return placeholderOption ? placeholderOption.text : null;\n        }\n        return null;\n    };\n    Choices.prototype._warnChoicesInitFailed = function (caller) {\n        if (this.config.silent) {\n            return;\n        }\n        if (!this.initialised) {\n            throw new TypeError(\"\".concat(caller, \" called on a non-initialised instance of Choices\"));\n        }\n        else if (!this.initialisedOK) {\n            throw new TypeError(\"\".concat(caller, \" called for an element which has multiple instances of Choices initialised on it\"));\n        }\n    };\n    Choices.version = '11.0.3';\n    return Choices;\n}());\n\nexport { Choices as default };\n", "import { Controller } from \"@hotwired/stimulus\"\nimport Choices from \"choices.js\"\n\n// Connects to data-controller=\"choices\"\nexport default class extends Controller {\n  static targets = [\"select\"]\n\n  static values = {\n    searchPath: String\n  }\n\n  connect () {\n    this.choices = new Choices(this.selectTarget, this.options)\n    this.update = this.update.bind(this)\n    this.filter = this.filter.bind(this)\n\n\n    if (this.searchPathValue) {\n      this.element.addEventListener(\"search\", this.search.bind(this))\n      this.element.addEventListener(\"showDropdown\", this.search.bind(this))\n    }\n  }\n\n  disconnect () {\n    this.choices.destroy()\n  }\n\n  search (event) {\n    fetch(this.searchURL(event.detail.value))\n      .then(response => response.json())\n      .then(this.update)\n  }\n\n  update (data) {\n    this.choices.setChoices(data.filter(this.filter), 'value', 'label', true)\n  }\n\n  filter (item) {\n    return !this.choices.getValue(true).includes(item.value.toString())\n  }\n\n  searchURL(query) {\n    let searchURL = new URL(this.searchPathValue, window.location.href)\n    if (query) searchURL.searchParams.set(\"query\", query)\n    return searchURL.toString()\n  }\n\n  get options() {\n    return {\n      removeItemButton: true,\n      duplicateItemsAllowed: false,\n      loadingText: \"\u0141adowanie...\",\n      noResultsText: \"Brak wynik\u00F3w\",\n      noChoicesText: \"Brak wynik\u00F3w\",\n      itemSelectText: \"Naci\u015Bnij aby wybra\u0107\",\n      removeItemIconText: () => \"Usu\u0144\",\n      removeItemLabelText: (value) => `Usu\u0144: ${value}`,\n      classNames: {\n        containerOuter: [\"choices\", \"shadow\", \"rounded\"],\n        containerInner: [\"choices__inner\", \"bg-body\", \"shadow\", \"rounded\", \"form-select\"],\n        itemSelectable: [\"choices__item--selectable\", \"rounded\"],\n      }\n    }\n  }\n}\n", "export class TdError extends Error {\n  code: number;\n}\n\nexport class ErrorMessages {\n  private base = 'TD:';\n\n  //#region out to console\n\n  /**\n   * Throws an error indicating that a key in the options object is invalid.\n   * @param optionName\n   */\n  unexpectedOption(optionName: string) {\n    const error = new TdError(\n      `${this.base} Unexpected option: ${optionName} does not match a known option.`\n    );\n    error.code = 1;\n    throw error;\n  }\n\n  /**\n   * Throws an error indicating that one more keys in the options object is invalid.\n   * @param optionName\n   */\n  unexpectedOptions(optionName: string[]) {\n    const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\n    error.code = 1;\n    throw error;\n  }\n\n  /**\n   * Throws an error when an option is provide an unsupported value.\n   * For example a value of 'cheese' for toolbarPlacement which only supports\n   * 'top', 'bottom', 'default'.\n   * @param optionName\n   * @param badValue\n   * @param validOptions\n   */\n  unexpectedOptionValue(\n    optionName: string,\n    badValue: string,\n    validOptions: string[]\n  ) {\n    const error = new TdError(\n      `${\n        this.base\n      } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\n        ', '\n      )}`\n    );\n    error.code = 2;\n    throw error;\n  }\n\n  /**\n   * Throws an error when an option value is the wrong type.\n   * For example a string value was provided to multipleDates which only\n   * supports true or false.\n   * @param optionName\n   * @param badType\n   * @param expectedType\n   */\n  typeMismatch(optionName: string, badType: string, expectedType: string) {\n    const error = new TdError(\n      `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\n    );\n    error.code = 3;\n    throw error;\n  }\n\n  /**\n   * Throws an error when an option value is  outside of the expected range.\n   * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\n   * @param optionName\n   * @param lower\n   * @param upper\n   */\n  numbersOutOfRange(optionName: string, lower: number, upper: number) {\n    const error = new TdError(\n      `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\n    );\n    error.code = 4;\n    throw error;\n  }\n\n  /**\n   * Throws an error when a value for a date options couldn't be parsed. Either\n   * the option was an invalid string or an invalid Date object.\n   * @param optionName\n   * @param date\n   * @param soft If true, logs a warning instead of an error.\n   */\n  //eslint-disable-next-line @typescript-eslint/no-explicit-any\n  failedToParseDate(optionName: string, date: any, soft = false) {\n    const error = new TdError(\n      `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\n    );\n    error.code = 5;\n    if (!soft) throw error;\n    console.warn(error);\n  }\n\n  /**\n   * Throws when an element to attach to was not provided in the constructor.\n   */\n  mustProvideElement() {\n    const error = new TdError(`${this.base} No element was provided.`);\n    error.code = 6;\n    throw error;\n  }\n\n  /**\n   * Throws if providing an array for the events to subscribe method doesn't have\n   * the same number of callbacks. E.g., subscribe([1,2], [1])\n   */\n  subscribeMismatch() {\n    const error = new TdError(\n      `${this.base} The subscribed events does not match the number of callbacks`\n    );\n    error.code = 7;\n    throw error;\n  }\n\n  /**\n   * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\n   */\n  conflictingConfiguration(message?: string) {\n    const error = new TdError(\n      `${this.base} A configuration value conflicts with another rule. ${message}`\n    );\n    error.code = 8;\n    throw error;\n  }\n\n  /**\n   * customDateFormat errors\n   */\n  customDateFormatError(message?: string) {\n    const error = new TdError(`${this.base} Custom Date Format: ${message}`);\n    error.code = 9;\n    throw error;\n  }\n\n  /**\n   * Logs a warning if a date option value is provided as a string, instead of\n   * a date/datetime object.\n   */\n  dateString() {\n    console.warn(\n      `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\n    );\n  }\n\n  deprecatedWarning(message: string, remediation?: string) {\n    console.warn(\n      `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`\n    );\n  }\n\n  throwError(message) {\n    const error = new TdError(`${this.base} ${message}`);\n    error.code = 9;\n    throw error;\n  }\n\n  //#endregion\n\n  //#region used with notify.error\n\n  /**\n   * Used with an Error Event type if the user selects a date that\n   * fails restriction validation.\n   */\n  failedToSetInvalidDate = 'Failed to set invalid date';\n\n  /**\n   * Used with an Error Event type when a user changes the value of the\n   * input field directly, and does not provide a valid date.\n   */\n  failedToParseInput = 'Failed parse input field';\n\n  //#endregion\n}\n", "import { ErrorMessages } from './errors';\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\nconst NAME = 'tempus-dominus',\n  dataKey = 'td';\n\n/**\n * Events\n */\nclass Events {\n  key = `.${dataKey}`;\n\n  /**\n   * Change event. Fired when the user selects a date.\n   * See also EventTypes.ChangeEvent\n   */\n  change = `change${this.key}`;\n\n  /**\n   * Emit when the view changes for example from month view to the year view.\n   * See also EventTypes.ViewUpdateEvent\n   */\n  update = `update${this.key}`;\n\n  /**\n   * Emits when a selected date or value from the input field fails to meet the provided validation rules.\n   * See also EventTypes.FailEvent\n   */\n  error = `error${this.key}`;\n\n  /**\n   * Show event\n   * @event Events#show\n   */\n  show = `show${this.key}`;\n\n  /**\n   * Hide event\n   * @event Events#hide\n   */\n  hide = `hide${this.key}`;\n\n  // blur and focus are used in the jQuery provider but are otherwise unused.\n  // keyup/down will be used later for keybinding options\n\n  blur = `blur${this.key}`;\n  focus = `focus${this.key}`;\n  keyup = `keyup${this.key}`;\n  keydown = `keydown${this.key}`;\n}\n\nclass Css {\n  /**\n   * The outer element for the widget.\n   */\n  widget = `${NAME}-widget`;\n\n  /**\n   * Hold the previous, next and switcher divs\n   */\n  calendarHeader = 'calendar-header';\n\n  /**\n   * The element for the action to change the calendar view. E.g. month -> year.\n   */\n  switch = 'picker-switch';\n\n  /**\n   * The elements for all the toolbar options\n   */\n  toolbar = 'toolbar';\n\n  /**\n   * Disables the hover and rounding affect.\n   */\n  noHighlight = 'no-highlight';\n\n  /**\n   * Applied to the widget element when the side by side option is in use.\n   */\n  sideBySide = 'timepicker-sbs';\n\n  /**\n   * The element for the action to change the calendar view, e.g. August -> July\n   */\n  previous = 'previous';\n\n  /**\n   * The element for the action to change the calendar view, e.g. August -> September\n   */\n  next = 'next';\n\n  /**\n   * Applied to any action that would violate any restriction options. ALso applied\n   * to an input field if the disabled function is called.\n   */\n  disabled = 'disabled';\n\n  /**\n   * Applied to any date that is less than requested view,\n   * e.g. the last day of the previous month.\n   */\n  old = 'old';\n\n  /**\n   * Applied to any date that is greater than of requested view,\n   * e.g. the last day of the previous month.\n   */\n  new = 'new';\n\n  /**\n   * Applied to any date that is currently selected.\n   */\n  active = 'active';\n\n  //#region date element\n\n  /**\n   * The outer element for the calendar view.\n   */\n  dateContainer = 'date-container';\n\n  /**\n   * The outer element for the decades view.\n   */\n  decadesContainer = `${this.dateContainer}-decades`;\n\n  /**\n   * Applied to elements within the decade container, e.g. 2020, 2030\n   */\n  decade = 'decade';\n\n  /**\n   * The outer element for the years view.\n   */\n  yearsContainer = `${this.dateContainer}-years`;\n\n  /**\n   * Applied to elements within the years container, e.g. 2021, 2021\n   */\n  year = 'year';\n\n  /**\n   * The outer element for the month view.\n   */\n  monthsContainer = `${this.dateContainer}-months`;\n\n  /**\n   * Applied to elements within the month container, e.g. January, February\n   */\n  month = 'month';\n\n  /**\n   * The outer element for the calendar view.\n   */\n  daysContainer = `${this.dateContainer}-days`;\n\n  /**\n   * Applied to elements within the day container, e.g. 1, 2..31\n   */\n  day = 'day';\n\n  /**\n   * If display.calendarWeeks is enabled, a column displaying the week of year\n   * is shown. This class is applied to each cell in that column.\n   */\n  calendarWeeks = 'cw';\n\n  /**\n   * Applied to the first row of the calendar view, e.g. Sunday, Monday\n   */\n  dayOfTheWeek = 'dow';\n\n  /**\n   * Applied to the current date on the calendar view.\n   */\n  today = 'today';\n\n  /**\n   * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\n   */\n  weekend = 'weekend';\n\n  rangeIn = 'range-in';\n  rangeStart = 'range-start';\n  rangeEnd = 'range-end';\n\n  //#endregion\n\n  //#region time element\n\n  /**\n   * The outer element for all time related elements.\n   */\n  timeContainer = 'time-container';\n\n  /**\n   * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\n   */\n  separator = 'separator';\n\n  /**\n   * The outer element for the clock view.\n   */\n  clockContainer = `${this.timeContainer}-clock`;\n\n  /**\n   * The outer element for the hours selection view.\n   */\n  hourContainer = `${this.timeContainer}-hour`;\n\n  /**\n   * The outer element for the minutes selection view.\n   */\n  minuteContainer = `${this.timeContainer}-minute`;\n\n  /**\n   * The outer element for the seconds selection view.\n   */\n  secondContainer = `${this.timeContainer}-second`;\n\n  /**\n   * Applied to each element in the hours selection view.\n   */\n  hour = 'hour';\n\n  /**\n   * Applied to each element in the minutes selection view.\n   */\n  minute = 'minute';\n\n  /**\n   * Applied to each element in the seconds selection view.\n   */\n  second = 'second';\n\n  /**\n   * Applied AM/PM toggle button.\n   */\n  toggleMeridiem = 'toggleMeridiem';\n\n  //#endregion\n\n  //#region collapse\n\n  /**\n   * Applied the element of the current view mode, e.g. calendar or clock.\n   */\n  show = 'show';\n\n  /**\n   * Applied to the currently showing view mode during a transition\n   * between calendar and clock views\n   */\n  collapsing = 'td-collapsing';\n\n  /**\n   * Applied to the currently hidden view mode.\n   */\n  collapse = 'td-collapse';\n\n  //#endregion\n\n  /**\n   * Applied to the widget when the option display.inline is enabled.\n   */\n  inline = 'inline';\n\n  /**\n   * Applied to the widget when the option display.theme is light.\n   */\n  lightTheme = 'light';\n\n  /**\n   * Applied to the widget when the option display.theme is dark.\n   */\n  darkTheme = 'dark';\n\n  /**\n   * Used for detecting if the system color preference is dark mode\n   */\n  isDarkPreferredQuery = '(prefers-color-scheme: dark)';\n}\n\nexport default class Namespace {\n  static NAME = NAME;\n  // noinspection JSUnusedGlobalSymbols\n  static dataKey = dataKey;\n\n  static events = new Events();\n\n  static css = new Css();\n\n  static errorMessages = new ErrorMessages();\n}\n", "import { FormatLocalization } from './options';\n\nconst DefaultFormatLocalization: FormatLocalization = {\n  dateFormats: {\n    LTS: 'h:mm:ss T',\n    LT: 'h:mm T',\n    L: 'MM/dd/yyyy',\n    LL: 'MMMM d, yyyy',\n    LLL: 'MMMM d, yyyy h:mm T',\n    LLLL: 'dddd, MMMM d, yyyy h:mm T',\n  },\n  format: 'L LT',\n  locale: 'default',\n  hourCycle: undefined,\n  ordinal: (n) => {\n    const s = ['th', 'st', 'nd', 'rd'];\n    const v = n % 100;\n    return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\n  },\n};\n\nexport default { ...DefaultFormatLocalization };\n", "import { FormatLocalization } from './utilities/options';\nimport Namespace from './utilities/namespace';\nimport DefaultFormatLocalization from './utilities/default-format-localization';\n\ntype parsedTime = {\n  afternoon?: boolean;\n  year?: number;\n  month?: number;\n  day?: number;\n  hours?: number;\n  minutes?: number;\n  seconds?: number;\n  milliseconds?: number;\n  zone?: {\n    offset: number;\n  };\n};\n\nexport enum Unit {\n  seconds = 'seconds',\n  minutes = 'minutes',\n  hours = 'hours',\n  date = 'date',\n  month = 'month',\n  year = 'year',\n}\n\nconst twoDigitTemplate = {\n  month: '2-digit',\n  day: '2-digit',\n  year: 'numeric',\n  hour: '2-digit',\n  minute: '2-digit',\n  second: '2-digit',\n};\n\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\n  timeStyle?: 'short' | 'medium' | 'long';\n  dateStyle?: 'short' | 'medium' | 'long' | 'full';\n  numberingSystem?: string;\n}\n\n/**\n * Returns an Intl format object based on the provided object\n * @param unit\n */\nexport const getFormatByUnit = (unit: Unit): object => {\n  switch (unit) {\n    case 'date':\n      return { dateStyle: 'short' };\n    case 'month':\n      return {\n        month: 'numeric',\n        year: 'numeric',\n      };\n    case 'year':\n      return { year: 'numeric' };\n  }\n};\n\n/**\n * Attempts to guess the hour cycle of the given local\n * @param locale\n */\nexport const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => {\n  if (!locale) return 'h12';\n\n  // noinspection SpellCheckingInspection\n  const template = {\n    hour: '2-digit',\n    minute: '2-digit',\n    numberingSystem: 'latn',\n  };\n\n  const dt = new DateTime().setLocalization({ locale });\n  dt.hours = 0;\n\n  const start = dt.parts(undefined, template).hour;\n\n  //midnight is 12 so en-US style 12 AM\n  if (start === '12') return 'h12';\n  //midnight is 24 is from 00-24\n  if (start === '24') return 'h24';\n\n  dt.hours = 23;\n  const end = dt.parts(undefined, template).hour;\n\n  //if midnight is 00 and hour 23 is 11 then\n  if (start === '00' && end === '11') return 'h11';\n\n  if (start === '00' && end === '23') return 'h23';\n\n  console.warn(\n    `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`\n  );\n\n  return undefined;\n};\n\ninterface FormatMatch {\n  parser: (obj: parsedTime, input: number) => void;\n  pattern?: RegExp;\n}\n\ninterface FormatMatchString {\n  parser: (obj: parsedTime, input: string) => void;\n  pattern?: RegExp;\n}\n\ninterface FormatExpression {\n  t: FormatMatchString;\n  T: FormatMatchString;\n  fff: FormatMatch;\n  s: FormatMatch;\n  ss: FormatMatch;\n  m: FormatMatch;\n  mm: FormatMatch;\n  H: FormatMatch;\n  h: FormatMatch;\n  HH: FormatMatch;\n  hh: FormatMatch;\n  d: FormatMatch;\n  dd: FormatMatch;\n  Do: FormatMatchString;\n  M: FormatMatch;\n  MM: FormatMatch;\n  MMM: FormatMatchString;\n  MMMM: FormatMatchString;\n  y: FormatMatch;\n  yy: FormatMatch;\n  yyyy: FormatMatch;\n}\n\n/**\n * For the most part this object behaves exactly the same way\n * as the native Date object with a little extra spice.\n */\nexport class DateTime extends Date {\n  localization: FormatLocalization = DefaultFormatLocalization;\n\n  /**\n   * Chainable way to set the {@link locale}\n   * @param value\n   * @deprecated use setLocalization with a FormatLocalization object instead\n   */\n  setLocale(value: string): this {\n    if (!this.localization) {\n      this.localization = DefaultFormatLocalization;\n      this.localization.locale = value;\n    }\n    return this;\n  }\n\n  /**\n   * Chainable way to set the {@link localization}\n   * @param value\n   */\n  setLocalization(value: FormatLocalization): this {\n    this.localization = value;\n    return this;\n  }\n\n  /**\n   * Converts a plain JS date object to a DateTime object.\n   * Doing this allows access to format, etc.\n   * @param  date\n   * @param locale this parameter is deprecated. Use formatLocalization instead.\n   * @param formatLocalization\n   */\n  static convert(\n    date: Date,\n    locale = 'default',\n    formatLocalization: FormatLocalization = undefined\n  ): DateTime {\n    if (!date) throw new Error(`A date is required`);\n\n    if (!formatLocalization) {\n      formatLocalization = DefaultFormatLocalization;\n      formatLocalization.locale = locale;\n    }\n\n    return new DateTime(\n      date.getFullYear(),\n      date.getMonth(),\n      date.getDate(),\n      date.getHours(),\n      date.getMinutes(),\n      date.getSeconds(),\n      date.getMilliseconds()\n    ).setLocalization(formatLocalization);\n  }\n\n  /**\n   * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\n   */\n  get clone() {\n    return new DateTime(\n      this.year,\n      this.month,\n      this.date,\n      this.hours,\n      this.minutes,\n      this.seconds,\n      this.getMilliseconds()\n    ).setLocalization(this.localization);\n  }\n\n  static isValid(d): boolean {\n    if (d === undefined || JSON.stringify(d) === 'null') return false;\n    if (d.constructor.name === DateTime.name) return true;\n    return false;\n  }\n\n  /**\n   * Sets the current date to the start of the {@link unit} provided\n   * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\n   * would return April 1, 2021, 12:00:00.000 AM (midnight)\n   * @param unit\n   * @param startOfTheWeek Allows for the changing the start of the week.\n   */\n  startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n    if (this[unit] === undefined)\n      throw new Error(`Unit '${unit}' is not valid`);\n    switch (unit) {\n      case 'seconds':\n        this.setMilliseconds(0);\n        break;\n      case 'minutes':\n        this.setSeconds(0, 0);\n        break;\n      case 'hours':\n        this.setMinutes(0, 0, 0);\n        break;\n      case 'date':\n        this.setHours(0, 0, 0, 0);\n        break;\n      case 'weekDay': {\n        this.startOf(Unit.date);\n        if (this.weekDay === startOfTheWeek) break;\n        const goBack = (this.weekDay - startOfTheWeek + 7) % 7;\n        this.manipulate(goBack * -1, Unit.date);\n        break;\n      }\n      case 'month':\n        this.startOf(Unit.date);\n        this.setDate(1);\n        break;\n      case 'year':\n        this.startOf(Unit.date);\n        this.setMonth(0, 1);\n        break;\n    }\n    return this;\n  }\n\n  /**\n   * Sets the current date to the end of the {@link unit} provided\n   * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\n   * would return April 30, 2021, 11:59:59.999 PM\n   * @param unit\n   * @param startOfTheWeek\n   */\n  endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n    if (this[unit] === undefined)\n      throw new Error(`Unit '${unit}' is not valid`);\n    switch (unit) {\n      case 'seconds':\n        this.setMilliseconds(999);\n        break;\n      case 'minutes':\n        this.setSeconds(59, 999);\n        break;\n      case 'hours':\n        this.setMinutes(59, 59, 999);\n        break;\n      case 'date':\n        this.setHours(23, 59, 59, 999);\n        break;\n      case 'weekDay': {\n        this.endOf(Unit.date);\n        const endOfWeek = 6 + startOfTheWeek;\n        if (this.weekDay === endOfWeek) break;\n        this.manipulate(endOfWeek - this.weekDay, Unit.date);\n        break;\n      }\n      case 'month':\n        this.endOf(Unit.date);\n        this.manipulate(1, Unit.month);\n        this.setDate(0);\n        break;\n      case 'year':\n        this.endOf(Unit.date);\n        this.setMonth(11, 31);\n        break;\n    }\n    return this;\n  }\n\n  /**\n   * Change a {@link unit} value. Value can be positive or negative\n   * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\n   * would return May 30, 2021, 11:45:32.984 AM\n   * @param value A positive or negative number\n   * @param unit\n   */\n  manipulate(value: number, unit: Unit): this {\n    if (this[unit] === undefined)\n      throw new Error(`Unit '${unit}' is not valid`);\n    this[unit] += value;\n    return this;\n  }\n\n  /**\n   * Return true if {@link compare} is before this date\n   * @param compare The Date/DateTime to compare\n   * @param unit If provided, uses {@link startOf} for\n   * comparison.\n   */\n  isBefore(compare: DateTime, unit?: Unit): boolean {\n    // If the comparisons is undefined, return false\n    if (!DateTime.isValid(compare)) return false;\n\n    if (!unit) return this.valueOf() < compare.valueOf();\n    if (this[unit] === undefined)\n      throw new Error(`Unit '${unit}' is not valid`);\n    return (\n      this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\n    );\n  }\n\n  /**\n   * Return true if {@link compare} is after this date\n   * @param compare The Date/DateTime to compare\n   * @param unit If provided, uses {@link startOf} for\n   * comparison.\n   */\n  isAfter(compare: DateTime, unit?: Unit): boolean {\n    // If the comparisons is undefined, return false\n    if (!DateTime.isValid(compare)) return false;\n\n    if (!unit) return this.valueOf() > compare.valueOf();\n    if (this[unit] === undefined)\n      throw new Error(`Unit '${unit}' is not valid`);\n    return (\n      this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\n    );\n  }\n\n  /**\n   * Return true if {@link compare} is same this date\n   * @param compare The Date/DateTime to compare\n   * @param unit If provided, uses {@link startOf} for\n   * comparison.\n   */\n  isSame(compare: DateTime, unit?: Unit): boolean {\n    // If the comparisons is undefined, return false\n    if (!DateTime.isValid(compare)) return false;\n\n    if (!unit) return this.valueOf() === compare.valueOf();\n    if (this[unit] === undefined)\n      throw new Error(`Unit '${unit}' is not valid`);\n    compare = DateTime.convert(compare);\n    return (\n      this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\n    );\n  }\n\n  /**\n   * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\n   * @param left\n   * @param right\n   * @param unit.\n   * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\n   * If the inclusivity parameter is used, both indicators must be passed.\n   */\n  isBetween(\n    left: DateTime,\n    right: DateTime,\n    unit?: Unit,\n    inclusivity: '()' | '[]' | '(]' | '[)' = '()'\n  ): boolean {\n    // If one of the comparisons is undefined, return false\n    if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false;\n    // If a unit is provided and is not a valid property of the DateTime object, throw an error\n    if (unit && this[unit] === undefined) {\n      throw new Error(`Unit '${unit}' is not valid`);\n    }\n\n    const leftInclusivity = inclusivity[0] === '(';\n    const rightInclusivity = inclusivity[1] === ')';\n\n    const isLeftInRange = leftInclusivity\n      ? this.isAfter(left, unit)\n      : !this.isBefore(left, unit);\n    const isRightInRange = rightInclusivity\n      ? this.isBefore(right, unit)\n      : !this.isAfter(right, unit);\n\n    return isLeftInRange && isRightInRange;\n  }\n\n  /**\n   * Returns flattened object of the date. Does not include literals\n   * @param locale\n   * @param template\n   */\n  parts(\n    locale = this.localization.locale,\n    template: Record<string, unknown> = { dateStyle: 'full', timeStyle: 'long' }\n  ): Record<string, string> {\n    const parts = {};\n    new Intl.DateTimeFormat(locale, template)\n      .formatToParts(this)\n      .filter((x) => x.type !== 'literal')\n      .forEach((x) => (parts[x.type] = x.value));\n    return parts;\n  }\n\n  /**\n   * Shortcut to Date.getSeconds()\n   */\n  get seconds(): number {\n    return this.getSeconds();\n  }\n\n  /**\n   * Shortcut to Date.setSeconds()\n   */\n  set seconds(value: number) {\n    this.setSeconds(value);\n  }\n\n  /**\n   * Returns two digit hours\n   */\n  get secondsFormatted(): string {\n    return this.parts(undefined, twoDigitTemplate).second;\n  }\n\n  /**\n   * Shortcut to Date.getMinutes()\n   */\n  get minutes(): number {\n    return this.getMinutes();\n  }\n\n  /**\n   * Shortcut to Date.setMinutes()\n   */\n  set minutes(value: number) {\n    this.setMinutes(value);\n  }\n\n  /**\n   * Returns two digit minutes\n   */\n  get minutesFormatted(): string {\n    return this.parts(undefined, twoDigitTemplate).minute;\n  }\n\n  /**\n   * Shortcut to Date.getHours()\n   */\n  get hours(): number {\n    return this.getHours();\n  }\n\n  /**\n   * Shortcut to Date.setHours()\n   */\n  set hours(value: number) {\n    this.setHours(value);\n  }\n\n  /**\n   * Returns two digit hour, e.g. 01...10\n   * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\n   */\n  getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') {\n    return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\n      .hour;\n  }\n\n  /**\n   * Get the meridiem of the date. E.g. AM or PM.\n   * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\n   * otherwise it will return AM or PM.\n   * @param locale\n   */\n  meridiem(locale: string = this.localization.locale): string {\n    return new Intl.DateTimeFormat(locale, {\n      hour: 'numeric',\n      hour12: true,\n    })\n      .formatToParts(this)\n      .find((p) => p.type === 'dayPeriod')?.value;\n  }\n\n  /**\n   * Shortcut to Date.getDate()\n   */\n  get date(): number {\n    return this.getDate();\n  }\n\n  /**\n   * Shortcut to Date.setDate()\n   */\n  set date(value: number) {\n    this.setDate(value);\n  }\n\n  /**\n   * Return two digit date\n   */\n  get dateFormatted(): string {\n    return this.parts(undefined, twoDigitTemplate).day;\n  }\n\n  /**\n   * Shortcut to Date.getDay()\n   */\n  get weekDay(): number {\n    return this.getDay();\n  }\n\n  /**\n   * Shortcut to Date.getMonth()\n   */\n  get month(): number {\n    return this.getMonth();\n  }\n\n  /**\n   * Shortcut to Date.setMonth()\n   */\n  set month(value: number) {\n    const targetMonth = new Date(this.year, value + 1);\n    targetMonth.setDate(0);\n    const endOfMonth = targetMonth.getDate();\n    if (this.date > endOfMonth) {\n      this.date = endOfMonth;\n    }\n    this.setMonth(value);\n  }\n\n  /**\n   * Return two digit, human expected month. E.g. January = 1, December = 12\n   */\n  get monthFormatted(): string {\n    return this.parts(undefined, twoDigitTemplate).month;\n  }\n\n  /**\n   * Shortcut to Date.getFullYear()\n   */\n  get year(): number {\n    return this.getFullYear();\n  }\n\n  /**\n   * Shortcut to Date.setFullYear()\n   */\n  set year(value: number) {\n    this.setFullYear(value);\n  }\n\n  // borrowed a bunch of stuff from Luxon\n  /**\n   * Gets the week of the year\n   */\n  get week(): number {\n    const ordinal = this.computeOrdinal(),\n      weekday = this.getUTCDay();\n\n    let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\n\n    if (weekNumber < 1) {\n      weekNumber = this.weeksInWeekYear();\n    } else if (weekNumber > this.weeksInWeekYear()) {\n      weekNumber = 1;\n    }\n\n    return weekNumber;\n  }\n\n  /**\n   * Returns the number of weeks in the year\n   */\n  weeksInWeekYear() {\n    const p1 =\n        (this.year +\n          Math.floor(this.year / 4) -\n          Math.floor(this.year / 100) +\n          Math.floor(this.year / 400)) %\n        7,\n      last = this.year - 1,\n      p2 =\n        (last +\n          Math.floor(last / 4) -\n          Math.floor(last / 100) +\n          Math.floor(last / 400)) %\n        7;\n    return p1 === 4 || p2 === 3 ? 53 : 52;\n  }\n\n  /**\n   * Returns true or false depending on if the year is a leap year or not.\n   */\n  get isLeapYear() {\n    return (\n      this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)\n    );\n  }\n\n  private computeOrdinal() {\n    return (\n      this.date +\n      (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]\n    );\n  }\n\n  private nonLeapLadder = [\n    0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\n  ];\n  private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\n  //#region CDF stuff\n\n  private dateTimeRegex =\n    //is regex cannot be simplified beyond what it already is\n    /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\n\n  private formattingTokens =\n    /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?d?d?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\n\n  /**\n   * Returns a list of month values based on the current locale\n   */\n  private getAllMonths(\n    format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long'\n  ) {\n    const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\n      month: format,\n    }).format;\n    return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\n  }\n\n  /**\n   * Replaces an expanded token set (e.g. LT/LTS)\n   */\n  private replaceTokens(formatStr, formats) {\n    /***\n     * _ => match\n     * a => first capture group. Anything between [ and ]\n     * b => second capture group\n     */\n    return formatStr.replace(\n      /(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g,\n      (_, a, b) => {\n        const B = b && b.toUpperCase();\n        return a || formats[B] || DefaultFormatLocalization.dateFormats[B];\n      }\n    );\n  }\n\n  private match2 = /\\d\\d/; // 00 - 99\n  private match3 = /\\d{3}/; // 000 - 999\n  private match4 = /\\d{4}/; // 0000 - 9999\n  private match1to2 = /\\d\\d?/; // 0 - 99\n  private matchSigned = /[+-]?\\d+/; // -inf - inf\n  private matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\n  private matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\n\n  private parseTwoDigitYear(input: number) {\n    return input + (input > 68 ? 1900 : 2000);\n  }\n\n  private offsetFromString(input: string) {\n    if (!input) return 0;\n    if (input === 'Z') return 0;\n    const [first, second, third] = input.match(/([+-]|\\d\\d)/g);\n    const minutes = +second * 60 + (+third || 0);\n    const signed = first === '+' ? -minutes : minutes;\n    return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\n  }\n\n  /**\n   * z = -4, zz = -04, zzz = -0400\n   * @param date\n   * @param style\n   * @private\n   */\n  private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') {\n    let name = date\n      .parts(this.localization.locale, { timeZoneName: 'longOffset' })\n      .timeZoneName.replace('GMT', '')\n      .replace(':', '');\n\n    const negative = name.includes('-');\n\n    name = name.replace('-', '');\n\n    if (style === 'z') name = name.substring(1, 2);\n    else if (style === 'zz') name = name.substring(0, 2);\n\n    return `${negative ? '-' : ''}${name}`;\n  }\n\n  private zoneExpressions = [\n    this.matchOffset,\n    (obj, input) => {\n      obj.offset = this.offsetFromString(input);\n    },\n  ];\n\n  private addInput(property) {\n    return (obj, input) => {\n      obj[property] = +input;\n    };\n  }\n\n  private getLocaleAfternoon(): string {\n    return new Intl.DateTimeFormat(this.localization.locale, {\n      hour: 'numeric',\n      hour12: true,\n    })\n      .formatToParts(new Date(2022, 3, 4, 13))\n      .find((p) => p.type === 'dayPeriod')\n      ?.value?.replace(/\\s+/g, ' ');\n  }\n\n  private meridiemMatch(input: string) {\n    return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase();\n  }\n\n  private expressions: FormatExpression = {\n    t: {\n      pattern: undefined, //this.matchWord,\n      parser: (obj, input) => {\n        obj.afternoon = this.meridiemMatch(input);\n      },\n    },\n    T: {\n      pattern: undefined, //this.matchWord,\n      parser: (obj, input) => {\n        obj.afternoon = this.meridiemMatch(input);\n      },\n    },\n    fff: {\n      pattern: this.match3,\n      parser: (obj, input) => {\n        obj.milliseconds = +input;\n      },\n    },\n    s: {\n      pattern: this.match1to2,\n      parser: this.addInput('seconds'),\n    },\n    ss: {\n      pattern: this.match1to2,\n      parser: this.addInput('seconds'),\n    },\n    m: {\n      pattern: this.match1to2,\n      parser: this.addInput('minutes'),\n    },\n    mm: {\n      pattern: this.match1to2,\n      parser: this.addInput('minutes'),\n    },\n    H: {\n      pattern: this.match1to2,\n      parser: this.addInput('hours'),\n    },\n    h: {\n      pattern: this.match1to2,\n      parser: this.addInput('hours'),\n    },\n    HH: {\n      pattern: this.match1to2,\n      parser: this.addInput('hours'),\n    },\n    hh: {\n      pattern: this.match1to2,\n      parser: this.addInput('hours'),\n    },\n    d: {\n      pattern: this.match1to2,\n      parser: this.addInput('day'),\n    },\n    dd: {\n      pattern: this.match2,\n      parser: this.addInput('day'),\n    },\n    Do: {\n      pattern: this.matchWord,\n      parser: (obj, input) => {\n        obj.day = +(input.match(/\\d+/)[0] || 1);\n        if (!this.localization.ordinal) return;\n        for (let i = 1; i <= 31; i += 1) {\n          if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\n            obj.day = i;\n          }\n        }\n      },\n    },\n    M: {\n      pattern: this.match1to2,\n      parser: this.addInput('month'),\n    },\n    MM: {\n      pattern: this.match2,\n      parser: this.addInput('month'),\n    },\n    MMM: {\n      pattern: this.matchWord,\n      parser: (obj, input) => {\n        const months = this.getAllMonths();\n        const monthsShort = this.getAllMonths('short');\n        const matchIndex =\n          (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\n        if (matchIndex < 1) {\n          throw new Error();\n        }\n        obj.month = matchIndex % 12 || matchIndex;\n      },\n    },\n    MMMM: {\n      pattern: this.matchWord,\n      parser: (obj, input) => {\n        const months = this.getAllMonths();\n        const matchIndex = months.indexOf(input) + 1;\n        if (matchIndex < 1) {\n          throw new Error();\n        }\n        obj.month = matchIndex % 12 || matchIndex;\n      },\n    },\n    y: {\n      pattern: this.matchSigned,\n      parser: this.addInput('year'),\n    },\n    yy: {\n      pattern: this.match2,\n      parser: (obj, input) => {\n        obj.year = this.parseTwoDigitYear(+input);\n      },\n    },\n    yyyy: {\n      pattern: this.match4,\n      parser: this.addInput('year'),\n    },\n    // z: this.zoneExpressions,\n    // zz: this.zoneExpressions,\n    // zzz: this.zoneExpressions\n  };\n\n  private correctHours(time) {\n    const { afternoon } = time;\n    if (afternoon !== undefined) {\n      const { hours } = time;\n      if (afternoon) {\n        if (hours < 12) {\n          time.hours += 12;\n        }\n      } else if (hours === 12) {\n        time.hours = 0;\n      }\n      delete time.afternoon;\n    }\n  }\n\n  private makeParser(format: string) {\n    format = this.replaceTokens(format, this.localization.dateFormats);\n    const matchArray = format.match(this.formattingTokens);\n    const { length } = matchArray;\n    const expressionArray: (FormatMatch | string)[] = [];\n    for (let i = 0; i < length; i += 1) {\n      const token = matchArray[i];\n      const expression = this.expressions[token] as FormatMatch;\n      if (expression?.parser) {\n        expressionArray[i] = expression;\n      } else {\n        expressionArray[i] = (token as string).replace(/^\\[[^[\\]]*]$/g, '');\n      }\n    }\n\n    return (input: string): parsedTime => {\n      const time = {\n        hours: 0,\n        minutes: 0,\n        seconds: 0,\n        milliseconds: 0,\n      };\n      for (let i = 0, start = 0; i < length; i += 1) {\n        const token = expressionArray[i];\n        if (typeof token === 'string') {\n          start += token.length;\n        } else {\n          const part = input.slice(start);\n          let value = part;\n\n          if (token.pattern) {\n            const match = token.pattern.exec(part);\n            value = match[0];\n          }\n          token.parser.call(this, time, value);\n          input = input.replace(value, '');\n        }\n      }\n      this.correctHours(time);\n      return time;\n    };\n  }\n\n  /**\n   * Attempts to create a DateTime from a string.\n   * @param input date as string\n   * @param localization provides the date template the string is in via the format property\n   */\n  //eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static fromString(input: string, localization: FormatLocalization): DateTime {\n    if (!localization?.format) {\n      Namespace.errorMessages.customDateFormatError('No format was provided');\n    }\n    try {\n      const dt = new DateTime();\n      dt.setLocalization(localization);\n      if (['x', 'X'].indexOf(localization.format) > -1)\n        return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\n\n      input = input.replace(/\\s+/g, ' ');\n      const parser = dt.makeParser(localization.format);\n      const { year, month, day, hours, minutes, seconds, milliseconds, zone } =\n        parser(input);\n      const d = day || (!year && !month ? dt.getDate() : 1);\n      const y = year || dt.getFullYear();\n      let M = 0;\n      if (!(year && !month)) {\n        M = month > 0 ? month - 1 : dt.getMonth();\n      }\n      if (zone) {\n        return new DateTime(\n          Date.UTC(\n            y,\n            M,\n            d,\n            hours,\n            minutes,\n            seconds,\n            milliseconds + zone.offset * 60 * 1000\n          )\n        );\n      }\n      return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\n    } catch (e) {\n      Namespace.errorMessages.customDateFormatError(\n        `Unable to parse provided input: ${input}, format: ${localization.format}`\n      );\n    }\n  }\n\n  /**\n   * Returns a string format.\n   * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\n   * for valid templates and locale objects\n   * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\n   * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\n   */\n  format(\n    template?: DateTimeFormatOptions | string,\n    locale = this.localization.locale\n  ): string {\n    if (template && typeof template === 'object')\n      return new Intl.DateTimeFormat(locale, template).format(this);\n\n    const formatString = this.replaceTokens(\n      //try template first\n      template ||\n        //otherwise try localization format\n        this.localization.format ||\n        //otherwise try date + time\n        `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`,\n      this.localization.dateFormats\n    );\n\n    const formatter = (template) =>\n      new Intl.DateTimeFormat(this.localization.locale, template).format(this);\n\n    if (!this.localization.hourCycle)\n      this.localization.hourCycle = guessHourCycle(this.localization.locale);\n\n    //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\n    const HHCycle = this.localization.hourCycle.startsWith('h1')\n      ? 'h24'\n      : this.localization.hourCycle;\n    const hhCycle = this.localization.hourCycle.startsWith('h2')\n      ? 'h12'\n      : this.localization.hourCycle;\n\n    const matches = {\n      y: this.year,\n      yy: formatter({ year: '2-digit' }),\n      yyyy: this.year,\n      M: formatter({ month: 'numeric' }),\n      MM: this.monthFormatted,\n      MMM: this.getAllMonths('short')[this.getMonth()],\n      MMMM: this.getAllMonths()[this.getMonth()],\n      d: this.date,\n      dd: this.dateFormatted,\n      ddd: formatter({ weekday: 'short' }),\n      dddd: formatter({ weekday: 'long' }),\n      H: this.getHours(),\n      HH: this.getHoursFormatted(HHCycle),\n      h: this.hours > 12 ? this.hours - 12 : this.hours,\n      hh: this.getHoursFormatted(hhCycle),\n      t: this.meridiem(),\n      T: this.meridiem().toUpperCase(),\n      m: this.minutes,\n      mm: this.minutesFormatted,\n      s: this.seconds,\n      ss: this.secondsFormatted,\n      fff: this.getMilliseconds(),\n      // z: this.zoneInformation(dateTime, 'z'), //-4\n      // zz: this.zoneInformation(dateTime, 'zz'), //-04\n      // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\n    };\n\n    return formatString\n      .replace(this.dateTimeRegex, (match, $1) => {\n        return $1 || matches[match];\n      })\n      .replace(/\\[/g, '')\n      .replace(/]/g, '');\n  }\n\n  //#endregion CDF stuff\n}\n", "//eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare type Constructable<T> = new (...args: any[]) => T;\n\nclass ServiceLocator {\n  private cache: Map<Constructable<unknown>, unknown | symbol> = new Map();\n\n  locate<T>(identifier: Constructable<T>): T {\n    const service = this.cache.get(identifier);\n    if (service) return service as T;\n    const value = new identifier();\n    this.cache.set(identifier, value);\n    return value;\n  }\n}\nexport const setupServiceLocator = () => {\n  serviceLocator = new ServiceLocator();\n};\n\nexport let serviceLocator: ServiceLocator;\n", "import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n  name: keyof ViewMode;\n  className: string;\n  unit: Unit;\n  step: number;\n}[] = [\n  {\n    name: 'calendar',\n    className: Namespace.css.daysContainer,\n    unit: Unit.month,\n    step: 1,\n  },\n  {\n    name: 'months',\n    className: Namespace.css.monthsContainer,\n    unit: Unit.year,\n    step: 1,\n  },\n  {\n    name: 'years',\n    className: Namespace.css.yearsContainer,\n    unit: Unit.year,\n    step: 10,\n  },\n  {\n    name: 'decades',\n    className: Namespace.css.decadesContainer,\n    unit: Unit.year,\n    step: 100,\n  },\n];\n\nexport default CalendarModes;\n", "import { DateTime } from '../datetime';\nimport CalendarModes from './calendar-modes';\nimport ViewMode from './view-mode';\nimport Options from './options';\n\nexport class OptionsStore {\n  options: Options;\n  element: HTMLElement;\n  input: HTMLInputElement;\n  unset: boolean;\n  private _currentCalendarViewMode = 0;\n\n  get currentCalendarViewMode() {\n    return this._currentCalendarViewMode;\n  }\n\n  set currentCalendarViewMode(value) {\n    this._currentCalendarViewMode = value;\n    this.currentView = CalendarModes[value].name;\n  }\n\n  _viewDate = new DateTime();\n\n  get viewDate() {\n    return this._viewDate;\n  }\n\n  set viewDate(v) {\n    this._viewDate = v;\n    if (this.options) this.options.viewDate = v;\n  }\n\n  /**\n   * When switching back to the calendar from the clock,\n   * this sets currentView to the correct calendar view.\n   */\n  refreshCurrentView() {\n    this.currentView = CalendarModes[this.currentCalendarViewMode].name;\n  }\n\n  minimumCalendarViewMode = 0;\n  currentView: keyof ViewMode = 'calendar';\n\n  get isTwelveHour() {\n    return ['h12', 'h11'].includes(this.options.localization.hourCycle);\n  }\n}\n", "import { DateTime, Unit } from './datetime';\nimport { serviceLocator } from './utilities/service-locator';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Main class for date validation rules based on the options provided.\n */\nexport default class Validation {\n  private optionsStore: OptionsStore;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n  }\n\n  /**\n   * Checks to see if the target date is valid based on the rules provided in the options.\n   * Granularity can be provided to check portions of the date instead of the whole.\n   * @param targetDate\n   * @param granularity\n   */\n  isValid(targetDate: DateTime, granularity?: Unit): boolean {\n    if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\n      return false;\n\n    if (\n      granularity !== Unit.month &&\n      granularity !== Unit.year &&\n      this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\n      this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\n        targetDate.weekDay\n      ) !== -1\n    )\n      return false;\n\n    if (!this._minMaxIsValid(granularity, targetDate)) return false;\n\n    if (\n      granularity === Unit.hours ||\n      granularity === Unit.minutes ||\n      granularity === Unit.seconds\n    ) {\n      if (!this._enabledDisabledHoursIsValid(targetDate)) return false;\n\n      if (\n        this.optionsStore.options.restrictions.disabledTimeIntervals?.filter(\n          (internal) => targetDate.isBetween(internal.from, internal.to)\n        ).length !== 0\n      )\n        return false;\n    }\n\n    return true;\n  }\n\n  private _enabledDisabledDatesIsValid(\n    granularity: Unit,\n    targetDate: DateTime\n  ): boolean {\n    if (granularity !== Unit.date) return true;\n\n    if (\n      this.optionsStore.options.restrictions.disabledDates.length > 0 &&\n      this._isInDisabledDates(targetDate)\n    ) {\n      return false;\n    }\n\n    // noinspection RedundantIfStatementJS\n    if (\n      this.optionsStore.options.restrictions.enabledDates.length > 0 &&\n      !this._isInEnabledDates(targetDate)\n    ) {\n      return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\n   * if the `testDate` is with in the array. Granularity is by date.\n   * @param testDate\n   * @private\n   */\n  private _isInDisabledDates(testDate: DateTime) {\n    if (\n      !this.optionsStore.options.restrictions.disabledDates ||\n      this.optionsStore.options.restrictions.disabledDates.length === 0\n    )\n      return false;\n\n    return !!this.optionsStore.options.restrictions.disabledDates.find((x) =>\n      x.isSame(testDate, Unit.date)\n    );\n  }\n\n  /**\n   * Checks to see if the enabledDates option is in use and returns true (meaning valid)\n   * if the `testDate` is with in the array. Granularity is by date.\n   * @param testDate\n   * @private\n   */\n  private _isInEnabledDates(testDate: DateTime) {\n    if (\n      !this.optionsStore.options.restrictions.enabledDates ||\n      this.optionsStore.options.restrictions.enabledDates.length === 0\n    )\n      return true;\n\n    return !!this.optionsStore.options.restrictions.enabledDates.find((x) =>\n      x.isSame(testDate, Unit.date)\n    );\n  }\n\n  private _minMaxIsValid(granularity: Unit, targetDate: DateTime) {\n    if (\n      this.optionsStore.options.restrictions.minDate &&\n      targetDate.isBefore(\n        this.optionsStore.options.restrictions.minDate,\n        granularity\n      )\n    ) {\n      return false;\n    }\n\n    // noinspection RedundantIfStatementJS\n    if (\n      this.optionsStore.options.restrictions.maxDate &&\n      targetDate.isAfter(\n        this.optionsStore.options.restrictions.maxDate,\n        granularity\n      )\n    ) {\n      return false;\n    }\n\n    return true;\n  }\n\n  private _enabledDisabledHoursIsValid(targetDate: DateTime) {\n    if (\n      this.optionsStore.options.restrictions.disabledHours.length > 0 &&\n      this._isInDisabledHours(targetDate)\n    ) {\n      return false;\n    }\n\n    // noinspection RedundantIfStatementJS\n    if (\n      this.optionsStore.options.restrictions.enabledHours.length > 0 &&\n      !this._isInEnabledHours(targetDate)\n    ) {\n      return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\n   * if the `testDate` is with in the array. Granularity is by hours.\n   * @param testDate\n   * @private\n   */\n  private _isInDisabledHours(testDate: DateTime) {\n    if (\n      !this.optionsStore.options.restrictions.disabledHours ||\n      this.optionsStore.options.restrictions.disabledHours.length === 0\n    )\n      return false;\n\n    const formattedDate = testDate.hours;\n    return this.optionsStore.options.restrictions.disabledHours.includes(\n      formattedDate\n    );\n  }\n\n  /**\n   * Checks to see if the enabledHours option is in use and returns true (meaning valid)\n   * if the `testDate` is with in the array. Granularity is by hours.\n   * @param testDate\n   * @private\n   */\n  private _isInEnabledHours(testDate: DateTime) {\n    if (\n      !this.optionsStore.options.restrictions.enabledHours ||\n      this.optionsStore.options.restrictions.enabledHours.length === 0\n    )\n      return true;\n\n    const formattedDate = testDate.hours;\n    return this.optionsStore.options.restrictions.enabledHours.includes(\n      formattedDate\n    );\n  }\n\n  dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) {\n    // if we're not using the option, then return valid\n    if (!this.optionsStore.options.dateRange) return true;\n\n    // if we've only selected 0..1 dates, and we're not setting the end date\n    // then return valid. We only want to validate the range if both are selected,\n    // because the other validation on the target has already occurred.\n    if (dates.length !== 2 && index !== 1) return true;\n\n    // initialize start date\n    const start = dates[0].clone;\n    // check if start date is not the same as target date\n    if (start.isSame(target, Unit.date)) return true;\n\n    // add one day to start; start has already been validated\n    start.manipulate(1, Unit.date);\n\n    // check each date in the range to make sure it's valid\n    while (!start.isSame(target, Unit.date)) {\n      const valid = this.isValid(start, Unit.date);\n      if (!valid) return false;\n      start.manipulate(1, Unit.date);\n    }\n\n    return true;\n  }\n}\n", "import { DateTime, Unit } from '../datetime';\nimport ActionTypes from './action-types';\nimport { BaseEvent } from './event-types';\n\nexport type ViewUpdateValues = Unit | 'decade' | 'clock' | 'calendar' | 'all';\n\nclass EventEmitter<T> {\n  private subscribers: ((value?: T) => void)[] = [];\n\n  subscribe(callback: (value: T) => void) {\n    this.subscribers.push(callback);\n    return this.unsubscribe.bind(this, this.subscribers.length - 1);\n  }\n\n  unsubscribe(index: number) {\n    this.subscribers.splice(index, 1);\n  }\n\n  emit(value?: T) {\n    this.subscribers.forEach((callback) => {\n      callback(value);\n    });\n  }\n\n  destroy() {\n    this.subscribers = null;\n    this.subscribers = [];\n  }\n}\n\nexport class EventEmitters {\n  triggerEvent = new EventEmitter<BaseEvent>();\n  viewUpdate = new EventEmitter();\n  updateDisplay = new EventEmitter<ViewUpdateValues>();\n  action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any\n  updateViewDate = new EventEmitter<DateTime>();\n\n  destroy() {\n    this.triggerEvent.destroy();\n    this.viewUpdate.destroy();\n    this.updateDisplay.destroy();\n    this.action.destroy();\n    this.updateViewDate.destroy();\n  }\n}\n", "import Options, { Localization } from './options';\nimport { DateTime } from '../datetime';\nimport DefaultFormatLocalization from './default-format-localization';\n\nconst defaultEnLocalization: Localization = {\n  clear: 'Clear selection',\n  close: 'Close the picker',\n  dateFormats: DefaultFormatLocalization.dateFormats,\n  dayViewHeaderFormat: { month: 'long', year: '2-digit' },\n  decrementHour: 'Decrement Hour',\n  decrementMinute: 'Decrement Minute',\n  decrementSecond: 'Decrement Second',\n  format: DefaultFormatLocalization.format,\n  hourCycle: DefaultFormatLocalization.hourCycle,\n  incrementHour: 'Increment Hour',\n  incrementMinute: 'Increment Minute',\n  incrementSecond: 'Increment Second',\n  locale: DefaultFormatLocalization.locale,\n  maxWeekdayLength: 0,\n  nextCentury: 'Next Century',\n  nextDecade: 'Next Decade',\n  nextMonth: 'Next Month',\n  nextYear: 'Next Year',\n  ordinal: DefaultFormatLocalization.ordinal,\n  pickHour: 'Pick Hour',\n  pickMinute: 'Pick Minute',\n  pickSecond: 'Pick Second',\n  previousCentury: 'Previous Century',\n  previousDecade: 'Previous Decade',\n  previousMonth: 'Previous Month',\n  previousYear: 'Previous Year',\n  selectDate: 'Select Date',\n  selectDecade: 'Select Decade',\n  selectMonth: 'Select Month',\n  selectTime: 'Select Time',\n  selectYear: 'Select Year',\n  startOfTheWeek: 0,\n  today: 'Go to today',\n  toggleMeridiem: 'Toggle Meridiem',\n};\n\nconst DefaultOptions: Options = {\n  allowInputToggle: false,\n  container: undefined,\n  dateRange: false,\n  debug: false,\n  defaultDate: undefined,\n  display: {\n    icons: {\n      type: 'icons',\n      time: 'fa-solid fa-clock',\n      date: 'fa-solid fa-calendar',\n      up: 'fa-solid fa-arrow-up',\n      down: 'fa-solid fa-arrow-down',\n      previous: 'fa-solid fa-chevron-left',\n      next: 'fa-solid fa-chevron-right',\n      today: 'fa-solid fa-calendar-check',\n      clear: 'fa-solid fa-trash',\n      close: 'fa-solid fa-xmark',\n    },\n    sideBySide: false,\n    calendarWeeks: false,\n    viewMode: 'calendar',\n    toolbarPlacement: 'bottom',\n    keepOpen: false,\n    buttons: {\n      today: false,\n      clear: false,\n      close: false,\n    },\n    components: {\n      calendar: true,\n      date: true,\n      month: true,\n      year: true,\n      decades: true,\n      clock: true,\n      hours: true,\n      minutes: true,\n      seconds: false,\n      useTwentyfourHour: undefined,\n    },\n    inline: false,\n    theme: 'auto',\n    placement: 'bottom',\n  },\n  keepInvalid: false,\n  localization: defaultEnLocalization,\n  meta: {},\n  multipleDates: false,\n  multipleDatesSeparator: '; ',\n  promptTimeOnDateChange: false,\n  promptTimeOnDateChangeTransitionDelay: 200,\n  restrictions: {\n    minDate: undefined,\n    maxDate: undefined,\n    disabledDates: [],\n    enabledDates: [],\n    daysOfWeekDisabled: [],\n    disabledTimeIntervals: [],\n    disabledHours: [],\n    enabledHours: [],\n  },\n  stepping: 1,\n  useCurrent: true,\n  viewDate: new DateTime(),\n};\n\nexport default DefaultOptions;\nexport const DefaultEnLocalization = { ...defaultEnLocalization };\n", "import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport { FormatLocalization } from './options';\nimport DefaultFormatLocalization from './default-format-localization';\n\n/**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\nexport function tryConvertToDateTime(\n  this: void,\n  d: DateTime | Date | string,\n  localization: FormatLocalization\n): DateTime | null {\n  if (!d) return null;\n  if (d.constructor.name === DateTime.name) return d as DateTime;\n  if (d.constructor.name === Date.name) {\n    return DateTime.convert(d as Date);\n  }\n  if (typeof d === typeof '') {\n    const dateTime = DateTime.fromString(d as unknown as string, localization);\n    if (JSON.stringify(dateTime) === 'null') {\n      return null;\n    }\n    return dateTime;\n  }\n  return null;\n}\n\n/**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\nexport function convertToDateTime(\n  this: void,\n  d: DateTime | Date | string,\n  optionName: string,\n  localization: FormatLocalization\n): DateTime {\n  if (typeof d === typeof '' && optionName !== 'input') {\n    Namespace.errorMessages.dateString();\n  }\n\n  const converted = tryConvertToDateTime(d, localization);\n\n  if (!converted) {\n    Namespace.errorMessages.failedToParseDate(\n      optionName,\n      d,\n      optionName === 'input'\n    );\n  }\n  return converted;\n}\n\n/**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\nexport function typeCheckDateArray(\n  this: void,\n  optionName: string,\n  value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n  providedType: string,\n  localization: FormatLocalization = DefaultFormatLocalization\n) {\n  if (!Array.isArray(value)) {\n    Namespace.errorMessages.typeMismatch(\n      optionName,\n      providedType,\n      'array of DateTime or Date'\n    );\n  }\n  for (let i = 0; i < value.length; i++) {\n    const d = value[i];\n    const dateTime = convertToDateTime(d, optionName, localization);\n    dateTime.setLocalization(localization);\n    value[i] = dateTime;\n  }\n}\n\n/**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\nexport function typeCheckNumberArray(\n  this: void,\n  optionName: string,\n  value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n  providedType: string\n) {\n  if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\n    Namespace.errorMessages.typeMismatch(\n      optionName,\n      providedType,\n      'array of numbers'\n    );\n  }\n}\n", "import Namespace from './namespace';\nimport type { FormatLocalization } from './options';\nimport {\n  convertToDateTime,\n  typeCheckNumberArray,\n  typeCheckDateArray,\n} from './typeChecker';\n\ninterface OptionProcessorFunctionArguments {\n  key: string;\n  value: any; //eslint-disable-line @typescript-eslint/no-explicit-any\n  providedType: string;\n  defaultType: string;\n  path: string;\n  localization: FormatLocalization;\n}\n\ntype OptionProcessorFunction = (\n  this: void,\n  args: OptionProcessorFunctionArguments\n) => any; //eslint-disable-line @typescript-eslint/no-explicit-any\n\nfunction mandatoryDate(key: string): OptionProcessorFunction {\n  return ({ value, providedType, localization }) => {\n    const dateTime = convertToDateTime(value, key, localization);\n    if (dateTime !== undefined) {\n      dateTime.setLocalization(localization);\n      return dateTime;\n    }\n  };\n}\n\nfunction optionalDate(key: string): OptionProcessorFunction {\n  const mandatory = mandatoryDate(key);\n  return (args) => {\n    if (args.value === undefined) {\n      return args.value;\n    }\n    return mandatory(args);\n  };\n}\n\nfunction numbersInRange(\n  key: string,\n  lower: number,\n  upper: number\n): OptionProcessorFunction {\n  return ({ value, providedType }) => {\n    if (value === undefined) {\n      return [];\n    }\n    typeCheckNumberArray(key, value, providedType);\n    if ((value as number[]).some((x) => x < lower || x > upper))\n      Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\n    return value;\n  };\n}\n\nfunction validHourRange(key: string): OptionProcessorFunction {\n  return numbersInRange(key, 0, 23);\n}\n\nfunction validDateArray(key: string): OptionProcessorFunction {\n  return ({ value, providedType, localization }) => {\n    if (value === undefined) {\n      return [];\n    }\n    typeCheckDateArray(key, value, providedType, localization);\n    return value;\n  };\n}\n\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\n  return ({ value, path }) => {\n    if (!keyOptions.includes(value))\n      Namespace.errorMessages.unexpectedOptionValue(\n        path.substring(1),\n        value,\n        keyOptions\n      );\n    return value;\n  };\n}\n\nconst optionProcessors: { [key: string]: OptionProcessorFunction } =\n  Object.freeze({\n    defaultDate: mandatoryDate('defaultDate'),\n    viewDate: mandatoryDate('viewDate'),\n    minDate: optionalDate('restrictions.minDate'),\n    maxDate: optionalDate('restrictions.maxDate'),\n    disabledHours: validHourRange('restrictions.disabledHours'),\n    enabledHours: validHourRange('restrictions.enabledHours'),\n    disabledDates: validDateArray('restrictions.disabledDates'),\n    enabledDates: validDateArray('restrictions.enabledDates'),\n    daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\n    disabledTimeIntervals: ({ key, value, providedType, localization }) => {\n      if (value === undefined) {\n        return [];\n      }\n      if (!Array.isArray(value)) {\n        Namespace.errorMessages.typeMismatch(\n          key,\n          providedType,\n          'array of { from: DateTime|Date, to: DateTime|Date }'\n        );\n      }\n      const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n      for (let i = 0; i < valueObject.length; i++) {\n        Object.keys(valueObject[i]).forEach((vk) => {\n          const subOptionName = `${key}[${i}].${vk}`;\n          const d = valueObject[i][vk];\n          const dateTime = convertToDateTime(d, subOptionName, localization);\n          dateTime.setLocalization(localization);\n          valueObject[i][vk] = dateTime;\n        });\n      }\n      return valueObject;\n    },\n    toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\n    type: validKeyOption(['icons', 'sprites']),\n    viewMode: validKeyOption([\n      'clock',\n      'calendar',\n      'months',\n      'years',\n      'decades',\n    ]),\n    theme: validKeyOption(['light', 'dark', 'auto']),\n    placement: validKeyOption(['top', 'bottom']),\n    meta: ({ value }) => value,\n    dayViewHeaderFormat: ({ value }) => value,\n    container: ({ value, path }) => {\n      if (\n        value &&\n        !(\n          value instanceof HTMLElement ||\n          value instanceof Element ||\n          value?.appendChild\n        )\n      ) {\n        Namespace.errorMessages.typeMismatch(\n          path.substring(1),\n          typeof value,\n          'HTMLElement'\n        );\n      }\n      return value;\n    },\n    useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\n      Namespace.errorMessages.deprecatedWarning(\n        'useTwentyfourHour',\n        'Please use \"options.localization.hourCycle\" instead'\n      );\n      if (value === undefined || providedType === 'boolean') return value;\n      Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n    },\n    hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\n  });\n\nconst defaultProcessor: OptionProcessorFunction = ({\n  value,\n  defaultType,\n  providedType,\n  path,\n}) => {\n  switch (defaultType) {\n    case 'boolean':\n      return value === 'true' || value === true;\n    case 'number':\n      return +value;\n    case 'string':\n      return value.toString();\n    case 'object':\n      return {};\n    case 'function':\n      return value;\n    default:\n      Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n  }\n};\n\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\n  return (optionProcessors[args.key] || defaultProcessor)(args);\n}\n", "import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport DefaultOptions from './default-options';\nimport Options, { FormatLocalization } from './options';\nimport { processKey } from './optionProcessor';\nimport {\n  convertToDateTime,\n  tryConvertToDateTime,\n  typeCheckDateArray,\n  typeCheckNumberArray,\n} from './typeChecker';\n\nexport class OptionConverter {\n  private static ignoreProperties = [\n    'meta',\n    'dayViewHeaderFormat',\n    'container',\n    'dateForms',\n    'ordinal',\n  ];\n\n  static deepCopy(input): Options {\n    const o = {};\n\n    Object.keys(input).forEach((key) => {\n      const inputElement = input[key];\n\n      if (inputElement instanceof DateTime) {\n        o[key] = inputElement.clone;\n        return;\n      } else if (inputElement instanceof Date) {\n        o[key] = new Date(inputElement.valueOf());\n        return;\n      }\n\n      o[key] = inputElement;\n      if (\n        typeof inputElement !== 'object' ||\n        inputElement instanceof HTMLElement ||\n        inputElement instanceof Element\n      )\n        return;\n      if (!Array.isArray(inputElement)) {\n        o[key] = OptionConverter.deepCopy(inputElement);\n      }\n    });\n\n    return o;\n  }\n\n  private static isValue = (a) => a != null; // everything except undefined + null\n\n  /**\n   * Finds value out of an object based on a string, period delimited, path\n   * @param paths\n   * @param obj\n   */\n  static objectPath(paths: string, obj) {\n    if (paths.charAt(0) === '.') paths = paths.slice(1);\n    if (!paths) return obj;\n    return paths\n      .split('.')\n      .reduce(\n        (value, key) =>\n          OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\n            ? value[key]\n            : undefined,\n        obj\n      );\n  }\n\n  /**\n   * The spread operator caused sub keys to be missing after merging.\n   * This is to fix that issue by using spread on the child objects first.\n   * Also handles complex options like disabledDates\n   * @param provided An option from new providedOptions\n   * @param copyTo Destination object. This was added to prevent reference copies\n   * @param localization\n   * @param path\n   */\n  static spread(provided, copyTo, localization: FormatLocalization, path = '') {\n    const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\n\n    const unsupportedOptions = Object.keys(provided).filter(\n      (x) => !Object.keys(defaultOptions).includes(x)\n    );\n\n    if (unsupportedOptions.length > 0) {\n      const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\n\n      const errors = unsupportedOptions.map((x) => {\n        let error = `\"${path}.${x}\" in not a known option.`;\n        const didYouMean = flattenedOptions.find((y) => y.includes(x));\n        if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\n        return error;\n      });\n      Namespace.errorMessages.unexpectedOptions(errors);\n    }\n\n    Object.keys(provided)\n      .filter((key) => key !== '__proto__' && key !== 'constructor')\n      .forEach((key) => {\n        path += `.${key}`;\n        if (path.charAt(0) === '.') path = path.slice(1);\n\n        const defaultOptionValue = defaultOptions[key];\n        const providedType = typeof provided[key];\n        const defaultType = typeof defaultOptionValue;\n        const value = provided[key];\n\n        if (value === undefined || value === null) {\n          copyTo[key] = value;\n          path = path.substring(0, path.lastIndexOf(`.${key}`));\n          return;\n        }\n\n        if (\n          typeof defaultOptionValue === 'object' &&\n          !Array.isArray(provided[key]) &&\n          !(\n            defaultOptionValue instanceof Date ||\n            OptionConverter.ignoreProperties.includes(key)\n          )\n        ) {\n          OptionConverter.spread(\n            provided[key],\n            copyTo[key],\n            localization,\n            path\n          );\n        } else {\n          copyTo[key] = OptionConverter.processKey(\n            key,\n            value,\n            providedType,\n            defaultType,\n            path,\n            localization\n          );\n        }\n\n        path = path.substring(0, path.lastIndexOf(`.${key}`));\n      });\n  }\n\n  static processKey(\n    key: string,\n    value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n    providedType: string,\n    defaultType: string,\n    path: string,\n    localization: FormatLocalization\n  ) {\n    return processKey({\n      key,\n      value,\n      providedType,\n      defaultType,\n      path,\n      localization,\n    });\n  }\n\n  static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\n    const newConfig = OptionConverter.deepCopy(mergeTo);\n    //see if the options specify a locale\n    const localization =\n      mergeTo.localization?.locale !== 'default'\n        ? mergeTo.localization\n        : providedOptions?.localization || DefaultOptions.localization;\n\n    OptionConverter.spread(providedOptions, newConfig, localization, '');\n\n    return newConfig;\n  }\n\n  static _dataToOptions(element, options: Options): Options {\n    const eData = JSON.parse(JSON.stringify(element.dataset));\n\n    if (eData?.tdTargetInput) delete eData.tdTargetInput;\n    if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\n\n    if (!eData || Object.keys(eData).length === 0) return options;\n    const dataOptions = {} as Options;\n\n    // because dataset returns camelCase including the 'td' key the option\n    // key won't align\n    const objectToNormalized = (object) => {\n      const lowered = {};\n      Object.keys(object).forEach((x) => {\n        lowered[x.toLowerCase()] = x;\n      });\n\n      return lowered;\n    };\n\n    const normalizeObject = this.normalizeObject(objectToNormalized);\n    const optionsLower = objectToNormalized(options);\n\n    Object.keys(eData)\n      .filter((x) => x.startsWith(Namespace.dataKey))\n      .map((x) => x.substring(2))\n      .forEach((key) => {\n        let keyOption = optionsLower[key.toLowerCase()];\n\n        // dataset merges dashes to camelCase... yay\n        // i.e. key = display_components_seconds\n        if (key.includes('_')) {\n          // [display, components, seconds]\n          const split = key.split('_');\n          // display\n          keyOption = optionsLower[split[0].toLowerCase()];\n          if (\n            keyOption !== undefined &&\n            options[keyOption].constructor === Object\n          ) {\n            dataOptions[keyOption] = normalizeObject(\n              split,\n              1,\n              options[keyOption],\n              eData[`td${key}`]\n            );\n          }\n        }\n        // or key = multipleDate\n        else if (keyOption !== undefined) {\n          dataOptions[keyOption] = eData[`td${key}`];\n        }\n      });\n\n    return this._mergeOptions(dataOptions, options);\n  }\n\n  //todo clean this up\n  private static normalizeObject(objectToNormalized: (object) => object) {\n    const normalizeObject = (\n      split: string[],\n      index: number,\n      optionSubgroup: unknown,\n      value: unknown\n    ) => {\n      // first round = display { ... }\n      const normalizedOptions = objectToNormalized(optionSubgroup);\n\n      const keyOption = normalizedOptions[split[index].toLowerCase()];\n      const internalObject = {};\n\n      if (keyOption === undefined) return internalObject;\n\n      // if this is another object, continue down the rabbit hole\n      if (optionSubgroup[keyOption]?.constructor === Object) {\n        index++;\n        internalObject[keyOption] = normalizeObject(\n          split,\n          index,\n          optionSubgroup[keyOption],\n          value\n        );\n      } else {\n        internalObject[keyOption] = value;\n      }\n      return internalObject;\n    };\n    return normalizeObject;\n  }\n\n  /**\n   * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n   * @param d If a string will attempt creating a date from it.\n   * @param localization object containing locale and format settings. Only used with the custom formats\n   * @private\n   */\n  static _dateTypeCheck(\n    d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n    localization: FormatLocalization\n  ): DateTime | null {\n    return tryConvertToDateTime(d, localization);\n  }\n\n  /**\n   * Type checks that `value` is an array of Date or DateTime\n   * @param optionName Provides text to error messages e.g. disabledDates\n   * @param value Option value\n   * @param providedType Used to provide text to error messages\n   * @param localization\n   */\n  static _typeCheckDateArray(\n    optionName: string,\n    value,\n    providedType: string,\n    localization: FormatLocalization\n  ) {\n    return typeCheckDateArray(optionName, value, providedType, localization);\n  }\n\n  /**\n   * Type checks that `value` is an array of numbers\n   * @param optionName Provides text to error messages e.g. disabledDates\n   * @param value Option value\n   * @param providedType Used to provide text to error messages\n   */\n  static _typeCheckNumberArray(\n    optionName: string,\n    value,\n    providedType: string\n  ) {\n    return typeCheckNumberArray(optionName, value, providedType);\n  }\n\n  /**\n   * Attempts to convert `d` to a DateTime object\n   * @param d value to convert\n   * @param optionName Provides text to error messages e.g. disabledDates\n   * @param localization object containing locale and format settings. Only used with the custom formats\n   */\n  static dateConversion(\n    d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n    optionName: string,\n    localization: FormatLocalization\n  ): DateTime {\n    return convertToDateTime(d, optionName, localization);\n  }\n\n  private static _flattenDefaults: string[];\n\n  private static getFlattenDefaultOptions(): string[] {\n    if (this._flattenDefaults) return this._flattenDefaults;\n    const deepKeys = (t, pre = []) => {\n      if (Array.isArray(t)) return [];\n      if (Object(t) === t) {\n        return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\n      } else {\n        return pre.join('.');\n      }\n    };\n\n    this._flattenDefaults = deepKeys(DefaultOptions);\n\n    return this._flattenDefaults;\n  }\n\n  /**\n   * Some options conflict like min/max date. Verify that these kinds of options\n   * are set correctly.\n   * @param config\n   */\n  static _validateConflicts(config: Options) {\n    if (\n      config.display.sideBySide &&\n      (!config.display.components.clock ||\n        !(\n          config.display.components.hours ||\n          config.display.components.minutes ||\n          config.display.components.seconds\n        ))\n    ) {\n      Namespace.errorMessages.conflictingConfiguration(\n        'Cannot use side by side mode without the clock components'\n      );\n    }\n\n    if (config.restrictions.minDate && config.restrictions.maxDate) {\n      if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\n        Namespace.errorMessages.conflictingConfiguration(\n          'minDate is after maxDate'\n        );\n      }\n\n      if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\n        Namespace.errorMessages.conflictingConfiguration(\n          'maxDate is before minDate'\n        );\n      }\n    }\n\n    if (config.multipleDates && config.dateRange) {\n      Namespace.errorMessages.conflictingConfiguration(\n        'Cannot uss option \"multipleDates\" with \"dateRange\"'\n      );\n    }\n  }\n}\n", "import { DateTime, getFormatByUnit, Unit } from './datetime';\nimport Namespace from './utilities/namespace';\nimport {\n  ChangeEvent,\n  FailEvent,\n  ParseErrorEvent,\n} from './utilities/event-types';\nimport Validation from './validation';\nimport { serviceLocator } from './utilities/service-locator';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\nexport default class Dates {\n  private _dates: DateTime[] = [];\n  private optionsStore: OptionsStore;\n  private validation: Validation;\n  private _eventEmitters: EventEmitters;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.validation = serviceLocator.locate(Validation);\n    this._eventEmitters = serviceLocator.locate(EventEmitters);\n  }\n\n  /**\n   * Returns the array of selected dates\n   */\n  get picked(): DateTime[] {\n    return [...this._dates];\n  }\n\n  /**\n   * Returns the last picked value.\n   */\n  get lastPicked(): DateTime {\n    return this._dates[this.lastPickedIndex]?.clone;\n  }\n\n  /**\n   * Returns the length of picked dates -1 or 0 if none are selected.\n   */\n  get lastPickedIndex(): number {\n    if (this._dates.length === 0) return 0;\n    return this._dates.length - 1;\n  }\n\n  /**\n   * Formats a DateTime object to a string. Used when setting the input value.\n   * @param date\n   */\n  formatInput(date: DateTime): string {\n    if (!date) return '';\n    date.localization = this.optionsStore.options.localization;\n    return date.format();\n  }\n\n  /**\n   * parse the value into a DateTime object.\n   * this can be overwritten to supply your own parsing.\n   */\n  //eslint-disable-next-line @typescript-eslint/no-explicit-any\n  parseInput(value: any): DateTime {\n    try {\n      return OptionConverter.dateConversion(\n        value,\n        'input',\n        this.optionsStore.options.localization\n      );\n    } catch (e) {\n      this._eventEmitters.triggerEvent.emit({\n        type: Namespace.events.error,\n        reason: Namespace.errorMessages.failedToParseInput,\n        format: this.optionsStore.options.localization.format,\n        value: value,\n      } as ParseErrorEvent);\n      return undefined;\n    }\n  }\n\n  /**\n   * Tries to convert the provided value to a DateTime object.\n   * If value is null|undefined then clear the value of the provided index (or 0).\n   * @param value Value to convert or null|undefined\n   * @param index When using multidates this is the index in the array\n   */\n  //eslint-disable-next-line @typescript-eslint/no-explicit-any\n  setFromInput(value: any, index?: number) {\n    if (!value) {\n      this.setValue(undefined, index);\n      return;\n    }\n    const converted = this.parseInput(value);\n    if (converted) {\n      converted.setLocalization(this.optionsStore.options.localization);\n      this.setValue(converted, index);\n    }\n  }\n\n  /**\n   * Adds a new DateTime to selected dates array\n   * @param date\n   */\n  add(date: DateTime): void {\n    this._dates.push(date);\n  }\n\n  /**\n   * Returns true if the `targetDate` is part of the selected dates array.\n   * If `unit` is provided then a granularity to that unit will be used.\n   * @param targetDate\n   * @param unit\n   */\n  isPicked(targetDate: DateTime, unit?: Unit): boolean {\n    if (!DateTime.isValid(targetDate)) return false;\n    if (!unit)\n      return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\n\n    const format = getFormatByUnit(unit);\n\n    const innerDateFormatted = targetDate.format(format);\n\n    return (\n      this._dates\n        .map((x) => x.format(format))\n        .find((x) => x === innerDateFormatted) !== undefined\n    );\n  }\n\n  /**\n   * Returns the index at which `targetDate` is in the array.\n   * This is used for updating or removing a date when multi-date is used\n   * If `unit` is provided then a granularity to that unit will be used.\n   * @param targetDate\n   * @param unit\n   */\n  pickedIndex(targetDate: DateTime, unit?: Unit): number {\n    if (!DateTime.isValid(targetDate)) return -1;\n    if (!unit)\n      return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\n\n    const format = getFormatByUnit(unit);\n\n    const innerDateFormatted = targetDate.format(format);\n\n    return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\n  }\n\n  /**\n   * Clears all selected dates.\n   */\n  clear() {\n    this.optionsStore.unset = true;\n    this._eventEmitters.triggerEvent.emit({\n      type: Namespace.events.change,\n      date: undefined,\n      oldDate: this.lastPicked,\n      isClear: true,\n      isValid: true,\n    } as ChangeEvent);\n    this._dates = [];\n    if (this.optionsStore.input) this.optionsStore.input.value = '';\n    this._eventEmitters.updateDisplay.emit('all');\n  }\n\n  /**\n   * Find the \"book end\" years given a `year` and a `factor`\n   * @param factor e.g. 100 for decades\n   * @param year e.g. 2021\n   */\n  static getStartEndYear(\n    factor: number,\n    year: number\n  ): [number, number, number] {\n    const step = factor / 10,\n      startYear = Math.floor(year / factor) * factor,\n      endYear = startYear + step * 9,\n      focusValue = Math.floor(year / step) * step;\n    return [startYear, endYear, focusValue];\n  }\n\n  updateInput(target?: DateTime) {\n    if (!this.optionsStore.input) return;\n\n    let newValue = this.formatInput(target);\n    if (\n      this.optionsStore.options.multipleDates ||\n      this.optionsStore.options.dateRange\n    ) {\n      newValue = this._dates\n        .map((d) => this.formatInput(d))\n        .join(this.optionsStore.options.multipleDatesSeparator);\n    }\n    if (this.optionsStore.input.value != newValue)\n      this.optionsStore.input.value = newValue;\n  }\n\n  /**\n   * Attempts to either clear or set the `target` date at `index`.\n   * If the `target` is null then the date will be cleared.\n   * If multi-date is being used then it will be removed from the array.\n   * If `target` is valid and multi-date is used then if `index` is\n   * provided the date at that index will be replaced, otherwise it is appended.\n   * @param target\n   * @param index\n   */\n  setValue(target?: DateTime, index?: number): void {\n    const noIndex = typeof index === 'undefined',\n      isClear = !target && noIndex;\n    let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone;\n    if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\n      oldDate = this.lastPicked;\n    }\n\n    if (target && oldDate?.isSame(target)) {\n      this.updateInput(target);\n      return;\n    }\n\n    // case of calling setValue(null)\n    if (!target) {\n      this._setValueNull(isClear, index, oldDate);\n      return;\n    }\n\n    index = index || 0;\n    target = target.clone;\n\n    // minute stepping is being used, force the minute to the closest value\n    if (this.optionsStore.options.stepping !== 1) {\n      target.minutes =\n        Math.round(target.minutes / this.optionsStore.options.stepping) *\n        this.optionsStore.options.stepping;\n      target.startOf(Unit.minutes);\n    }\n\n    const onUpdate = (isValid: boolean) => {\n      this._dates[index] = target;\n      this._eventEmitters.updateViewDate.emit(target.clone);\n\n      this.updateInput(target);\n\n      this.optionsStore.unset = false;\n      this._eventEmitters.updateDisplay.emit('all');\n      this._eventEmitters.triggerEvent.emit({\n        type: Namespace.events.change,\n        date: target,\n        oldDate,\n        isClear,\n        isValid: isValid,\n      } as ChangeEvent);\n    };\n\n    if (\n      this.validation.isValid(target) &&\n      this.validation.dateRangeIsValid(this.picked, index, target)\n    ) {\n      onUpdate(true);\n      return;\n    }\n\n    if (this.optionsStore.options.keepInvalid) {\n      onUpdate(false);\n    }\n\n    this._eventEmitters.triggerEvent.emit({\n      type: Namespace.events.error,\n      reason: Namespace.errorMessages.failedToSetInvalidDate,\n      date: target,\n      oldDate,\n    } as FailEvent);\n  }\n\n  private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) {\n    if (\n      !this.optionsStore.options.multipleDates ||\n      this._dates.length === 1 ||\n      isClear\n    ) {\n      this.optionsStore.unset = true;\n      this._dates = [];\n    } else {\n      this._dates.splice(index, 1);\n    }\n\n    this.updateInput();\n\n    this._eventEmitters.triggerEvent.emit({\n      type: Namespace.events.change,\n      date: undefined,\n      oldDate,\n      isClear,\n      isValid: true,\n    } as ChangeEvent);\n\n    this._eventEmitters.updateDisplay.emit('all');\n  }\n}\n", "enum ActionTypes {\n  next = 'next',\n  previous = 'previous',\n  changeCalendarView = 'changeCalendarView',\n  selectMonth = 'selectMonth',\n  selectYear = 'selectYear',\n  selectDecade = 'selectDecade',\n  selectDay = 'selectDay',\n  selectHour = 'selectHour',\n  selectMinute = 'selectMinute',\n  selectSecond = 'selectSecond',\n  incrementHours = 'incrementHours',\n  incrementMinutes = 'incrementMinutes',\n  incrementSeconds = 'incrementSeconds',\n  decrementHours = 'decrementHours',\n  decrementMinutes = 'decrementMinutes',\n  decrementSeconds = 'decrementSeconds',\n  toggleMeridiem = 'toggleMeridiem',\n  togglePicker = 'togglePicker',\n  showClock = 'showClock',\n  showHours = 'showHours',\n  showMinutes = 'showMinutes',\n  showSeconds = 'showSeconds',\n  clear = 'clear',\n  close = 'close',\n  today = 'today',\n}\n\nexport default ActionTypes;\n", "import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `date`\n */\nexport default class DateDisplay {\n  private optionsStore: OptionsStore;\n  private dates: Dates;\n  private validation: Validation;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.dates = serviceLocator.locate(Dates);\n    this.validation = serviceLocator.locate(Validation);\n  }\n\n  /**\n   * Build the container html for the display\n   * @private\n   */\n  getPicker(): HTMLElement {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.daysContainer);\n\n    container.append(...this._daysOfTheWeek());\n\n    if (this.optionsStore.options.display.calendarWeeks) {\n      const div = document.createElement('div');\n      div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\n      container.appendChild(div);\n    }\n\n    const { rangeHoverEvent, rangeHoverOutEvent } =\n      this.handleMouseEvents(container);\n\n    for (let i = 0; i < 42; i++) {\n      if (i !== 0 && i % 7 === 0) {\n        if (this.optionsStore.options.display.calendarWeeks) {\n          const div = document.createElement('div');\n          div.classList.add(\n            Namespace.css.calendarWeeks,\n            Namespace.css.noHighlight\n          );\n          container.appendChild(div);\n        }\n      }\n\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.selectDay);\n      container.appendChild(div);\n\n      // if hover is supported then add the events\n      if (\n        matchMedia('(hover: hover)').matches &&\n        this.optionsStore.options.dateRange\n      ) {\n        div.addEventListener('mouseover', rangeHoverEvent);\n        div.addEventListener('mouseout', rangeHoverOutEvent);\n      }\n    }\n\n    return container;\n  }\n\n  /**\n   * Populates the grid and updates enabled states\n   * @private\n   */\n  _update(widget: HTMLElement, paint: Paint): void {\n    const container = widget.getElementsByClassName(\n      Namespace.css.daysContainer\n    )[0] as HTMLElement;\n\n    this._updateCalendarView(container);\n\n    const innerDate = this.optionsStore.viewDate.clone\n      .startOf(Unit.month)\n      .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n      .manipulate(12, Unit.hours);\n\n    this._handleCalendarWeeks(container, innerDate.clone);\n\n    container\n      .querySelectorAll(`[data-action=\"${ActionTypes.selectDay}\"]`)\n      .forEach((element: HTMLElement) => {\n        const classes: string[] = [];\n        classes.push(Namespace.css.day);\n\n        if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\n          classes.push(Namespace.css.old);\n        }\n        if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\n          classes.push(Namespace.css.new);\n        }\n\n        if (\n          !this.optionsStore.unset &&\n          !this.optionsStore.options.dateRange &&\n          this.dates.isPicked(innerDate, Unit.date)\n        ) {\n          classes.push(Namespace.css.active);\n        }\n        if (!this.validation.isValid(innerDate, Unit.date)) {\n          classes.push(Namespace.css.disabled);\n        }\n        if (innerDate.isSame(new DateTime(), Unit.date)) {\n          classes.push(Namespace.css.today);\n        }\n        if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\n          classes.push(Namespace.css.weekend);\n        }\n\n        this._handleDateRange(innerDate, classes);\n\n        paint(Unit.date, innerDate, classes, element);\n\n        element.classList.remove(...element.classList);\n        element.classList.add(...classes);\n        element.setAttribute('data-value', this._dateToDataValue(innerDate));\n        element.setAttribute('data-day', `${innerDate.date}`);\n        element.innerText = innerDate.parts(undefined, {\n          day: 'numeric',\n        }).day;\n        innerDate.manipulate(1, Unit.date);\n      });\n  }\n\n  private _dateToDataValue(date: DateTime): string {\n    if (!DateTime.isValid(date)) return '';\n\n    return `${date.year}-${date.month.toString().padStart(2, '0')}-${date.date\n      .toString()\n      .padStart(2, '0')}`;\n  }\n\n  private _handleDateRange(innerDate: DateTime, classes: string[]) {\n    const rangeStart = this.dates.picked[0];\n    const rangeEnd = this.dates.picked[1];\n\n    if (this.optionsStore.options.dateRange) {\n      if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\n        classes.push(Namespace.css.rangeIn);\n      }\n\n      if (innerDate.isSame(rangeStart, Unit.date)) {\n        classes.push(Namespace.css.rangeStart);\n      }\n\n      if (innerDate.isSame(rangeEnd, Unit.date)) {\n        classes.push(Namespace.css.rangeEnd);\n      }\n    }\n  }\n\n  private handleMouseEvents(container: HTMLElement) {\n    const rangeHoverEvent = (e: MouseEvent) => {\n      const currentTarget = e?.currentTarget as HTMLElement;\n\n      // if we have 0 or 2 selected or if the target is disabled then ignore\n      if (\n        this.dates.picked.length !== 1 ||\n        currentTarget.classList.contains(Namespace.css.disabled)\n      )\n        return;\n\n      // select all the date divs\n      const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n      // get the date value from the element being hovered over\n      const attributeValue = currentTarget.getAttribute('data-value');\n\n      // format the string to a date\n      const innerDate = DateTime.fromString(attributeValue, {\n        format: 'yyyy-MM-dd',\n      });\n\n      // find the position of the target in the date container\n      const dayIndex = allDays.findIndex(\n        (e) => e.getAttribute('data-value') === attributeValue\n      );\n\n      // find the first and second selected dates\n      const rangeStart = this.dates.picked[0];\n      const rangeEnd = this.dates.picked[1];\n\n      //format the start date so that it can be found by the attribute\n      const rangeStartFormatted = this._dateToDataValue(rangeStart);\n      const rangeStartIndex = allDays.findIndex(\n        (e) => e.getAttribute('data-value') === rangeStartFormatted\n      );\n      const rangeStartElement = allDays[rangeStartIndex];\n\n      //make sure we don't leave start/end classes if we don't need them\n      if (!innerDate.isSame(rangeStart, Unit.date)) {\n        currentTarget.classList.remove(Namespace.css.rangeStart);\n      }\n\n      if (!innerDate.isSame(rangeEnd, Unit.date)) {\n        currentTarget.classList.remove(Namespace.css.rangeEnd);\n      }\n\n      // the following figures out which direct from start date is selected\n      // the selection \"cap\" classes are applied if needed\n      // otherwise all the dates between will get the `rangeIn` class.\n      // We make this selection based on the element's index and the rangeStart index\n\n      let lambda: (_, index) => boolean;\n\n      if (innerDate.isBefore(rangeStart)) {\n        currentTarget.classList.add(Namespace.css.rangeStart);\n        rangeStartElement?.classList.remove(Namespace.css.rangeStart);\n        rangeStartElement?.classList.add(Namespace.css.rangeEnd);\n        lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\n      } else {\n        currentTarget.classList.add(Namespace.css.rangeEnd);\n        rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\n        rangeStartElement?.classList.add(Namespace.css.rangeStart);\n        lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\n      }\n\n      allDays.filter(lambda).forEach((e) => {\n        e.classList.add(Namespace.css.rangeIn);\n      });\n    };\n\n    const rangeHoverOutEvent = (e: MouseEvent) => {\n      // find all the dates in the container\n      const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n      // if only the start is selected, remove all the rangeIn classes\n      // we do this because once the user hovers over a new date the range will be recalculated.\n      if (this.dates.picked.length === 1)\n        allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\n\n      // if we have 0 or 2 dates selected then ignore\n      if (this.dates.picked.length !== 1) return;\n\n      const currentTarget = e?.currentTarget as HTMLElement;\n\n      // get the elements date from the attribute value\n      const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\n\n      // verify selections and remove invalid classes\n      if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\n        currentTarget.classList.remove(Namespace.css.rangeStart);\n      }\n\n      if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\n        currentTarget.classList.remove(Namespace.css.rangeEnd);\n      }\n    };\n\n    return { rangeHoverEvent, rangeHoverOutEvent };\n  }\n\n  private _updateCalendarView(container: Element) {\n    if (this.optionsStore.currentView !== 'calendar') return;\n    const [previous, switcher, next] = container.parentElement\n      .getElementsByClassName(Namespace.css.calendarHeader)[0]\n      .getElementsByTagName('div');\n    switcher.setAttribute(\n      Namespace.css.daysContainer,\n      this.optionsStore.viewDate.format(\n        this.optionsStore.options.localization.dayViewHeaderFormat\n      )\n    );\n    this.optionsStore.options.display.components.month\n      ? switcher.classList.remove(Namespace.css.disabled)\n      : switcher.classList.add(Namespace.css.disabled);\n    this.validation.isValid(\n      this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\n      Unit.month\n    )\n      ? previous.classList.remove(Namespace.css.disabled)\n      : previous.classList.add(Namespace.css.disabled);\n    this.validation.isValid(\n      this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\n      Unit.month\n    )\n      ? next.classList.remove(Namespace.css.disabled)\n      : next.classList.add(Namespace.css.disabled);\n  }\n\n  /***\n   * Generates a html row that contains the days of the week.\n   * @private\n   */\n  private _daysOfTheWeek(): HTMLElement[] {\n    const innerDate = this.optionsStore.viewDate.clone\n      .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n      .startOf(Unit.date);\n    const row = [];\n    document.createElement('div');\n\n    if (this.optionsStore.options.display.calendarWeeks) {\n      const htmlDivElement = document.createElement('div');\n      htmlDivElement.classList.add(\n        Namespace.css.calendarWeeks,\n        Namespace.css.noHighlight\n      );\n      htmlDivElement.innerText = '#';\n      row.push(htmlDivElement);\n    }\n\n    for (let i = 0; i < 7; i++) {\n      const htmlDivElement = document.createElement('div');\n      htmlDivElement.classList.add(\n        Namespace.css.dayOfTheWeek,\n        Namespace.css.noHighlight\n      );\n      let weekDay = innerDate.format({ weekday: 'short' });\n      if (this.optionsStore.options.localization.maxWeekdayLength > 0)\n        weekDay = weekDay.substring(\n          0,\n          this.optionsStore.options.localization.maxWeekdayLength\n        );\n      htmlDivElement.innerText = weekDay;\n      innerDate.manipulate(1, Unit.date);\n      row.push(htmlDivElement);\n    }\n\n    return row;\n  }\n\n  private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) {\n    [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\n      .filter((e: HTMLElement) => e.innerText !== '#')\n      .forEach((element: HTMLElement) => {\n        element.innerText = `${innerDate.week}`;\n        innerDate.manipulate(7, Unit.date);\n      });\n  }\n}\n", "import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `month`\n */\nexport default class MonthDisplay {\n  private optionsStore: OptionsStore;\n  private dates: Dates;\n  private validation: Validation;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.dates = serviceLocator.locate(Dates);\n    this.validation = serviceLocator.locate(Validation);\n  }\n  /**\n   * Build the container html for the display\n   * @private\n   */\n  getPicker(): HTMLElement {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.monthsContainer);\n\n    for (let i = 0; i < 12; i++) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.selectMonth);\n      container.appendChild(div);\n    }\n\n    return container;\n  }\n\n  /**\n   * Populates the grid and updates enabled states\n   * @private\n   */\n  _update(widget: HTMLElement, paint: Paint): void {\n    const container = widget.getElementsByClassName(\n      Namespace.css.monthsContainer\n    )[0];\n\n    if (this.optionsStore.currentView === 'months') {\n      const [previous, switcher, next] = container.parentElement\n        .getElementsByClassName(Namespace.css.calendarHeader)[0]\n        .getElementsByTagName('div');\n\n      switcher.setAttribute(\n        Namespace.css.monthsContainer,\n        this.optionsStore.viewDate.format({ year: 'numeric' })\n      );\n\n      this.optionsStore.options.display.components.year\n        ? switcher.classList.remove(Namespace.css.disabled)\n        : switcher.classList.add(Namespace.css.disabled);\n\n      this.validation.isValid(\n        this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\n        Unit.year\n      )\n        ? previous.classList.remove(Namespace.css.disabled)\n        : previous.classList.add(Namespace.css.disabled);\n\n      this.validation.isValid(\n        this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\n        Unit.year\n      )\n        ? next.classList.remove(Namespace.css.disabled)\n        : next.classList.add(Namespace.css.disabled);\n    }\n\n    const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\n\n    container\n      .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\n      .forEach((containerClone: HTMLElement, index) => {\n        const classes = [];\n        classes.push(Namespace.css.month);\n\n        if (\n          !this.optionsStore.unset &&\n          this.dates.isPicked(innerDate, Unit.month)\n        ) {\n          classes.push(Namespace.css.active);\n        }\n        if (!this.validation.isValid(innerDate, Unit.month)) {\n          classes.push(Namespace.css.disabled);\n        }\n\n        paint(Unit.month, innerDate, classes, containerClone);\n\n        containerClone.classList.remove(...containerClone.classList);\n        containerClone.classList.add(...classes);\n        containerClone.setAttribute('data-value', `${index}`);\n        containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\n        innerDate.manipulate(1, Unit.month);\n      });\n  }\n}\n", "import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Dates from '../../dates';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `year`\n */\nexport default class YearDisplay {\n  private _startYear: DateTime;\n  private _endYear: DateTime;\n  private optionsStore: OptionsStore;\n  private dates: Dates;\n  private validation: Validation;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.dates = serviceLocator.locate(Dates);\n    this.validation = serviceLocator.locate(Validation);\n  }\n\n  /**\n   * Build the container html for the display\n   * @private\n   */\n  getPicker(): HTMLElement {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.yearsContainer);\n\n    for (let i = 0; i < 12; i++) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.selectYear);\n      container.appendChild(div);\n    }\n\n    return container;\n  }\n\n  /**\n   * Populates the grid and updates enabled states\n   * @private\n   */\n  _update(widget: HTMLElement, paint: Paint) {\n    this._startYear = this.optionsStore.viewDate.clone.manipulate(\n      -1,\n      Unit.year\n    );\n    this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\n\n    const container = widget.getElementsByClassName(\n      Namespace.css.yearsContainer\n    )[0];\n\n    if (this.optionsStore.currentView === 'years') {\n      const [previous, switcher, next] = container.parentElement\n        .getElementsByClassName(Namespace.css.calendarHeader)[0]\n        .getElementsByTagName('div');\n\n      switcher.setAttribute(\n        Namespace.css.yearsContainer,\n        `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\n          year: 'numeric',\n        })}`\n      );\n\n      this.optionsStore.options.display.components.decades\n        ? switcher.classList.remove(Namespace.css.disabled)\n        : switcher.classList.add(Namespace.css.disabled);\n\n      this.validation.isValid(this._startYear, Unit.year)\n        ? previous.classList.remove(Namespace.css.disabled)\n        : previous.classList.add(Namespace.css.disabled);\n      this.validation.isValid(this._endYear, Unit.year)\n        ? next.classList.remove(Namespace.css.disabled)\n        : next.classList.add(Namespace.css.disabled);\n    }\n\n    const innerDate = this.optionsStore.viewDate.clone\n      .startOf(Unit.year)\n      .manipulate(-1, Unit.year);\n\n    container\n      .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\n      .forEach((containerClone: HTMLElement) => {\n        const classes = [];\n        classes.push(Namespace.css.year);\n\n        if (\n          !this.optionsStore.unset &&\n          this.dates.isPicked(innerDate, Unit.year)\n        ) {\n          classes.push(Namespace.css.active);\n        }\n        if (!this.validation.isValid(innerDate, Unit.year)) {\n          classes.push(Namespace.css.disabled);\n        }\n\n        paint(Unit.year, innerDate, classes, containerClone);\n\n        containerClone.classList.remove(...containerClone.classList);\n        containerClone.classList.add(...classes);\n        containerClone.setAttribute('data-value', `${innerDate.year}`);\n        containerClone.innerText = innerDate.format({ year: 'numeric' });\n\n        innerDate.manipulate(1, Unit.year);\n      });\n  }\n}\n", "import Dates from '../../dates';\nimport { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class DecadeDisplay {\n  private _startDecade: DateTime;\n  private _endDecade: DateTime;\n  private optionsStore: OptionsStore;\n  private dates: Dates;\n  private validation: Validation;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.dates = serviceLocator.locate(Dates);\n    this.validation = serviceLocator.locate(Validation);\n  }\n\n  /**\n   * Build the container html for the display\n   * @private\n   */\n  getPicker() {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.decadesContainer);\n\n    for (let i = 0; i < 12; i++) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.selectDecade);\n      container.appendChild(div);\n    }\n    return container;\n  }\n\n  /**\n   * Populates the grid and updates enabled states\n   * @private\n   */\n  _update(widget: HTMLElement, paint: Paint) {\n    const [start, end] = Dates.getStartEndYear(\n      100,\n      this.optionsStore.viewDate.year\n    );\n    this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n    this._startDecade.year = start;\n    this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n    this._endDecade.year = end;\n\n    const container = widget.getElementsByClassName(\n      Namespace.css.decadesContainer\n    )[0];\n\n    const [previous, switcher, next] = container.parentElement\n      .getElementsByClassName(Namespace.css.calendarHeader)[0]\n      .getElementsByTagName('div');\n\n    if (this.optionsStore.currentView === 'decades') {\n      switcher.setAttribute(\n        Namespace.css.decadesContainer,\n        `${this._startDecade.format({\n          year: 'numeric',\n        })}-${this._endDecade.format({ year: 'numeric' })}`\n      );\n\n      this.validation.isValid(this._startDecade, Unit.year)\n        ? previous.classList.remove(Namespace.css.disabled)\n        : previous.classList.add(Namespace.css.disabled);\n      this.validation.isValid(this._endDecade, Unit.year)\n        ? next.classList.remove(Namespace.css.disabled)\n        : next.classList.add(Namespace.css.disabled);\n    }\n\n    const pickedYears = this.dates.picked.map((x) => x.year);\n\n    container\n      .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\n      .forEach((containerClone: HTMLElement, index) => {\n        if (index === 0) {\n          containerClone.classList.add(Namespace.css.old);\n          if (this._startDecade.year - 10 < 0) {\n            containerClone.textContent = ' ';\n            previous.classList.add(Namespace.css.disabled);\n            containerClone.classList.add(Namespace.css.disabled);\n            containerClone.setAttribute('data-value', '');\n            return;\n          } else {\n            containerClone.innerText = this._startDecade.clone\n              .manipulate(-10, Unit.year)\n              .format({ year: 'numeric' });\n            containerClone.setAttribute(\n              'data-value',\n              `${this._startDecade.year}`\n            );\n            return;\n          }\n        }\n\n        const classes = [];\n        classes.push(Namespace.css.decade);\n        const startDecadeYear = this._startDecade.year;\n        const endDecadeYear = this._startDecade.year + 9;\n\n        if (\n          !this.optionsStore.unset &&\n          pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\n            .length > 0\n        ) {\n          classes.push(Namespace.css.active);\n        }\n        if (\n          !this.validation.isValid(this._startDecade, Unit.year) &&\n          !this.validation.isValid(\n            this._startDecade.clone.manipulate(10, Unit.year),\n            Unit.year\n          )\n        ) {\n          classes.push(Namespace.css.disabled);\n        }\n\n        paint('decade', this._startDecade, classes, containerClone);\n\n        containerClone.classList.remove(...containerClone.classList);\n        containerClone.classList.add(...classes);\n        containerClone.setAttribute('data-value', `${this._startDecade.year}`);\n        containerClone.innerText = `${this._startDecade.format({\n          year: 'numeric',\n        })}`;\n\n        this._startDecade.manipulate(10, Unit.year);\n      });\n  }\n}\n", "import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates the clock display\n */\nexport default class TimeDisplay {\n  private _gridColumns = '';\n  private optionsStore: OptionsStore;\n  private validation: Validation;\n  private dates: Dates;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.dates = serviceLocator.locate(Dates);\n    this.validation = serviceLocator.locate(Validation);\n  }\n\n  /**\n   * Build the container html for the clock display\n   * @private\n   */\n  getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.clockContainer);\n\n    container.append(...this._grid(iconTag));\n\n    return container;\n  }\n\n  /**\n   * Populates the various elements with in the clock display\n   * like the current hour and if the manipulation icons are enabled.\n   * @private\n   */\n  _update(widget: HTMLElement): void {\n    const timesDiv = <HTMLElement>(\n      widget.getElementsByClassName(Namespace.css.clockContainer)[0]\n    );\n    let lastPicked = this.dates.lastPicked?.clone;\n    if (!lastPicked && this.optionsStore.options.useCurrent)\n      lastPicked = this.optionsStore.viewDate.clone;\n\n    timesDiv\n      .querySelectorAll('.disabled')\n      .forEach((element) => element.classList.remove(Namespace.css.disabled));\n\n    if (this.optionsStore.options.display.components.hours) {\n      if (\n        !this.validation.isValid(\n          this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\n          Unit.hours\n        )\n      ) {\n        timesDiv\n          .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\n          .classList.add(Namespace.css.disabled);\n      }\n\n      if (\n        !this.validation.isValid(\n          this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\n          Unit.hours\n        )\n      ) {\n        timesDiv\n          .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\n          .classList.add(Namespace.css.disabled);\n      }\n\n      timesDiv.querySelector<HTMLElement>(\n        `[data-time-component=${Unit.hours}]`\n      ).innerText = lastPicked\n        ? lastPicked.getHoursFormatted(\n            this.optionsStore.options.localization.hourCycle\n          )\n        : '--';\n    }\n\n    if (this.optionsStore.options.display.components.minutes) {\n      if (\n        !this.validation.isValid(\n          this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\n          Unit.minutes\n        )\n      ) {\n        timesDiv\n          .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\n          .classList.add(Namespace.css.disabled);\n      }\n\n      if (\n        !this.validation.isValid(\n          this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\n          Unit.minutes\n        )\n      ) {\n        timesDiv\n          .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\n          .classList.add(Namespace.css.disabled);\n      }\n      timesDiv.querySelector<HTMLElement>(\n        `[data-time-component=${Unit.minutes}]`\n      ).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\n    }\n\n    if (this.optionsStore.options.display.components.seconds) {\n      if (\n        !this.validation.isValid(\n          this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\n          Unit.seconds\n        )\n      ) {\n        timesDiv\n          .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\n          .classList.add(Namespace.css.disabled);\n      }\n\n      if (\n        !this.validation.isValid(\n          this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\n          Unit.seconds\n        )\n      ) {\n        timesDiv\n          .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\n          .classList.add(Namespace.css.disabled);\n      }\n      timesDiv.querySelector<HTMLElement>(\n        `[data-time-component=${Unit.seconds}]`\n      ).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\n    }\n\n    if (this.optionsStore.isTwelveHour) {\n      const toggle = timesDiv.querySelector<HTMLElement>(\n        `[data-action=${ActionTypes.toggleMeridiem}]`\n      );\n\n      const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\n\n      toggle.innerText = meridiemDate.meridiem();\n\n      if (\n        !this.validation.isValid(\n          meridiemDate.manipulate(\n            meridiemDate.hours >= 12 ? -12 : 12,\n            Unit.hours\n          )\n        )\n      ) {\n        toggle.classList.add(Namespace.css.disabled);\n      } else {\n        toggle.classList.remove(Namespace.css.disabled);\n      }\n    }\n\n    timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\n  }\n\n  /**\n   * Creates the table for the clock display depending on what options are selected.\n   * @private\n   */\n  private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\n    this._gridColumns = '';\n    const top = [],\n      middle = [],\n      bottom = [],\n      separator = document.createElement('div'),\n      upIcon = iconTag(this.optionsStore.options.display.icons.up),\n      downIcon = iconTag(this.optionsStore.options.display.icons.down);\n\n    separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\n    const separatorColon = <HTMLElement>separator.cloneNode(true);\n    separatorColon.innerHTML = ':';\n\n    const getSeparator = (colon = false): HTMLElement => {\n      return colon\n        ? <HTMLElement>separatorColon.cloneNode(true)\n        : <HTMLElement>separator.cloneNode(true);\n    };\n\n    if (this.optionsStore.options.display.components.hours) {\n      let divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.incrementHour\n      );\n      divElement.setAttribute('data-action', ActionTypes.incrementHours);\n      divElement.appendChild(upIcon.cloneNode(true));\n      top.push(divElement);\n\n      divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.pickHour\n      );\n      divElement.setAttribute('data-action', ActionTypes.showHours);\n      divElement.setAttribute('data-time-component', Unit.hours);\n      middle.push(divElement);\n\n      divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.decrementHour\n      );\n      divElement.setAttribute('data-action', ActionTypes.decrementHours);\n      divElement.appendChild(downIcon.cloneNode(true));\n      bottom.push(divElement);\n      this._gridColumns += 'a';\n    }\n\n    if (this.optionsStore.options.display.components.minutes) {\n      this._gridColumns += ' a';\n      if (this.optionsStore.options.display.components.hours) {\n        top.push(getSeparator());\n        middle.push(getSeparator(true));\n        bottom.push(getSeparator());\n        this._gridColumns += ' a';\n      }\n      let divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.incrementMinute\n      );\n      divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\n      divElement.appendChild(upIcon.cloneNode(true));\n      top.push(divElement);\n\n      divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.pickMinute\n      );\n      divElement.setAttribute('data-action', ActionTypes.showMinutes);\n      divElement.setAttribute('data-time-component', Unit.minutes);\n      middle.push(divElement);\n\n      divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.decrementMinute\n      );\n      divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\n      divElement.appendChild(downIcon.cloneNode(true));\n      bottom.push(divElement);\n    }\n\n    if (this.optionsStore.options.display.components.seconds) {\n      this._gridColumns += ' a';\n      if (this.optionsStore.options.display.components.minutes) {\n        top.push(getSeparator());\n        middle.push(getSeparator(true));\n        bottom.push(getSeparator());\n        this._gridColumns += ' a';\n      }\n      let divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.incrementSecond\n      );\n      divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\n      divElement.appendChild(upIcon.cloneNode(true));\n      top.push(divElement);\n\n      divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.pickSecond\n      );\n      divElement.setAttribute('data-action', ActionTypes.showSeconds);\n      divElement.setAttribute('data-time-component', Unit.seconds);\n      middle.push(divElement);\n\n      divElement = document.createElement('div');\n      divElement.setAttribute(\n        'title',\n        this.optionsStore.options.localization.decrementSecond\n      );\n      divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\n      divElement.appendChild(downIcon.cloneNode(true));\n      bottom.push(divElement);\n    }\n\n    if (this.optionsStore.isTwelveHour) {\n      this._gridColumns += ' a';\n      let divElement = getSeparator();\n      top.push(divElement);\n\n      const button = document.createElement('button');\n      button.setAttribute('type', 'button');\n      button.setAttribute(\n        'title',\n        this.optionsStore.options.localization.toggleMeridiem\n      );\n      button.setAttribute('data-action', ActionTypes.toggleMeridiem);\n      button.setAttribute('tabindex', '-1');\n      if (Namespace.css.toggleMeridiem.includes(',')) {\n        //todo move this to paint function?\n        button.classList.add(...Namespace.css.toggleMeridiem.split(','));\n      } else button.classList.add(Namespace.css.toggleMeridiem);\n\n      divElement = document.createElement('div');\n      divElement.classList.add(Namespace.css.noHighlight);\n      divElement.appendChild(button);\n      middle.push(divElement);\n\n      divElement = getSeparator();\n      bottom.push(divElement);\n    }\n\n    this._gridColumns = this._gridColumns.trim();\n\n    return [...top, ...middle, ...bottom];\n  }\n}\n", "import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `hours`\n */\nexport default class HourDisplay {\n  private optionsStore: OptionsStore;\n  private validation: Validation;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.validation = serviceLocator.locate(Validation);\n  }\n  /**\n   * Build the container html for the display\n   * @private\n   */\n  getPicker(): HTMLElement {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.hourContainer);\n\n    for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.selectHour);\n      container.appendChild(div);\n    }\n\n    return container;\n  }\n\n  /**\n   * Populates the grid and updates enabled states\n   * @private\n   */\n  _update(widget: HTMLElement, paint: Paint): void {\n    const container = widget.getElementsByClassName(\n      Namespace.css.hourContainer\n    )[0];\n    const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\n\n    container\n      .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\n      .forEach((containerClone: HTMLElement) => {\n        const classes = [];\n        classes.push(Namespace.css.hour);\n\n        if (!this.validation.isValid(innerDate, Unit.hours)) {\n          classes.push(Namespace.css.disabled);\n        }\n\n        paint(Unit.hours, innerDate, classes, containerClone);\n\n        containerClone.classList.remove(...containerClone.classList);\n        containerClone.classList.add(...classes);\n        containerClone.setAttribute('data-value', `${innerDate.hours}`);\n        containerClone.innerText = innerDate.getHoursFormatted(\n          this.optionsStore.options.localization.hourCycle\n        );\n        innerDate.manipulate(1, Unit.hours);\n      });\n  }\n}\n", "import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `minutes`\n */\nexport default class MinuteDisplay {\n  private optionsStore: OptionsStore;\n  private validation: Validation;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.validation = serviceLocator.locate(Validation);\n  }\n  /**\n   * Build the container html for the display\n   * @private\n   */\n  getPicker(): HTMLElement {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.minuteContainer);\n\n    const step =\n      this.optionsStore.options.stepping === 1\n        ? 5\n        : this.optionsStore.options.stepping;\n    for (let i = 0; i < 60 / step; i++) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.selectMinute);\n      container.appendChild(div);\n    }\n\n    return container;\n  }\n\n  /**\n   * Populates the grid and updates enabled states\n   * @private\n   */\n  _update(widget: HTMLElement, paint: Paint): void {\n    const container = widget.getElementsByClassName(\n      Namespace.css.minuteContainer\n    )[0];\n    const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\n    const step =\n      this.optionsStore.options.stepping === 1\n        ? 5\n        : this.optionsStore.options.stepping;\n\n    container\n      .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\n      .forEach((containerClone: HTMLElement) => {\n        const classes = [];\n        classes.push(Namespace.css.minute);\n\n        if (!this.validation.isValid(innerDate, Unit.minutes)) {\n          classes.push(Namespace.css.disabled);\n        }\n\n        paint(Unit.minutes, innerDate, classes, containerClone);\n\n        containerClone.classList.remove(...containerClone.classList);\n        containerClone.classList.add(...classes);\n        containerClone.setAttribute('data-value', `${innerDate.minutes}`);\n        containerClone.innerText = innerDate.minutesFormatted;\n        innerDate.manipulate(step, Unit.minutes);\n      });\n  }\n}\n", "import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class secondDisplay {\n  private optionsStore: OptionsStore;\n  private validation: Validation;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.validation = serviceLocator.locate(Validation);\n  }\n  /**\n   * Build the container html for the display\n   * @private\n   */\n  getPicker(): HTMLElement {\n    const container = document.createElement('div');\n    container.classList.add(Namespace.css.secondContainer);\n\n    for (let i = 0; i < 12; i++) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.selectSecond);\n      container.appendChild(div);\n    }\n\n    return container;\n  }\n\n  /**\n   * Populates the grid and updates enabled states\n   * @private\n   */\n  _update(widget: HTMLElement, paint: Paint): void {\n    const container = widget.getElementsByClassName(\n      Namespace.css.secondContainer\n    )[0];\n    const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\n\n    container\n      .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\n      .forEach((containerClone: HTMLElement) => {\n        const classes = [];\n        classes.push(Namespace.css.second);\n\n        if (!this.validation.isValid(innerDate, Unit.seconds)) {\n          classes.push(Namespace.css.disabled);\n        }\n\n        paint(Unit.seconds, innerDate, classes, containerClone);\n\n        containerClone.classList.remove(...containerClone.classList);\n        containerClone.classList.add(...classes);\n        containerClone.setAttribute('data-value', `${innerDate.seconds}`);\n        containerClone.innerText = innerDate.secondsFormatted;\n        innerDate.manipulate(5, Unit.seconds);\n      });\n  }\n}\n", "import Namespace from '../utilities/namespace';\n\n/**\n * Provides a collapse functionality to the view changes\n */\nexport default class Collapse {\n  /**\n   * Flips the show/hide state of `target`\n   * @param target html element to affect.\n   */\n  static toggle(target: HTMLElement) {\n    if (target.classList.contains(Namespace.css.show)) {\n      this.hide(target);\n    } else {\n      this.show(target);\n    }\n  }\n\n  /**\n   * Skips any animation or timeouts and immediately set the element to show.\n   * @param target\n   */\n  static showImmediately(target: HTMLElement) {\n    target.classList.remove(Namespace.css.collapsing);\n    target.classList.add(Namespace.css.collapse, Namespace.css.show);\n    target.style.height = '';\n  }\n\n  /**\n   * If `target` is not already showing, then show after the animation.\n   * @param target\n   */\n  static show(target: HTMLElement) {\n    if (\n      target.classList.contains(Namespace.css.collapsing) ||\n      target.classList.contains(Namespace.css.show)\n    )\n      return;\n\n    let timeOut = null;\n    const complete = () => {\n      Collapse.showImmediately(target);\n      timeOut = null;\n    };\n\n    target.style.height = '0';\n    target.classList.remove(Namespace.css.collapse);\n    target.classList.add(Namespace.css.collapsing);\n\n    //eslint-disable-next-line @typescript-eslint/no-unused-vars\n    timeOut = setTimeout(\n      complete,\n      this.getTransitionDurationFromElement(target)\n    );\n    target.style.height = `${target.scrollHeight}px`;\n  }\n\n  /**\n   * Skips any animation or timeouts and immediately set the element to hide.\n   * @param target\n   */\n  static hideImmediately(target: HTMLElement) {\n    if (!target) return;\n    target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\n    target.classList.add(Namespace.css.collapse);\n  }\n\n  /**\n   * If `target` is not already hidden, then hide after the animation.\n   * @param target HTML Element\n   */\n  static hide(target: HTMLElement) {\n    if (\n      target.classList.contains(Namespace.css.collapsing) ||\n      !target.classList.contains(Namespace.css.show)\n    )\n      return;\n\n    let timeOut = null;\n    const complete = () => {\n      Collapse.hideImmediately(target);\n      timeOut = null;\n    };\n\n    target.style.height = `${target.getBoundingClientRect()['height']}px`;\n\n    const reflow = (element) => element.offsetHeight;\n\n    reflow(target);\n\n    target.classList.remove(Namespace.css.collapse, Namespace.css.show);\n    target.classList.add(Namespace.css.collapsing);\n    target.style.height = '';\n\n    //eslint-disable-next-line @typescript-eslint/no-unused-vars\n    timeOut = setTimeout(\n      complete,\n      this.getTransitionDurationFromElement(target)\n    );\n  }\n\n  /**\n   * Gets the transition duration from the `element` by getting css properties\n   * `transition-duration` and `transition-delay`\n   * @param element HTML Element\n   */\n  private static getTransitionDurationFromElement = (element: HTMLElement) => {\n    if (!element) {\n      return 0;\n    }\n\n    // Get transition-duration of the element\n    let { transitionDuration, transitionDelay } =\n      window.getComputedStyle(element);\n\n    const floatTransitionDuration = Number.parseFloat(transitionDuration);\n    const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n    // Return 0 if element or transition duration is not found\n    if (!floatTransitionDuration && !floatTransitionDelay) {\n      return 0;\n    }\n\n    // If multiple durations are defined, take the first\n    transitionDuration = transitionDuration.split(',')[0];\n    transitionDelay = transitionDelay.split(',')[0];\n\n    return (\n      (Number.parseFloat(transitionDuration) +\n        Number.parseFloat(transitionDelay)) *\n      1000\n    );\n  };\n}\n", "import DateDisplay from './calendar/date-display';\nimport MonthDisplay from './calendar/month-display';\nimport YearDisplay from './calendar/year-display';\nimport DecadeDisplay from './calendar/decade-display';\nimport TimeDisplay from './time/time-display';\nimport HourDisplay from './time/hour-display';\nimport MinuteDisplay from './time/minute-display';\nimport SecondDisplay from './time/second-display';\nimport { DateTime, Unit } from '../datetime';\nimport Namespace from '../utilities/namespace';\nimport { HideEvent } from '../utilities/event-types';\nimport Collapse from './collapse';\nimport Validation from '../validation';\nimport Dates from '../dates';\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\nimport { serviceLocator } from '../utilities/service-locator';\nimport ActionTypes from '../utilities/action-types';\nimport CalendarModes from '../utilities/calendar-modes';\nimport { OptionsStore } from '../utilities/optionsStore';\n\n/**\n * Main class for all things display related.\n */\nexport default class Display {\n  private _widget: HTMLElement;\n  private _popperInstance: any; // eslint-disable-line  @typescript-eslint/no-explicit-any\n  private _isVisible = false;\n  private optionsStore: OptionsStore;\n  private validation: Validation;\n  private dates: Dates;\n\n  dateDisplay: DateDisplay;\n  monthDisplay: MonthDisplay;\n  yearDisplay: YearDisplay;\n  decadeDisplay: DecadeDisplay;\n  timeDisplay: TimeDisplay;\n  hourDisplay: HourDisplay;\n  minuteDisplay: MinuteDisplay;\n  secondDisplay: SecondDisplay;\n  private _eventEmitters: EventEmitters;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.validation = serviceLocator.locate(Validation);\n    this.dates = serviceLocator.locate(Dates);\n\n    this.dateDisplay = serviceLocator.locate(DateDisplay);\n    this.monthDisplay = serviceLocator.locate(MonthDisplay);\n    this.yearDisplay = serviceLocator.locate(YearDisplay);\n    this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\n    this.timeDisplay = serviceLocator.locate(TimeDisplay);\n    this.hourDisplay = serviceLocator.locate(HourDisplay);\n    this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\n    this.secondDisplay = serviceLocator.locate(SecondDisplay);\n    this._eventEmitters = serviceLocator.locate(EventEmitters);\n    this._widget = undefined;\n\n    this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\n      this._update(result);\n    });\n  }\n\n  /**\n   * Returns the widget body or undefined\n   * @private\n   */\n  get widget(): HTMLElement | undefined {\n    return this._widget;\n  }\n\n  get dateContainer(): HTMLElement | undefined {\n    return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\n  }\n\n  get timeContainer(): HTMLElement | undefined {\n    return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\n  }\n\n  /**\n   * Returns this visible state of the picker (shown)\n   */\n  get isVisible() {\n    return this._isVisible;\n  }\n\n  /**\n   * Updates the table for a particular unit. Used when an option as changed or\n   * whenever the class list might need to be refreshed.\n   * @param unit\n   * @private\n   */\n  _update(unit: ViewUpdateValues): void {\n    if (!this.widget) return;\n    switch (unit) {\n      case Unit.seconds:\n        this.secondDisplay._update(this.widget, this.paint);\n        break;\n      case Unit.minutes:\n        this.minuteDisplay._update(this.widget, this.paint);\n        break;\n      case Unit.hours:\n        this.hourDisplay._update(this.widget, this.paint);\n        break;\n      case Unit.date:\n        this.dateDisplay._update(this.widget, this.paint);\n        break;\n      case Unit.month:\n        this.monthDisplay._update(this.widget, this.paint);\n        break;\n      case Unit.year:\n        this.yearDisplay._update(this.widget, this.paint);\n        break;\n      case 'decade':\n        this.decadeDisplay._update(this.widget, this.paint);\n        break;\n      case 'clock':\n        if (!this._hasTime) break;\n        this.timeDisplay._update(this.widget);\n        this._update(Unit.hours);\n        this._update(Unit.minutes);\n        this._update(Unit.seconds);\n        break;\n      case 'calendar':\n        this._update(Unit.date);\n        this._update(Unit.year);\n        this._update(Unit.month);\n        this.decadeDisplay._update(this.widget, this.paint);\n        this._updateCalendarHeader();\n        break;\n      case 'all':\n        if (this._hasTime) {\n          this._update('clock');\n        }\n        if (this._hasDate) {\n          this._update('calendar');\n        }\n    }\n  }\n\n  // noinspection JSUnusedLocalSymbols\n  /**\n   * Allows developers to add/remove classes from an element.\n   * @param _unit\n   * @param _date\n   * @param _classes\n   * @param _element\n   */\n\n  /* eslint-disable @typescript-eslint/no-unused-vars */\n  paint(\n    _unit: Unit | 'decade',\n    _date: DateTime,\n    _classes: string[],\n    _element: HTMLElement\n  ) {\n    // implemented in plugin\n  }\n\n  /**\n   * Shows the picker and creates a Popper instance if needed.\n   * Add document click event to hide when clicking outside the picker.\n   * fires Events#show\n   */\n  show(): void {\n    if (this.widget == undefined) {\n      this._showSetDefaultIfNeeded();\n\n      this._buildWidget();\n      this._updateTheme();\n\n      this._showSetupViewMode();\n\n      if (!this.optionsStore.options.display.inline) {\n        // If needed to change the parent container\n        const container = this.optionsStore.options?.container || document.body;\n        const placement =\n          this.optionsStore.options?.display?.placement || 'bottom';\n\n        container.appendChild(this.widget);\n        this.createPopup(this.optionsStore.element, this.widget, {\n          modifiers: [{ name: 'eventListeners', enabled: true }],\n          //#2400\n          placement:\n            document.documentElement.dir === 'rtl'\n              ? `${placement}-end`\n              : `${placement}-start`,\n        }).then();\n      } else {\n        this.optionsStore.element.appendChild(this.widget);\n      }\n\n      if (this.optionsStore.options.display.viewMode == 'clock') {\n        this._eventEmitters.action.emit({\n          e: null,\n          action: ActionTypes.showClock,\n        });\n      }\n\n      this.widget\n        .querySelectorAll('[data-action]')\n        .forEach((element) =>\n          element.addEventListener('click', this._actionsClickEvent)\n        );\n\n      // show the clock when using sideBySide\n      if (this._hasTime && this.optionsStore.options.display.sideBySide) {\n        this.timeDisplay._update(this.widget);\n        (\n          this.widget.getElementsByClassName(\n            Namespace.css.clockContainer\n          )[0] as HTMLElement\n        ).style.display = 'grid';\n      }\n    }\n\n    this.widget.classList.add(Namespace.css.show);\n    if (!this.optionsStore.options.display.inline) {\n      this.updatePopup();\n      document.addEventListener('click', this._documentClickEvent);\n    }\n    this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\n    this._isVisible = true;\n  }\n\n  private _showSetupViewMode() {\n    // If modeView is only clock\n    const onlyClock = this._hasTime && !this._hasDate;\n\n    // reset the view to the clock if there's no date components\n    if (onlyClock) {\n      this.optionsStore.currentView = 'clock';\n      this._eventEmitters.action.emit({\n        e: null,\n        action: ActionTypes.showClock,\n      });\n    }\n    // otherwise return to the calendar view\n    else if (!this.optionsStore.currentCalendarViewMode) {\n      this.optionsStore.currentCalendarViewMode =\n        this.optionsStore.minimumCalendarViewMode;\n    }\n\n    if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\n      if (this._hasTime) {\n        if (!this.optionsStore.options.display.sideBySide) {\n          Collapse.hideImmediately(this.timeContainer);\n        } else {\n          Collapse.show(this.timeContainer);\n        }\n      }\n      Collapse.show(this.dateContainer);\n    }\n\n    if (this._hasDate) {\n      this._showMode();\n    }\n  }\n\n  private _showSetDefaultIfNeeded() {\n    if (this.dates.picked.length != 0) return;\n\n    if (\n      this.optionsStore.options.useCurrent &&\n      !this.optionsStore.options.defaultDate\n    ) {\n      const date = new DateTime().setLocalization(\n        this.optionsStore.options.localization\n      );\n      if (!this.optionsStore.options.keepInvalid) {\n        let tries = 0;\n        let direction = 1;\n        if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\n          direction = -1;\n        }\n        while (!this.validation.isValid(date) && tries > 31) {\n          date.manipulate(direction, Unit.date);\n          tries++;\n        }\n      }\n      this.dates.setValue(date);\n    }\n\n    if (this.optionsStore.options.defaultDate) {\n      this.dates.setValue(this.optionsStore.options.defaultDate);\n    }\n  }\n\n  async createPopup(\n    element: HTMLElement,\n    widget: HTMLElement,\n    //eslint-disable-next-line @typescript-eslint/no-explicit-any\n    options: any\n  ): Promise<void> {\n    let createPopperFunction;\n    //eslint-disable-next-line @typescript-eslint/no-explicit-any\n    if ((window as any)?.Popper) {\n      //eslint-disable-next-line @typescript-eslint/no-explicit-any\n      createPopperFunction = (window as any)?.Popper?.createPopper;\n    } else {\n      const { createPopper } = await import('@popperjs/core');\n      createPopperFunction = createPopper;\n    }\n    if (createPopperFunction) {\n      this._popperInstance = createPopperFunction(element, widget, options);\n    }\n  }\n\n  updatePopup(): void {\n    this._popperInstance?.update();\n  }\n\n  /**\n   * Changes the calendar view mode. E.g. month <-> year\n   * @param direction -/+ number to move currentViewMode\n   * @private\n   */\n  _showMode(direction?: number): void {\n    if (!this.widget) {\n      return;\n    }\n    if (direction) {\n      const max = Math.max(\n        this.optionsStore.minimumCalendarViewMode,\n        Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\n      );\n      if (this.optionsStore.currentCalendarViewMode == max) return;\n      this.optionsStore.currentCalendarViewMode = max;\n    }\n\n    this.widget\n      .querySelectorAll(\n        `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\n      )\n      .forEach((e: HTMLElement) => (e.style.display = 'none'));\n\n    const datePickerMode =\n      CalendarModes[this.optionsStore.currentCalendarViewMode];\n    const picker: HTMLElement = this.widget.querySelector(\n      `.${datePickerMode.className}`\n    );\n\n    switch (datePickerMode.className) {\n      case Namespace.css.decadesContainer:\n        this.decadeDisplay._update(this.widget, this.paint);\n        break;\n      case Namespace.css.yearsContainer:\n        this.yearDisplay._update(this.widget, this.paint);\n        break;\n      case Namespace.css.monthsContainer:\n        this.monthDisplay._update(this.widget, this.paint);\n        break;\n      case Namespace.css.daysContainer:\n        this.dateDisplay._update(this.widget, this.paint);\n        break;\n    }\n\n    picker.style.display = 'grid';\n\n    if (this.optionsStore.options.display.sideBySide)\n      (<HTMLElement>(\n        this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]\n      )).style.display = 'grid';\n\n    this._updateCalendarHeader();\n    this._eventEmitters.viewUpdate.emit();\n  }\n\n  /**\n   * Changes the theme. E.g. light, dark or auto\n   * @param theme the theme name\n   * @private\n   */\n  _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\n    if (!this.widget) {\n      return;\n    }\n    if (theme) {\n      if (this.optionsStore.options.display.theme === theme) return;\n      this.optionsStore.options.display.theme = theme;\n    }\n\n    this.widget.classList.remove('light', 'dark');\n    this.widget.classList.add(this._getThemeClass());\n\n    if (this.optionsStore.options.display.theme === 'auto') {\n      window\n        .matchMedia(Namespace.css.isDarkPreferredQuery)\n        .addEventListener('change', () => this._updateTheme());\n    } else {\n      window\n        .matchMedia(Namespace.css.isDarkPreferredQuery)\n        .removeEventListener('change', () => this._updateTheme());\n    }\n  }\n\n  _getThemeClass(): string {\n    const currentTheme = this.optionsStore.options.display.theme || 'auto';\n\n    const isDarkMode =\n      window.matchMedia &&\n      window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\n\n    switch (currentTheme) {\n      case 'light':\n        return Namespace.css.lightTheme;\n      case 'dark':\n        return Namespace.css.darkTheme;\n      case 'auto':\n        return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\n    }\n  }\n\n  _updateCalendarHeader() {\n    if (!this._hasDate) return;\n    const showing = [\n      ...this.widget.querySelector(\n        `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\n      ).classList,\n    ].find((x) => x.startsWith(Namespace.css.dateContainer));\n\n    const [previous, switcher, next] = this.widget\n      .getElementsByClassName(Namespace.css.calendarHeader)[0]\n      .getElementsByTagName('div');\n\n    switch (showing) {\n      case Namespace.css.decadesContainer:\n        previous.setAttribute(\n          'title',\n          this.optionsStore.options.localization.previousCentury\n        );\n        switcher.setAttribute('title', '');\n        next.setAttribute(\n          'title',\n          this.optionsStore.options.localization.nextCentury\n        );\n        break;\n      case Namespace.css.yearsContainer:\n        previous.setAttribute(\n          'title',\n          this.optionsStore.options.localization.previousDecade\n        );\n        switcher.setAttribute(\n          'title',\n          this.optionsStore.options.localization.selectDecade\n        );\n        next.setAttribute(\n          'title',\n          this.optionsStore.options.localization.nextDecade\n        );\n        break;\n      case Namespace.css.monthsContainer:\n        previous.setAttribute(\n          'title',\n          this.optionsStore.options.localization.previousYear\n        );\n        switcher.setAttribute(\n          'title',\n          this.optionsStore.options.localization.selectYear\n        );\n        next.setAttribute(\n          'title',\n          this.optionsStore.options.localization.nextYear\n        );\n        break;\n      case Namespace.css.daysContainer:\n        previous.setAttribute(\n          'title',\n          this.optionsStore.options.localization.previousMonth\n        );\n        switcher.setAttribute(\n          'title',\n          this.optionsStore.options.localization.selectMonth\n        );\n        next.setAttribute(\n          'title',\n          this.optionsStore.options.localization.nextMonth\n        );\n        switcher.setAttribute(\n          showing,\n          this.optionsStore.viewDate.format(\n            this.optionsStore.options.localization.dayViewHeaderFormat\n          )\n        );\n        break;\n    }\n    switcher.innerText = switcher.getAttribute(showing);\n  }\n\n  /**\n   * Hides the picker if needed.\n   * Remove document click event to hide when clicking outside the picker.\n   * fires Events#hide\n   */\n  hide(): void {\n    if (!this.widget || !this._isVisible) return;\n\n    this.widget.classList.remove(Namespace.css.show);\n\n    if (this._isVisible) {\n      this._eventEmitters.triggerEvent.emit({\n        type: Namespace.events.hide,\n        date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\n      } as HideEvent);\n      this._isVisible = false;\n    }\n\n    document.removeEventListener('click', this._documentClickEvent);\n  }\n\n  /**\n   * Toggles the picker's open state. Fires a show/hide event depending.\n   */\n  toggle() {\n    return this._isVisible ? this.hide() : this.show();\n  }\n\n  /**\n   * Removes document and data-action click listener and reset the widget\n   * @private\n   */\n  _dispose() {\n    document.removeEventListener('click', this._documentClickEvent);\n    if (!this.widget) return;\n    this.widget\n      .querySelectorAll('[data-action]')\n      .forEach((element) =>\n        element.removeEventListener('click', this._actionsClickEvent)\n      );\n    this.widget.parentNode.removeChild(this.widget);\n    this._widget = undefined;\n  }\n\n  /**\n   * Builds the widgets html template.\n   * @private\n   */\n  private _buildWidget(): HTMLElement {\n    const template = document.createElement('div');\n    template.classList.add(Namespace.css.widget);\n\n    const dateView = document.createElement('div');\n    dateView.classList.add(Namespace.css.dateContainer);\n    dateView.append(\n      this.getHeadTemplate(),\n      this.decadeDisplay.getPicker(),\n      this.yearDisplay.getPicker(),\n      this.monthDisplay.getPicker(),\n      this.dateDisplay.getPicker()\n    );\n\n    const timeView = document.createElement('div');\n    timeView.classList.add(Namespace.css.timeContainer);\n    timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\n    timeView.appendChild(this.hourDisplay.getPicker());\n    timeView.appendChild(this.minuteDisplay.getPicker());\n    timeView.appendChild(this.secondDisplay.getPicker());\n\n    const toolbar = document.createElement('div');\n    toolbar.classList.add(Namespace.css.toolbar);\n    toolbar.append(...this.getToolbarElements());\n\n    if (this.optionsStore.options.display.inline) {\n      template.classList.add(Namespace.css.inline);\n    }\n\n    if (this.optionsStore.options.display.calendarWeeks) {\n      template.classList.add('calendarWeeks');\n    }\n\n    if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\n      this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\n      return;\n    }\n\n    if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n      template.appendChild(toolbar);\n    }\n\n    const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\n      if (!hasFirst) return;\n      if (hasSecond) {\n        element.classList.add(Namespace.css.collapse);\n        if (shouldShow) element.classList.add(Namespace.css.show);\n      }\n      template.appendChild(element);\n    };\n\n    setupComponentView(\n      this._hasDate,\n      this._hasTime,\n      dateView,\n      this.optionsStore.options.display.viewMode !== 'clock'\n    );\n\n    setupComponentView(\n      this._hasTime,\n      this._hasDate,\n      timeView,\n      this.optionsStore.options.display.viewMode === 'clock'\n    );\n\n    if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n      template.appendChild(toolbar);\n    }\n\n    const arrow = document.createElement('div');\n    arrow.classList.add('arrow');\n    arrow.setAttribute('data-popper-arrow', '');\n    template.appendChild(arrow);\n\n    this._widget = template;\n  }\n\n  private _buildWidgetSideBySide(\n    template: HTMLDivElement,\n    dateView: HTMLDivElement,\n    timeView: HTMLDivElement,\n    toolbar: HTMLDivElement\n  ) {\n    template.classList.add(Namespace.css.sideBySide);\n    if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n      template.appendChild(toolbar);\n    }\n    const row = document.createElement('div');\n    row.classList.add('td-row');\n    dateView.classList.add('td-half');\n    timeView.classList.add('td-half');\n\n    row.appendChild(dateView);\n    row.appendChild(timeView);\n    template.appendChild(row);\n    if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n      template.appendChild(toolbar);\n    }\n    this._widget = template;\n  }\n\n  /**\n   * Returns true if the hours, minutes, or seconds component is turned on\n   */\n  get _hasTime(): boolean {\n    return (\n      this.optionsStore.options.display.components.clock &&\n      (this.optionsStore.options.display.components.hours ||\n        this.optionsStore.options.display.components.minutes ||\n        this.optionsStore.options.display.components.seconds)\n    );\n  }\n\n  /**\n   * Returns true if the year, month, or date component is turned on\n   */\n  get _hasDate(): boolean {\n    return (\n      this.optionsStore.options.display.components.calendar &&\n      (this.optionsStore.options.display.components.year ||\n        this.optionsStore.options.display.components.month ||\n        this.optionsStore.options.display.components.date)\n    );\n  }\n\n  get _hasDateAndTime(): boolean {\n    return this._hasDate && this._hasTime;\n  }\n\n  /**\n   * Get the toolbar html based on options like buttons => today\n   * @private\n   */\n  getToolbarElements(): HTMLElement[] {\n    const toolbar = [];\n\n    if (this.optionsStore.options.display.buttons.today) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.today);\n      div.setAttribute('title', this.optionsStore.options.localization.today);\n\n      div.appendChild(\n        this._iconTag(this.optionsStore.options.display.icons.today)\n      );\n      toolbar.push(div);\n    }\n    if (\n      !this.optionsStore.options.display.sideBySide &&\n      this._hasDate &&\n      this._hasTime\n    ) {\n      let title, icon;\n      if (this.optionsStore.options.display.viewMode === 'clock') {\n        title = this.optionsStore.options.localization.selectDate;\n        icon = this.optionsStore.options.display.icons.date;\n      } else {\n        title = this.optionsStore.options.localization.selectTime;\n        icon = this.optionsStore.options.display.icons.time;\n      }\n\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.togglePicker);\n      div.setAttribute('title', title);\n\n      div.appendChild(this._iconTag(icon));\n      toolbar.push(div);\n    }\n    if (this.optionsStore.options.display.buttons.clear) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.clear);\n      div.setAttribute('title', this.optionsStore.options.localization.clear);\n\n      div.appendChild(\n        this._iconTag(this.optionsStore.options.display.icons.clear)\n      );\n      toolbar.push(div);\n    }\n    if (this.optionsStore.options.display.buttons.close) {\n      const div = document.createElement('div');\n      div.setAttribute('data-action', ActionTypes.close);\n      div.setAttribute('title', this.optionsStore.options.localization.close);\n\n      div.appendChild(\n        this._iconTag(this.optionsStore.options.display.icons.close)\n      );\n      toolbar.push(div);\n    }\n\n    return toolbar;\n  }\n\n  /***\n   * Builds the base header template with next and previous icons\n   * @private\n   */\n  getHeadTemplate(): HTMLElement {\n    const calendarHeader = document.createElement('div');\n    calendarHeader.classList.add(Namespace.css.calendarHeader);\n\n    const previous = document.createElement('div');\n    previous.classList.add(Namespace.css.previous);\n    previous.setAttribute('data-action', ActionTypes.previous);\n    previous.appendChild(\n      this._iconTag(this.optionsStore.options.display.icons.previous)\n    );\n\n    const switcher = document.createElement('div');\n    switcher.classList.add(Namespace.css.switch);\n    switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\n\n    const next = document.createElement('div');\n    next.classList.add(Namespace.css.next);\n    next.setAttribute('data-action', ActionTypes.next);\n    next.appendChild(\n      this._iconTag(this.optionsStore.options.display.icons.next)\n    );\n\n    calendarHeader.append(previous, switcher, next);\n    return calendarHeader;\n  }\n\n  /**\n   * Builds an icon tag as either an `<i>`\n   * or with icons => type is `sprites` then a svg tag instead\n   * @param iconClass\n   * @private\n   */\n  _iconTag(iconClass: string): HTMLElement | SVGElement {\n    if (this.optionsStore.options.display.icons.type === 'sprites') {\n      const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n      const icon = document.createElementNS(\n        'http://www.w3.org/2000/svg',\n        'use'\n      );\n      icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\n      icon.setAttribute('href', iconClass);\n      svg.appendChild(icon);\n\n      return svg;\n    }\n    const icon = document.createElement('i');\n    icon.classList.add(...iconClass.split(' '));\n    return icon;\n  }\n\n  /**\n   * A document click event to hide the widget if click is outside\n   * @private\n   * @param e MouseEvent\n   */\n  private _documentClickEvent = (e: MouseEvent) => {\n    if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any\n\n    if (\n      this._isVisible &&\n      !e.composedPath().includes(this.widget) && // click inside the widget\n      !e.composedPath()?.includes(this.optionsStore.element) // click on the element\n    ) {\n      this.hide();\n    }\n  };\n\n  /**\n   * Click event for any action like selecting a date\n   * @param e MouseEvent\n   * @private\n   */\n  private _actionsClickEvent = (e: MouseEvent) => {\n    this._eventEmitters.action.emit({ e: e });\n  };\n\n  /**\n   * Causes the widget to get rebuilt on next show. If the picker is already open\n   * then hide and reshow it.\n   * @private\n   */\n  _rebuild() {\n    const wasVisible = this._isVisible;\n    this._dispose();\n    if (wasVisible) this.show();\n  }\n\n  refreshCurrentView() {\n    //if the widget is not showing, just destroy it\n    if (!this._isVisible) this._dispose();\n\n    switch (this.optionsStore.currentView) {\n      case 'clock':\n        this._update('clock');\n        break;\n      case 'calendar':\n        this._update(Unit.date);\n        break;\n      case 'months':\n        this._update(Unit.month);\n        break;\n      case 'years':\n        this._update(Unit.year);\n        break;\n      case 'decades':\n        this._update('decade');\n        break;\n    }\n  }\n}\n\nexport type Paint = (\n  unit: Unit | 'decade',\n  innerDate: DateTime,\n  classes: string[],\n  element: HTMLElement\n) => void;\n", "import { DateTime, Unit } from './datetime';\nimport Collapse from './display/collapse';\nimport Namespace from './utilities/namespace';\nimport Dates from './dates';\nimport Validation from './validation';\nimport Display from './display';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { serviceLocator } from './utilities/service-locator.js';\nimport ActionTypes from './utilities/action-types';\nimport CalendarModes from './utilities/calendar-modes';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Logic for various click actions\n */\nexport default class Actions {\n  private optionsStore: OptionsStore;\n  private validation: Validation;\n  private dates: Dates;\n  private display: Display;\n  private _eventEmitters: EventEmitters;\n\n  constructor() {\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.dates = serviceLocator.locate(Dates);\n    this.validation = serviceLocator.locate(Validation);\n    this.display = serviceLocator.locate(Display);\n    this._eventEmitters = serviceLocator.locate(EventEmitters);\n\n    this._eventEmitters.action.subscribe((result) => {\n      this.do(result.e, result.action);\n    });\n  }\n\n  /**\n   * Performs the selected `action`. See ActionTypes\n   * @param e This is normally a click event\n   * @param action If not provided, then look for a [data-action]\n   */\n  //eslint-disable-next-line @typescript-eslint/no-explicit-any\n  do(e: any, action?: ActionTypes) {\n    const currentTarget = e?.currentTarget as HTMLElement;\n    if (currentTarget?.classList?.contains(Namespace.css.disabled)) return;\n    action = action || (currentTarget?.dataset?.action as ActionTypes);\n    const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\n      .clone;\n\n    switch (action) {\n      case ActionTypes.next:\n      case ActionTypes.previous:\n        this.handleNextPrevious(action);\n        break;\n      case ActionTypes.changeCalendarView:\n        this.display._showMode(1);\n        this.display._updateCalendarHeader();\n        break;\n      case ActionTypes.selectMonth:\n      case ActionTypes.selectYear:\n      case ActionTypes.selectDecade:\n        this.handleSelectCalendarMode(action, currentTarget);\n        break;\n      case ActionTypes.selectDay:\n        this.handleSelectDay(currentTarget);\n        break;\n      case ActionTypes.selectHour: {\n        let hour = +currentTarget.dataset.value;\n        if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\n          hour += 12;\n        lastPicked.hours = hour;\n        this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n        this.hideOrClock(e);\n        break;\n      }\n      case ActionTypes.selectMinute: {\n        lastPicked.minutes = +currentTarget.dataset.value;\n        this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n        this.hideOrClock(e);\n        break;\n      }\n      case ActionTypes.selectSecond: {\n        lastPicked.seconds = +currentTarget.dataset.value;\n        this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n        this.hideOrClock(e);\n        break;\n      }\n      case ActionTypes.incrementHours:\n        this.manipulateAndSet(lastPicked, Unit.hours);\n        break;\n      case ActionTypes.incrementMinutes:\n        this.manipulateAndSet(\n          lastPicked,\n          Unit.minutes,\n          this.optionsStore.options.stepping\n        );\n        break;\n      case ActionTypes.incrementSeconds:\n        this.manipulateAndSet(lastPicked, Unit.seconds);\n        break;\n      case ActionTypes.decrementHours:\n        this.manipulateAndSet(lastPicked, Unit.hours, -1);\n        break;\n      case ActionTypes.decrementMinutes:\n        this.manipulateAndSet(\n          lastPicked,\n          Unit.minutes,\n          this.optionsStore.options.stepping * -1\n        );\n        break;\n      case ActionTypes.decrementSeconds:\n        this.manipulateAndSet(lastPicked, Unit.seconds, -1);\n        break;\n      case ActionTypes.toggleMeridiem:\n        this.manipulateAndSet(\n          lastPicked,\n          Unit.hours,\n          this.dates.lastPicked.hours >= 12 ? -12 : 12\n        );\n        break;\n      case ActionTypes.togglePicker:\n        this.handleToggle(currentTarget);\n        break;\n      case ActionTypes.showClock:\n      case ActionTypes.showHours:\n      case ActionTypes.showMinutes:\n      case ActionTypes.showSeconds:\n        //make sure the clock is actually displaying\n        if (\n          !this.optionsStore.options.display.sideBySide &&\n          this.optionsStore.currentView !== 'clock'\n        ) {\n          //hide calendar\n          Collapse.hideImmediately(this.display.dateContainer);\n          //show clock\n          Collapse.showImmediately(this.display.timeContainer);\n        }\n        this.handleShowClockContainers(action);\n        break;\n      case ActionTypes.clear:\n        this.dates.setValue(null);\n        this.display._updateCalendarHeader();\n        break;\n      case ActionTypes.close:\n        this.display.hide();\n        break;\n      case ActionTypes.today: {\n        const today = new DateTime().setLocalization(\n          this.optionsStore.options.localization\n        );\n        this._eventEmitters.updateViewDate.emit(today);\n\n        //todo this this really a good idea?\n        if (this.validation.isValid(today, Unit.date))\n          this.dates.setValue(today, this.dates.lastPickedIndex);\n        break;\n      }\n    }\n  }\n\n  private handleShowClockContainers(action: ActionTypes) {\n    if (!this.display._hasTime) {\n      Namespace.errorMessages.throwError(\n        'Cannot show clock containers when time is disabled.'\n      );\n      /* ignore coverage: should never happen */\n      return;\n    }\n\n    this.optionsStore.currentView = 'clock';\n    this.display.widget\n      .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\n      .forEach(\n        (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\n      );\n\n    let classToUse = '';\n    switch (action) {\n      case ActionTypes.showClock:\n        classToUse = Namespace.css.clockContainer;\n        this.display._update('clock');\n        break;\n      case ActionTypes.showHours:\n        classToUse = Namespace.css.hourContainer;\n        this.display._update(Unit.hours);\n        break;\n      case ActionTypes.showMinutes:\n        classToUse = Namespace.css.minuteContainer;\n        this.display._update(Unit.minutes);\n        break;\n      case ActionTypes.showSeconds:\n        classToUse = Namespace.css.secondContainer;\n        this.display._update(Unit.seconds);\n        break;\n    }\n\n    (<HTMLElement>(\n      this.display.widget.getElementsByClassName(classToUse)[0]\n    )).style.display = 'grid';\n  }\n\n  private handleNextPrevious(action: ActionTypes) {\n    const { unit, step } =\n      CalendarModes[this.optionsStore.currentCalendarViewMode];\n    if (action === ActionTypes.next)\n      this.optionsStore.viewDate.manipulate(step, unit);\n    else this.optionsStore.viewDate.manipulate(step * -1, unit);\n    this._eventEmitters.viewUpdate.emit();\n\n    this.display._showMode();\n  }\n\n  /**\n   * After setting the value it will either show the clock or hide the widget.\n   * @param e\n   */\n  private hideOrClock(e) {\n    if (\n      !this.optionsStore.isTwelveHour &&\n      !this.optionsStore.options.display.components.minutes &&\n      !this.optionsStore.options.display.keepOpen &&\n      !this.optionsStore.options.display.inline\n    ) {\n      this.display.hide();\n    } else {\n      this.do(e, ActionTypes.showClock);\n    }\n  }\n\n  /**\n   * Common function to manipulate {@link lastPicked} by `unit`.\n   * @param lastPicked\n   * @param unit\n   * @param value Value to change by\n   */\n  private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\n    const newDate = lastPicked.manipulate(value, unit);\n    if (this.validation.isValid(newDate, unit)) {\n      this.dates.setValue(newDate, this.dates.lastPickedIndex);\n    }\n  }\n\n  private handleSelectCalendarMode(\n    action:\n      | ActionTypes.selectMonth\n      | ActionTypes.selectYear\n      | ActionTypes.selectDecade,\n    currentTarget: HTMLElement\n  ) {\n    const value = +currentTarget.dataset.value;\n    switch (action) {\n      case ActionTypes.selectMonth:\n        this.optionsStore.viewDate.month = value;\n        break;\n      case ActionTypes.selectYear:\n      case ActionTypes.selectDecade:\n        this.optionsStore.viewDate.year = value;\n        break;\n    }\n\n    if (\n      this.optionsStore.currentCalendarViewMode ===\n      this.optionsStore.minimumCalendarViewMode\n    ) {\n      this.dates.setValue(\n        this.optionsStore.viewDate,\n        this.dates.lastPickedIndex\n      );\n\n      if (!this.optionsStore.options.display.inline) {\n        this.display.hide();\n      }\n    } else {\n      this.display._showMode(-1);\n    }\n  }\n\n  private handleToggle(currentTarget: HTMLElement) {\n    if (\n      currentTarget.getAttribute('title') ===\n      this.optionsStore.options.localization.selectDate\n    ) {\n      currentTarget.setAttribute(\n        'title',\n        this.optionsStore.options.localization.selectTime\n      );\n      currentTarget.innerHTML = this.display._iconTag(\n        this.optionsStore.options.display.icons.time\n      ).outerHTML;\n\n      this.display._updateCalendarHeader();\n      this.optionsStore.refreshCurrentView();\n    } else {\n      currentTarget.setAttribute(\n        'title',\n        this.optionsStore.options.localization.selectDate\n      );\n      currentTarget.innerHTML = this.display._iconTag(\n        this.optionsStore.options.display.icons.date\n      ).outerHTML;\n      if (this.display._hasTime) {\n        this.handleShowClockContainers(ActionTypes.showClock);\n        this.display._update('clock');\n      }\n    }\n\n    this.display.widget\n      .querySelectorAll(\n        `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\n      )\n      .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\n    this._eventEmitters.viewUpdate.emit();\n  }\n\n  private handleSelectDay(currentTarget: HTMLElement) {\n    const day = this.optionsStore.viewDate.clone;\n    if (currentTarget.classList.contains(Namespace.css.old)) {\n      day.manipulate(-1, Unit.month);\n    }\n    if (currentTarget.classList.contains(Namespace.css.new)) {\n      day.manipulate(1, Unit.month);\n    }\n\n    day.date = +currentTarget.dataset.day;\n    if (this.optionsStore.options.dateRange) this.handleDateRange(day);\n    else if (this.optionsStore.options.multipleDates) {\n      this.handleMultiDate(day);\n    } else {\n      this.dates.setValue(day, this.dates.lastPickedIndex);\n    }\n\n    if (\n      !this.display._hasTime &&\n      !this.optionsStore.options.display.keepOpen &&\n      !this.optionsStore.options.display.inline &&\n      !this.optionsStore.options.multipleDates &&\n      !this.optionsStore.options.dateRange\n    ) {\n      this.display.hide();\n    }\n  }\n\n  private handleMultiDate(day: DateTime) {\n    let index = this.dates.pickedIndex(day, Unit.date);\n    console.log(index);\n    if (index !== -1) {\n      this.dates.setValue(null, index); //deselect multi-date\n    } else {\n      index = this.dates.lastPickedIndex + 1;\n      if (this.dates.picked.length === 0) index = 0;\n\n      this.dates.setValue(day, index);\n    }\n  }\n\n  private handleDateRange(day: DateTime) {\n    switch (this.dates.picked.length) {\n      case 2: {\n        this.dates.clear();\n        break;\n      }\n      case 1: {\n        const other = this.dates.picked[0];\n        if (day.getTime() === other.getTime()) {\n          this.dates.clear();\n          break;\n        }\n        if (day.isBefore(other)) {\n          this.dates.setValue(day, 0);\n          this.dates.setValue(other, 1);\n          return;\n        } else {\n          this.dates.setValue(day, 1);\n          return;\n        }\n      }\n    }\n\n    this.dates.setValue(day, 0);\n  }\n}\n", "import Display from './display/index';\nimport Dates from './dates';\nimport Actions from './actions';\nimport {\n  DateTime,\n  DateTimeFormatOptions,\n  guessHourCycle,\n  Unit,\n} from './datetime';\nimport Namespace from './utilities/namespace';\nimport Options from './utilities/options';\nimport {\n  BaseEvent,\n  ChangeEvent,\n  ViewUpdateEvent,\n} from './utilities/event-types';\nimport { EventEmitters } from './utilities/event-emitter';\nimport {\n  serviceLocator,\n  setupServiceLocator,\n} from './utilities/service-locator';\nimport CalendarModes from './utilities/calendar-modes';\nimport DefaultOptions, {\n  DefaultEnLocalization,\n} from './utilities/default-options';\nimport ActionTypes from './utilities/action-types';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\n/**\n * A robust and powerful date/time picker component.\n */\nclass TempusDominus {\n  //eslint-disable-next-line @typescript-eslint/no-explicit-any\n  _subscribers: { [key: string]: ((event: any) => Record<string, unknown>)[] } =\n    {};\n  private _isDisabled = false;\n  private _toggle: HTMLElement;\n  private _currentPromptTimeTimeout: NodeJS.Timeout;\n  private actions: Actions;\n  private optionsStore: OptionsStore;\n  private _eventEmitters: EventEmitters;\n  display: Display;\n  dates: Dates;\n\n  constructor(element: HTMLElement, options: Options = {} as Options) {\n    setupServiceLocator();\n    this._eventEmitters = serviceLocator.locate(EventEmitters);\n    this.optionsStore = serviceLocator.locate(OptionsStore);\n    this.display = serviceLocator.locate(Display);\n    this.dates = serviceLocator.locate(Dates);\n    this.actions = serviceLocator.locate(Actions);\n\n    if (!element) {\n      Namespace.errorMessages.mustProvideElement();\n    }\n\n    this.optionsStore.element = element;\n    this._initializeOptions(options, DefaultOptions, true);\n    this.optionsStore.viewDate.setLocalization(\n      this.optionsStore.options.localization\n    );\n    this.optionsStore.unset = true;\n\n    this._initializeInput();\n    this._initializeToggle();\n\n    if (this.optionsStore.options.display.inline) this.display.show();\n\n    this._eventEmitters.triggerEvent.subscribe((e) => {\n      this._triggerEvent(e);\n    });\n\n    this._eventEmitters.viewUpdate.subscribe(() => {\n      this._viewUpdate();\n    });\n\n    this._eventEmitters.updateViewDate.subscribe((dateTime) => {\n      this.viewDate = dateTime;\n    });\n  }\n\n  get viewDate() {\n    return this.optionsStore.viewDate;\n  }\n\n  set viewDate(value) {\n    this.optionsStore.viewDate = value;\n    this.optionsStore.viewDate.setLocalization(\n      this.optionsStore.options.localization\n    );\n    this.display._update(\n      this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'\n    );\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\n   * @param options\n   * @param reset\n   * @public\n   */\n  updateOptions(options, reset = false): void {\n    if (reset) this._initializeOptions(options, DefaultOptions);\n    else this._initializeOptions(options, this.optionsStore.options);\n\n    this.optionsStore.viewDate.setLocalization(\n      this.optionsStore.options.localization\n    );\n    this.display.refreshCurrentView();\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\n   * @public\n   */\n  toggle(): void {\n    if (this._isDisabled) return;\n    this.display.toggle();\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Shows the picker unless the picker is disabled.\n   * @public\n   */\n  show(): void {\n    if (this._isDisabled) return;\n    this.display.show();\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Hides the picker unless the picker is disabled.\n   * @public\n   */\n  hide(): void {\n    this.display.hide();\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Disables the picker and the target input field.\n   * @public\n   */\n  disable(): void {\n    this._isDisabled = true;\n    // todo this might be undesired. If a dev disables the input field to\n    // only allow using the picker, this will break that.\n    this.optionsStore.input?.setAttribute('disabled', 'disabled');\n    this.display.hide();\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Enables the picker and the target input field.\n   * @public\n   */\n  enable(): void {\n    this._isDisabled = false;\n    this.optionsStore.input?.removeAttribute('disabled');\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Clears all the selected dates\n   * @public\n   */\n  clear(): void {\n    this.optionsStore.input.value = '';\n    this.dates.clear();\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\n   * @param eventTypes See Namespace.Events\n   * @param callbacks Function to call when event is triggered\n   * @public\n   */\n  subscribe(\n    eventTypes: string | string[],\n    callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any\n  ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\n    if (typeof eventTypes === 'string') {\n      eventTypes = [eventTypes];\n    }\n    let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n    if (!Array.isArray(callbacks)) {\n      callBackArray = [callbacks];\n    } else {\n      callBackArray = callbacks;\n    }\n\n    if (eventTypes.length !== callBackArray.length) {\n      Namespace.errorMessages.subscribeMismatch();\n    }\n\n    const returnArray = [];\n\n    for (let i = 0; i < eventTypes.length; i++) {\n      const eventType = eventTypes[i];\n      if (!Array.isArray(this._subscribers[eventType])) {\n        this._subscribers[eventType] = [];\n      }\n\n      this._subscribers[eventType].push(callBackArray[i]);\n\n      returnArray.push({\n        unsubscribe: this._unsubscribe.bind(\n          this,\n          eventType,\n          this._subscribers[eventType].length - 1\n        ),\n      });\n\n      if (eventTypes.length === 1) {\n        return returnArray[0];\n      }\n    }\n\n    return returnArray;\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * Hides the picker and removes event listeners\n   */\n  dispose() {\n    this.display.hide();\n    // this will clear the document click event listener\n    this.display._dispose();\n    this._eventEmitters.destroy();\n    this.optionsStore.input?.removeEventListener(\n      'change',\n      this._inputChangeEvent\n    );\n    if (this.optionsStore.options.allowInputToggle) {\n      this.optionsStore.input?.removeEventListener(\n        'click',\n        this._openClickEvent\n      );\n      this.optionsStore.input?.removeEventListener(\n        'focus',\n        this._openClickEvent\n      );\n    }\n    this._toggle?.removeEventListener('click', this._toggleClickEvent);\n    this._subscribers = {};\n  }\n\n  /**\n   * Updates the options to use the provided language.\n   * THe language file must be loaded first.\n   * @param language\n   */\n  locale(language: string) {\n    const asked = loadedLocales[language];\n    if (!asked) return;\n    this.updateOptions({\n      localization: asked,\n    });\n  }\n\n  /**\n   * Triggers an event like ChangeEvent when the picker has updated the value\n   * of a selected date.\n   * @param event Accepts a BaseEvent object.\n   * @private\n   */\n  private _triggerEvent(event: BaseEvent) {\n    event.viewMode = this.optionsStore.currentView;\n\n    const isChangeEvent = event.type === Namespace.events.change;\n    if (isChangeEvent) {\n      const { date, oldDate, isClear } = event as ChangeEvent;\n      if (\n        (date && oldDate && date.isSame(oldDate)) ||\n        (!isClear && !date && !oldDate)\n      ) {\n        return;\n      }\n      this._handleAfterChangeEvent(event as ChangeEvent);\n\n      this.optionsStore.input?.dispatchEvent(\n        //eslint-disable-next-line @typescript-eslint/no-explicit-any\n        new CustomEvent('change', { detail: event as any })\n      );\n    }\n\n    this.optionsStore.element.dispatchEvent(\n      //eslint-disable-next-line @typescript-eslint/no-explicit-any\n      new CustomEvent(event.type, { detail: event as any })\n    );\n\n    //eslint-disable-next-line @typescript-eslint/no-explicit-any\n    if ((window as any).jQuery) {\n      //eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const $ = (window as any).jQuery;\n\n      if (isChangeEvent && this.optionsStore.input) {\n        $(this.optionsStore.input).trigger(event);\n      } else {\n        $(this.optionsStore.element).trigger(event);\n      }\n    }\n\n    this._publish(event);\n  }\n\n  private _publish(event: BaseEvent) {\n    // return if event is not subscribed\n    if (!Array.isArray(this._subscribers[event.type])) {\n      return;\n    }\n\n    // Trigger callback for each subscriber\n    this._subscribers[event.type].forEach((callback) => {\n      callback(event);\n    });\n  }\n\n  /**\n   * Fires a ViewUpdate event when, for example, the month view is changed.\n   * @private\n   */\n  private _viewUpdate() {\n    this._triggerEvent({\n      type: Namespace.events.update,\n      viewDate: this.optionsStore.viewDate.clone,\n    } as ViewUpdateEvent);\n  }\n\n  private _unsubscribe(eventName, index) {\n    this._subscribers[eventName].splice(index, 1);\n  }\n\n  /**\n   * Merges two Option objects together and validates options type\n   * @param config new Options\n   * @param mergeTo Options to merge into\n   * @param includeDataset When true, the elements data-td attributes will be included in the\n   * @private\n   */\n  private _initializeOptions(\n    config: Options,\n    mergeTo: Options,\n    includeDataset = false\n  ): void {\n    let newConfig = OptionConverter.deepCopy(config);\n    newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\n    if (includeDataset)\n      newConfig = OptionConverter._dataToOptions(\n        this.optionsStore.element,\n        newConfig\n      );\n\n    OptionConverter._validateConflicts(newConfig);\n\n    newConfig.viewDate = newConfig.viewDate.setLocalization(\n      newConfig.localization\n    );\n\n    if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\n      this.optionsStore.viewDate = newConfig.viewDate;\n    }\n\n    /**\n     * Sets the minimum view allowed by the picker. For example the case of only\n     * allowing year and month to be selected but not date.\n     */\n    if (newConfig.display.components.year) {\n      this.optionsStore.minimumCalendarViewMode = 2;\n    }\n    if (newConfig.display.components.month) {\n      this.optionsStore.minimumCalendarViewMode = 1;\n    }\n    if (newConfig.display.components.date) {\n      this.optionsStore.minimumCalendarViewMode = 0;\n    }\n\n    this.optionsStore.currentCalendarViewMode = Math.max(\n      this.optionsStore.minimumCalendarViewMode,\n      this.optionsStore.currentCalendarViewMode\n    );\n\n    // Update view mode if needed\n    if (\n      CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\n      newConfig.display.viewMode\n    ) {\n      this.optionsStore.currentCalendarViewMode = Math.max(\n        CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\n        this.optionsStore.minimumCalendarViewMode\n      );\n    }\n\n    if (this.display?.isVisible) {\n      this.display._update('all');\n    }\n\n    if (\n      newConfig.display.components.useTwentyfourHour &&\n      newConfig.localization.hourCycle === undefined\n    )\n      newConfig.localization.hourCycle = 'h24';\n    else if (newConfig.localization.hourCycle === undefined) {\n      newConfig.localization.hourCycle = guessHourCycle(\n        newConfig.localization.locale\n      );\n    }\n\n    this.optionsStore.options = newConfig;\n\n    if (\n      newConfig.restrictions.maxDate &&\n      this.viewDate.isAfter(newConfig.restrictions.maxDate)\n    )\n      this.viewDate = newConfig.restrictions.maxDate.clone;\n\n    if (\n      newConfig.restrictions.minDate &&\n      this.viewDate.isBefore(newConfig.restrictions.minDate)\n    )\n      this.viewDate = newConfig.restrictions.minDate.clone;\n  }\n\n  /**\n   * Checks if an input field is being used, attempts to locate one and sets an\n   * event listener if found.\n   * @private\n   */\n  private _initializeInput() {\n    if (this.optionsStore.element.tagName == 'INPUT') {\n      this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\n    } else {\n      const query = this.optionsStore.element.dataset.tdTargetInput;\n      if (query == undefined || query == 'nearest') {\n        this.optionsStore.input =\n          this.optionsStore.element.querySelector('input');\n      } else {\n        this.optionsStore.input =\n          this.optionsStore.element.querySelector(query);\n      }\n    }\n\n    if (!this.optionsStore.input) return;\n\n    if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\n      this.optionsStore.input.value = this.dates.formatInput(\n        this.optionsStore.options.defaultDate\n      );\n\n    this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\n    if (this.optionsStore.options.allowInputToggle) {\n      this.optionsStore.input.addEventListener('click', this._openClickEvent);\n      this.optionsStore.input.addEventListener('focus', this._openClickEvent);\n    }\n\n    if (this.optionsStore.input.value) {\n      this._inputChangeEvent();\n    }\n  }\n\n  /**\n   * Attempts to locate a toggle for the picker and sets an event listener\n   * @private\n   */\n  private _initializeToggle() {\n    if (this.optionsStore.options.display.inline) return;\n    let query = this.optionsStore.element.dataset.tdTargetToggle;\n    if (query == 'nearest') {\n      query = '[data-td-toggle=\"datetimepicker\"]';\n    }\n    this._toggle =\n      query == undefined\n        ? this.optionsStore.element\n        : this.optionsStore.element.querySelector(query);\n    this._toggle.addEventListener('click', this._toggleClickEvent);\n  }\n\n  /**\n   * If the option is enabled this will render the clock view after a date pick.\n   * @param e change event\n   * @private\n   */\n  private _handleAfterChangeEvent(e: ChangeEvent) {\n    if (\n      // options is disabled\n      !this.optionsStore.options.promptTimeOnDateChange ||\n      this.optionsStore.options.multipleDates ||\n      this.optionsStore.options.display.inline ||\n      this.optionsStore.options.display.sideBySide ||\n      // time is disabled\n      !this.display._hasTime ||\n      // clock component is already showing\n      this.display.widget\n        ?.getElementsByClassName(Namespace.css.show)[0]\n        .classList.contains(Namespace.css.timeContainer)\n    )\n      return;\n\n    // First time ever. If useCurrent option is set to true (default), do nothing\n    // because the first date is selected automatically.\n    // or date didn't change (time did) or date changed because time did.\n    if (\n      (!e.oldDate && this.optionsStore.options.useCurrent) ||\n      (e.oldDate && e.date?.isSame(e.oldDate))\n    ) {\n      return;\n    }\n\n    clearTimeout(this._currentPromptTimeTimeout);\n    this._currentPromptTimeTimeout = setTimeout(() => {\n      if (this.display.widget) {\n        this._eventEmitters.action.emit({\n          e: {\n            currentTarget: this.display.widget.querySelector(\n              '[data-action=\"togglePicker\"]'\n            ),\n          },\n          action: ActionTypes.togglePicker,\n        });\n      }\n    }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\n  }\n\n  /**\n   * Event for when the input field changes. This is a class level method so there's\n   * something for the remove listener function.\n   * @private\n   */\n  //eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _inputChangeEvent = (event?: any) => {\n    const internallyTriggered = event?.detail;\n    if (internallyTriggered) return;\n\n    const setViewDate = () => {\n      if (this.dates.lastPicked)\n        this.optionsStore.viewDate = this.dates.lastPicked.clone;\n    };\n\n    const value = this.optionsStore.input.value;\n    if (\n      this.optionsStore.options.multipleDates ||\n      this.optionsStore.options.dateRange\n    ) {\n      try {\n        const valueSplit = value.split(\n          this.optionsStore.options.multipleDatesSeparator\n        );\n        for (let i = 0; i < valueSplit.length; i++) {\n          this.dates.setFromInput(valueSplit[i], i);\n        }\n        setViewDate();\n      } catch {\n        console.warn(\n          'TD: Something went wrong trying to set the multipleDates values from the input field.'\n        );\n      }\n    } else {\n      this.dates.setFromInput(value, 0);\n      setViewDate();\n    }\n  };\n\n  /**\n   * Event for when the toggle is clicked. This is a class level method so there's\n   * something for the remove listener function.\n   * @private\n   */\n  private _toggleClickEvent = () => {\n    if (\n      (this.optionsStore.element as HTMLInputElement)?.disabled ||\n      this.optionsStore.input?.disabled ||\n      //if we just have the input and allow input toggle is enabled, then don't cause a toggle\n      (this._toggle.nodeName === 'INPUT' &&\n        (this._toggle as HTMLInputElement)?.type === 'text' &&\n        this.optionsStore.options.allowInputToggle)\n    )\n      return;\n    this.toggle();\n  };\n\n  /**\n   * Event for when the toggle is clicked. This is a class level method so there's\n   * something for the remove listener function.\n   * @private\n   */\n  private _openClickEvent = () => {\n    if (\n      (this.optionsStore.element as HTMLInputElement)?.disabled ||\n      this.optionsStore.input?.disabled\n    )\n      return;\n    if (!this.display.isVisible) this.show();\n  };\n}\n\n/**\n * Whenever a locale is loaded via a plugin then store it here based on the\n * locale name. E.g. loadedLocales['ru']\n */\nconst loadedLocales = {};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a locale plugin.\n * @param l locale object for localization options\n */\nconst loadLocale = (l) => {\n  if (loadedLocales[l.name]) return;\n  loadedLocales[l.name] = l.localization;\n};\n\n/**\n * A sets the global localization options to the provided locale name.\n * `loadLocale` MUST be called first.\n * @param l\n */\nconst locale = (l: string) => {\n  const asked = loadedLocales[l];\n  if (!asked) return;\n  DefaultOptions.localization = asked;\n};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a plugin to extend or override picker defaults.\n * @param plugin\n * @param option\n */\nconst extend = function (plugin, option = undefined) {\n  if (!plugin) return tempusDominus;\n  if (!plugin.installed) {\n    // install plugin only once\n    plugin(\n      option,\n      { TempusDominus, Dates, Display, DateTime, Namespace },\n      tempusDominus\n    );\n    plugin.installed = true;\n  }\n  return tempusDominus;\n};\n\nconst version = '6.9.4';\n\nconst tempusDominus = {\n  TempusDominus,\n  extend,\n  loadLocale,\n  locale,\n  Namespace,\n  DefaultOptions,\n  DateTime,\n  Unit,\n  version,\n  DefaultEnLocalization,\n};\n\nexport {\n  TempusDominus,\n  extend,\n  loadLocale,\n  locale,\n  Namespace,\n  DefaultOptions,\n  DateTime,\n  Unit,\n  version,\n  DateTimeFormatOptions,\n  Options,\n  DefaultEnLocalization,\n};\n", "import * as tempusDominus from \"@eonasdan/tempus-dominus\"\n\nconst DATE_DEFAULT_OPTIONS = {\n  display: {\n    components: {\n      decades: true,\n      year: true,\n      month: true,\n      date: true,\n      hours: false,\n      minutes: false,\n      seconds: false\n    },\n    icons: {\n      time: \"bi bi-clock\",\n      date: \"bi bi-calendar\",\n      up: \"bi bi-arrow-up\",\n      down: \"bi bi-arrow-down\",\n      previous: \"bi bi-chevron-left\",\n      next: \"bi bi-chevron-right\",\n      today: \"bi bi-calendar-check\",\n      clear: \"bi bi-trash\",\n      close: \"bi bi-x\"\n    },\n    buttons: {\n      today: true,\n      clear: true,\n      close: true\n    }\n  }\n}\n\nexport { tempusDominus, DATE_DEFAULT_OPTIONS }\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { tempusDominus, DATE_DEFAULT_OPTIONS } from \"../libs/tempus-dominus\"\n\n// Connects to data-controller=\"datepicker\"\nexport default class extends Controller {\n  static values = {\n    format: { type: String, default: \"dd.MM.yyyy\" },\n    locale: { type: String, default: \"pl\" },\n    withTime: { type: Boolean, default: false },\n    minDate: { type: String, default: \"\" },\n    maxDate: { type: String, default: \"\" }\n  }\n\n  connect() {\n    new tempusDominus.TempusDominus(this.element, this.defaultDateOptions)\n  }\n\n  get defaultDateOptions() {\n    if (this.withTimeValue) {\n      DATE_DEFAULT_OPTIONS.display.components.hours = true\n      DATE_DEFAULT_OPTIONS.display.components.minutes = true\n    }\n    else {\n      DATE_DEFAULT_OPTIONS.display.components.hours = false\n      DATE_DEFAULT_OPTIONS.display.components.minutes = false\n    }\n\n    return Object.assign(\n      {\n        restrictions: {\n          minDate: this.minDateOption,\n          maxDate: this.maxDateOption\n        },\n        localization: {\n          locale: this.localeValue,\n          format: this.formatValue,\n          startOfTheWeek: 1\n        }\n      }, DATE_DEFAULT_OPTIONS\n    )\n  }\n\n  get minDateOption() {\n    return (this.minDateValue == \"\" ? undefined : this.minDateValue)\n  }\n\n  get maxDateOption() {\n    return (this.maxDateValue == \"\" ? undefined : this.maxDateValue)\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { tempusDominus, DATE_DEFAULT_OPTIONS } from \"../libs/tempus-dominus\"\n\nexport default class extends Controller {\n  static targets = [\"dateFrom\", \"dateTo\"]\n\n  static values = {\n    format: { type: String, default: \"dd.MM.yyyy\" },\n    locale: { type: String, default: \"pl\" },\n    withTime: { type: Boolean, default: false }\n  }\n\n  connect() {\n    this.dateFrom = new tempusDominus.TempusDominus(this.dateFromTarget, this.dateFromOptions)\n    this.dateTo = new tempusDominus.TempusDominus(this.dateToTarget, this.dateToOptions)\n    this.dateFromObserveOnChange()\n    this.dateToObserveOnChange()\n  }\n\n  get dateFromOptions() {\n    return Object.assign({ restrictions: { maxDate: this.dateToValue } }, this.defaultDateOptions)\n  }\n\n  get dateToOptions() {\n    return Object.assign({ restrictions: { minDate: this.dateFromValue } }, this.defaultDateOptions)\n  }\n\n  get dateFromValue() {\n    return (this.dateFromTarget.value.trim().length === 0) ? undefined : this.dateFromTarget.value\n  }\n\n  get dateToValue() {\n    return (this.dateToTarget.value.trim().length === 0) ? undefined : this.dateToTarget.value\n  }\n\n  dateFromObserveOnChange() {\n    this.dateFromTarget.addEventListener(tempusDominus.Namespace.events.change, (event) => {\n      this.dateTo.updateOptions({\n        restrictions: {\n          minDate: event.detail.date,\n        }\n      })\n    })\n  }\n\n  dateToObserveOnChange() {\n    this.dateToTarget.addEventListener(tempusDominus.Namespace.events.change, (event) => {\n      this.dateFrom.updateOptions({\n        restrictions: {\n          maxDate: event.detail.date,\n        }\n      })\n    })\n  }\n\n  get defaultDateOptions() {\n    if (this.withTimeValue) {\n      DATE_DEFAULT_OPTIONS.display.components.hours = true\n      DATE_DEFAULT_OPTIONS.display.components.minutes = true\n    }\n    else {\n      DATE_DEFAULT_OPTIONS.display.components.hours = false\n      DATE_DEFAULT_OPTIONS.display.components.minutes = false\n    }\n\n    return Object.assign(\n      {\n        localization: {\n          locale: this.localeValue,\n          format: this.formatValue,\n          startOfTheWeek: 1\n        }\n      }, DATE_DEFAULT_OPTIONS\n    )\n  }\n}\n", "/*\n * FormSubmit allow dynamicly update forms on changed values in fields.\n *\n * example:\n *\n * <div data-controller=\"form-submit\">\n *   <form data-form-submit-target=\"form\"  >\n *     <select\n *       data-action: \"form-submit#submit\",\n *       data-form-submit-action-value: \"/users/1/update_form\",\n *       data-form-submit-method-value: \"patch\">\n *\n *     action & method are optional.\n *   </form>\n * </div>\n */\n\nimport { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n  static targets = [\"form\"]\n  static values = {\n    action: String,\n    method: String,\n    name: { type: String, default: \"submit_via_form_submit\" },\n  }\n\n  submit(event) {\n    event.preventDefault();\n    let submitter = this.submitter\n\n    if (submitter.formMethod && this.formMethod) {\n      this.formMethod.disabled = true\n    }\n\n    this.form.appendChild(submitter)\n    submitter.click()\n    this.form.removeChild(submitter)\n\n    if (submitter.formMethod && this.formMethod) {\n      this.formMethod.disabled = false\n    }\n  }\n\n  get submitter() {\n    let submitter = document.createElement(\"input\")\n\n    submitter.type = \"submit\"\n    submitter.name = this.nameValue\n    submitter.value = true\n    submitter.hidden = true\n\n    if (this.actionValue) submitter.formAction = this.actionValue\n    if (this.methodValue) submitter.formMethod = this.methodValue\n\n    return submitter\n  }\n\n  get formMethod() {\n    return this.form.querySelector(\"[name=_method]\")\n  }\n\n  get form() {\n    return this.formTarget\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n  connect() {\n    this.element.textContent = \"Hello World!\"\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport leaflet from \"leaflet\"\n\nexport default class extends Controller {\n  static values = {\n    iconUrl: String,\n    lat: Number,\n    lon: Number,\n    zoom: { type: Number, default: 1 }\n  }\n\n  connect() {\n    this.createMap()\n    this.disablePrefixAttributionControl()\n    this.addMarker()\n    this.addTileLayer()\n  }\n\n  createMap() {\n    this.map = leaflet.map(this.element, {\n      zoomControl: false,\n      scrollWheelZoom: false\n    }).setView([this.latValue, this.lonValue], this.zoomValue);\n  }\n\n  disablePrefixAttributionControl() {\n    this.map.attributionControl.setPrefix(false)\n  }\n\n  addMarker() {\n    leaflet.marker([this.latValue, this.lonValue], { icon: this.markerIcon }).addTo(this.map);\n  }\n\n  get markerIcon() {\n    return leaflet.icon({\n      iconUrl: this.iconUrlValue,\n      iconSize: [36, 54],\n      iconAnchor: [18, 54]\n    });\n  }\n\n  addTileLayer() {\n    leaflet.tileLayer(\"https://tile.openstreetmap.org/{z}/{x}/{y}.png\", {\n      attribution: \"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>\"\n    }).addTo(this.map)\n  }\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map()\n\nexport default {\n  set(element, key, instance) {\n    if (!elementMap.has(element)) {\n      elementMap.set(element, new Map())\n    }\n\n    const instanceMap = elementMap.get(element)\n\n    // make it clear we only want one instance per element\n    // can be removed later when multiple key/instances are fine to be used\n    if (!instanceMap.has(key) && instanceMap.size !== 0) {\n      // eslint-disable-next-line no-console\n      console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n      return\n    }\n\n    instanceMap.set(key, instance)\n  },\n\n  get(element, key) {\n    if (elementMap.has(element)) {\n      return elementMap.get(element).get(key) || null\n    }\n\n    return null\n  },\n\n  remove(element, key) {\n    if (!elementMap.has(element)) {\n      return\n    }\n\n    const instanceMap = elementMap.get(element)\n\n    instanceMap.delete(key)\n\n    // free up element references if there are no instances left for an element\n    if (instanceMap.size === 0) {\n      elementMap.delete(element)\n    }\n  }\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1_000_000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n  if (selector && window.CSS && window.CSS.escape) {\n    // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n    selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`)\n  }\n\n  return selector\n}\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n  if (object === null || object === undefined) {\n    return `${object}`\n  }\n\n  return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n  do {\n    prefix += Math.floor(Math.random() * MAX_UID)\n  } while (document.getElementById(prefix))\n\n  return prefix\n}\n\nconst getTransitionDurationFromElement = element => {\n  if (!element) {\n    return 0\n  }\n\n  // Get transition-duration of the element\n  let { transitionDuration, transitionDelay } = window.getComputedStyle(element)\n\n  const floatTransitionDuration = Number.parseFloat(transitionDuration)\n  const floatTransitionDelay = Number.parseFloat(transitionDelay)\n\n  // Return 0 if element or transition duration is not found\n  if (!floatTransitionDuration && !floatTransitionDelay) {\n    return 0\n  }\n\n  // If multiple durations are defined, take the first\n  transitionDuration = transitionDuration.split(',')[0]\n  transitionDelay = transitionDelay.split(',')[0]\n\n  return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n  element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = object => {\n  if (!object || typeof object !== 'object') {\n    return false\n  }\n\n  if (typeof object.jquery !== 'undefined') {\n    object = object[0]\n  }\n\n  return typeof object.nodeType !== 'undefined'\n}\n\nconst getElement = object => {\n  // it's a jQuery object or a node element\n  if (isElement(object)) {\n    return object.jquery ? object[0] : object\n  }\n\n  if (typeof object === 'string' && object.length > 0) {\n    return document.querySelector(parseSelector(object))\n  }\n\n  return null\n}\n\nconst isVisible = element => {\n  if (!isElement(element) || element.getClientRects().length === 0) {\n    return false\n  }\n\n  const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'\n  // Handle `details` element as its content may falsie appear visible when it is closed\n  const closedDetails = element.closest('details:not([open])')\n\n  if (!closedDetails) {\n    return elementIsVisible\n  }\n\n  if (closedDetails !== element) {\n    const summary = element.closest('summary')\n    if (summary && summary.parentNode !== closedDetails) {\n      return false\n    }\n\n    if (summary === null) {\n      return false\n    }\n  }\n\n  return elementIsVisible\n}\n\nconst isDisabled = element => {\n  if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n    return true\n  }\n\n  if (element.classList.contains('disabled')) {\n    return true\n  }\n\n  if (typeof element.disabled !== 'undefined') {\n    return element.disabled\n  }\n\n  return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'\n}\n\nconst findShadowRoot = element => {\n  if (!document.documentElement.attachShadow) {\n    return null\n  }\n\n  // Can find the shadow root otherwise it'll return the document\n  if (typeof element.getRootNode === 'function') {\n    const root = element.getRootNode()\n    return root instanceof ShadowRoot ? root : null\n  }\n\n  if (element instanceof ShadowRoot) {\n    return element\n  }\n\n  // when we don't find a shadow root\n  if (!element.parentNode) {\n    return null\n  }\n\n  return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => {}\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n  element.offsetHeight // eslint-disable-line no-unused-expressions\n}\n\nconst getjQuery = () => {\n  if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n    return window.jQuery\n  }\n\n  return null\n}\n\nconst DOMContentLoadedCallbacks = []\n\nconst onDOMContentLoaded = callback => {\n  if (document.readyState === 'loading') {\n    // add listener on the first call when the document is in loading state\n    if (!DOMContentLoadedCallbacks.length) {\n      document.addEventListener('DOMContentLoaded', () => {\n        for (const callback of DOMContentLoadedCallbacks) {\n          callback()\n        }\n      })\n    }\n\n    DOMContentLoadedCallbacks.push(callback)\n  } else {\n    callback()\n  }\n}\n\nconst isRTL = () => document.documentElement.dir === 'rtl'\n\nconst defineJQueryPlugin = plugin => {\n  onDOMContentLoaded(() => {\n    const $ = getjQuery()\n    /* istanbul ignore if */\n    if ($) {\n      const name = plugin.NAME\n      const JQUERY_NO_CONFLICT = $.fn[name]\n      $.fn[name] = plugin.jQueryInterface\n      $.fn[name].Constructor = plugin\n      $.fn[name].noConflict = () => {\n        $.fn[name] = JQUERY_NO_CONFLICT\n        return plugin.jQueryInterface\n      }\n    }\n  })\n}\n\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n  return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue\n}\n\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n  if (!waitForTransition) {\n    execute(callback)\n    return\n  }\n\n  const durationPadding = 5\n  const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding\n\n  let called = false\n\n  const handler = ({ target }) => {\n    if (target !== transitionElement) {\n      return\n    }\n\n    called = true\n    transitionElement.removeEventListener(TRANSITION_END, handler)\n    execute(callback)\n  }\n\n  transitionElement.addEventListener(TRANSITION_END, handler)\n  setTimeout(() => {\n    if (!called) {\n      triggerTransitionEnd(transitionElement)\n    }\n  }, emulatedDuration)\n}\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list    The list of elements\n * @param activeElement   The active element\n * @param shouldGetNext   Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n  const listLength = list.length\n  let index = list.indexOf(activeElement)\n\n  // if the element does not exist in the list return an element\n  // depending on the direction and if cycle is allowed\n  if (index === -1) {\n    return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]\n  }\n\n  index += shouldGetNext ? 1 : -1\n\n  if (isCycleAllowed) {\n    index = (index + listLength) % listLength\n  }\n\n  return list[Math.max(0, Math.min(index, listLength - 1))]\n}\n\nexport {\n  defineJQueryPlugin,\n  execute,\n  executeAfterTransition,\n  findShadowRoot,\n  getElement,\n  getjQuery,\n  getNextActiveElement,\n  getTransitionDurationFromElement,\n  getUID,\n  isDisabled,\n  isElement,\n  isRTL,\n  isVisible,\n  noop,\n  onDOMContentLoaded,\n  parseSelector,\n  reflow,\n  triggerTransitionEnd,\n  toType\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from '../util/index.js'\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/\nconst stripNameRegex = /\\..*/\nconst stripUidRegex = /::\\d+$/\nconst eventRegistry = {} // Events storage\nlet uidEvent = 1\nconst customEvents = {\n  mouseenter: 'mouseover',\n  mouseleave: 'mouseout'\n}\n\nconst nativeEvents = new Set([\n  'click',\n  'dblclick',\n  'mouseup',\n  'mousedown',\n  'contextmenu',\n  'mousewheel',\n  'DOMMouseScroll',\n  'mouseover',\n  'mouseout',\n  'mousemove',\n  'selectstart',\n  'selectend',\n  'keydown',\n  'keypress',\n  'keyup',\n  'orientationchange',\n  'touchstart',\n  'touchmove',\n  'touchend',\n  'touchcancel',\n  'pointerdown',\n  'pointermove',\n  'pointerup',\n  'pointerleave',\n  'pointercancel',\n  'gesturestart',\n  'gesturechange',\n  'gestureend',\n  'focus',\n  'blur',\n  'change',\n  'reset',\n  'select',\n  'submit',\n  'focusin',\n  'focusout',\n  'load',\n  'unload',\n  'beforeunload',\n  'resize',\n  'move',\n  'DOMContentLoaded',\n  'readystatechange',\n  'error',\n  'abort',\n  'scroll'\n])\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n  return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++\n}\n\nfunction getElementEvents(element) {\n  const uid = makeEventUid(element)\n\n  element.uidEvent = uid\n  eventRegistry[uid] = eventRegistry[uid] || {}\n\n  return eventRegistry[uid]\n}\n\nfunction bootstrapHandler(element, fn) {\n  return function handler(event) {\n    hydrateObj(event, { delegateTarget: element })\n\n    if (handler.oneOff) {\n      EventHandler.off(element, event.type, fn)\n    }\n\n    return fn.apply(element, [event])\n  }\n}\n\nfunction bootstrapDelegationHandler(element, selector, fn) {\n  return function handler(event) {\n    const domElements = element.querySelectorAll(selector)\n\n    for (let { target } = event; target && target !== this; target = target.parentNode) {\n      for (const domElement of domElements) {\n        if (domElement !== target) {\n          continue\n        }\n\n        hydrateObj(event, { delegateTarget: target })\n\n        if (handler.oneOff) {\n          EventHandler.off(element, event.type, selector, fn)\n        }\n\n        return fn.apply(target, [event])\n      }\n    }\n  }\n}\n\nfunction findHandler(events, callable, delegationSelector = null) {\n  return Object.values(events)\n    .find(event => event.callable === callable && event.delegationSelector === delegationSelector)\n}\n\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n  const isDelegated = typeof handler === 'string'\n  // TODO: tooltip passes `false` instead of selector, so we need to check\n  const callable = isDelegated ? delegationFunction : (handler || delegationFunction)\n  let typeEvent = getTypeEvent(originalTypeEvent)\n\n  if (!nativeEvents.has(typeEvent)) {\n    typeEvent = originalTypeEvent\n  }\n\n  return [isDelegated, callable, typeEvent]\n}\n\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n  if (typeof originalTypeEvent !== 'string' || !element) {\n    return\n  }\n\n  let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n\n  // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n  // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n  if (originalTypeEvent in customEvents) {\n    const wrapFunction = fn => {\n      return function (event) {\n        if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {\n          return fn.call(this, event)\n        }\n      }\n    }\n\n    callable = wrapFunction(callable)\n  }\n\n  const events = getElementEvents(element)\n  const handlers = events[typeEvent] || (events[typeEvent] = {})\n  const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null)\n\n  if (previousFunction) {\n    previousFunction.oneOff = previousFunction.oneOff && oneOff\n\n    return\n  }\n\n  const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''))\n  const fn = isDelegated ?\n    bootstrapDelegationHandler(element, handler, callable) :\n    bootstrapHandler(element, callable)\n\n  fn.delegationSelector = isDelegated ? handler : null\n  fn.callable = callable\n  fn.oneOff = oneOff\n  fn.uidEvent = uid\n  handlers[uid] = fn\n\n  element.addEventListener(typeEvent, fn, isDelegated)\n}\n\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n  const fn = findHandler(events[typeEvent], handler, delegationSelector)\n\n  if (!fn) {\n    return\n  }\n\n  element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))\n  delete events[typeEvent][fn.uidEvent]\n}\n\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n  const storeElementEvent = events[typeEvent] || {}\n\n  for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n    if (handlerKey.includes(namespace)) {\n      removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n    }\n  }\n}\n\nfunction getTypeEvent(event) {\n  // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n  event = event.replace(stripNameRegex, '')\n  return customEvents[event] || event\n}\n\nconst EventHandler = {\n  on(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, false)\n  },\n\n  one(element, event, handler, delegationFunction) {\n    addHandler(element, event, handler, delegationFunction, true)\n  },\n\n  off(element, originalTypeEvent, handler, delegationFunction) {\n    if (typeof originalTypeEvent !== 'string' || !element) {\n      return\n    }\n\n    const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n    const inNamespace = typeEvent !== originalTypeEvent\n    const events = getElementEvents(element)\n    const storeElementEvent = events[typeEvent] || {}\n    const isNamespace = originalTypeEvent.startsWith('.')\n\n    if (typeof callable !== 'undefined') {\n      // Simplest case: handler is passed, remove that listener ONLY.\n      if (!Object.keys(storeElementEvent).length) {\n        return\n      }\n\n      removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null)\n      return\n    }\n\n    if (isNamespace) {\n      for (const elementEvent of Object.keys(events)) {\n        removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))\n      }\n    }\n\n    for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n      const handlerKey = keyHandlers.replace(stripUidRegex, '')\n\n      if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n        removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n      }\n    }\n  },\n\n  trigger(element, event, args) {\n    if (typeof event !== 'string' || !element) {\n      return null\n    }\n\n    const $ = getjQuery()\n    const typeEvent = getTypeEvent(event)\n    const inNamespace = event !== typeEvent\n\n    let jQueryEvent = null\n    let bubbles = true\n    let nativeDispatch = true\n    let defaultPrevented = false\n\n    if (inNamespace && $) {\n      jQueryEvent = $.Event(event, args)\n\n      $(element).trigger(jQueryEvent)\n      bubbles = !jQueryEvent.isPropagationStopped()\n      nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()\n      defaultPrevented = jQueryEvent.isDefaultPrevented()\n    }\n\n    const evt = hydrateObj(new Event(event, { bubbles, cancelable: true }), args)\n\n    if (defaultPrevented) {\n      evt.preventDefault()\n    }\n\n    if (nativeDispatch) {\n      element.dispatchEvent(evt)\n    }\n\n    if (evt.defaultPrevented && jQueryEvent) {\n      jQueryEvent.preventDefault()\n    }\n\n    return evt\n  }\n}\n\nfunction hydrateObj(obj, meta = {}) {\n  for (const [key, value] of Object.entries(meta)) {\n    try {\n      obj[key] = value\n    } catch {\n      Object.defineProperty(obj, key, {\n        configurable: true,\n        get() {\n          return value\n        }\n      })\n    }\n  }\n\n  return obj\n}\n\nexport default EventHandler\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n  if (value === 'true') {\n    return true\n  }\n\n  if (value === 'false') {\n    return false\n  }\n\n  if (value === Number(value).toString()) {\n    return Number(value)\n  }\n\n  if (value === '' || value === 'null') {\n    return null\n  }\n\n  if (typeof value !== 'string') {\n    return value\n  }\n\n  try {\n    return JSON.parse(decodeURIComponent(value))\n  } catch {\n    return value\n  }\n}\n\nfunction normalizeDataKey(key) {\n  return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n  setDataAttribute(element, key, value) {\n    element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n  },\n\n  removeDataAttribute(element, key) {\n    element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n  },\n\n  getDataAttributes(element) {\n    if (!element) {\n      return {}\n    }\n\n    const attributes = {}\n    const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'))\n\n    for (const key of bsKeys) {\n      let pureKey = key.replace(/^bs/, '')\n      pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n      attributes[pureKey] = normalizeData(element.dataset[key])\n    }\n\n    return attributes\n  },\n\n  getDataAttribute(element, key) {\n    return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n  }\n}\n\nexport default Manipulator\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport { isElement, toType } from './index.js'\n\n/**\n * Class definition\n */\n\nclass Config {\n  // Getters\n  static get Default() {\n    return {}\n  }\n\n  static get DefaultType() {\n    return {}\n  }\n\n  static get NAME() {\n    throw new Error('You have to implement the static method \"NAME\", for each component!')\n  }\n\n  _getConfig(config) {\n    config = this._mergeConfigObj(config)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  _configAfterMerge(config) {\n    return config\n  }\n\n  _mergeConfigObj(config, element) {\n    const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {} // try to parse\n\n    return {\n      ...this.constructor.Default,\n      ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n      ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n      ...(typeof config === 'object' ? config : {})\n    }\n  }\n\n  _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n    for (const [property, expectedTypes] of Object.entries(configTypes)) {\n      const value = config[property]\n      const valueType = isElement(value) ? 'element' : toType(value)\n\n      if (!new RegExp(expectedTypes).test(valueType)) {\n        throw new TypeError(\n          `${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`\n        )\n      }\n    }\n  }\n}\n\nexport default Config\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Data from './dom/data.js'\nimport EventHandler from './dom/event-handler.js'\nimport Config from './util/config.js'\nimport { executeAfterTransition, getElement } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.2'\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n  constructor(element, config) {\n    super()\n\n    element = getElement(element)\n    if (!element) {\n      return\n    }\n\n    this._element = element\n    this._config = this._getConfig(config)\n\n    Data.set(this._element, this.constructor.DATA_KEY, this)\n  }\n\n  // Public\n  dispose() {\n    Data.remove(this._element, this.constructor.DATA_KEY)\n    EventHandler.off(this._element, this.constructor.EVENT_KEY)\n\n    for (const propertyName of Object.getOwnPropertyNames(this)) {\n      this[propertyName] = null\n    }\n  }\n\n  _queueCallback(callback, element, isAnimated = true) {\n    executeAfterTransition(callback, element, isAnimated)\n  }\n\n  _getConfig(config) {\n    config = this._mergeConfigObj(config, this._element)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  // Static\n  static getInstance(element) {\n    return Data.get(getElement(element), this.DATA_KEY)\n  }\n\n  static getOrCreateInstance(element, config = {}) {\n    return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null)\n  }\n\n  static get VERSION() {\n    return VERSION\n  }\n\n  static get DATA_KEY() {\n    return `bs.${this.NAME}`\n  }\n\n  static get EVENT_KEY() {\n    return `.${this.DATA_KEY}`\n  }\n\n  static eventName(name) {\n    return `${name}${this.EVENT_KEY}`\n  }\n}\n\nexport default BaseComponent\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { isDisabled, isVisible, parseSelector } from '../util/index.js'\n\nconst getSelector = element => {\n  let selector = element.getAttribute('data-bs-target')\n\n  if (!selector || selector === '#') {\n    let hrefAttribute = element.getAttribute('href')\n\n    // The only valid content that could double as a selector are IDs or classes,\n    // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n    // `document.querySelector` will rightfully complain it is invalid.\n    // See https://github.com/twbs/bootstrap/issues/32273\n    if (!hrefAttribute || (!hrefAttribute.includes('#') && !hrefAttribute.startsWith('.'))) {\n      return null\n    }\n\n    // Just in case some CMS puts out a full URL with the anchor appended\n    if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n      hrefAttribute = `#${hrefAttribute.split('#')[1]}`\n    }\n\n    selector = hrefAttribute && hrefAttribute !== '#' ? parseSelector(hrefAttribute.trim()) : null\n  }\n\n  return selector\n}\n\nconst SelectorEngine = {\n  find(selector, element = document.documentElement) {\n    return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n  },\n\n  findOne(selector, element = document.documentElement) {\n    return Element.prototype.querySelector.call(element, selector)\n  },\n\n  children(element, selector) {\n    return [].concat(...element.children).filter(child => child.matches(selector))\n  },\n\n  parents(element, selector) {\n    const parents = []\n    let ancestor = element.parentNode.closest(selector)\n\n    while (ancestor) {\n      parents.push(ancestor)\n      ancestor = ancestor.parentNode.closest(selector)\n    }\n\n    return parents\n  },\n\n  prev(element, selector) {\n    let previous = element.previousElementSibling\n\n    while (previous) {\n      if (previous.matches(selector)) {\n        return [previous]\n      }\n\n      previous = previous.previousElementSibling\n    }\n\n    return []\n  },\n  // TODO: this is now unused; remove later along with prev()\n  next(element, selector) {\n    let next = element.nextElementSibling\n\n    while (next) {\n      if (next.matches(selector)) {\n        return [next]\n      }\n\n      next = next.nextElementSibling\n    }\n\n    return []\n  },\n\n  focusableChildren(element) {\n    const focusables = [\n      'a',\n      'button',\n      'input',\n      'textarea',\n      'select',\n      'details',\n      '[tabindex]',\n      '[contenteditable=\"true\"]'\n    ].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',')\n\n    return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))\n  },\n\n  getSelectorFromElement(element) {\n    const selector = getSelector(element)\n\n    if (selector) {\n      return SelectorEngine.findOne(selector) ? selector : null\n    }\n\n    return null\n  },\n\n  getElementFromSelector(element) {\n    const selector = getSelector(element)\n\n    return selector ? SelectorEngine.findOne(selector) : null\n  },\n\n  getMultipleElementsFromSelector(element) {\n    const selector = getSelector(element)\n\n    return selector ? SelectorEngine.find(selector) : []\n  }\n}\n\nexport default SelectorEngine\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isDisabled } from './index.js'\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n  const clickEvent = `click.dismiss${component.EVENT_KEY}`\n  const name = component.NAME\n\n  EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n    if (['A', 'AREA'].includes(this.tagName)) {\n      event.preventDefault()\n    }\n\n    if (isDisabled(this)) {\n      return\n    }\n\n    const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`)\n    const instance = component.getOrCreateInstance(target)\n\n    // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n    instance[method]()\n  })\n}\n\nexport {\n  enableDismissTrigger\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'alert'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_CLOSE = `close${EVENT_KEY}`\nconst EVENT_CLOSED = `closed${EVENT_KEY}`\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  close() {\n    const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE)\n\n    if (closeEvent.defaultPrevented) {\n      return\n    }\n\n    this._element.classList.remove(CLASS_NAME_SHOW)\n\n    const isAnimated = this._element.classList.contains(CLASS_NAME_FADE)\n    this._queueCallback(() => this._destroyElement(), this._element, isAnimated)\n  }\n\n  // Private\n  _destroyElement() {\n    this._element.remove()\n    EventHandler.trigger(this._element, EVENT_CLOSED)\n    this.dispose()\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Alert.getOrCreateInstance(this)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](this)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close')\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert)\n\nexport default Alert\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'button'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"button\"]'\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n    this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Button.getOrCreateInstance(this)\n\n      if (config === 'toggle') {\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {\n  event.preventDefault()\n\n  const button = event.target.closest(SELECTOR_DATA_TOGGLE)\n  const data = Button.getOrCreateInstance(button)\n\n  data.toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button)\n\nexport default Button\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport { execute } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'swipe'\nconst EVENT_KEY = '.bs.swipe'\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY}`\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY}`\nconst POINTER_TYPE_TOUCH = 'touch'\nconst POINTER_TYPE_PEN = 'pen'\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event'\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n  endCallback: null,\n  leftCallback: null,\n  rightCallback: null\n}\n\nconst DefaultType = {\n  endCallback: '(function|null)',\n  leftCallback: '(function|null)',\n  rightCallback: '(function|null)'\n}\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n  constructor(element, config) {\n    super()\n    this._element = element\n\n    if (!element || !Swipe.isSupported()) {\n      return\n    }\n\n    this._config = this._getConfig(config)\n    this._deltaX = 0\n    this._supportPointerEvents = Boolean(window.PointerEvent)\n    this._initEvents()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  dispose() {\n    EventHandler.off(this._element, EVENT_KEY)\n  }\n\n  // Private\n  _start(event) {\n    if (!this._supportPointerEvents) {\n      this._deltaX = event.touches[0].clientX\n\n      return\n    }\n\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX\n    }\n  }\n\n  _end(event) {\n    if (this._eventIsPointerPenTouch(event)) {\n      this._deltaX = event.clientX - this._deltaX\n    }\n\n    this._handleSwipe()\n    execute(this._config.endCallback)\n  }\n\n  _move(event) {\n    this._deltaX = event.touches && event.touches.length > 1 ?\n      0 :\n      event.touches[0].clientX - this._deltaX\n  }\n\n  _handleSwipe() {\n    const absDeltaX = Math.abs(this._deltaX)\n\n    if (absDeltaX <= SWIPE_THRESHOLD) {\n      return\n    }\n\n    const direction = absDeltaX / this._deltaX\n\n    this._deltaX = 0\n\n    if (!direction) {\n      return\n    }\n\n    execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)\n  }\n\n  _initEvents() {\n    if (this._supportPointerEvents) {\n      EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event))\n      EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event))\n\n      this._element.classList.add(CLASS_NAME_POINTER_EVENT)\n    } else {\n      EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event))\n      EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event))\n      EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event))\n    }\n  }\n\n  _eventIsPointerPenTouch(event) {\n    return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)\n  }\n\n  // Static\n  static isSupported() {\n    return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n  }\n}\n\nexport default Swipe\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  getNextActiveElement,\n  isRTL,\n  isVisible,\n  reflow,\n  triggerTransitionEnd\n} from './util/index.js'\nimport Swipe from './util/swipe.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'carousel'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next'\nconst ORDER_PREV = 'prev'\nconst DIRECTION_LEFT = 'left'\nconst DIRECTION_RIGHT = 'right'\n\nconst EVENT_SLIDE = `slide${EVENT_KEY}`\nconst EVENT_SLID = `slid${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`\nconst EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_CAROUSEL = 'carousel'\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_SLIDE = 'slide'\nconst CLASS_NAME_END = 'carousel-item-end'\nconst CLASS_NAME_START = 'carousel-item-start'\nconst CLASS_NAME_NEXT = 'carousel-item-next'\nconst CLASS_NAME_PREV = 'carousel-item-prev'\n\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_ITEM = '.carousel-item'\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM\nconst SELECTOR_ITEM_IMG = '.carousel-item img'\nconst SELECTOR_INDICATORS = '.carousel-indicators'\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]'\n\nconst KEY_TO_DIRECTION = {\n  [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n  [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n}\n\nconst Default = {\n  interval: 5000,\n  keyboard: true,\n  pause: 'hover',\n  ride: false,\n  touch: true,\n  wrap: true\n}\n\nconst DefaultType = {\n  interval: '(number|boolean)', // TODO:v6 remove boolean support\n  keyboard: 'boolean',\n  pause: '(string|boolean)',\n  ride: '(boolean|string)',\n  touch: 'boolean',\n  wrap: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._interval = null\n    this._activeElement = null\n    this._isSliding = false\n    this.touchTimeout = null\n    this._swipeHelper = null\n\n    this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)\n    this._addEventListeners()\n\n    if (this._config.ride === CLASS_NAME_CAROUSEL) {\n      this.cycle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  next() {\n    this._slide(ORDER_NEXT)\n  }\n\n  nextWhenVisible() {\n    // FIXME TODO use `document.visibilityState`\n    // Don't call next when the page isn't visible\n    // or the carousel or its parent isn't visible\n    if (!document.hidden && isVisible(this._element)) {\n      this.next()\n    }\n  }\n\n  prev() {\n    this._slide(ORDER_PREV)\n  }\n\n  pause() {\n    if (this._isSliding) {\n      triggerTransitionEnd(this._element)\n    }\n\n    this._clearInterval()\n  }\n\n  cycle() {\n    this._clearInterval()\n    this._updateInterval()\n\n    this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)\n  }\n\n  _maybeEnableCycle() {\n    if (!this._config.ride) {\n      return\n    }\n\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.cycle())\n      return\n    }\n\n    this.cycle()\n  }\n\n  to(index) {\n    const items = this._getItems()\n    if (index > items.length - 1 || index < 0) {\n      return\n    }\n\n    if (this._isSliding) {\n      EventHandler.one(this._element, EVENT_SLID, () => this.to(index))\n      return\n    }\n\n    const activeIndex = this._getItemIndex(this._getActive())\n    if (activeIndex === index) {\n      return\n    }\n\n    const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV\n\n    this._slide(order, items[index])\n  }\n\n  dispose() {\n    if (this._swipeHelper) {\n      this._swipeHelper.dispose()\n    }\n\n    super.dispose()\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    config.defaultInterval = config.interval\n    return config\n  }\n\n  _addEventListeners() {\n    if (this._config.keyboard) {\n      EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n    }\n\n    if (this._config.pause === 'hover') {\n      EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause())\n      EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle())\n    }\n\n    if (this._config.touch && Swipe.isSupported()) {\n      this._addTouchEventListeners()\n    }\n  }\n\n  _addTouchEventListeners() {\n    for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n      EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault())\n    }\n\n    const endCallBack = () => {\n      if (this._config.pause !== 'hover') {\n        return\n      }\n\n      // If it's a touch-enabled device, mouseenter/leave are fired as\n      // part of the mouse compatibility events on first tap - the carousel\n      // would stop cycling until user tapped out of it;\n      // here, we listen for touchend, explicitly pause the carousel\n      // (as if it's the second time we tap on it, mouseenter compat event\n      // is NOT fired) and after a timeout (to allow for mouse compatibility\n      // events to fire) we explicitly restart cycling\n\n      this.pause()\n      if (this.touchTimeout) {\n        clearTimeout(this.touchTimeout)\n      }\n\n      this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n    }\n\n    const swipeConfig = {\n      leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n      rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n      endCallback: endCallBack\n    }\n\n    this._swipeHelper = new Swipe(this._element, swipeConfig)\n  }\n\n  _keydown(event) {\n    if (/input|textarea/i.test(event.target.tagName)) {\n      return\n    }\n\n    const direction = KEY_TO_DIRECTION[event.key]\n    if (direction) {\n      event.preventDefault()\n      this._slide(this._directionToOrder(direction))\n    }\n  }\n\n  _getItemIndex(element) {\n    return this._getItems().indexOf(element)\n  }\n\n  _setActiveIndicatorElement(index) {\n    if (!this._indicatorsElement) {\n      return\n    }\n\n    const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement)\n\n    activeIndicator.classList.remove(CLASS_NAME_ACTIVE)\n    activeIndicator.removeAttribute('aria-current')\n\n    const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement)\n\n    if (newActiveIndicator) {\n      newActiveIndicator.classList.add(CLASS_NAME_ACTIVE)\n      newActiveIndicator.setAttribute('aria-current', 'true')\n    }\n  }\n\n  _updateInterval() {\n    const element = this._activeElement || this._getActive()\n\n    if (!element) {\n      return\n    }\n\n    const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10)\n\n    this._config.interval = elementInterval || this._config.defaultInterval\n  }\n\n  _slide(order, element = null) {\n    if (this._isSliding) {\n      return\n    }\n\n    const activeElement = this._getActive()\n    const isNext = order === ORDER_NEXT\n    const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap)\n\n    if (nextElement === activeElement) {\n      return\n    }\n\n    const nextElementIndex = this._getItemIndex(nextElement)\n\n    const triggerEvent = eventName => {\n      return EventHandler.trigger(this._element, eventName, {\n        relatedTarget: nextElement,\n        direction: this._orderToDirection(order),\n        from: this._getItemIndex(activeElement),\n        to: nextElementIndex\n      })\n    }\n\n    const slideEvent = triggerEvent(EVENT_SLIDE)\n\n    if (slideEvent.defaultPrevented) {\n      return\n    }\n\n    if (!activeElement || !nextElement) {\n      // Some weirdness is happening, so we bail\n      // TODO: change tests that use empty divs to avoid this check\n      return\n    }\n\n    const isCycling = Boolean(this._interval)\n    this.pause()\n\n    this._isSliding = true\n\n    this._setActiveIndicatorElement(nextElementIndex)\n    this._activeElement = nextElement\n\n    const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END\n    const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV\n\n    nextElement.classList.add(orderClassName)\n\n    reflow(nextElement)\n\n    activeElement.classList.add(directionalClassName)\n    nextElement.classList.add(directionalClassName)\n\n    const completeCallBack = () => {\n      nextElement.classList.remove(directionalClassName, orderClassName)\n      nextElement.classList.add(CLASS_NAME_ACTIVE)\n\n      activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)\n\n      this._isSliding = false\n\n      triggerEvent(EVENT_SLID)\n    }\n\n    this._queueCallback(completeCallBack, activeElement, this._isAnimated())\n\n    if (isCycling) {\n      this.cycle()\n    }\n  }\n\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_SLIDE)\n  }\n\n  _getActive() {\n    return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n  }\n\n  _getItems() {\n    return SelectorEngine.find(SELECTOR_ITEM, this._element)\n  }\n\n  _clearInterval() {\n    if (this._interval) {\n      clearInterval(this._interval)\n      this._interval = null\n    }\n  }\n\n  _directionToOrder(direction) {\n    if (isRTL()) {\n      return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT\n    }\n\n    return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV\n  }\n\n  _orderToDirection(order) {\n    if (isRTL()) {\n      return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT\n    }\n\n    return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Carousel.getOrCreateInstance(this, config)\n\n      if (typeof config === 'number') {\n        data.to(config)\n        return\n      }\n\n      if (typeof config === 'string') {\n        if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n    return\n  }\n\n  event.preventDefault()\n\n  const carousel = Carousel.getOrCreateInstance(target)\n  const slideIndex = this.getAttribute('data-bs-slide-to')\n\n  if (slideIndex) {\n    carousel.to(slideIndex)\n    carousel._maybeEnableCycle()\n    return\n  }\n\n  if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n    carousel.next()\n    carousel._maybeEnableCycle()\n    return\n  }\n\n  carousel.prev()\n  carousel._maybeEnableCycle()\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)\n\n  for (const carousel of carousels) {\n    Carousel.getOrCreateInstance(carousel)\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel)\n\nexport default Carousel\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  getElement,\n  reflow\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'collapse'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_COLLAPSE = 'collapse'\nconst CLASS_NAME_COLLAPSING = 'collapsing'\nconst CLASS_NAME_COLLAPSED = 'collapsed'\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal'\n\nconst WIDTH = 'width'\nconst HEIGHT = 'height'\n\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"collapse\"]'\n\nconst Default = {\n  parent: null,\n  toggle: true\n}\n\nconst DefaultType = {\n  parent: '(null|element)',\n  toggle: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._isTransitioning = false\n    this._triggerArray = []\n\n    const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)\n\n    for (const elem of toggleList) {\n      const selector = SelectorEngine.getSelectorFromElement(elem)\n      const filterElement = SelectorEngine.find(selector)\n        .filter(foundElement => foundElement === this._element)\n\n      if (selector !== null && filterElement.length) {\n        this._triggerArray.push(elem)\n      }\n    }\n\n    this._initializeChildren()\n\n    if (!this._config.parent) {\n      this._addAriaAndCollapsedClass(this._triggerArray, this._isShown())\n    }\n\n    if (this._config.toggle) {\n      this.toggle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    if (this._isShown()) {\n      this.hide()\n    } else {\n      this.show()\n    }\n  }\n\n  show() {\n    if (this._isTransitioning || this._isShown()) {\n      return\n    }\n\n    let activeChildren = []\n\n    // find active children\n    if (this._config.parent) {\n      activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES)\n        .filter(element => element !== this._element)\n        .map(element => Collapse.getOrCreateInstance(element, { toggle: false }))\n    }\n\n    if (activeChildren.length && activeChildren[0]._isTransitioning) {\n      return\n    }\n\n    const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n    if (startEvent.defaultPrevented) {\n      return\n    }\n\n    for (const activeInstance of activeChildren) {\n      activeInstance.hide()\n    }\n\n    const dimension = this._getDimension()\n\n    this._element.classList.remove(CLASS_NAME_COLLAPSE)\n    this._element.classList.add(CLASS_NAME_COLLAPSING)\n\n    this._element.style[dimension] = 0\n\n    this._addAriaAndCollapsedClass(this._triggerArray, true)\n    this._isTransitioning = true\n\n    const complete = () => {\n      this._isTransitioning = false\n\n      this._element.classList.remove(CLASS_NAME_COLLAPSING)\n      this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n      this._element.style[dimension] = ''\n\n      EventHandler.trigger(this._element, EVENT_SHOWN)\n    }\n\n    const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n    const scrollSize = `scroll${capitalizedDimension}`\n\n    this._queueCallback(complete, this._element, true)\n    this._element.style[dimension] = `${this._element[scrollSize]}px`\n  }\n\n  hide() {\n    if (this._isTransitioning || !this._isShown()) {\n      return\n    }\n\n    const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n    if (startEvent.defaultPrevented) {\n      return\n    }\n\n    const dimension = this._getDimension()\n\n    this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n    reflow(this._element)\n\n    this._element.classList.add(CLASS_NAME_COLLAPSING)\n    this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n    for (const trigger of this._triggerArray) {\n      const element = SelectorEngine.getElementFromSelector(trigger)\n\n      if (element && !this._isShown(element)) {\n        this._addAriaAndCollapsedClass([trigger], false)\n      }\n    }\n\n    this._isTransitioning = true\n\n    const complete = () => {\n      this._isTransitioning = false\n      this._element.classList.remove(CLASS_NAME_COLLAPSING)\n      this._element.classList.add(CLASS_NAME_COLLAPSE)\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._element.style[dimension] = ''\n\n    this._queueCallback(complete, this._element, true)\n  }\n\n  _isShown(element = this._element) {\n    return element.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    config.toggle = Boolean(config.toggle) // Coerce string values\n    config.parent = getElement(config.parent)\n    return config\n  }\n\n  _getDimension() {\n    return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT\n  }\n\n  _initializeChildren() {\n    if (!this._config.parent) {\n      return\n    }\n\n    const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE)\n\n    for (const element of children) {\n      const selected = SelectorEngine.getElementFromSelector(element)\n\n      if (selected) {\n        this._addAriaAndCollapsedClass([element], this._isShown(selected))\n      }\n    }\n  }\n\n  _getFirstLevelChildren(selector) {\n    const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)\n    // remove children if greater depth\n    return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element))\n  }\n\n  _addAriaAndCollapsedClass(triggerArray, isOpen) {\n    if (!triggerArray.length) {\n      return\n    }\n\n    for (const element of triggerArray) {\n      element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen)\n      element.setAttribute('aria-expanded', isOpen)\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    const _config = {}\n    if (typeof config === 'string' && /show|hide/.test(config)) {\n      _config.toggle = false\n    }\n\n    return this.each(function () {\n      const data = Collapse.getOrCreateInstance(this, _config)\n\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config]()\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n  if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {\n    event.preventDefault()\n  }\n\n  for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n    Collapse.getOrCreateInstance(element, { toggle: false }).toggle()\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse)\n\nexport default Collapse\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n  defineJQueryPlugin,\n  execute,\n  getElement,\n  getNextActiveElement,\n  isDisabled,\n  isElement,\n  isRTL,\n  isVisible,\n  noop\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'dropdown'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ESCAPE_KEY = 'Escape'\nconst TAB_KEY = 'Tab'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_DROPUP = 'dropup'\nconst CLASS_NAME_DROPEND = 'dropend'\nconst CLASS_NAME_DROPSTART = 'dropstart'\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center'\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)'\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`\nconst SELECTOR_MENU = '.dropdown-menu'\nconst SELECTOR_NAVBAR = '.navbar'\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav'\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'\nconst PLACEMENT_TOPCENTER = 'top'\nconst PLACEMENT_BOTTOMCENTER = 'bottom'\n\nconst Default = {\n  autoClose: true,\n  boundary: 'clippingParents',\n  display: 'dynamic',\n  offset: [0, 2],\n  popperConfig: null,\n  reference: 'toggle'\n}\n\nconst DefaultType = {\n  autoClose: '(boolean|string)',\n  boundary: '(string|element)',\n  display: 'string',\n  offset: '(array|string|function)',\n  popperConfig: '(null|object|function)',\n  reference: '(string|element|object)'\n}\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._popper = null\n    this._parent = this._element.parentNode // dropdown wrapper\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] ||\n      SelectorEngine.prev(this._element, SELECTOR_MENU)[0] ||\n      SelectorEngine.findOne(SELECTOR_MENU, this._parent)\n    this._inNavbar = this._detectNavbar()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle() {\n    return this._isShown() ? this.hide() : this.show()\n  }\n\n  show() {\n    if (isDisabled(this._element) || this._isShown()) {\n      return\n    }\n\n    const relatedTarget = {\n      relatedTarget: this._element\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget)\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._createPopper()\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop)\n      }\n    }\n\n    this._element.focus()\n    this._element.setAttribute('aria-expanded', true)\n\n    this._menu.classList.add(CLASS_NAME_SHOW)\n    this._element.classList.add(CLASS_NAME_SHOW)\n    EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget)\n  }\n\n  hide() {\n    if (isDisabled(this._element) || !this._isShown()) {\n      return\n    }\n\n    const relatedTarget = {\n      relatedTarget: this._element\n    }\n\n    this._completeHide(relatedTarget)\n  }\n\n  dispose() {\n    if (this._popper) {\n      this._popper.destroy()\n    }\n\n    super.dispose()\n  }\n\n  update() {\n    this._inNavbar = this._detectNavbar()\n    if (this._popper) {\n      this._popper.update()\n    }\n  }\n\n  // Private\n  _completeHide(relatedTarget) {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget)\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop)\n      }\n    }\n\n    if (this._popper) {\n      this._popper.destroy()\n    }\n\n    this._menu.classList.remove(CLASS_NAME_SHOW)\n    this._element.classList.remove(CLASS_NAME_SHOW)\n    this._element.setAttribute('aria-expanded', 'false')\n    Manipulator.removeDataAttribute(this._menu, 'popper')\n    EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)\n  }\n\n  _getConfig(config) {\n    config = super._getConfig(config)\n\n    if (typeof config.reference === 'object' && !isElement(config.reference) &&\n      typeof config.reference.getBoundingClientRect !== 'function'\n    ) {\n      // Popper virtual elements require a getBoundingClientRect method\n      throw new TypeError(`${NAME.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`)\n    }\n\n    return config\n  }\n\n  _createPopper() {\n    if (typeof Popper === 'undefined') {\n      throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)')\n    }\n\n    let referenceElement = this._element\n\n    if (this._config.reference === 'parent') {\n      referenceElement = this._parent\n    } else if (isElement(this._config.reference)) {\n      referenceElement = getElement(this._config.reference)\n    } else if (typeof this._config.reference === 'object') {\n      referenceElement = this._config.reference\n    }\n\n    const popperConfig = this._getPopperConfig()\n    this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)\n  }\n\n  _isShown() {\n    return this._menu.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _getPlacement() {\n    const parentDropdown = this._parent\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n      return PLACEMENT_RIGHT\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n      return PLACEMENT_LEFT\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n      return PLACEMENT_TOPCENTER\n    }\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n      return PLACEMENT_BOTTOMCENTER\n    }\n\n    // We need to trim the value because custom properties can also include spaces\n    const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'\n\n    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n      return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP\n    }\n\n    return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM\n  }\n\n  _detectNavbar() {\n    return this._element.closest(SELECTOR_NAVBAR) !== null\n  }\n\n  _getOffset() {\n    const { offset } = this._config\n\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10))\n    }\n\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element)\n    }\n\n    return offset\n  }\n\n  _getPopperConfig() {\n    const defaultBsPopperConfig = {\n      placement: this._getPlacement(),\n      modifiers: [{\n        name: 'preventOverflow',\n        options: {\n          boundary: this._config.boundary\n        }\n      },\n      {\n        name: 'offset',\n        options: {\n          offset: this._getOffset()\n        }\n      }]\n    }\n\n    // Disable Popper if we have a static display or Dropdown is in Navbar\n    if (this._inNavbar || this._config.display === 'static') {\n      Manipulator.setDataAttribute(this._menu, 'popper', 'static') // TODO: v6 remove\n      defaultBsPopperConfig.modifiers = [{\n        name: 'applyStyles',\n        enabled: false\n      }]\n    }\n\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n    }\n  }\n\n  _selectMenuItem({ key, target }) {\n    const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element))\n\n    if (!items.length) {\n      return\n    }\n\n    // if target isn't included in items (e.g. when expanding the dropdown)\n    // allow cycling to get the last item in case key equals ARROW_UP_KEY\n    getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Dropdown.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n\n  static clearMenus(event) {\n    if (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY)) {\n      return\n    }\n\n    const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN)\n\n    for (const toggle of openToggles) {\n      const context = Dropdown.getInstance(toggle)\n      if (!context || context._config.autoClose === false) {\n        continue\n      }\n\n      const composedPath = event.composedPath()\n      const isMenuTarget = composedPath.includes(context._menu)\n      if (\n        composedPath.includes(context._element) ||\n        (context._config.autoClose === 'inside' && !isMenuTarget) ||\n        (context._config.autoClose === 'outside' && isMenuTarget)\n      ) {\n        continue\n      }\n\n      // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n      if (context._menu.contains(event.target) && ((event.type === 'keyup' && event.key === TAB_KEY) || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n        continue\n      }\n\n      const relatedTarget = { relatedTarget: context._element }\n\n      if (event.type === 'click') {\n        relatedTarget.clickEvent = event\n      }\n\n      context._completeHide(relatedTarget)\n    }\n  }\n\n  static dataApiKeydownHandler(event) {\n    // If not an UP | DOWN | ESCAPE key => not a dropdown command\n    // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n    const isInput = /input|textarea/i.test(event.target.tagName)\n    const isEscapeEvent = event.key === ESCAPE_KEY\n    const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)\n\n    if (!isUpOrDownEvent && !isEscapeEvent) {\n      return\n    }\n\n    if (isInput && !isEscapeEvent) {\n      return\n    }\n\n    event.preventDefault()\n\n    // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n    const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ?\n      this :\n      (SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] ||\n        SelectorEngine.next(this, SELECTOR_DATA_TOGGLE)[0] ||\n        SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode))\n\n    const instance = Dropdown.getOrCreateInstance(getToggleButton)\n\n    if (isUpOrDownEvent) {\n      event.stopPropagation()\n      instance.show()\n      instance._selectMenuItem(event)\n      return\n    }\n\n    if (instance._isShown()) { // else is escape and we check if it is shown\n      event.stopPropagation()\n      instance.hide()\n      getToggleButton.focus()\n    }\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  event.preventDefault()\n  Dropdown.getOrCreateInstance(this).toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown)\n\nexport default Dropdown\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport { execute, executeAfterTransition, getElement, reflow } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'backdrop'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`\n\nconst Default = {\n  className: 'modal-backdrop',\n  clickCallback: null,\n  isAnimated: false,\n  isVisible: true, // if false, we use the backdrop helper without adding any element to the dom\n  rootElement: 'body' // give the choice to place backdrop under different elements\n}\n\nconst DefaultType = {\n  className: 'string',\n  clickCallback: '(function|null)',\n  isAnimated: 'boolean',\n  isVisible: 'boolean',\n  rootElement: '(element|string)'\n}\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n    this._isAppended = false\n    this._element = null\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show(callback) {\n    if (!this._config.isVisible) {\n      execute(callback)\n      return\n    }\n\n    this._append()\n\n    const element = this._getElement()\n    if (this._config.isAnimated) {\n      reflow(element)\n    }\n\n    element.classList.add(CLASS_NAME_SHOW)\n\n    this._emulateAnimation(() => {\n      execute(callback)\n    })\n  }\n\n  hide(callback) {\n    if (!this._config.isVisible) {\n      execute(callback)\n      return\n    }\n\n    this._getElement().classList.remove(CLASS_NAME_SHOW)\n\n    this._emulateAnimation(() => {\n      this.dispose()\n      execute(callback)\n    })\n  }\n\n  dispose() {\n    if (!this._isAppended) {\n      return\n    }\n\n    EventHandler.off(this._element, EVENT_MOUSEDOWN)\n\n    this._element.remove()\n    this._isAppended = false\n  }\n\n  // Private\n  _getElement() {\n    if (!this._element) {\n      const backdrop = document.createElement('div')\n      backdrop.className = this._config.className\n      if (this._config.isAnimated) {\n        backdrop.classList.add(CLASS_NAME_FADE)\n      }\n\n      this._element = backdrop\n    }\n\n    return this._element\n  }\n\n  _configAfterMerge(config) {\n    // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n    config.rootElement = getElement(config.rootElement)\n    return config\n  }\n\n  _append() {\n    if (this._isAppended) {\n      return\n    }\n\n    const element = this._getElement()\n    this._config.rootElement.append(element)\n\n    EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n      execute(this._config.clickCallback)\n    })\n\n    this._isAppended = true\n  }\n\n  _emulateAnimation(callback) {\n    executeAfterTransition(callback, this._getElement(), this._config.isAnimated)\n  }\n}\n\nexport default Backdrop\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'focustrap'\nconst DATA_KEY = 'bs.focustrap'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`\n\nconst TAB_KEY = 'Tab'\nconst TAB_NAV_FORWARD = 'forward'\nconst TAB_NAV_BACKWARD = 'backward'\n\nconst Default = {\n  autofocus: true,\n  trapElement: null // The element to trap focus inside of\n}\n\nconst DefaultType = {\n  autofocus: 'boolean',\n  trapElement: 'element'\n}\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n    this._isActive = false\n    this._lastTabNavDirection = null\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  activate() {\n    if (this._isActive) {\n      return\n    }\n\n    if (this._config.autofocus) {\n      this._config.trapElement.focus()\n    }\n\n    EventHandler.off(document, EVENT_KEY) // guard against infinite focus loop\n    EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event))\n    EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event))\n\n    this._isActive = true\n  }\n\n  deactivate() {\n    if (!this._isActive) {\n      return\n    }\n\n    this._isActive = false\n    EventHandler.off(document, EVENT_KEY)\n  }\n\n  // Private\n  _handleFocusin(event) {\n    const { trapElement } = this._config\n\n    if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n      return\n    }\n\n    const elements = SelectorEngine.focusableChildren(trapElement)\n\n    if (elements.length === 0) {\n      trapElement.focus()\n    } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n      elements[elements.length - 1].focus()\n    } else {\n      elements[0].focus()\n    }\n  }\n\n  _handleKeydown(event) {\n    if (event.key !== TAB_KEY) {\n      return\n    }\n\n    this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD\n  }\n}\n\nexport default FocusTrap\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\nconst SELECTOR_STICKY_CONTENT = '.sticky-top'\nconst PROPERTY_PADDING = 'padding-right'\nconst PROPERTY_MARGIN = 'margin-right'\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n  constructor() {\n    this._element = document.body\n  }\n\n  // Public\n  getWidth() {\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n    const documentWidth = document.documentElement.clientWidth\n    return Math.abs(window.innerWidth - documentWidth)\n  }\n\n  hide() {\n    const width = this.getWidth()\n    this._disableOverFlow()\n    // give padding to element to balance the hidden scrollbar width\n    this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n    // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n    this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n    this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width)\n  }\n\n  reset() {\n    this._resetElementAttributes(this._element, 'overflow')\n    this._resetElementAttributes(this._element, PROPERTY_PADDING)\n    this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING)\n    this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN)\n  }\n\n  isOverflowing() {\n    return this.getWidth() > 0\n  }\n\n  // Private\n  _disableOverFlow() {\n    this._saveInitialAttribute(this._element, 'overflow')\n    this._element.style.overflow = 'hidden'\n  }\n\n  _setElementAttributes(selector, styleProperty, callback) {\n    const scrollbarWidth = this.getWidth()\n    const manipulationCallBack = element => {\n      if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n        return\n      }\n\n      this._saveInitialAttribute(element, styleProperty)\n      const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty)\n      element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`)\n    }\n\n    this._applyManipulationCallback(selector, manipulationCallBack)\n  }\n\n  _saveInitialAttribute(element, styleProperty) {\n    const actualValue = element.style.getPropertyValue(styleProperty)\n    if (actualValue) {\n      Manipulator.setDataAttribute(element, styleProperty, actualValue)\n    }\n  }\n\n  _resetElementAttributes(selector, styleProperty) {\n    const manipulationCallBack = element => {\n      const value = Manipulator.getDataAttribute(element, styleProperty)\n      // We only want to remove the property if the value is `null`; the value can also be zero\n      if (value === null) {\n        element.style.removeProperty(styleProperty)\n        return\n      }\n\n      Manipulator.removeDataAttribute(element, styleProperty)\n      element.style.setProperty(styleProperty, value)\n    }\n\n    this._applyManipulationCallback(selector, manipulationCallBack)\n  }\n\n  _applyManipulationCallback(selector, callBack) {\n    if (isElement(selector)) {\n      callBack(selector)\n      return\n    }\n\n    for (const sel of SelectorEngine.find(selector, this._element)) {\n      callBack(sel)\n    }\n  }\n}\n\nexport default ScrollBarHelper\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport { defineJQueryPlugin, isRTL, isVisible, reflow } from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'modal'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst ESCAPE_KEY = 'Escape'\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_OPEN = 'modal-open'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_STATIC = 'modal-static'\n\nconst OPEN_SELECTOR = '.modal.show'\nconst SELECTOR_DIALOG = '.modal-dialog'\nconst SELECTOR_MODAL_BODY = '.modal-body'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"modal\"]'\n\nconst Default = {\n  backdrop: true,\n  focus: true,\n  keyboard: true\n}\n\nconst DefaultType = {\n  backdrop: '(boolean|string)',\n  focus: 'boolean',\n  keyboard: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element)\n    this._backdrop = this._initializeBackDrop()\n    this._focustrap = this._initializeFocusTrap()\n    this._isShown = false\n    this._isTransitioning = false\n    this._scrollBar = new ScrollBarHelper()\n\n    this._addEventListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget)\n  }\n\n  show(relatedTarget) {\n    if (this._isShown || this._isTransitioning) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {\n      relatedTarget\n    })\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = true\n    this._isTransitioning = true\n\n    this._scrollBar.hide()\n\n    document.body.classList.add(CLASS_NAME_OPEN)\n\n    this._adjustDialog()\n\n    this._backdrop.show(() => this._showElement(relatedTarget))\n  }\n\n  hide() {\n    if (!this._isShown || this._isTransitioning) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = false\n    this._isTransitioning = true\n    this._focustrap.deactivate()\n\n    this._element.classList.remove(CLASS_NAME_SHOW)\n\n    this._queueCallback(() => this._hideModal(), this._element, this._isAnimated())\n  }\n\n  dispose() {\n    EventHandler.off(window, EVENT_KEY)\n    EventHandler.off(this._dialog, EVENT_KEY)\n\n    this._backdrop.dispose()\n    this._focustrap.deactivate()\n\n    super.dispose()\n  }\n\n  handleUpdate() {\n    this._adjustDialog()\n  }\n\n  // Private\n  _initializeBackDrop() {\n    return new Backdrop({\n      isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value,\n      isAnimated: this._isAnimated()\n    })\n  }\n\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    })\n  }\n\n  _showElement(relatedTarget) {\n    // try to append dynamic modal\n    if (!document.body.contains(this._element)) {\n      document.body.append(this._element)\n    }\n\n    this._element.style.display = 'block'\n    this._element.removeAttribute('aria-hidden')\n    this._element.setAttribute('aria-modal', true)\n    this._element.setAttribute('role', 'dialog')\n    this._element.scrollTop = 0\n\n    const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)\n    if (modalBody) {\n      modalBody.scrollTop = 0\n    }\n\n    reflow(this._element)\n\n    this._element.classList.add(CLASS_NAME_SHOW)\n\n    const transitionComplete = () => {\n      if (this._config.focus) {\n        this._focustrap.activate()\n      }\n\n      this._isTransitioning = false\n      EventHandler.trigger(this._element, EVENT_SHOWN, {\n        relatedTarget\n      })\n    }\n\n    this._queueCallback(transitionComplete, this._dialog, this._isAnimated())\n  }\n\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n      if (event.key !== ESCAPE_KEY) {\n        return\n      }\n\n      if (this._config.keyboard) {\n        this.hide()\n        return\n      }\n\n      this._triggerBackdropTransition()\n    })\n\n    EventHandler.on(window, EVENT_RESIZE, () => {\n      if (this._isShown && !this._isTransitioning) {\n        this._adjustDialog()\n      }\n    })\n\n    EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n      // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n      EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n        if (this._element !== event.target || this._element !== event2.target) {\n          return\n        }\n\n        if (this._config.backdrop === 'static') {\n          this._triggerBackdropTransition()\n          return\n        }\n\n        if (this._config.backdrop) {\n          this.hide()\n        }\n      })\n    })\n  }\n\n  _hideModal() {\n    this._element.style.display = 'none'\n    this._element.setAttribute('aria-hidden', true)\n    this._element.removeAttribute('aria-modal')\n    this._element.removeAttribute('role')\n    this._isTransitioning = false\n\n    this._backdrop.hide(() => {\n      document.body.classList.remove(CLASS_NAME_OPEN)\n      this._resetAdjustments()\n      this._scrollBar.reset()\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    })\n  }\n\n  _isAnimated() {\n    return this._element.classList.contains(CLASS_NAME_FADE)\n  }\n\n  _triggerBackdropTransition() {\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n    const initialOverflowY = this._element.style.overflowY\n    // return if the following background transition hasn't yet completed\n    if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n      return\n    }\n\n    if (!isModalOverflowing) {\n      this._element.style.overflowY = 'hidden'\n    }\n\n    this._element.classList.add(CLASS_NAME_STATIC)\n    this._queueCallback(() => {\n      this._element.classList.remove(CLASS_NAME_STATIC)\n      this._queueCallback(() => {\n        this._element.style.overflowY = initialOverflowY\n      }, this._dialog)\n    }, this._dialog)\n\n    this._element.focus()\n  }\n\n  /**\n   * The following methods are used to handle overflowing modals\n   */\n\n  _adjustDialog() {\n    const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n    const scrollbarWidth = this._scrollBar.getWidth()\n    const isBodyOverflowing = scrollbarWidth > 0\n\n    if (isBodyOverflowing && !isModalOverflowing) {\n      const property = isRTL() ? 'paddingLeft' : 'paddingRight'\n      this._element.style[property] = `${scrollbarWidth}px`\n    }\n\n    if (!isBodyOverflowing && isModalOverflowing) {\n      const property = isRTL() ? 'paddingRight' : 'paddingLeft'\n      this._element.style[property] = `${scrollbarWidth}px`\n    }\n  }\n\n  _resetAdjustments() {\n    this._element.style.paddingLeft = ''\n    this._element.style.paddingRight = ''\n  }\n\n  // Static\n  static jQueryInterface(config, relatedTarget) {\n    return this.each(function () {\n      const data = Modal.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](relatedTarget)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  EventHandler.one(target, EVENT_SHOW, showEvent => {\n    if (showEvent.defaultPrevented) {\n      // only register focus restorer if modal will actually get shown\n      return\n    }\n\n    EventHandler.one(target, EVENT_HIDDEN, () => {\n      if (isVisible(this)) {\n        this.focus()\n      }\n    })\n  })\n\n  // avoid conflict when clicking modal toggler while another one is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n  if (alreadyOpen) {\n    Modal.getInstance(alreadyOpen).hide()\n  }\n\n  const data = Modal.getOrCreateInstance(target)\n\n  data.toggle(this)\n})\n\nenableDismissTrigger(Modal)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal)\n\nexport default Modal\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n  defineJQueryPlugin,\n  isDisabled,\n  isVisible\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'offcanvas'\nconst DATA_KEY = 'bs.offcanvas'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst ESCAPE_KEY = 'Escape'\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\nconst CLASS_NAME_HIDING = 'hiding'\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop'\nconst OPEN_SELECTOR = '.offcanvas.show'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"offcanvas\"]'\n\nconst Default = {\n  backdrop: true,\n  keyboard: true,\n  scroll: false\n}\n\nconst DefaultType = {\n  backdrop: '(boolean|string)',\n  keyboard: 'boolean',\n  scroll: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._isShown = false\n    this._backdrop = this._initializeBackDrop()\n    this._focustrap = this._initializeFocusTrap()\n    this._addEventListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  toggle(relatedTarget) {\n    return this._isShown ? this.hide() : this.show(relatedTarget)\n  }\n\n  show(relatedTarget) {\n    if (this._isShown) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._isShown = true\n    this._backdrop.show()\n\n    if (!this._config.scroll) {\n      new ScrollBarHelper().hide()\n    }\n\n    this._element.setAttribute('aria-modal', true)\n    this._element.setAttribute('role', 'dialog')\n    this._element.classList.add(CLASS_NAME_SHOWING)\n\n    const completeCallBack = () => {\n      if (!this._config.scroll || this._config.backdrop) {\n        this._focustrap.activate()\n      }\n\n      this._element.classList.add(CLASS_NAME_SHOW)\n      this._element.classList.remove(CLASS_NAME_SHOWING)\n      EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })\n    }\n\n    this._queueCallback(completeCallBack, this._element, true)\n  }\n\n  hide() {\n    if (!this._isShown) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    this._focustrap.deactivate()\n    this._element.blur()\n    this._isShown = false\n    this._element.classList.add(CLASS_NAME_HIDING)\n    this._backdrop.hide()\n\n    const completeCallback = () => {\n      this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING)\n      this._element.removeAttribute('aria-modal')\n      this._element.removeAttribute('role')\n\n      if (!this._config.scroll) {\n        new ScrollBarHelper().reset()\n      }\n\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._queueCallback(completeCallback, this._element, true)\n  }\n\n  dispose() {\n    this._backdrop.dispose()\n    this._focustrap.deactivate()\n    super.dispose()\n  }\n\n  // Private\n  _initializeBackDrop() {\n    const clickCallback = () => {\n      if (this._config.backdrop === 'static') {\n        EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n        return\n      }\n\n      this.hide()\n    }\n\n    // 'static' option will be translated to true, and booleans will keep their value\n    const isVisible = Boolean(this._config.backdrop)\n\n    return new Backdrop({\n      className: CLASS_NAME_BACKDROP,\n      isVisible,\n      isAnimated: true,\n      rootElement: this._element.parentNode,\n      clickCallback: isVisible ? clickCallback : null\n    })\n  }\n\n  _initializeFocusTrap() {\n    return new FocusTrap({\n      trapElement: this._element\n    })\n  }\n\n  _addEventListeners() {\n    EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n      if (event.key !== ESCAPE_KEY) {\n        return\n      }\n\n      if (this._config.keyboard) {\n        this.hide()\n        return\n      }\n\n      EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n    })\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Offcanvas.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config](this)\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  const target = SelectorEngine.getElementFromSelector(this)\n\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  if (isDisabled(this)) {\n    return\n  }\n\n  EventHandler.one(target, EVENT_HIDDEN, () => {\n    // focus on trigger when it is closed\n    if (isVisible(this)) {\n      this.focus()\n    }\n  })\n\n  // avoid conflict when clicking a toggler of an offcanvas, while another is open\n  const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n  if (alreadyOpen && alreadyOpen !== target) {\n    Offcanvas.getInstance(alreadyOpen).hide()\n  }\n\n  const data = Offcanvas.getOrCreateInstance(target)\n  data.toggle(this)\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n    Offcanvas.getOrCreateInstance(selector).show()\n  }\n})\n\nEventHandler.on(window, EVENT_RESIZE, () => {\n  for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n    if (getComputedStyle(element).position !== 'fixed') {\n      Offcanvas.getOrCreateInstance(element).hide()\n    }\n  }\n})\n\nenableDismissTrigger(Offcanvas)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas)\n\nexport default Offcanvas\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultAllowlist = {\n  // Global attributes allowed on any supplied element below.\n  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n  a: ['target', 'href', 'title', 'rel'],\n  area: [],\n  b: [],\n  br: [],\n  col: [],\n  code: [],\n  div: [],\n  em: [],\n  hr: [],\n  h1: [],\n  h2: [],\n  h3: [],\n  h4: [],\n  h5: [],\n  h6: [],\n  i: [],\n  img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n  li: [],\n  ol: [],\n  p: [],\n  pre: [],\n  s: [],\n  small: [],\n  span: [],\n  sub: [],\n  sup: [],\n  strong: [],\n  u: [],\n  ul: []\n}\n// js-docs-end allow-list\n\nconst uriAttributes = new Set([\n  'background',\n  'cite',\n  'href',\n  'itemtype',\n  'longdesc',\n  'poster',\n  'src',\n  'xlink:href'\n])\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\n// eslint-disable-next-line unicorn/better-regex\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i\n\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n  const attributeName = attribute.nodeName.toLowerCase()\n\n  if (allowedAttributeList.includes(attributeName)) {\n    if (uriAttributes.has(attributeName)) {\n      return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))\n    }\n\n    return true\n  }\n\n  // Check if a regular expression validates the attribute.\n  return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)\n    .some(regex => regex.test(attributeName))\n}\n\nexport function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n  if (!unsafeHtml.length) {\n    return unsafeHtml\n  }\n\n  if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n    return sanitizeFunction(unsafeHtml)\n  }\n\n  const domParser = new window.DOMParser()\n  const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n  const elements = [].concat(...createdDocument.body.querySelectorAll('*'))\n\n  for (const element of elements) {\n    const elementName = element.nodeName.toLowerCase()\n\n    if (!Object.keys(allowList).includes(elementName)) {\n      element.remove()\n      continue\n    }\n\n    const attributeList = [].concat(...element.attributes)\n    const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || [])\n\n    for (const attribute of attributeList) {\n      if (!allowedAttribute(attribute, allowedAttributes)) {\n        element.removeAttribute(attribute.nodeName)\n      }\n    }\n  }\n\n  return createdDocument.body.innerHTML\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\nimport { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'\nimport { execute, getElement, isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'TemplateFactory'\n\nconst Default = {\n  allowList: DefaultAllowlist,\n  content: {}, // { selector : text ,  selector2 : text2 , }\n  extraClass: '',\n  html: false,\n  sanitize: true,\n  sanitizeFn: null,\n  template: '<div></div>'\n}\n\nconst DefaultType = {\n  allowList: 'object',\n  content: 'object',\n  extraClass: '(string|function)',\n  html: 'boolean',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  template: 'string'\n}\n\nconst DefaultContentType = {\n  entry: '(string|element|function|null)',\n  selector: '(string|element)'\n}\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n  constructor(config) {\n    super()\n    this._config = this._getConfig(config)\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  getContent() {\n    return Object.values(this._config.content)\n      .map(config => this._resolvePossibleFunction(config))\n      .filter(Boolean)\n  }\n\n  hasContent() {\n    return this.getContent().length > 0\n  }\n\n  changeContent(content) {\n    this._checkContent(content)\n    this._config.content = { ...this._config.content, ...content }\n    return this\n  }\n\n  toHtml() {\n    const templateWrapper = document.createElement('div')\n    templateWrapper.innerHTML = this._maybeSanitize(this._config.template)\n\n    for (const [selector, text] of Object.entries(this._config.content)) {\n      this._setContent(templateWrapper, text, selector)\n    }\n\n    const template = templateWrapper.children[0]\n    const extraClass = this._resolvePossibleFunction(this._config.extraClass)\n\n    if (extraClass) {\n      template.classList.add(...extraClass.split(' '))\n    }\n\n    return template\n  }\n\n  // Private\n  _typeCheckConfig(config) {\n    super._typeCheckConfig(config)\n    this._checkContent(config.content)\n  }\n\n  _checkContent(arg) {\n    for (const [selector, content] of Object.entries(arg)) {\n      super._typeCheckConfig({ selector, entry: content }, DefaultContentType)\n    }\n  }\n\n  _setContent(template, content, selector) {\n    const templateElement = SelectorEngine.findOne(selector, template)\n\n    if (!templateElement) {\n      return\n    }\n\n    content = this._resolvePossibleFunction(content)\n\n    if (!content) {\n      templateElement.remove()\n      return\n    }\n\n    if (isElement(content)) {\n      this._putElementInTemplate(getElement(content), templateElement)\n      return\n    }\n\n    if (this._config.html) {\n      templateElement.innerHTML = this._maybeSanitize(content)\n      return\n    }\n\n    templateElement.textContent = content\n  }\n\n  _maybeSanitize(arg) {\n    return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg\n  }\n\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [this])\n  }\n\n  _putElementInTemplate(element, templateElement) {\n    if (this._config.html) {\n      templateElement.innerHTML = ''\n      templateElement.append(element)\n      return\n    }\n\n    templateElement.textContent = element.textContent\n  }\n}\n\nexport default TemplateFactory\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport { defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop } from './util/index.js'\nimport { DefaultAllowlist } from './util/sanitizer.js'\nimport TemplateFactory from './util/template-factory.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tooltip'\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_MODAL = 'modal'\nconst CLASS_NAME_SHOW = 'show'\n\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner'\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`\n\nconst EVENT_MODAL_HIDE = 'hide.bs.modal'\n\nconst TRIGGER_HOVER = 'hover'\nconst TRIGGER_FOCUS = 'focus'\nconst TRIGGER_CLICK = 'click'\nconst TRIGGER_MANUAL = 'manual'\n\nconst EVENT_HIDE = 'hide'\nconst EVENT_HIDDEN = 'hidden'\nconst EVENT_SHOW = 'show'\nconst EVENT_SHOWN = 'shown'\nconst EVENT_INSERTED = 'inserted'\nconst EVENT_CLICK = 'click'\nconst EVENT_FOCUSIN = 'focusin'\nconst EVENT_FOCUSOUT = 'focusout'\nconst EVENT_MOUSEENTER = 'mouseenter'\nconst EVENT_MOUSELEAVE = 'mouseleave'\n\nconst AttachmentMap = {\n  AUTO: 'auto',\n  TOP: 'top',\n  RIGHT: isRTL() ? 'left' : 'right',\n  BOTTOM: 'bottom',\n  LEFT: isRTL() ? 'right' : 'left'\n}\n\nconst Default = {\n  allowList: DefaultAllowlist,\n  animation: true,\n  boundary: 'clippingParents',\n  container: false,\n  customClass: '',\n  delay: 0,\n  fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n  html: false,\n  offset: [0, 6],\n  placement: 'top',\n  popperConfig: null,\n  sanitize: true,\n  sanitizeFn: null,\n  selector: false,\n  template: '<div class=\"tooltip\" role=\"tooltip\">' +\n            '<div class=\"tooltip-arrow\"></div>' +\n            '<div class=\"tooltip-inner\"></div>' +\n            '</div>',\n  title: '',\n  trigger: 'hover focus'\n}\n\nconst DefaultType = {\n  allowList: 'object',\n  animation: 'boolean',\n  boundary: '(string|element)',\n  container: '(string|element|boolean)',\n  customClass: '(string|function)',\n  delay: '(number|object)',\n  fallbackPlacements: 'array',\n  html: 'boolean',\n  offset: '(array|string|function)',\n  placement: '(string|function)',\n  popperConfig: '(null|object|function)',\n  sanitize: 'boolean',\n  sanitizeFn: '(null|function)',\n  selector: '(string|boolean)',\n  template: 'string',\n  title: '(string|element|function)',\n  trigger: 'string'\n}\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n  constructor(element, config) {\n    if (typeof Popper === 'undefined') {\n      throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)')\n    }\n\n    super(element, config)\n\n    // Private\n    this._isEnabled = true\n    this._timeout = 0\n    this._isHovered = null\n    this._activeTrigger = {}\n    this._popper = null\n    this._templateFactory = null\n    this._newContent = null\n\n    // Protected\n    this.tip = null\n\n    this._setListeners()\n\n    if (!this._config.selector) {\n      this._fixTitle()\n    }\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  enable() {\n    this._isEnabled = true\n  }\n\n  disable() {\n    this._isEnabled = false\n  }\n\n  toggleEnabled() {\n    this._isEnabled = !this._isEnabled\n  }\n\n  toggle() {\n    if (!this._isEnabled) {\n      return\n    }\n\n    this._activeTrigger.click = !this._activeTrigger.click\n    if (this._isShown()) {\n      this._leave()\n      return\n    }\n\n    this._enter()\n  }\n\n  dispose() {\n    clearTimeout(this._timeout)\n\n    EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n\n    if (this._element.getAttribute('data-bs-original-title')) {\n      this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'))\n    }\n\n    this._disposePopper()\n    super.dispose()\n  }\n\n  show() {\n    if (this._element.style.display === 'none') {\n      throw new Error('Please use show on visible elements')\n    }\n\n    if (!(this._isWithContent() && this._isEnabled)) {\n      return\n    }\n\n    const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))\n    const shadowRoot = findShadowRoot(this._element)\n    const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)\n\n    if (showEvent.defaultPrevented || !isInTheDom) {\n      return\n    }\n\n    // TODO: v6 remove this or make it optional\n    this._disposePopper()\n\n    const tip = this._getTipElement()\n\n    this._element.setAttribute('aria-describedby', tip.getAttribute('id'))\n\n    const { container } = this._config\n\n    if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n      container.append(tip)\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED))\n    }\n\n    this._popper = this._createPopper(tip)\n\n    tip.classList.add(CLASS_NAME_SHOW)\n\n    // If this is a touch-enabled device we add extra\n    // empty mouseover listeners to the body's immediate children;\n    // only needed because of broken event delegation on iOS\n    // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.on(element, 'mouseover', noop)\n      }\n    }\n\n    const complete = () => {\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))\n\n      if (this._isHovered === false) {\n        this._leave()\n      }\n\n      this._isHovered = false\n    }\n\n    this._queueCallback(complete, this.tip, this._isAnimated())\n  }\n\n  hide() {\n    if (!this._isShown()) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE))\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const tip = this._getTipElement()\n    tip.classList.remove(CLASS_NAME_SHOW)\n\n    // If this is a touch-enabled device we remove the extra\n    // empty mouseover listeners we added for iOS support\n    if ('ontouchstart' in document.documentElement) {\n      for (const element of [].concat(...document.body.children)) {\n        EventHandler.off(element, 'mouseover', noop)\n      }\n    }\n\n    this._activeTrigger[TRIGGER_CLICK] = false\n    this._activeTrigger[TRIGGER_FOCUS] = false\n    this._activeTrigger[TRIGGER_HOVER] = false\n    this._isHovered = null // it is a trick to support manual triggering\n\n    const complete = () => {\n      if (this._isWithActiveTrigger()) {\n        return\n      }\n\n      if (!this._isHovered) {\n        this._disposePopper()\n      }\n\n      this._element.removeAttribute('aria-describedby')\n      EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN))\n    }\n\n    this._queueCallback(complete, this.tip, this._isAnimated())\n  }\n\n  update() {\n    if (this._popper) {\n      this._popper.update()\n    }\n  }\n\n  // Protected\n  _isWithContent() {\n    return Boolean(this._getTitle())\n  }\n\n  _getTipElement() {\n    if (!this.tip) {\n      this.tip = this._createTipElement(this._newContent || this._getContentForTemplate())\n    }\n\n    return this.tip\n  }\n\n  _createTipElement(content) {\n    const tip = this._getTemplateFactory(content).toHtml()\n\n    // TODO: remove this check in v6\n    if (!tip) {\n      return null\n    }\n\n    tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)\n    // TODO: v6 the following can be achieved with CSS only\n    tip.classList.add(`bs-${this.constructor.NAME}-auto`)\n\n    const tipId = getUID(this.constructor.NAME).toString()\n\n    tip.setAttribute('id', tipId)\n\n    if (this._isAnimated()) {\n      tip.classList.add(CLASS_NAME_FADE)\n    }\n\n    return tip\n  }\n\n  setContent(content) {\n    this._newContent = content\n    if (this._isShown()) {\n      this._disposePopper()\n      this.show()\n    }\n  }\n\n  _getTemplateFactory(content) {\n    if (this._templateFactory) {\n      this._templateFactory.changeContent(content)\n    } else {\n      this._templateFactory = new TemplateFactory({\n        ...this._config,\n        // the `content` var has to be after `this._config`\n        // to override config.content in case of popover\n        content,\n        extraClass: this._resolvePossibleFunction(this._config.customClass)\n      })\n    }\n\n    return this._templateFactory\n  }\n\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n    }\n  }\n\n  _getTitle() {\n    return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title')\n  }\n\n  // Private\n  _initializeOnDelegatedTarget(event) {\n    return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())\n  }\n\n  _isAnimated() {\n    return this._config.animation || (this.tip && this.tip.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _isShown() {\n    return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  _createPopper(tip) {\n    const placement = execute(this._config.placement, [this, tip, this._element])\n    const attachment = AttachmentMap[placement.toUpperCase()]\n    return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))\n  }\n\n  _getOffset() {\n    const { offset } = this._config\n\n    if (typeof offset === 'string') {\n      return offset.split(',').map(value => Number.parseInt(value, 10))\n    }\n\n    if (typeof offset === 'function') {\n      return popperData => offset(popperData, this._element)\n    }\n\n    return offset\n  }\n\n  _resolvePossibleFunction(arg) {\n    return execute(arg, [this._element])\n  }\n\n  _getPopperConfig(attachment) {\n    const defaultBsPopperConfig = {\n      placement: attachment,\n      modifiers: [\n        {\n          name: 'flip',\n          options: {\n            fallbackPlacements: this._config.fallbackPlacements\n          }\n        },\n        {\n          name: 'offset',\n          options: {\n            offset: this._getOffset()\n          }\n        },\n        {\n          name: 'preventOverflow',\n          options: {\n            boundary: this._config.boundary\n          }\n        },\n        {\n          name: 'arrow',\n          options: {\n            element: `.${this.constructor.NAME}-arrow`\n          }\n        },\n        {\n          name: 'preSetPlacement',\n          enabled: true,\n          phase: 'beforeMain',\n          fn: data => {\n            // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n            // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n            this._getTipElement().setAttribute('data-popper-placement', data.state.placement)\n          }\n        }\n      ]\n    }\n\n    return {\n      ...defaultBsPopperConfig,\n      ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n    }\n  }\n\n  _setListeners() {\n    const triggers = this._config.trigger.split(' ')\n\n    for (const trigger of triggers) {\n      if (trigger === 'click') {\n        EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context.toggle()\n        })\n      } else if (trigger !== TRIGGER_MANUAL) {\n        const eventIn = trigger === TRIGGER_HOVER ?\n          this.constructor.eventName(EVENT_MOUSEENTER) :\n          this.constructor.eventName(EVENT_FOCUSIN)\n        const eventOut = trigger === TRIGGER_HOVER ?\n          this.constructor.eventName(EVENT_MOUSELEAVE) :\n          this.constructor.eventName(EVENT_FOCUSOUT)\n\n        EventHandler.on(this._element, eventIn, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true\n          context._enter()\n        })\n        EventHandler.on(this._element, eventOut, this._config.selector, event => {\n          const context = this._initializeOnDelegatedTarget(event)\n          context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] =\n            context._element.contains(event.relatedTarget)\n\n          context._leave()\n        })\n      }\n    }\n\n    this._hideModalHandler = () => {\n      if (this._element) {\n        this.hide()\n      }\n    }\n\n    EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n  }\n\n  _fixTitle() {\n    const title = this._element.getAttribute('title')\n\n    if (!title) {\n      return\n    }\n\n    if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n      this._element.setAttribute('aria-label', title)\n    }\n\n    this._element.setAttribute('data-bs-original-title', title) // DO NOT USE IT. Is only for backwards compatibility\n    this._element.removeAttribute('title')\n  }\n\n  _enter() {\n    if (this._isShown() || this._isHovered) {\n      this._isHovered = true\n      return\n    }\n\n    this._isHovered = true\n\n    this._setTimeout(() => {\n      if (this._isHovered) {\n        this.show()\n      }\n    }, this._config.delay.show)\n  }\n\n  _leave() {\n    if (this._isWithActiveTrigger()) {\n      return\n    }\n\n    this._isHovered = false\n\n    this._setTimeout(() => {\n      if (!this._isHovered) {\n        this.hide()\n      }\n    }, this._config.delay.hide)\n  }\n\n  _setTimeout(handler, timeout) {\n    clearTimeout(this._timeout)\n    this._timeout = setTimeout(handler, timeout)\n  }\n\n  _isWithActiveTrigger() {\n    return Object.values(this._activeTrigger).includes(true)\n  }\n\n  _getConfig(config) {\n    const dataAttributes = Manipulator.getDataAttributes(this._element)\n\n    for (const dataAttribute of Object.keys(dataAttributes)) {\n      if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n        delete dataAttributes[dataAttribute]\n      }\n    }\n\n    config = {\n      ...dataAttributes,\n      ...(typeof config === 'object' && config ? config : {})\n    }\n    config = this._mergeConfigObj(config)\n    config = this._configAfterMerge(config)\n    this._typeCheckConfig(config)\n    return config\n  }\n\n  _configAfterMerge(config) {\n    config.container = config.container === false ? document.body : getElement(config.container)\n\n    if (typeof config.delay === 'number') {\n      config.delay = {\n        show: config.delay,\n        hide: config.delay\n      }\n    }\n\n    if (typeof config.title === 'number') {\n      config.title = config.title.toString()\n    }\n\n    if (typeof config.content === 'number') {\n      config.content = config.content.toString()\n    }\n\n    return config\n  }\n\n  _getDelegateConfig() {\n    const config = {}\n\n    for (const [key, value] of Object.entries(this._config)) {\n      if (this.constructor.Default[key] !== value) {\n        config[key] = value\n      }\n    }\n\n    config.selector = false\n    config.trigger = 'manual'\n\n    // In the future can be replaced with:\n    // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n    // `Object.fromEntries(keysWithDifferentValues)`\n    return config\n  }\n\n  _disposePopper() {\n    if (this._popper) {\n      this._popper.destroy()\n      this._popper = null\n    }\n\n    if (this.tip) {\n      this.tip.remove()\n      this.tip = null\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tooltip.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip)\n\nexport default Tooltip\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Tooltip from './tooltip.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'popover'\n\nconst SELECTOR_TITLE = '.popover-header'\nconst SELECTOR_CONTENT = '.popover-body'\n\nconst Default = {\n  ...Tooltip.Default,\n  content: '',\n  offset: [0, 8],\n  placement: 'right',\n  template: '<div class=\"popover\" role=\"tooltip\">' +\n    '<div class=\"popover-arrow\"></div>' +\n    '<h3 class=\"popover-header\"></h3>' +\n    '<div class=\"popover-body\"></div>' +\n    '</div>',\n  trigger: 'click'\n}\n\nconst DefaultType = {\n  ...Tooltip.DefaultType,\n  content: '(null|string|element|function)'\n}\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Overrides\n  _isWithContent() {\n    return this._getTitle() || this._getContent()\n  }\n\n  // Private\n  _getContentForTemplate() {\n    return {\n      [SELECTOR_TITLE]: this._getTitle(),\n      [SELECTOR_CONTENT]: this._getContent()\n    }\n  }\n\n  _getContent() {\n    return this._resolvePossibleFunction(this._config.content)\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Popover.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover)\n\nexport default Popover\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport { defineJQueryPlugin, getElement, isDisabled, isVisible } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'scrollspy'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_ACTIVATE = `activate${EVENT_KEY}`\nconst EVENT_CLICK = `click${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'\nconst CLASS_NAME_ACTIVE = 'active'\n\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]'\nconst SELECTOR_TARGET_LINKS = '[href]'\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'\nconst SELECTOR_NAV_LINKS = '.nav-link'\nconst SELECTOR_NAV_ITEMS = '.nav-item'\nconst SELECTOR_LIST_ITEMS = '.list-group-item'\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`\nconst SELECTOR_DROPDOWN = '.dropdown'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\n\nconst Default = {\n  offset: null, // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: '0px 0px -25%',\n  smoothScroll: false,\n  target: null,\n  threshold: [0.1, 0.5, 1]\n}\n\nconst DefaultType = {\n  offset: '(number|null)', // TODO v6 @deprecated, keep it for backwards compatibility reasons\n  rootMargin: 'string',\n  smoothScroll: 'boolean',\n  target: 'element',\n  threshold: 'array'\n}\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    // this._element is the observablesContainer and config.target the menu links wrapper\n    this._targetLinks = new Map()\n    this._observableSections = new Map()\n    this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element\n    this._activeTarget = null\n    this._observer = null\n    this._previousScrollData = {\n      visibleEntryTop: 0,\n      parentScrollTop: 0\n    }\n    this.refresh() // initialize\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  refresh() {\n    this._initializeTargetsAndObservables()\n    this._maybeEnableSmoothScroll()\n\n    if (this._observer) {\n      this._observer.disconnect()\n    } else {\n      this._observer = this._getNewObserver()\n    }\n\n    for (const section of this._observableSections.values()) {\n      this._observer.observe(section)\n    }\n  }\n\n  dispose() {\n    this._observer.disconnect()\n    super.dispose()\n  }\n\n  // Private\n  _configAfterMerge(config) {\n    // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n    config.target = getElement(config.target) || document.body\n\n    // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n    config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin\n\n    if (typeof config.threshold === 'string') {\n      config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value))\n    }\n\n    return config\n  }\n\n  _maybeEnableSmoothScroll() {\n    if (!this._config.smoothScroll) {\n      return\n    }\n\n    // unregister any previous listeners\n    EventHandler.off(this._config.target, EVENT_CLICK)\n\n    EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n      const observableSection = this._observableSections.get(event.target.hash)\n      if (observableSection) {\n        event.preventDefault()\n        const root = this._rootElement || window\n        const height = observableSection.offsetTop - this._element.offsetTop\n        if (root.scrollTo) {\n          root.scrollTo({ top: height, behavior: 'smooth' })\n          return\n        }\n\n        // Chrome 60 doesn't support `scrollTo`\n        root.scrollTop = height\n      }\n    })\n  }\n\n  _getNewObserver() {\n    const options = {\n      root: this._rootElement,\n      threshold: this._config.threshold,\n      rootMargin: this._config.rootMargin\n    }\n\n    return new IntersectionObserver(entries => this._observerCallback(entries), options)\n  }\n\n  // The logic of selection\n  _observerCallback(entries) {\n    const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`)\n    const activate = entry => {\n      this._previousScrollData.visibleEntryTop = entry.target.offsetTop\n      this._process(targetElement(entry))\n    }\n\n    const parentScrollTop = (this._rootElement || document.documentElement).scrollTop\n    const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop\n    this._previousScrollData.parentScrollTop = parentScrollTop\n\n    for (const entry of entries) {\n      if (!entry.isIntersecting) {\n        this._activeTarget = null\n        this._clearActiveClass(targetElement(entry))\n\n        continue\n      }\n\n      const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop\n      // if we are scrolling down, pick the bigger offsetTop\n      if (userScrollsDown && entryIsLowerThanPrevious) {\n        activate(entry)\n        // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n        if (!parentScrollTop) {\n          return\n        }\n\n        continue\n      }\n\n      // if we are scrolling up, pick the smallest offsetTop\n      if (!userScrollsDown && !entryIsLowerThanPrevious) {\n        activate(entry)\n      }\n    }\n  }\n\n  _initializeTargetsAndObservables() {\n    this._targetLinks = new Map()\n    this._observableSections = new Map()\n\n    const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target)\n\n    for (const anchor of targetLinks) {\n      // ensure that the anchor has an id and is not disabled\n      if (!anchor.hash || isDisabled(anchor)) {\n        continue\n      }\n\n      const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)\n\n      // ensure that the observableSection exists & is visible\n      if (isVisible(observableSection)) {\n        this._targetLinks.set(decodeURI(anchor.hash), anchor)\n        this._observableSections.set(anchor.hash, observableSection)\n      }\n    }\n  }\n\n  _process(target) {\n    if (this._activeTarget === target) {\n      return\n    }\n\n    this._clearActiveClass(this._config.target)\n    this._activeTarget = target\n    target.classList.add(CLASS_NAME_ACTIVE)\n    this._activateParents(target)\n\n    EventHandler.trigger(this._element, EVENT_ACTIVATE, { relatedTarget: target })\n  }\n\n  _activateParents(target) {\n    // Activate dropdown parents\n    if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n      SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, target.closest(SELECTOR_DROPDOWN))\n        .classList.add(CLASS_NAME_ACTIVE)\n      return\n    }\n\n    for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n      // Set triggered links parents as active\n      // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n      for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) {\n        item.classList.add(CLASS_NAME_ACTIVE)\n      }\n    }\n  }\n\n  _clearActiveClass(parent) {\n    parent.classList.remove(CLASS_NAME_ACTIVE)\n\n    const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE}`, parent)\n    for (const node of activeNodes) {\n      node.classList.remove(CLASS_NAME_ACTIVE)\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = ScrollSpy.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) {\n    ScrollSpy.getOrCreateInstance(spy)\n  }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(ScrollSpy)\n\nexport default ScrollSpy\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport { defineJQueryPlugin, getNextActiveElement, isDisabled } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tab'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}`\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst HOME_KEY = 'Home'\nconst END_KEY = 'End'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_DROPDOWN = 'dropdown'\n\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\nconst SELECTOR_DROPDOWN_MENU = '.dropdown-menu'\nconst NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`\n\nconst SELECTOR_TAB_PANEL = '.list-group, .nav, [role=\"tablist\"]'\nconst SELECTOR_OUTER = '.nav-item, .list-group-item'\nconst SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role=\"tab\"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]' // TODO: could only be `tab` in v6\nconst SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`\n\nconst SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle=\"tab\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"pill\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"list\"]`\n\n/**\n * Class definition\n */\n\nclass Tab extends BaseComponent {\n  constructor(element) {\n    super(element)\n    this._parent = this._element.closest(SELECTOR_TAB_PANEL)\n\n    if (!this._parent) {\n      return\n      // TODO: should throw exception in v6\n      // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)\n    }\n\n    // Set up initial aria attributes\n    this._setInitialAttributes(this._parent, this._getChildren())\n\n    EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n  }\n\n  // Getters\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show() { // Shows this elem and deactivate the active sibling if exists\n    const innerElem = this._element\n    if (this._elemIsActive(innerElem)) {\n      return\n    }\n\n    // Search for active tab on same parent to deactivate it\n    const active = this._getActiveElem()\n\n    const hideEvent = active ?\n      EventHandler.trigger(active, EVENT_HIDE, { relatedTarget: innerElem }) :\n      null\n\n    const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW, { relatedTarget: active })\n\n    if (showEvent.defaultPrevented || (hideEvent && hideEvent.defaultPrevented)) {\n      return\n    }\n\n    this._deactivate(active, innerElem)\n    this._activate(innerElem, active)\n  }\n\n  // Private\n  _activate(element, relatedElem) {\n    if (!element) {\n      return\n    }\n\n    element.classList.add(CLASS_NAME_ACTIVE)\n\n    this._activate(SelectorEngine.getElementFromSelector(element)) // Search and activate/show the proper section\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.add(CLASS_NAME_SHOW)\n        return\n      }\n\n      element.removeAttribute('tabindex')\n      element.setAttribute('aria-selected', true)\n      this._toggleDropDown(element, true)\n      EventHandler.trigger(element, EVENT_SHOWN, {\n        relatedTarget: relatedElem\n      })\n    }\n\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _deactivate(element, relatedElem) {\n    if (!element) {\n      return\n    }\n\n    element.classList.remove(CLASS_NAME_ACTIVE)\n    element.blur()\n\n    this._deactivate(SelectorEngine.getElementFromSelector(element)) // Search and deactivate the shown section too\n\n    const complete = () => {\n      if (element.getAttribute('role') !== 'tab') {\n        element.classList.remove(CLASS_NAME_SHOW)\n        return\n      }\n\n      element.setAttribute('aria-selected', false)\n      element.setAttribute('tabindex', '-1')\n      this._toggleDropDown(element, false)\n      EventHandler.trigger(element, EVENT_HIDDEN, { relatedTarget: relatedElem })\n    }\n\n    this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE))\n  }\n\n  _keydown(event) {\n    if (!([ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key))) {\n      return\n    }\n\n    event.stopPropagation()// stopPropagation/preventDefault both added to support up/down keys without scrolling the page\n    event.preventDefault()\n\n    const children = this._getChildren().filter(element => !isDisabled(element))\n    let nextActiveElement\n\n    if ([HOME_KEY, END_KEY].includes(event.key)) {\n      nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1]\n    } else {\n      const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key)\n      nextActiveElement = getNextActiveElement(children, event.target, isNext, true)\n    }\n\n    if (nextActiveElement) {\n      nextActiveElement.focus({ preventScroll: true })\n      Tab.getOrCreateInstance(nextActiveElement).show()\n    }\n  }\n\n  _getChildren() { // collection of inner elements\n    return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent)\n  }\n\n  _getActiveElem() {\n    return this._getChildren().find(child => this._elemIsActive(child)) || null\n  }\n\n  _setInitialAttributes(parent, children) {\n    this._setAttributeIfNotExists(parent, 'role', 'tablist')\n\n    for (const child of children) {\n      this._setInitialAttributesOnChild(child)\n    }\n  }\n\n  _setInitialAttributesOnChild(child) {\n    child = this._getInnerElement(child)\n    const isActive = this._elemIsActive(child)\n    const outerElem = this._getOuterElement(child)\n    child.setAttribute('aria-selected', isActive)\n\n    if (outerElem !== child) {\n      this._setAttributeIfNotExists(outerElem, 'role', 'presentation')\n    }\n\n    if (!isActive) {\n      child.setAttribute('tabindex', '-1')\n    }\n\n    this._setAttributeIfNotExists(child, 'role', 'tab')\n\n    // set attributes to the related panel too\n    this._setInitialAttributesOnTargetPanel(child)\n  }\n\n  _setInitialAttributesOnTargetPanel(child) {\n    const target = SelectorEngine.getElementFromSelector(child)\n\n    if (!target) {\n      return\n    }\n\n    this._setAttributeIfNotExists(target, 'role', 'tabpanel')\n\n    if (child.id) {\n      this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`)\n    }\n  }\n\n  _toggleDropDown(element, open) {\n    const outerElem = this._getOuterElement(element)\n    if (!outerElem.classList.contains(CLASS_DROPDOWN)) {\n      return\n    }\n\n    const toggle = (selector, className) => {\n      const element = SelectorEngine.findOne(selector, outerElem)\n      if (element) {\n        element.classList.toggle(className, open)\n      }\n    }\n\n    toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE)\n    toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW)\n    outerElem.setAttribute('aria-expanded', open)\n  }\n\n  _setAttributeIfNotExists(element, attribute, value) {\n    if (!element.hasAttribute(attribute)) {\n      element.setAttribute(attribute, value)\n    }\n  }\n\n  _elemIsActive(elem) {\n    return elem.classList.contains(CLASS_NAME_ACTIVE)\n  }\n\n  // Try to get the inner element (usually the .nav-link)\n  _getInnerElement(elem) {\n    return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem)\n  }\n\n  // Try to get the outer element (usually the .nav-item)\n  _getOuterElement(elem) {\n    return elem.closest(SELECTOR_OUTER) || elem\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tab.getOrCreateInstance(this)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  if (isDisabled(this)) {\n    return\n  }\n\n  Tab.getOrCreateInstance(this).show()\n})\n\n/**\n * Initialize on focus\n */\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n  for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) {\n    Tab.getOrCreateInstance(element)\n  }\n})\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tab)\n\nexport default Tab\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin, reflow } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'toast'\nconst DATA_KEY = 'bs.toast'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`\nconst EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_FOCUSOUT = `focusout${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_HIDE = 'hide' // @deprecated - kept here only for backwards compatibility\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\n\nconst DefaultType = {\n  animation: 'boolean',\n  autohide: 'boolean',\n  delay: 'number'\n}\n\nconst Default = {\n  animation: true,\n  autohide: true,\n  delay: 5000\n}\n\n/**\n * Class definition\n */\n\nclass Toast extends BaseComponent {\n  constructor(element, config) {\n    super(element, config)\n\n    this._timeout = null\n    this._hasMouseInteraction = false\n    this._hasKeyboardInteraction = false\n    this._setListeners()\n  }\n\n  // Getters\n  static get Default() {\n    return Default\n  }\n\n  static get DefaultType() {\n    return DefaultType\n  }\n\n  static get NAME() {\n    return NAME\n  }\n\n  // Public\n  show() {\n    const showEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n\n    if (showEvent.defaultPrevented) {\n      return\n    }\n\n    this._clearTimeout()\n\n    if (this._config.animation) {\n      this._element.classList.add(CLASS_NAME_FADE)\n    }\n\n    const complete = () => {\n      this._element.classList.remove(CLASS_NAME_SHOWING)\n      EventHandler.trigger(this._element, EVENT_SHOWN)\n\n      this._maybeScheduleHide()\n    }\n\n    this._element.classList.remove(CLASS_NAME_HIDE) // @deprecated\n    reflow(this._element)\n    this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING)\n\n    this._queueCallback(complete, this._element, this._config.animation)\n  }\n\n  hide() {\n    if (!this.isShown()) {\n      return\n    }\n\n    const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n    if (hideEvent.defaultPrevented) {\n      return\n    }\n\n    const complete = () => {\n      this._element.classList.add(CLASS_NAME_HIDE) // @deprecated\n      this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW)\n      EventHandler.trigger(this._element, EVENT_HIDDEN)\n    }\n\n    this._element.classList.add(CLASS_NAME_SHOWING)\n    this._queueCallback(complete, this._element, this._config.animation)\n  }\n\n  dispose() {\n    this._clearTimeout()\n\n    if (this.isShown()) {\n      this._element.classList.remove(CLASS_NAME_SHOW)\n    }\n\n    super.dispose()\n  }\n\n  isShown() {\n    return this._element.classList.contains(CLASS_NAME_SHOW)\n  }\n\n  // Private\n\n  _maybeScheduleHide() {\n    if (!this._config.autohide) {\n      return\n    }\n\n    if (this._hasMouseInteraction || this._hasKeyboardInteraction) {\n      return\n    }\n\n    this._timeout = setTimeout(() => {\n      this.hide()\n    }, this._config.delay)\n  }\n\n  _onInteraction(event, isInteracting) {\n    switch (event.type) {\n      case 'mouseover':\n      case 'mouseout': {\n        this._hasMouseInteraction = isInteracting\n        break\n      }\n\n      case 'focusin':\n      case 'focusout': {\n        this._hasKeyboardInteraction = isInteracting\n        break\n      }\n\n      default: {\n        break\n      }\n    }\n\n    if (isInteracting) {\n      this._clearTimeout()\n      return\n    }\n\n    const nextElement = event.relatedTarget\n    if (this._element === nextElement || this._element.contains(nextElement)) {\n      return\n    }\n\n    this._maybeScheduleHide()\n  }\n\n  _setListeners() {\n    EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true))\n    EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false))\n    EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true))\n    EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false))\n  }\n\n  _clearTimeout() {\n    clearTimeout(this._timeout)\n    this._timeout = null\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Toast.getOrCreateInstance(this, config)\n\n      if (typeof config === 'string') {\n        if (typeof data[config] === 'undefined') {\n          throw new TypeError(`No method named \"${config}\"`)\n        }\n\n        data[config](this)\n      }\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Toast)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Toast)\n\nexport default Toast\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { Modal } from \"bootstrap\"\n\nexport default class extends Controller {\n  connect() {\n    this.element.addEventListener('shown.bs.modal', this.onShow.bind(this))\n    this.modal = new Modal(this.element)\n    this.modal.show()\n  }\n\n  disconnect() {\n    this.modal.hide()\n  }\n\n  onShow() {\n    const autofocusInput = this.element.querySelector(\"[autofocus]\")\n\n    if (autofocusInput) {\n      autofocusInput.focus()\n    }\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport * as PDFObject from \"pdfobject\"\n\n// Connects to data-controller=\"pdf-object\"\nexport default class extends Controller {\n  static targets = [ \"container\" ]\n  static values = {\n    source: String,\n    fallbackLink: String\n  }\n  static classes = [ \"pdf\" ]\n\n  connect() {\n    this.embedPdfObject()\n    this.addClassesToPdfObject()\n  }\n\n  embedPdfObject() {\n    return PDFObject.embed(this.source, this.container, this.options)\n  }\n\n  get options() {\n    return Object.assign(\n      {\n        omitInlineStyles: true,\n        fallbackLink: this.fallbackLink\n      }\n    )\n  }\n\n  get container() {\n    return this.containerTarget\n  }\n\n  get source() {\n    return this.sourceValue\n  }\n\n  get fallbackLink() {\n    return this.fallbackLinkValue ||\n      `\n      <p>\n        Twoja przegl\u0105darka nie wspiera wy\u015Bwietlania plik\u00F3w PDF.\n        Pobierz <a class=\"link-primary\" href='[url]'>plik</a> aby wy\u015Bwietli\u0107.\n      </p>\n      `\n  }\n\n  addClassesToPdfObject() {\n    if (this.hasPdfClass) {\n      this.embedPdfObject().classList.add(...this.pdfClasses)\n    }\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n  static values = {\n    url: String\n  }\n\n  connect() {\n    window.location = this.urlValue\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n  static targets = [\"element\"]\n  static values = {\n    name: String\n  }\n\n  toggle(event) {\n    event.preventDefault()\n\n    this.elements.forEach(element => this.classNames.forEach(className => element.classList.toggle(className)))\n  }\n\n  get elements() {\n    return this.elementTargets;\n  }\n\n  get classNames() {\n    return this.nameValue.split(\" \")\n  }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { Tooltip } from \"bootstrap\"\n\nexport default class extends Controller {\n  connect () {\n    new Tooltip(this.element)\n  }\n}\n", "// This file is auto-generated by ./bin/rails stimulus:manifest:update\n// Run that command whenever you add a new controller or create them with\n// ./bin/rails generate stimulus controllerName\n\nimport { application } from \"./application\"\n\nimport ChoicesController from \"./choices_controller\"\napplication.register(\"choices\", ChoicesController)\n\nimport DatepickerController from \"./datepicker_controller\"\napplication.register(\"datepicker\", DatepickerController)\n\nimport DatepickerRangeController from \"./datepicker_range_controller\"\napplication.register(\"datepicker-range\", DatepickerRangeController)\n\nimport FormSubmitController from \"./form_submit_controller\"\napplication.register(\"form-submit\", FormSubmitController)\n\nimport HelloController from \"./hello_controller\"\napplication.register(\"hello\", HelloController)\n\nimport MapController from \"./map_controller\"\napplication.register(\"map\", MapController)\n\nimport ModalController from \"./modal_controller\"\napplication.register(\"modal\", ModalController)\n\nimport PdfObjectController from \"./pdf_object_controller\"\napplication.register(\"pdf-object\", PdfObjectController)\n\nimport RedirectController from \"./redirect_controller\"\napplication.register(\"redirect\", RedirectController)\n\nimport ToggleClassController from \"./toggle_class_controller\"\napplication.register(\"toggle-class\", ToggleClassController)\n\nimport TooltipController from \"./tooltip_controller\"\napplication.register(\"tooltip\", TooltipController)\n", "// cookiesboot loads automaticly on domready but not when visiting next pages\n// by turbo. Also Load event is fired later that visit thats why we only\n// display consest cookie on visit.\ndocument.addEventListener(\"turbo:visit\", function(event) {\n  window.isTurboVisit = true\n})\ndocument.addEventListener(\"turbo:load\", function(event) {\n  if (window.isTurboVisit && !CookieConsent.hasResponse) {\n    CookieConsent.show()\n  }\n  window.isTurboVisit = false\n})\n"],
  "mappings": "quCAAA,GAAO,IAAP,UAAO,GAAQ,CACb,OAAQ,KAAK,QACb,UAAW,KAAK,SAClB,ICHA,GAcO,IAdP,eAcA,AAAO,GAAQ,CACb,OAAO,EAAU,CACf,AAAI,KAAK,SACP,GAAS,KAAK,KAAK,IAAI,CAAC,EACxB,GAAS,OAAO,IAAI,gBAAiB,GAAG,CAAQ,EAEpD,CACF,ICrBA,GAKM,IAEA,GAEN,GAmHO,GA5HP,eAKA,AAAM,GAAM,IAAM,GAAI,MAAK,EAAE,QAAQ,EAE/B,GAAe,GAAS,IAAI,EAAI,GAAQ,IAE9C,QAAwB,CACtB,YAAY,EAAY,CACtB,KAAK,oBAAsB,KAAK,oBAAoB,KAAK,IAAI,EAC7D,KAAK,WAAa,EAClB,KAAK,kBAAoB,CAC3B,CAEA,OAAQ,CACN,AAAK,KAAK,UAAU,GAClB,MAAK,UAAY,GAAI,EACrB,MAAO,MAAK,UACZ,KAAK,aAAa,EAClB,iBAAiB,mBAAoB,KAAK,mBAAmB,EAC7D,GAAO,IAAI,gDAAg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